123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410 |
- /**
- * @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 : 출력버튼
- * @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()
- {
- // KNUH_20101207_박성호_start_의무기록 부서코드 가져오기
- mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/basedeptcd", 5501);
- //mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/appdeptcd", 5503);
-
- var basedeptcd = model.getValue("/root/temp/basedeptcd/hardcd/hardcd");
- //var appdeptcd = model.getValue("/root/temp/appdeptcd/hardcd/hardcd");
- //alert(basedeptcd + " " + appdeptcd);
- // KNUH_20101207_박성호_end
-
- model.setValue("/root/main/condition/basedeptcd", basedeptcd);
- var appdeptcd = getUserInfo("dutplcecd");
- model.setValue("/root/main/condition/appdeptcd", appdeptcd);
- // 상단환자정보 가져오기..
- var node = getGlobalVariable("paminfo");
- model.removeNodeset("/root/main/result/paminfo/list");
- setCSVToNode("/root/main/result/paminfo", node);
- // 환자등록번호
- var pid = model.getValue("/root/main/result/paminfo/list/pid");
- var pnm = model.getValue("/root/main/result/paminfo/list/hngnm");
- var indd = model.getValue("/root/main/result/paminfo/list/indd");
- var cretno = model.getValue("/root/main/result/paminfo/list/cretno");
- //var wardcd = model.getValue("/root/main/result/paminfo/list/wardcd");
- //var roomcd = model.getValue("/root/main/result/paminfo/list/roomcd");
- model.makeValue("/root/main/condition/pid" , pid);
- model.makeValue("/root/main/condition/pnm" , pnm);
- model.makeValue("/root/main/condition/indd" , indd);
- model.makeValue("/root/main/condition/cretno", cretno);
- //model.makeValue("/root/main/condition/wardcd", wardcd);
- //model.makeValue("/root/main/condition/roomcd", roomcd);
- model.refresh();
- if (pid == ""){
- //alert("상단의 환자정보가 없습니다");
- //window.close();
- //return;
- }
- else
- {
- // 챠트조회하기..
- fGetOtherLendChrtList();
- }
- /*
- if (isPopup() == true) {
- // 2008.01.08. 파라메터로 입원 병동코드,병실코드 를 받는다..(응급실에서..)
- // 입원 병동코드,병실코드
- var pid = opener.javascript.getParameter("pid");
- //var inwardcd = opener.javascript.getParameter("inwardcd");
- //var inroomcd = opener.javascript.getParameter("inroomcd");
- if (pid.length > 0){
- model.makeValue("/root/main/condition/pid" , pid);
- //model.makeValue("/root/main/condition/wardcd", inwardcd);
- //model.makeValue("/root/main/condition/roomcd", inroomcd);
- model.makeValue("/root/hidden/param/pid" , pid);
- //model.makeValue("/root/hidden/param/inwardcd", inwardcd);
- //model.makeValue("/root/hidden/param/inroomcd", inroomcd);
- model.refresh();
- }
- }
- */
- // 병동조회하기..
- //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/wardlist", "W"); //병동코드 콤보
- // 병실조회하기..
- //fSelectWard();
-
-
- }
- /**
- * @desc : 병동에 병실 가져오기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fSelectWard()
- {
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/main/condition/wardcd"));
- submit("TRMRC00051");
- }
- /**
- * @desc : 응급실에서 대출한 챠트 리스트 조회하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetOtherLendChrtList()
- {
- var pid = model.getValue("/root/main/condition/pid");
- var appdeptcd = model.getValue("/root/main/condition/appdeptcd");
- model.makeValue("/root/send/reqdata/pid", pid);
- model.makeValue("/root/send/reqdata/appdeptcd", appdeptcd);
- model.refresh();
-
- if (pid.length > 0) {
- if (submit("TRMRC04301") == true)
- {
- var chrtseqno = model.getValue("/root/main/lendchrt/chrtinfo/chrtseqno");
- if (chrtseqno == "")
- {
- model.resetInstanceNode("/root/main/lendchrt/chrtlist");
- messageBox("차트 대출정보가 없는 환자 번호 입니다.", "E999", "");
-
- }
- }
-
- model.refresh();
-
- }
- }
- /**
- * @desc : 챠트이관
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fSendChrt()
- {
- var ref = "/root/main/lendchrt/chrtlist";
- var cnt = getNodeSetCnt(ref);
- //var savedata = "status▦chrtseqno▦medirecno▦pid▦rtndeptcd▦rtnmanid▦indd▦cretno▦wardcd▦roomcd▦basedeptcd▩";
- var savedata = "chrtseqno▦medirecno▦pid▦rtndeptcd▦rtnmanid▦rtnchrtseqno▦basedeptcd▩";
- var dataString = "";
- var dataCount = 0;
- var rtndeptcd = getUserInfo("dutplcecd");
- var rtnmanid = getUserInfo("userid");
- var rtnchrtseqno = model.getValue("/root/main/lendchrt/chrtinfo/chrtseqno");
- //var indd = model.getValue("/root/main/condition/indd");
- //var cretno = model.getValue("/root/main/condition/cretno");
- //var wardcd = model.getValue("/root/main/condition/wardcd");
- //var roomcd = model.getValue("/root/main/condition/roomcd");
- var basedeptcd = model.getValue("/root/main/condition/basedeptcd");
- /*
- if (wardcd == "") {
- alert("보낼병동을 선택하세요."); return;
- }
- if (roomcd == "") {
- alert("보낼병실을 선택하세요"); return;
- }
- */
-
-
- var chrtseqno = model.getValue(ref + "[" + grd_chrtlist.row + "]/chrtseqno");
- var medirecno = model.getValue(ref + "[" + grd_chrtlist.row + "]/medirecno");
- var pid = model.getValue(ref + "[" + grd_chrtlist.row + "]/pid");
-
- dataString = dataString + chrtseqno + "▦" + medirecno + "▦" + pid + "▦";
- dataString = dataString + rtndeptcd + "▦" + rtnmanid + "▦" + rtnchrtseqno + "▦" + basedeptcd + "▩";
- /*
- for ( var i = 1; i <= cnt; i++)
- {
- var checked = model.getValue(ref + "[" + i + "]/checked");
- var chrtseqno = model.getValue(ref + "[" + i + "]/chrtseqno");
- var medirecno = model.getValue(ref + "[" + i + "]/medirecno");
- var pid = model.getValue(ref + "[" + i + "]/pid");
- if (checked == "true" && medirecno != "")
- {
- dataString = dataString + "u▦" + chrtseqno + "▦" + medirecno + "▦" + pid + "▦";
- dataString = dataString + rtndeptcd + "▦" + rtnmanid + "▦" + rtnchrtseqno + "▦" + indd + "▦" + cretno + "▦" + basedeptcd + "▩";
- dataCount = dataCount + 1;
- }
- }
- */
-
- if (dataString.length > 0)
- {
- model.makeValue("/root/send/savedata", savedata + dataString);
- submit("TXMRC04301");
- //alert("총 " + dataCount + " 건 챠트이관 되었습니다.");
- // 다시 조회하기..
- submit("TRMRC04301");
- }
- }
- /**
- * @desc : 환자등록번호 조회 팝업
- * @
- * @param : refPid - 환자번호 node path
- * @ refPnm - 환자명 node path
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- 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 - 환자번호 입력 컨트롤 (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 : 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();
- }
|