123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[
- /**
- * @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(ds_send_reqdata, ds_temp_basedeptcd_hardcd, 5501);
- //mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/appdeptcd", 5503);
-
- var basedeptcd = ds_temp_basedeptcd_hardcd.getColumn(0, "hardcd");
- //var appdeptcd = model.getValue("/root/temp/appdeptcd/hardcd/hardcd");
- //alert(basedeptcd + " " + appdeptcd);
- // KNUH_20101207_박성호_end
-
- ds_main_condition.setColumn(0, "basedeptcd", basedeptcd);
- var appdeptcd = sysf_getUserInfo("dutplcecd");
- ds_main_condition.setColumn(0, "appdeptcd", appdeptcd);
- // 상단환자정보 가져오기..
- var node = sysf_getGlobalVariable("paminfo");
- ds_main_result_paminfo_list.clearData();
- dsf_setCSVToDs("ds_main_result_paminfo_list", node); //환자정보내리기
-
- // 환자등록번호
- var pid = ds_main_result_paminfo_list.getColumn(0, "pid");
- var pnm = ds_main_result_paminfo_list.getColumn(0, "hngnm");
- var indd = ds_main_result_paminfo_list.getColumn(0, "indd");
- var cretno = ds_main_result_paminfo_list.getColumn(0, "cretno");
- //var wardcd = model.getValue("/root/main/result/paminfo/list/wardcd");
- //var roomcd = model.getValue("/root/main/result/paminfo/list/roomcd");
- ds_main_condition.setColumn(0, "pid" , pid);
- ds_main_condition.setColumn(0, "pnm" , pnm);
- ds_main_condition.setColumn(0, "indd" , indd);
- ds_main_condition.setColumn(0, "cretno", cretno);
- //model.makeValue("/root/main/condition/wardcd", wardcd);
- //model.makeValue("/root/main/condition/roomcd", roomcd);
- if( utlf_isNull(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()
- {
- ds_send_reqdata.setColumn(0, "wardcd", ds_main_condition.getColumn(0, "wardcd"));
- submit("TRMRC00051");
- }
- /**
- * @desc : 응급실에서 대출한 챠트 리스트 조회하기
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetOtherLendChrtList()
- {
- var pid = utlf_transNullToEmpty(ds_main_condition.getColumn(0, "pid"));
- var appdeptcd = ds_main_condition.getColumn(0, "appdeptcd");
- ds_send_reqdata.setColumn(0, "pid", pid);
- ds_send_reqdata.setColumn(0, "appdeptcd", appdeptcd);
-
- if( pid.length > 0 ){
- var oParam = {};
- oParam.id = "TRMRC04301";
- oParam.service = "chrtmngtapp.ChrtRendMngt";
- oParam.method = "reqGetOtherLendChrt";
- oParam.inds = "req=ds_send_reqdata";
- oParam.outds = "ds_main_lendchrt_chrtlist=chrtlist ds_main_lendchrt_chrtinfo=chrtinfo";
- oParam.async = false;
- oParam.callback = "cf_TRMRC04301";
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TRMRC04301") > -1 )
- {
- var chrtseqno = ds_main_lendchrt_chrtinfo.getColumn(0, "chrtseqno");
- if( utlf_isNull(chrtseqno) )
- {
- ds_main_lendchrt_chrtlist.clearData();
- sysf_messageBox("차트 대출정보가 없는 환자 번호 입니다.", "E999", "");
-
- }
- }
- }
- }
- function cf_TRMRC04301(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /**
- * @desc : 챠트이관
- * @
- * @param :
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fSendChrt()
- {
- var ref = ds_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 = sysf_getUserInfo("dutplcecd");
- var rtnmanid = sysf_getUserInfo("userid");
- var rtnchrtseqno = utlf_transNullToEmpty(ds_main_lendchrt_chrtinfo.getColumn(0, "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 = utlf_transNullToEmpty(ds_main_condition.getColumn(0, "basedeptcd"));
- /*
- if (wardcd == "") {
- alert("보낼병동을 선택하세요."); return;
- }
- if (roomcd == "") {
- alert("보낼병실을 선택하세요"); return;
- }
- */
-
-
- var chrtseqno = utlf_transNullToEmpty(ref.getColumn(ref.rowposition, "chrtseqno"));
- var medirecno = utlf_transNullToEmpty(ref.getColumn(ref.rowposition, "medirecno"));
- var pid = utlf_transNullToEmpty(ref.getColumn(ref.rowposition, "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 )
- {
- dsf_setCSVToDs("ds_send_savedata", savedata + dataString);
-
- var oParam = {};
- oParam.id = "TXMRC04301";
- oParam.service = "chrtmngtapp.ChrtRendMngt";
- oParam.method = "reqSetOtherSendChrt";
- oParam.inds = "req=ds_send_savedata";
- oParam.outds = "";
- oParam.async = false;
- //oParam.callback = "cf_TXMRC04301";
- tranf_submit(oParam);
-
- //alert("총 " + dataCount + " 건 챠트이관 되었습니다.");
- // 다시 조회하기..
- var oParam = {};
- oParam.id = "TRMRC04301";
- oParam.service = "chrtmngtapp.ChrtRendMngt";
- oParam.method = "reqGetOtherLendChrt";
- oParam.inds = "req=ds_send_reqdata";
- oParam.outds = "ds_main_lendchrt_chrtlist=chrtlist ds_main_lendchrt_chrtinfo=chrtinfo";
- oParam.async = false;
- //oParam.callback = "cf_TRMRC04301";
- tranf_submit(oParam);
- }
- }
- /**
- * @desc : 환자등록번호 조회 팝업
- * @
- * @param : refPid - 환자번호 node path
- * @ refPnm - 환자명 node path
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetPid(refPid, refPnm)
- {
- //조회건수가 1건일 경우 팝업창을 바로 닫는다.
- ds_hidden_tmp_pidpopupinfo.setColumn(0, "checkfnexam", "1");
- ds_hidden_tmp_pidpopupinfo.setColumn(0, "autoflag", "N");
- if( utlf_isNull(ds_hidden_tmp_pidpopupinfo.getColumn(0, "srchcond")) ){
- ds_hidden_tmp_pidpopupinfo.setColumn(0, "srchcond", '2');
- }
-
- var objArg = new Object();
- objArg.arg_ds_send = ds_hidden_tmp_pidpopupinfo;
- frmf_modal("SPPMC02500","SPPMC02500","", 1, 150, 150, "", "", "", "", "", "", "M");
-
- //환자번호 copy
- var popupendflag = frmf_getParameter("SPPMC02500_popupendflag");
-
- if( popupendflag == "ok" )
- {
- ds_main_condition.setColumn(0, refPid, ds_patinfolist.getColumn(0, "pid"));
-
- if( !utlf_isNull(refPnm) ){
- ds_main_condition.setColumn(0, refPnm, ds_patinfolist.getColumn(0, "hngnm"));
- }
- }
- }
- /**
- * @desc : 등록된 환자번호인지 체킹한다..
- * @
- * @param : iptObj - 환자번호 입력 컨트롤 (pid)
- * @return : pnm - 환자명
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fCheckPid(iptObj, refPnm)
- {
- ds_send_req.setColumn(0, "srchcond", "1");
- ds_send_req.setColumn(0, "pid", iptObj.value);
-
- //환자등록번호 체크
- if( utlf_transNullToEmpty(iptObj.value).length > 0 ){
-
- ds_main_result_patinfo_patinfolist.clearData();
-
- var oParam = {};
- oParam.id = "TRPMC02500";
- oParam.service = "patinfomngtapp.PatBaseInfo";
- oParam.method = "reqGetPatInfo";
- oParam.inds = "req=ds_send_req";
- oParam.outds = "ds_main_result_patinfo_patinfolist=patinfolist";
- oParam.async = false;
- oParam.callback = "cf_TRPMC02500";
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TRPMC02500") > -1 ){
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( ds_main_result_patinfo_patinfolist.rowcount > 0 ){
- ds_main_patinfo_patinfolist.copyData(ds_main_result_patinfo_patinfolist);
-
- //* 2009.04.07. 이중번호 메세지 ( 14257937 박용석 -> 13275912 신옥순 )
- var sBindPid = ds_main_result_patinfo_patinfolist.getColumn(0, "bindpid");
- if( sBindPid != '-' && !utlf_isNull(sBindPid) && sBindPid != ' ' ){
- //합번된 등록번호 메세지 처리
- var sPid = ds_main_result_patinfo_patinfolist.getColumn(0, "pid");
- var sHngnm = ds_main_result_patinfo_patinfolist.getColumn(0, "hngnm");
- var retValue = sysf_messageBox(sPid + " (" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
- if( retValue == '6' ){
- ds_main_condition.setColumn(0, "pid", sBindPid);
-
- fCheckPid(iptObj, refPnm);
- return "";
- }
- }
- //*/
- var pid = ds_main_result_patinfo_patinfolist.getColumn(0, "pid");
- var pnm = ds_main_result_patinfo_patinfolist.getColumn(0, "hngnm");
- if( !utlf_isNull(refPnm) )
- {
- ds_main_condition.setColumn(0, refPnm, pnm);
- }
- return pnm;
- }else{
- ds_main_patinfo_patinfolist.clearData();
- sysf_messageBox("없는 환자 번호 입니다.", "E999", "");
- return "";
- }
- }
-
- }else{
- sysf_messageBox("환자등록번호를 정확히", "C001");
- return "";
- }
- }
- function cf_TRPMC02500(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- /**
- * @desc : 하드코드 조회
- * @
- * @param : ref - reference path
- * rsltref - result reference path
- * hardcd - 하드코드
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function mmbfGetHardCodeInfo(ref, rsltref, hardcd){
- var mmb_rsltref = ds_hidden_mmb_hardcd;
- mmb_rsltref.clearData();
-
- ref.setColumn(0, "hardcd", hardcd);
-
- var oParam = {};
- oParam.id = "TRMMB04103";
- oParam.service = "prcpbaseapp.EnvInfoMngt";
- oParam.method = "reqGetHardCodeCD";
- oParam.inds = "req=ds_send_reqdata";
- oParam.outds = "ds_hidden_mmb_hardcd=hardcd";
- oParam.async = false;
- oParam.callback = "cf_TRMMB04103";
- tranf_submit(oParam);
-
- if( arErrorCode.pop("TRMMB04103") > -1 ){
- rsltref.copyData(mmb_rsltref);
- mmb_rsltref.clearData();
- }
- }
- function cf_TRMMB04103(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- ]]></Script>
|