123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185 |
- var ClickTab = false;
- var allchecked = "false";
- /**
- * @desc : Source Node의 갯수를 구한다.
- * @
- * @param : path - node path
- * @return :
- * @authur : 김선태 2007. 5. 8
- * @---------------------------------------------------
- */
- function getNodeSetCnt(path)
- {
- var insXml = model.instances(0);
- var nodeList = insXml.selectNodes(path);
- return nodeList.length;
- }
- /**
- * @desc : Source Node의 child nodelist를 Destination의 nodelist로 append한다.
- * @
- * @param : strDest - 도착node path
- * : strSrc - 출발node path
- * @return :
- * @authur : 이상현 2007. 3. 27
- * @---------------------------------------------------
- */
- function addCopyNodeset(strDest, strSrc, mode, destModel, srcModel) {
- if( destModel == null || destModel =="" )
- destModel = document.models.item(0);
-
- if( srcModel == null || srcModel =="" )
- srcModel = document.models.item(0);
-
- var srcNodeList = srcModel.instances(0).selectNodes(strSrc);
- var srcNode;
-
- var pDestNode = destModel.instances.item(0).selectSingleNode(strDest).parentNode;
-
- if( mode == "replace" || mode == null ) {
- destModel.removeNodeset(strDest);
- while( srcNode = srcNodeList.nextNode() ) {
- pDestNode.appendChild(srcNode.cloneNode(true));
- }
- }
-
- else if( mode == "after" ) {
- while( srcNode = srcNodeList.nextNode() ) {
- pDestNode.appendChild(srcNode.cloneNode(true));
- }
- }
-
- else if( mode == "before" ) {
- var destNode;
- for( var i = srcNodeList.length - 1; i >= 0; i-- ) {
- destNode = destModel.instances.item(0).selectSingleNode(strDest + "[1]");
- pDestNode.insertBefore(srcNodeList.item(i).cloneNode(true), destNode);
- }
- }
- }
- /**
- * @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.03.18
- * @---------------------------------------------------
- */
- function fFormInit()
- {
- //컨트롤 권한 설정
- fchkAuth();
- //공통코드 가져오기...
- //M0424:차트분실코드
- zbcfGetCodeList(new Array("M0424"), new Array("/root/init/M0424"));
-
- model.removeNodeset("/root/main/chartlend/clrs/applist");
- model.removeNodeset("/root/main/chartlend/clrs/rendlist");
-
- btn_movchrt.dispatch("onclick");
-
- var today = getCurrentDate();
- var valitodd = (today.toDate()).getAddDate(-90);
- valitodd = valitodd.getDateFormat();
- model.setValue("/root/req/chartlend/rendcd" , "");
- model.setValue("/root/req/chartlend/appdeptcd" , "");
- model.setValue("/root/req/chartlend/lendmanid" , "");
- model.setValue("/root/req/chartlend/renddd" , today);
- model.setValue("/root/req/chartlend/appmanid" , getUserId());
- model.setValue("/root/req/chartlend/appman" , getUserName());
- model.setValue("/root/req/chartlend/acptid" , getUserId());
- model.setValue("/root/req/chartreturn/rendcd" , "ALL");
- model.setValue("/root/req/chartreturn/appdeptcd", "ALL");
- model.setValue("/root/req/chartreturn/fromappdd", today);
- model.setValue("/root/req/chartreturn/toappdd" , today);
- model.setValue("/root/req/chartreturn/fromrtndd", "");
- model.setValue("/root/req/chartreturn/tortndd" , "");
- ipt_fromrtndd.disabled = true;
- ipt_tortndd.disabled = true;
- rtnterm_disabled.value = "";
- model.setValue("/root/req/chartlend/resettm" , getCurrentTime());
- model.setValue("/root/req/chartreturn/resettm" , getCurrentTime());
-
- model.removeNodeset("/root/main/rendreport/report/chrtlist");
- model.removeNodeset("/root/main/rendreport/report/unpreplist");
- model.removeNodeset("/root/main/rendreport/report/chrtlendlist");
- model.removeNodeset("/root/main/rendreport/report/chrtstatlist");
- model.refresh();
- }
- /**
- * @desc : 탭 클릭...
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fClickTab()
- {
- if (ClickTab == false)
- {
- ClickTab = true;
- //공통코드 가져오기...
- //M0392:챠트미대출사유코드
- //M0412:과보관사유코드
- zbcfGetCodeList(new Array("M0392","M0412"), new Array("/root/init/M0392","/root/init/M0412"));
- // 대출용도, 대출과, 차트과, 차트담당자, 보관장소
- model.makeValue("/root/send/reqdata/ioflag" , "I");
- model.makeValue("/root/send/reqdata/useyn" , "Y");
- model.makeValue("/root/send/reqdata/allwardyn", "");
- model.refresh();
- submit("TRMRC00100");
-
- model.removeNodeset("/root/main/chartlend/clrs/chrtlendlist");
- model.removeNodeset("/root/main/chartreturn/clrs/rtntrgtlist");
- model.removeNodeset("/root/main/chartreturn/clrs/rtnlist");
- model.refresh();
- }
- }
- /**
- * @desc : 챠트 반납 우클릭시 - > 챠트 반납
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fsetrtnchart(bcflag)
- {
- var ref = "/root/main/chartreturn/clrs/rtntrgtlist";
- var grdObj = grd_rendlist2;
- var savedata = "status▦pid▦ioflag▦chrtflag▦bcno▦medirecno▦chrtseqno▩";
- var dataString = "";
- var dataCount = 0;
- if (bcflag == "Y"){
- var bcno = model.getValue("/root/req/chartreturn/bcno");
- if (bcno != ""){
- dataString = dataString + "u▦▦I▦I▦" + bcno + "▦▦▩";
- }
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- if (submit("TXMRC02702", "", "/root/send/savedata", "/root/main/result") == true){
- // 2008.01.25. 바코드 번호 클리어...
- model.makeValue("/root/req/chartreturn/bcno", "");
- ipt_rtnbcno.refresh();
- // 다시조회..
- model.setValue("/root/req/chartreturn/acptid", getUserId());
- fGetUserRtnList();
- }
- }
-
- } else {
- if (bcflag == "C") {
- for ( var i = 0; i < grdObj.rows; i++)
- {
- var checked = model.getValue(ref + "[" + i + "]/checked");
- if (checked == "true")
- {
- var pid = model.getValue(ref + "[" + i + "]/pid");
- var bcno = model.getValue(ref + "[" + i + "]/bcno");
- var medirecno = model.getValue(ref + "[" + i + "]/medirecno");
- var chrtseqno = model.getValue(ref + "[" + i + "]/chrtseqno");
- if (chrtseqno != ""){
- dataString = dataString + "u▦" + pid + "▦I▦I▦" + bcno + "▦" + medirecno + "▦" + chrtseqno + "▩";
- dataCount = dataCount + 1;
- }
- }
- }
- } else {
- for ( var i = 0; i < grdObj.selectedRows; i++)
- {
- var pid = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/pid");
- var bcno = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/bcno");
- var medirecno = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/medirecno");
- var chrtseqno = model.getValue(ref + "[" + grdObj.selectedrow(i) + "]/chrtseqno");
- if (chrtseqno != ""){
- dataString = dataString + "u▦" + pid + "▦I▦I▦" + bcno + "▦" + medirecno + "▦" + chrtseqno + "▩";
- dataCount = dataCount + 1;
- }
- }
- }
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- if (submit("TXMRC02702", "", "/root/send/savedata", "/root/main/result") == true){
- alert("총 " + dataCount + " 건 챠트반납 되었습니다.");
- // 다시 조회하기..
- fGetRtnList();
- // 다시조회..
- model.setValue("/root/req/chartreturn/acptid", getUserId());
- fGetUserRtnList();
- }
- }
- }
- }
- /**
- * @desc : 챠트 반납 우클릭시 - > 차트 분실 처리
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.28
- * @---------------------------------------------------
- */
- function fsetlosschrt()
- {
- if(grd_rendlist2.row < 1){
- return;
- }
- // 2008.07.28. 차트 분실 처리하기...
- fShowWndIptBox();
- }
- /**
- * @desc : 챠트상태를 수정한다.
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.28
- * @---------------------------------------------------
- */
- function fUpdateChrtStat()
- {
- // 2008.07.28. 차트 분실 처리하기...
- var chrtstat = model.getValue("/root/hidden/lendlist/chrtstat");
- var chrtstatnm = model.getValue("/root/init/M0424/M0424[cdid='" + chrtstat + "']/cdnm");
- var savedata ="medirecno▦chrtseqno▦chrtstat▦msgcnts▩";
- var dataString = "";
- var dataCount = 0;
- for ( var i = 0; i < grd_rendlist2.selectedRows; i++)
- {
- var medirecno = model.getValue("/root/main/chrtrtn/rtntrgtlist[" + grd_rendlist2.selectedrow(i) + "]/medirecno");
- var chrtseqno = model.getValue("/root/main/chrtrtn/rtntrgtlist[" + grd_rendlist2.selectedrow(i) + "]/chrtseqno");
- var msgcnts = model.getValue("/root/main/chrtrtn/rtntrgtlist[" + grd_rendlist2.selectedrow(i) + "]/msgcnts");
- msgcnts = msgcnts + "[" + chrtstatnm + "]";
- if (chrtseqno != "") {
- dataString = dataString + medirecno + "▦" + chrtseqno + "▦" + chrtstat + "▦" + msgcnts + "▩";
- dataCount = dataCount + 1;
- }
- }
-
- grup_losschrt.visible = false;
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- model.refresh();
- submit("TXMRC00107");
- alert("총 " + dataCount + " 건 차트 분실 처리 되었습니다.");
- // 다시 조회하기..
- fGetRtnList();
- }
- }
- /**
- * @desc : 챠트 대출 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fGetLendList()
- {
- model.setValue("/root/req/chartlend/ioflag", "I");
- model.setValue("/root/req/chartlend/acptid", "");
- model.setValue("/root/req/chartlend/renddd", getCurrentDate());
- model.setValue("/root/req/chartlend/resettm", "000000");
- model.copyNode("/root/send/reqdata", "/root/req/chartlend");
- // 챠트대출이력조회
- submit("TRMRC02703", "true", "/root/send/reqdata", "/root/main/chartlend/clrs/chrtlendlist");
- var pid = model.getValue("/root/req/chartlend/pid");
- if (pid.length > 0) {
- model.setValue("/root/req/chartlend/chrtpid", pid);
- model.refresh();
- btn_chrtlist.dispatch("DOMActivate");
- }
- // 2008.01.02. 대출현황 조회 총건수..
- model.setValue ("/root/req/chartlend/count", grd_rendlist.rows - 1);
- cap_rendlist.refresh();
- }
- /**
- * @desc : 챠트 대출 조회 - 바크도 입력후 대출현황만 다시조회한다. (로그인 사용자별)
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fGetUserLendList()
- {
- model.setValue("/root/req/chartlend/ioflag", "I");
- model.setValue("/root/req/chartlend/acptid", getUserId());
- model.setValue("/root/req/chartlend/renddd", getCurrentDate());
- model.copyNode("/root/send/reqdata", "/root/req/chartlend");
- // 챠트대출이력조회
- submit("TRMRC02703", "true", "/root/send/reqdata", "/root/main/chartlend/clrs/chrtlendlist");
- // 2008.01.02. 대출현황 조회 총건수..
- model.setValue ("/root/req/chartlend/count", grd_rendlist.rows - 1);
- cap_rendlist.refresh();
- }
- /**
- * @desc : 챠트 반납 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fGetRtnList()
- {
- model.setValue("/root/req/chartreturn/ioflag", "I");
- model.copyNode("/root/send/reqdata", "/root/req/chartreturn");
- submit("TRMRC02704");
- }
- /**
- * @desc : 챠트 반납 조회 - 바크도 입력후 반납현황만 다시조회한다. (로그인 사용자별)
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fGetUserRtnList()
- {
- model.setValue("/root/req/chartreturn/ioflag", "I");
- model.copyNode("/root/send/reqdata", "/root/req/chartreturn");
- submit("TRMRC02705");
- // 2008.01.02. 반납현황 조회 총건수..
- model.setValue ("/root/req/chartreturn/count", grd_rtnlist.rows - 1);
- cap_rtnlist.refresh();
- }
- /**
- * @desc : 입원 차트 선택 후 -> 대출등록
- * @
- * @param : bcflag : Y / N
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fSetLendChart(bcflag)
- {
- // 2007.12.14. 대출일자는 당일로 한다...
- var renddd = getCurrentDate();
- // 대출등록
- var rendcd = model.getValue("/root/req/chartlend/rendcd");
- var appdeptcd = model.getValue("/root/req/chartlend/appdeptcd");
- var lendmanid = model.getValue("/root/req/chartlend/lendmanid");
- var appmanid = model.getValue("/root/req/chartlend/appmanid");
- var msgcnts = model.getValue("/root/req/chartlend/msgcnts");
- var cntctelno = model.getValue("/root/req/chartlend/cntctelno");
- var chrtpid = model.getValue("/root/req/chartlend/chrtpid");
- if (rendcd == ""){
- window.alert("대출용도를 선택해 주세요", "차트대출 및 반납", 0 | 64);
- model.setFocus("cbo_l_rendcd");
- return;
- }
- if (appdeptcd == ""){
- window.alert("대출과를 선택해 주세요", "차트대출 및 반납", 0 | 64);
- model.setFocus("cbo_l_appdeptcd");
- return;
- }
- if (lendmanid == "" || lendmanid.isNumber()== false){
- window.alert("대출자를 선택해 주세요", "차트대출 및 반납", 0 | 64);
- model.setFocus("cbo_l_lendmanid");
- return;
- }
-
- var icnt = 0;
- var HearderData = "status▦pid▦ioflag▦chrtflag▦bcno▦medirecno▦rendcd▦appdeptcd▦lendmanid▦appmanid▦msgcnts▦cntctelno▦rendbcflag▩";
- var tmpSaveData = "";
- if (bcflag == "Y")
- {
- var bcno = model.getValue("/root/req/chartlend/bcno");
- if (bcno == "" || bcno == "0"){
- window.alert("바코드번호를 입력해 주세요", "차트대출 및 반납", 0 | 64);
- model.setFocus("ipt_lendbcno");
- return;
- }
- if (bcno != "" && bcno != "0")
- {
- tmpSaveData = tmpSaveData + "i▦▦I▦I▦" + bcno + "▦▦" ;
- tmpSaveData = tmpSaveData + rendcd + "▦" + appdeptcd + "▦" + lendmanid + "▦" + appmanid + "▦" + msgcnts + "▦" + cntctelno + "▦B▩";
- }
- if (tmpSaveData != ""){
- model.makeValue("/root/send/savedata", HearderData + tmpSaveData);
- submit("TXMRC02701", "", "/root/send/savedata", "/root/main/result");
- // 바코드번호 초기화
- model.setValue("/root/req/chartlend/bcno", "");
- ipt_lendbcno.refresh();
- // 다시조회.. 챠트대출
- fGetUserLendList();
- }
- } else {
- if (chrtpid == ""){
- window.alert("환자번호를 입력해 주세요", "차트대출 및 반납", 0 | 64);
- model.setFocus("ipt_chrtpid");
- return;
- }
- for ( var i = 1; i < grd_chartlist.rows; i++)
- {
- var pid = model.getValue("/root/main/chartlend/chrtlist["+ i +"]/pid");
- var ioflag = model.getValue("/root/main/chartlend/chrtlist["+ i +"]/ioflag");
- var chrtflag = "I";
- var bcno = model.getValue("/root/main/chartlend/chrtlist["+ i +"]/bcno");
- var medirecno = model.getValue("/root/main/chartlend/chrtlist["+ i +"]/medirecno");
-
- var chkflag = model.getValue("/root/main/chartlend/chrtlist["+ i +"]/chkflag");
- if(chkflag == "Y"){
- tmpSaveData = tmpSaveData + "i▦" + pid + "▦" + ioflag + "▦" + chrtflag + "▦▦" + medirecno + "▦" ;
- tmpSaveData = tmpSaveData + rendcd + "▦" + appdeptcd + "▦" + lendmanid + "▦" + appmanid + "▦" + msgcnts + "▦" + cntctelno + "▦M▩";
- icnt++;
- }
- }
- if(icnt < 1){
- window.alert("대출할 차트를 선택해 주세요", "차트대출 및 반납", 0 | 64);
- return;
- }
- if (tmpSaveData != ""){
- model.makeValue("/root/send/savedata", HearderData + tmpSaveData);
- submit("TXMRC02701", "", "/root/send/savedata", "/root/main/result");
- // 다시조회.. 종이챠트 리스트
- // 2008.12.11. 환자번호 체크번호 조회 안하고 입원차트 조회하기...
- var pid = model.getValue("/root/req/chartlend/chrtpid");
- model.makeValue("/root/send/reqdata/ioflag", "I");
- model.makeValue("/root/send/reqdata/pid", pid);
- submit("TRMRC02700","","/root/send/reqdata","/root/main/chartlend/chrtlist");
- // 다시조회.. 챠트대출
- fGetUserLendList();
- }
- }
- }
- /**
- * @desc : 등록된 환자번호인지 체킹한다..
- * @
- * @param : iptObj - 환자번호 입력 컨트롤 (pid)
- * @return :
- * @authur : 이은영 2008.09.17
- * @---------------------------------------------------
- */
- function fGetPidNo(iptObj, ref)
- {
- var chkyn = model.getValue(ref);
- if (chkyn == "Y") {
- if (iptObj.currentText.length > 0) {
- var pid = iptObj.currentText;
- pid = getCretCheckNo(pid, getUserInfo("dutplceinstcd"));
- model.makeValue(iptObj.attribute("ref"), pid);
- iptObj.refresh();
- }
- }
- }
- /**
- * @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");
-
- 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.07.14
- * @---------------------------------------------------
- */
- function fGetPid(refPid, refPnm)
- {
- //조회건수가 1건일 경우 팝업창을 바로 닫는다.
- model.setValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
- model.setValue("/root/hidden/tmp/pidpopupinfo/autoflag", "N");
- if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
- model.setValue("/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.setValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
- if (refPnm != null || refPnm != "") {
- model.setValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- }
- model.refresh();
- }
- }
- /**
- * @desc : 등록된 사용자 번호인지 체킹한다..
- * @
- * @param : iptObj - 사용자 ID 입력 컨트롤 (userid)
- * @return : posdeptcd - 사용자 부서코드
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fCheckUserid(iptObj)
- {
- setInputNodeCurText();
- // 사용자 번호 체크
- if(iptObj.currentText.length > 0 ){
- // 사용자 조회
- model.removenode("/root/hidden/tmp/tempuserinfo/list");
- model.reset("/root/hidden/tmp/tempuserinfo");
-
- model.setValue("/root/hidden/tmp/userpopupinfo/param", "_OneS");
- model.setValue("/root/hidden/tmp/userpopupinfo/flag", "userid");
- model.setValue("/root/hidden/tmp/userpopupinfo/searchitem", iptObj.currentText);
-
- modal("SPZSU10103", "", "200", "200", "SPZSU10103","/root/hidden/tmp/userpopupinfo","/root/main/temp");
-
- var iParam = getParameter("SPZSU10103_");
- setCSVToNode("/root/hidden/tmp/tempuserinfo", iParam);
- clearParameter("SPZSU10103_");
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/hidden/tmp/tempuserinfo/list") > 0 ){
-
- var userid = model.getValue("/root/hidden/tmp/tempuserinfo/list/userid");
- var posdeptcd = model.getValue("/root/hidden/tmp/tempuserinfo/list/posdeptcd");
- iptObj.value = userid;
- model.refresh();
- return posdeptcd;
-
- //fSearch();
- }else{
- model.resetInstanceNode("/root/hidden/tmp/tempuserinfo/list");
- messageBox("없는 사용자 번호 입니다.", "E999", "");
- model.refresh();
- }
-
- }else{
- messageBox("사용자 번호를 정확히", "C001");
- }
- return "";
- }
- /**
- * @desc : 마우스 오른쪽 버튼 팝업창
- * @
- * @param : job - 0:챠트대출, 1:챠트반납
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fMouseRghtBtnPopup(gridObj, job)
- {
- if (event.button == 3) {
- if (gridObj.isCell(event.target) && gridObj.mouseRow >= gridObj.fixedrows) {
- if (job == "0") {
- model.removeNodeset("/root/send/savedata");
- window.setPopupMenu(true, "/root/hidden/applist_menu/menu", "label", "func", false);
- } else if (job == "1") {
- model.removeNodeset("/root/send/savedata");
- window.setPopupMenu(true, "/root/hidden/rtntrgtlist_menu/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- }
- /**
- * @desc : 팝업폼 보여주기..
- * @
- * @param : job - 0:챠트대출(미대출사유) , 1:챠트반납(과보관사유),
- * @ 2:접수자명단(미대출사유), 3:챠트반납(대출연장)
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fShowWndIptBox(job)
- {
- grup_losschrt.visible = "false";
- model.setValue("/root/hidden/lendlist/chrtstat", "01");
- model.refresh();
- if (event.clientY < 300) {
- grup_losschrt.attribute("top") = event.clientY-110;
- } else {
- grup_losschrt.attribute("top") = 200;
- }
- grup_losschrt.visible = "true";
- }
- /**
- * @desc : 선택된 환자등록번호로 현위치조회 텝이동..
- * @
- * @param : gridObj - 그리드 컨트롤, ref - node path
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fMoveTabChartByPid(gridObj, ref){
-
- if (isDataCell() == false){
- return;
- }
-
- if (gridObj.row < 1){
- return;
- }
-
- var chrtdept = model.getValue(ref + "[" + gridObj.row +"]/chrtdeptcd");
- var pid = model.getValue(ref + "[" + gridObj.row +"]/pid");
- var pnm = model.getValue(ref + "[" + gridObj.row +"]/pnm");
- var renddd = model.getValue(ref + "[" + gridObj.row +"]/renddd");
- var dd = getCurrentDate();
- var valitodd = (dd.toDate()).getAddDate(-90);
- valitodd = valitodd.getDateFormat();
-
- if(renddd == ""){
- renddd = valitodd;
- }
-
- model.makeValue("/root/req/rendreport/pid" , pid);
- model.makeValue("/root/req/rendreport/pnm" , pnm);
- model.makeValue("/root/req/rendreport/fromdd", renddd);
- model.makeValue("/root/req/rendreport/todd" , dd);
- model.makeValue("/root/req/rendreport/dept" , chrtdept);
-
- model.refresh();
-
- btn_movchrt.dispatch("onclick");
- // 2008.12.18. 차트정보 조회하기..
- fChartHistory();
- }
- /**
- * @desc : 현위치조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fChartHistory()
- {
- if(isXPathTextNull("/root/req/rendreport/pid")){
- messageBox("환자번호를 입력해 주세요.", "I999", "");
- return;
- }
- model.makeValue("/root/send/reqdata/medirecno", "");
- model.removeNodeset("/root/main/rendreport/report/chrtlist");
- model.removeNodeset("/root/main/rendreport/report/unpreplist");
- model.removeNodeset("/root/main/rendreport/report/chrtlendlist");
- model.removeNodeset("/root/main/rendreport/report/chrtstatlist");
- model.refresh();
-
- // 입원차트 조회하기...
- model.setValue("/root/req/rendreport/ioflag", "I");
- model.copyNode("/root/send/reqdata", "/root/req/rendreport");
- submit("TRMRC02700","","/root/send/reqdata","/root/main/rendreport/report/chrtlist");
- }
- /**
- * @desc : 입원차트 조회
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fGetChartList()
- {
- fGetPidNo(ipt_chrtpid, "/root/hidden/chkyn2");
- fCheckPid(ipt_chrtpid, "/root/req/chartlend/chrtpnm");
- // 입원차트 조회하기...
- model.makeValue("/root/send/reqdata/ioflag", "I");
- var pid = ipt_chrtpid.currentText;
- model.makeValue("/root/send/reqdata/pid", pid);
- submit("TRMRC02700","","/root/send/reqdata","/root/main/chartlend/chrtlist");
- }
- /**
- * @desc : 대출용도 코드 입력시 대출용도 콤보 선택되도록 함
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fSelectedComboLendCd(iptObj, comboRef)
- {
- var lendcd = iptObj.currentText;
- lendcd = lendcd.getLeftPad(3, "0");
- var ref = iptObj.attribute("ref");
- model.setValue(ref, lendcd);
- model.setValue(comboRef, lendcd);
- model.refresh();
- }
- /**
- * @desc : 대출과 약어 입력시 대출과 콤보 선택되도록 함
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.05.30
- * @---------------------------------------------------
- */
- function fSelectedComboLendDeptCd(iptObj, comboObj)
- {
- var lenddeptabbr = iptObj.currentText;
- lenddeptabbr = lenddeptabbr.toUpperCase( );
- var ref = iptObj.attribute("ref");
- model.setValue(ref, lenddeptabbr);
- var deptcd = model.getValue("/root/init/lendmastinfo/lenddeptlist[lenddeptabbr ='" + lenddeptabbr + "']/lenddeptcd");
- var comboRef = comboObj.attribute("ref");
- model.setValue(comboRef, deptcd);
- model.refresh();
- if (deptcd != ""){
- // 대출과에 따른 대출자(의사) 조회하기
- comboObj.dispatch("xforms-value-changed");
- }
- }
- /**
- * @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");
- }
- /**
- * @desc : 차트 반납에서 대출일자 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fLendTermDisabled()
- {
- var lendtermdisabled = lendterm_disabled.value;
- if (lendtermdisabled == "Y") {
- var today = getCurrentDate();
- var valitodd = (today.toDate()).getAddDate(-90);
- valitodd = valitodd.getDateFormat();
- model.setValue("/root/req/chartreturn/fromappdd", today);
- model.setValue("/root/req/chartreturn/toappdd" , today);
- ipt_rtnfromappdd.disabled = false;
- ipt_rtntoappdd.disabled = false;
- } else {
- model.setValue("/root/req/chartreturn/fromappdd", "");
- model.setValue("/root/req/chartreturn/toappdd" , "");
- ipt_rtnfromappdd.disabled = true;
- ipt_rtntoappdd.disabled = true;
- }
- ipt_rtnfromappdd.refresh();
- ipt_rtntoappdd.refresh();
- }
- /**
- * @desc : 차트 반납에서 반납예정일 기간 콤보 보여줄까? 말까?
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fRrtTermDisabled()
- {
- var rtntermdisabled = rtnterm_disabled.value;
- if (rtntermdisabled == "Y") {
- var today = getCurrentDate();
- var valitodd = (today.toDate()).getAddDate(-90);
- valitodd = valitodd.getDateFormat();
- model.setValue("/root/req/chartreturn/fromrtndd", today);
- model.setValue("/root/req/chartreturn/tortndd" , today);
- ipt_fromrtndd.disabled = false;
- ipt_tortndd.disabled = false;
- } else {
- model.setValue("/root/req/chartreturn/fromrtndd", "");
- model.setValue("/root/req/chartreturn/tortndd" , "");
- ipt_fromrtndd.disabled = true;
- ipt_tortndd.disabled = true;
- }
- ipt_fromrtndd.refresh();
- ipt_tortndd.refresh();
- }
- /**
- * @desc : 챠트상태를 수정한다.
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fUpdateChrtStat(){
-
- var medirecno = model.getValue("/root/req/rendreport/medirecno");
- if(medirecno == ""){
- messageBox("선택된 차트이력이 ", "I004")
- return;
- }
- model.copyNode("/root/send/reqdata", "/root/req/rendreport");
- model.removeNodeset("/root/main/rendreport/report/chrtstatlist");
- submit("TXMRC01403", "true", "/root/send/reqdata", "/root/main/rendreport/report/chrtlist");
- }
- /**
- * @desc : 선택된 챠트정보를 조회한다.
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.07.14
- * @---------------------------------------------------
- */
- function fDisplayChrtInfo(gridObj){
- if (gridObj.row < 1){
- return;
- }
-
- var ref = gridObj.nodeset;
- var row = gridObj.row;
-
- var pid = model.getValue(ref + "[" + row +"]/pid");
- var pnm = model.getValue(ref + "[" + row +"]/pnm");
- var medirecno = model.getValue(ref + "[" + row +"]/medirecno");
- var orddeptcd = model.getValue(ref + "[" + row +"]/orddeptcd");
- var bcno = model.getValue(ref + "[" + row +"]/bcno");
- var chrtrem = model.getValue(ref + "[" + row +"]/chrtrem");
- var chrtstat = model.getValue(ref + "[" + row +"]/chrtstat");
- var lendyn = model.getValue(ref + "[" + row +"]/lendyn");
- var lastorddd = model.getValue(ref + "[" + row +"]/lastorddd");
- var ioflag = model.getValue(ref + "[" + row +"]/ioflag");
- var dschdd = model.getValue(ref + "[" + row +"]/dschdd");
-
- model.makeValue("/root/req/rendreport/pid" , pid);
- model.makeValue("/root/req/rendreport/pnm" , pnm);
- model.makeValue("/root/req/rendreport/medirecno", medirecno);
- model.makeValue("/root/req/rendreport/orddeptcd", orddeptcd);
- model.makeValue("/root/req/rendreport/bcno" , bcno);
- model.makeValue("/root/req/rendreport/chrtrem" , chrtrem);
- model.makeValue("/root/req/rendreport/chrtstat" , chrtstat);
- model.makeValue("/root/req/rendreport/lendyn" , lendyn);
- model.makeValue("/root/req/rendreport/lastorddd", lastorddd);
- model.makeValue("/root/req/rendreport/ioflag" , ioflag);
- model.makeValue("/root/req/rendreport/dschdd" , dschdd);
- model.copyNode("/root/send/reqdata", "/root/req/rendreport");
- // 미비현황
- submit("TRMRC02701", "true", "/root/send/reqdata", "/root/main/rendreport/report/unpreplist");
- // 챠트대출이력조회
- submit("TRMRC02702", "true", "/root/send/reqdata", "/root/main/rendreport/report/chrtlendlist");
- // 챠트분실이력조회
- submit("TRMRC01401", "true", "/root/send/reqdata", "/root/main/rendreport/report/chrtstatlist");
- }
- /**
- * @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 : 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);
- }
- }
|