123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- /*
- 환자별 투석 history 조회(SMMND02100.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- /**
- * @group :
- * @ver : 2007.06.20
- * @by : 김진아
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 화면 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDone(){
- //**그리드 초기화**//
- model.removeNodeset("/root/main/pathistlist/pathistinfo");
- var sCurrentDate = getCurrentDate(); // 현재일자
- model.setValue("/root/main/condition/srchfromdd", (sCurrentDate.substr(0,4)-1)+sCurrentDate.substr(4,4));
- model.setValue("/root/main/condition/srchtodd" , sCurrentDate);
- //**공통코드 가져오기**//
- zbcfGetCodeList( new Array ( "M0133" // 도관관리 부위
- , "M0134" // 도관관리 종류1
- , "M0135" // 도관관리 종류2
- , "M0136" // 혈액투석도관 제거이유
- , "M0138" // 동정맥루 부위
- , "M0137" // 동정맥루 종류
- , "M0139" // 동정맥루 사용혈관
- , "M0140" // 시술종류
- , "M0141" // 시술원인
- , "M0345" // 혈액투석액
- , "M0127" // 투석기
- , "M0128" // 용적
- , "M0142" // Cath.종류
- , "M0144" // 복막투석도관 제거사유
- , "M0145" // 감염종류
- , "M0146" // 원인균
- , "M0147" // 예후
- , "M0131" // 복막투석액 회사명
- , "M0132" // 복막투석액
- )
- , new Array ( "/root/init/M0133list" // 도관관리 부위
- , "/root/init/M0134list" // 도관관리 종류1
- , "/root/init/M0135list" // 도관관리 종류2
- , "/root/init/M0136list" // 혈액투석도관 제거이유
- , "/root/init/M0138list" // 동정맥루 부위
- , "/root/init/M0137list" // 동정맥루 종류
- , "/root/init/M0139list" // 동정맥루 사용혈관
- , "/root/init/M0140list" // 시술종류
- , "/root/init/M0141list" // 시술원인
- , "/root/init/M0345list" // 혈액투석액
- , "/root/init/M0127list" // 투석기
- , "/root/init/M0128list" // 용적
- , "/root/init/M0142list" // Cath.종류
- , "/root/init/M0144list" // 복막투석도관 제거사유
- , "/root/init/M0145list" // 감염종류
- , "/root/init/M0146list" // 원인균
- , "/root/init/M0147list" // 예후
- , "/root/init/M0131list" // 복막투석액 회사명
- , "/root/init/M0132list" // 복막투석액
- )
- );
-
- //** 상단환자 화면설정 **//
- var node = getGlobalVariable("paminfo");
- setCSVToNode("/root/temp/paminfo", node);
-
- if(getNodesetCount("/root/temp/paminfo/list") > 0) {
- var sSelPid = model.getValue("/root/temp/paminfo/list/pid"); // 등록번호
- model.setValue("/root/main/condition/pid", sSelPid);
- }
- if(model.getValue("/root/main/condition/pid")!=""){
- fSrchPatHistList(); // 환자별 투석 History 리스트 조회
- }
- }
- /**
- * @group :
- * @ver : 2007.06.20
- * @by : 김진아
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자별 투석 History 리스트 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSrchPatHistList(){
- if(model.getValue("/root/main/condition/pid") == "") {
- fClearChildNode("/root/main/condition");
- var sCurrentDate = getCurrentDate(); // 현재일자
- model.setValue("/root/main/condition/srchfromdd", (sCurrentDate.substr(0,4)-1)+sCurrentDate.substr(4,4));
- model.setValue("/root/main/condition/srchtodd" , sCurrentDate);
- model.refresh();
- messageBox("등록번호는", "I003", "");
-
- fClearChildNode("/root/main/patbaselist/patbaseinfo");
- model.removeNodeset("/root/main/pathistlist");
- model.refresh();
- return;
- }
- // 조회기간 체크
- if(model.getValue("/root/main/condition/srchfromdd") > model.getValue("/root/main/condition/srchtodd")) {
- messageBox("예약일자 기간이 올바르지 않습니다.", "E");
-
- var sCurrentDate = getCurrentDate(); // 현재일자
- model.setValue("/root/main/condition/srchfromdd", (sCurrentDate.substr(0,4)-1)+sCurrentDate.substr(4,4));
- model.setValue("/root/main/condition/srchtodd" , sCurrentDate);
- model.refresh();
- }
- model.removenode("/root/send");
- model.makeNode ("/root/send");
- model.makeValue ("/root/send/reqdata/pid ", model.getValue("/root/main/condition/pid ")); // 등록번호
- model.makeValue ("/root/send/reqdata/hngnm ", model.getValue("/root/main/condition/hngnm ")); // 환자명
- model.makeValue ("/root/send/reqdata/srchfromdd", model.getValue("/root/main/condition/srchfromdd")); // 조회기간(시작)
- model.makeValue ("/root/send/reqdata/srchtodd ", model.getValue("/root/main/condition/srchtodd ")); // 조회기간(끝)
-
- model.removeNodeset("/root/main/pathistlist");
- model.removeNodeset("/root/main/patbaselist");
- submit("TRMND02101");
- // if(model.getValue("/root/main/pathistlist/pathistinfo/recdd") == ""){
- // model.removeNodeset("/root/main/pathistlist");
- // }
- // 환자명 설정
- model.makeValue("/root/main/condition/hngnm", model.getValue("/root/main/patbaselist/patbaseinfo/hngnm"));
-
- // 그리드Merge설정
- for(var i=2;i<grd_pathistinfo.cols;i++){
- grd_pathistinfo.mergecol(i) = false;
- }
- grd_pathistinfo.mergeCells = "bycol";
- model.refresh();
- }
- function fUseridPopup(pPath, pNodeID, pNodeNM, pNodeRrgsNo1, pNodeRrgsNo2, pDOC) {
- model.removeNodeset("/root/properties/parameters/SendData/SendDatavalue");
- model.removeNodeset("/root/main/pathistlist");
- modal("SMMNE03700", 1, event.screenX-100, event.screenY-100, "SMMNE03700", "/root/main/condition/pid", "/root/init/searchitem");
- var pParam = model.getValue("/root/properties/parameters/SendData/SendDatavalue");
- var pParamValue = pParam.split("|");
- model.setValue("/root/main/condition/pid", pParamValue[0]);
- }
- /************************************************************************************************************************/
- /**
- * @group :
- * @ver :
- * @by : 김기용, KJA 여러개의 그리드를 한 Sheet저장으로 수정
- * @---------------------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그리드 별 엑셀저장
- * @param :
- * @return :
- * @---------------------------------------------------------------
- */
- function saveExcelAll() {
-
- var paramLen = saveExcelAll.arguments.length;
-
- // 마지막 인자가 Boolean일 경우 처리
- var extendsCaptionBool;
- if( typeof(saveExcelAll.arguments[paramLen - 1]) == "boolean" ) {
- extendsCaptionBool = saveExcelAll.arguments[paramLen - 1];
- paramLen = paramLen - 1;
- }
- else{
- extendsCaptionBool = false;
- }
-
- var tmpParamArray = new Array();
- if( extendsCaptionBool ) {
- for( var i = 0; i < paramLen; i++ ) {
- tmpParamArray[i] = saveExcelAll.arguments[i];
- }
- saveExcelAllWithCaption(tmpParamArray);
- }
- else{
- for( var i = 0; i < paramLen; i++ ) {
- tmpParamArray[i] = saveExcelAll.arguments[i];
- }
- saveExcelAllWithNotCaption(tmpParamArray);
- }
- }
- function saveExcelAllWithCaption( sheetArray ) {
-
- // alert(gridCaptionArray);
-
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
-
- if( fileName == "" )
- return;
-
- var sheetArrayLen = sheetArray.length;
- var gridId;
- var gridObj;
- for( var i = 0; i < sheetArray.length; i++ ) {
- gridId = sheetArray[i].split("|")[0];
- gridObj = document.all.item(gridId);
- // saveText() 함수는 Caption저장이 불가능 하여 SaveExcel()을 이용한다.
- gridObj.saveExcel("C:\\Temp\\tmp_TFExcel_" + i +".xls");
- }
-
- // excel application 실행함
- tfexcel.launchnewinstance(0);
-
- //실행된 excel application에서 새로운 workbook을 생성
- tfexcel.createworkbook();
-
- tfexcel.activatesheet(1);
-
- var sheetName;
- var nResult;
-
- //수정부분////////////////////////////////////////////////////////////////////////////////////////
- for( var i = 0; i < sheetArrayLen; i++ )
- {
- sheetName = sheetArray[1].split("|")[1];
- if( i > 1 ) {
- nResult = tfexcel.activatesheet(1);
- tfexcel.sheetname(1) = sheetName;
- }
- else {
- nResult = tfexcel.activatesheet(1);//tfexcel.addsheet(i+1, sheetName);
- }
- if( nResult < 0 ) {
- messageBox(sheetName + " 저장을", "E009");
- // alert(sheetName + " 오류발생");
- return;
- }
- tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
- }
- //여기까지//////////////////////////////////////////////////////////////////////////////////////////
-
- tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel.xls");
-
- //workbook을 저장.
- tfexcel.save(fileName);
-
- //excel application을 종료. excel application 생성 후 반드시 close해야함.
- tfexcel.close();
-
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- for( var i = 0; i < sheetArrayLen; i++ ) {
- fso.DeleteFile("C:\\Temp\\tmp_TFExcel_" + i + ".xls");
- }
-
- var rmsg = messageBox("저장된 Excel을", "Q004");
- // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
- if( rmsg == 6 )
- window.exec("excel.exe", '\"' + fileName + '\"');
- }
- function saveExcelAllWithNotCaption( sheetArray ) {
-
- // alert(gridCaptionArray);
-
- var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
-
- if( fileName == "" )
- return;
- // excel application 실행함
- tfexcel.launchnewinstance(0);
-
- // 실행된 excel application에서 새로운 workbook을 생성
- tfexcel.createworkbook();
-
- // var sheetArray = new Array("grd_bizprescondstats|업무현황", "grd_patprescondstats|환자현황", "grd_hdstatsinfo|혈액투석현황", "grd_pdstatsinfo|복막투석현황", "grd_pdbizstatsinfo|복막투석업무현황");
- var sheetArrayLen = sheetArray.length;
- var gridId;
- var gridObj;
- var sheetName;
- var nResult;
-
- for( var i = 0; i < sheetArrayLen; i++ ) {
- gridId = sheetArray[i].split("|")[0];
- gridObj = document.all.item(gridId);
- sheetName = sheetArray[i].split("|")[1];
-
- if( i > 1 ) {
- nResult = tfexcel.activatesheet(i+1);
- tfexcel.sheetname(i+1) = sheetName;
- }
- else {
- nResult = tfexcel.addsheet(i+1, sheetName);
- }
- if( nResult < 0 ) {
- messageBox(sheetName + " 저장을", "E009");
- // alert(sheetName + " 오류발생");
- return;
- }
- gridObj.saveText("C:\\Temp\\tmp_TFExcel.csv", "\n", ",", '\:', true);
- tfexcel.loadCSV("C:\\Temp\\tmp_TFExcel.csv");
- }
-
- //workbook을 저장.
- tfexcel.save(fileName);
-
- //excel application을 종료. excel application 생성 후 반드시 close해야함.
- tfexcel.close();
-
- // CSV File 삭제
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- fso.DeleteFile("C:\\Temp\\tmp_TFExcel.csv");
-
- var rmsg = messageBox("저장된 Excel을", "Q004");
- // var rmsg = window.alert("저장된 Excel을 실행하시겠습니까?", "알림", 36);
- if( rmsg == 6 )
- window.exec("excel.exe", '\"' + fileName + '\"');
- }
- function createTFExcel(tfExcelID, parentObj) {
- if( parentObj == null )
- parentObj = body;
- var tfExcelObj = parentObj.createChild("xforms:object", "id:" + tfExcelID + "; clsid:{fe8d1001-6a9d-424d-ae2a-301493bb12da}; left:100px; top:100px; width:100px; height:100px; ");
- return tfExcelObj;
- }
- /************************************************************************************************************************/
|