SMZUM00301_상태메시지XP.xrw 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/hismainweb/css/hismain.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>메세지</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <properties>
  10. <screenloc>
  11. </screenloc>
  12. <clonenode>
  13. <scn>
  14. <sid/>
  15. <leftpos/>
  16. <toppos/>
  17. <status/>
  18. <mon/>
  19. </scn>
  20. </clonenode>
  21. <actscreen/>
  22. <menugroupinfo/>
  23. <configclone>
  24. <item>
  25. <cfgname/>
  26. <cfgvalue/>
  27. </item>
  28. </configclone>
  29. <popupmenu>
  30. <items>
  31. <name>소스보기</name>
  32. <func>fViewSource</func>
  33. </items>
  34. <items>
  35. <name>인스턴스</name>
  36. <func>fViewInstance</func>
  37. </items>
  38. <items>
  39. <name>로그보기</name>
  40. <func>fViewLog</func>
  41. </items>
  42. <items>
  43. <name>-</name>
  44. <func/>
  45. </items>
  46. <items>
  47. <name>화면출력</name>
  48. <func>fScreenPrint</func>
  49. </items>
  50. <items>
  51. <name>-</name>
  52. <func/>
  53. </items>
  54. <items>
  55. <name>버전정보</name>
  56. <func>fViewerAbout</func>
  57. </items>
  58. </popupmenu>
  59. </properties>
  60. <send>
  61. <screenloc>
  62. </screenloc>
  63. <prcpdd/>
  64. <instcd/>
  65. <awtyn/>
  66. <securitydata>
  67. <menugrupcd/>
  68. <menuitemcd/>
  69. <scrncd/>
  70. </securitydata>
  71. <awtgrpcd/>
  72. <awtstnsyn/>
  73. <chngdept>
  74. <userid/>
  75. <sessionstr/>
  76. <dutplcecd/>
  77. <dutplceinstcd/>
  78. </chngdept>
  79. </send>
  80. <main>
  81. <msg/>
  82. <userinfo>
  83. <deptnm/>
  84. <usernm/>
  85. <logindt/>
  86. <wsnm/>
  87. </userinfo>
  88. </main>
  89. <hidden>
  90. <zbccode/>
  91. <jobkindlist/>
  92. </hidden>
  93. </root>
  94. </instance>
  95. <script type="javascript" ev:event="xforms-ready">
  96. <![CDATA[
  97. // Viewer가 완전히 로딩되기 이전에 model.property 를 사용하면 Viewer 다운현상
  98. // 메뉴Submit과 ready submit 동시 발생으로 인한 IE 다운현상
  99. // 메뉴가 로딩된후 관련 값을을 model.property에 설정하도록 viewer 내에서 타이머로 처리
  100. gMenuTimerID = window.setInterval("fMenuReady()",200);
  101. if(getUserInfo("dutplceinstcd")== "032") {
  102. caption1.attribute("background-color") = "#fdc87e";
  103. } else {
  104. caption1.attribute("background-color") = "#99ccff";
  105. }
  106. ]]>
  107. </script>
  108. <submission id="TRZUM00301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/properties/screenloc"/>
  109. <submission id="TRZUM00302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/properties/orderbasicinfo"/>
  110. <submission id="TXZUM00301" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/screenloc" resultref="/root/hidden/screenloc"/>
  111. <submission id="TXZUM00302" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/properties/screenloc"/>
  112. <submission id="TXZUM00303" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
  113. <submission id="TXZUM00304" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
  114. <submission id="TXZUM00305" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/securitydata"/>
  115. <submission id="TXZUM00306" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
  116. <submission id="TRZBC00101" mediatype="application/x-www-form-urlencoded" method="post"/>
  117. <submission id="TRZBC00105" mediatype="application/x-www-form-urlencoded" method="post"/>
  118. <submission id="TRZUM20001" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/hidden/lastpwdchgdt"/>
  119. <submission id="TRZHM00500" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/temp/logcheck" resultref="/root/temp"/>
  120. <submission id="TXZUM01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/chngdept" resultref="/root/hidden">// XP에서 부서변경시 TF쪽 처리를 위해 추가</submission>
  121. <submission id="TXZUM01902" mediatype="application/x-www-form-urlencoded" method="post"/>
  122. </model>
  123. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  124. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  125. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  126. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  127. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC006.js"/>
  128. <script type="javascript" src="../../../com/noticeinfoweb/js/noticepopup.js"/>
  129. <script type="javascript">
  130. <![CDATA[
  131. var screenLocSave = null; // 화면좌표 저장여부
  132. var msgsvrIPKeyStr = null; // msg server connect IP
  133. var msgsvrPortKeyStr = null; // msg server connect Port
  134. var msgsvrRetyrKeyStr = null; // msg server connect retry time
  135. var isConnected = false; // msg server 연결 여부
  136. var gPingTimerID = ""; // msg server 재접속 타이머 아이디
  137. var msg = ""; // 보낼 메시지
  138. var startTime = "";
  139. var endTime = "";
  140. var HISSystem = ""; //HIS여부
  141. var basicCodeList = "";
  142. // var gScreenTimerID = ""; // 화면 좌표 정보 loading용 타이머
  143. var gMenuTimerID = ""; // 최초 메뉴그룹 정보 저장용 타이머
  144. var gActivateWindowTimerID = ""; // 열린화면에서 선택한 화면을 activate() 하기위한 타이머
  145. //
  146. var gMouseCountFlag = false; // 화면 마우스 클릭수 집계 여부
  147. // function fLoadScreenInfo() {
  148. // alert("fLoadScreenInfo:"+htmlwindow.menuLoaded);
  149. // if (htmlwindow.menuLoaded) {
  150. // submit("TRZUM00301");
  151. // if (gScreenTimerID != "") {
  152. // window.clearInterval(gScreenTimerID);
  153. // gScreenTimerID = "";
  154. // }
  155. // }
  156. // }
  157. //
  158. function fInitialize(){
  159. /* fInitializeOnLoading() 함수로 이동*/
  160. //전체 공통 세션용 변수 reset
  161. model.resetProperty();
  162. //fDelGlobalVariable();
  163. //팝업 메뉴를 보이게 할지 여부 (true: 보인다. false: 숨긴다)
  164. // 반드시 Boolean type 을 사용한다. - 김기호 2008.02.19
  165. app.showPopupMenu(new Boolean(htmlwindow.DEVSystem));
  166. //로그 파일을 삭제한다. (해당 폴더까지 삭제함)
  167. //app.deleteLog();
  168. //1개월 로그만 남기고, 로그 파일을 삭제한다. (해당 폴더까지 삭제함) added by CBJ 2012.03.23
  169. app.deleteLog(1);
  170. //메인화면 상태 저장
  171. setGlobalVariable("mainclose", "N");
  172. //스크립트 버전정보 저장
  173. model.makeValue("/root/properties/jsversion",ScriptEngineMajorVersion()+"."+ScriptEngineMinorVersion()+"."+ScriptEngineBuildVersion());
  174. //사용중인 뷰어의 버전
  175. model.makeValue("/root/properties/tfviewerversion",app.appVersion );
  176. // 서버시간과 차이값을 저장해 놓는다.
  177. if (htmlwindow == null) {
  178. setGlobalVariable("timediff", "0");
  179. } else {
  180. setGlobalVariable("timediff", htmlwindow.diffTime);
  181. setGlobalVariable("currenttimemillis", htmlwindow.currentTimeMillis);
  182. }
  183. // 시간 동기화 120920 손병은
  184. var newDate = getNewDate();
  185. //window.exec("c:\\Program Files\\himed\\components\\KNUH\\kdate.bat",newDate.getDateFormat("YYYY/MM/DD hh:mm:ss"));
  186. // 세션 타임아웃 값을 저장해 놓는다.
  187. // XP에서는 세션타임아웃 체크 중복 되므로 예외처리 (by 김지훈)
  188. if (htmlwindow != null) {
  189. setGlobalVariable("session_timeout", -1); // session_timeout이 0 이하이면 암호 묻지 않음
  190. // setGlobalVariable("session_timeout", htmlwindow.sessionTimeout);
  191. // setGlobalVariable("last_submit", (new Date()).getTime());
  192. //// setGlobalVariable("last_submit", newDate);
  193. }
  194. setGlobalVariable("xp", htmlwindow.sessionTimeout);
  195. //사용자 정보 저장
  196. fSetUserInfo();
  197. fSetStatusUserInfo();
  198. initTitle();
  199. fSetMonitorInfo();
  200. fSetUrls();
  201. if (htmlwindow != null) {
  202. screenLocSave = new String(htmlwindow.screenLocSave);
  203. HISSystem = new String(htmlwindow.HISSystem);
  204. basicCodeList = new String(htmlwindow.basicCode);
  205. } else {
  206. screenLocSave = "false";
  207. HISSystem = "true";
  208. basicCodeList = "";
  209. }
  210. if(getUserInfo("dutplceinstcd")== "032") {
  211. caption1.attribute("background-color") = "#fdc87e";
  212. }
  213. if (screenLocSave == "true") {
  214. // TFMenu와 동시 submit 될때 오류가 발생하므로 menu가 로드된 후에만 실행되도록 타이머로 처리
  215. //gScreenTimerID = window.setInterval("fLoadScreenInfo()",500);
  216. setErrorOff();
  217. submit("TRZUM00301");
  218. }
  219. if (basicCodeList != "") {
  220. var basicCode = basicCodeList.split("|");
  221. setErrorOff();
  222. zbcfGetCodeListCache(null,basicCode);
  223. }
  224. // 마정민 대리 요청으로 의사이외의 직종에서도 처방기본정보 조회 가능하도록 수정 - 2008.10.09 김기호
  225. // && getUserInfo("jobkindcd") == "0330"
  226. fInitializsOrderBasicInfo();
  227. /* 주석처리 (XP)
  228. // 비밀번호 공지사항 띄우기. 손병은.
  229. if(submit("TRZUM20001")){
  230. var lastpwdchgdt = model.getValue("/root/hidden/lastpwdchgdt/lastpwdchgdt/lastpwdchgdt").substring(0,8);
  231. var logindt = getUserInfo("logindt").substring(0,8);
  232. var difmon;
  233. if(lastpwdchgdt == ""){
  234. //fOpenPwdNotice();
  235. fOpenPwdNotice2();
  236. }
  237. }
  238. //사용자별 바로가기 메뉴 호출
  239. window.htmlwindow.getShortcutMenuItem();
  240. */
  241. //메뉴그룹 저장 및 기본화면 호출
  242. fSetMenuGroupInfo();
  243. // PC의 세션타임아웃 값 설정
  244. // XP에서는 세션타임아웃 체크 중복 되므로 주석처리 (by 김지훈)
  245. //fSetSessionTimeout();
  246. /* 주석처리 (XP)
  247. // 사용자 설정에 따라서 메시지 팝업창을 띄워준다.
  248. var popupyn = fGetUserConfig("msgpopupflag");
  249. if (popupyn != "") {
  250. fOpenMsgPopup();
  251. }
  252. */
  253. // 전자인증서 유효여부 체크(갱신)
  254. if (getSystemCd().substring(3, 6).toLowerCase() == "his" && (new Boolean(htmlwindow.DEVSystem) != true)) {
  255. fCheckSign();
  256. }
  257. /*
  258. // 비밀번호 주기적 변경토록 강제. 손병은.
  259. if(submit("TRZUM20001")){
  260. var lastpwdchgdt = model.getValue("/root/hidden/lastpwdchgdt/lastpwdchgdt").substring(0,8);
  261. var logindt = getUserInfo("logindt").substring(0,8);
  262. var difmon;
  263. if(lastpwdchgdt == ""){
  264. modal("SPZUM20000", "", null, null, null, "/root/hidden/lastpwdchgdt", "/root/hidden/lastpwdchgdt", "sysmenu:hidden;width:500px;height:310px");
  265. }else{
  266. difmon = getDifMonths(lastpwdchgdt, logindt);
  267. if(difmon >=6 )
  268. modal("SPZUM20000", "", null, null, null, "/root/hidden/lastpwdchgdt", "/root/hidden/lastpwdchgdt", "width:500px;height:310px");
  269. }
  270. }
  271. */
  272. /* XP 주석처리(TF 팝업 공지사항 제거 by 김지훈)
  273. // 조국 임시 공지사항 띄우기
  274. var jobkindcd = getUserInfo("jobkindcd");
  275. var userInstcd = getUserInfo("dutplceinstcd");
  276. if((getSystemCd().substring(0,3).toLowerCase() == "his") && (jobkindcd=="0330" || jobkindcd=="1140")) {
  277. fOpenNoticePopup();
  278. }
  279. if((getSystemCd().substring(0,3).toLowerCase() == "mis")) {
  280. fOpenNoticePopup();
  281. }
  282. */
  283. /*
  284. if(userInstcd== "032") {
  285. caption1.attribute("background-color") = "#fdc87e";
  286. } else {
  287. caption1.attribute("class") = "message";
  288. }
  289. */
  290. // IRM메시지 있는지 체크(나중에 구현. 손병은)
  291. //checkIrm();
  292. // 화면 마우스 클릭 집계 여부 구하기 위한 조회(by 김지훈)
  293. // if(getSystemCd().substring(0,3).toLowerCase() == "his"){ // mis는 미적용
  294. // model.setValue("/root/send/search/userid", getUserId());
  295. //
  296. // htmlwindow.setTimeout(function(){
  297. // if(submit("TRZHM00402")){
  298. //
  299. // var chkCount = getNodesetCount("/root/main/clickmemberinfo/clickmemberlist");
  300. // if( chkCount > 0 ){
  301. // gMouseCountFlag = true;
  302. // }
  303. // }
  304. // }, 1000);
  305. // }
  306. }
  307. // start, end format: yyyymmdd
  308. function getDifDays(start, end)
  309. {
  310. var dateStart = new Date(start.substring(0, 4), start.substring(4, 6) - 1, start.substring(6, 8));
  311. var dateEnd = new Date(end.substring(0, 4), end.substring(4, 6) - 1, end.substring(6, 8));
  312. var difDays = (dateEnd.getTime() - dateStart.getTime()) / (24 * 60 * 60 * 1000);
  313. // because view this function
  314. //window.alert("- run getDifDays()\n- " + start + " ~ " + end + " => " + Math.ceil(difDays));
  315. return Math.ceil(difDays);
  316. }
  317. // start, end format: yyyymmdd
  318. function getDifMonths(start, end)
  319. {
  320. var startYear = start.substring(0, 4);
  321. var endYear = end.substring(0, 4);
  322. var startMonth = start.substring(4, 6) - 1;
  323. var endMonth = end.substring(4, 6) - 1;
  324. var startDay = start.substring(6, 8);
  325. var endDay = end.substring(6, 8);
  326. // 연도 차이가 나는 경우
  327. if (eval(startYear) < eval(endYear)) {
  328. // 종료일 월이 시작일 월보다 수치로 빠른 경우
  329. if (eval(startMonth) > eval(endMonth)) {
  330. var newEnd = startYear + "1231";
  331. var newStart = endYear + "0101";
  332. return (eval(getDifMonths(start, newEnd)) + eval(getDifMonths(newStart, end))).toFixed(2);
  333. // 종료일 월이 시작일 월보다 수치로 같거나 늦은 경우
  334. } else {
  335. var formMonth = eval(startMonth) + 1;
  336. if (eval(formMonth) < 10) formMonth = "0" + formMonth;
  337. var newStart = endYear + "" + formMonth + "" + startDay;
  338. var addMonths = (eval(endYear) - eval(startYear)) * 12;
  339. return (eval(addMonths) + eval(getDifMonths(newStart, end))).toFixed(2);
  340. }
  341. } else {
  342. // 월별 일수차 (30일 기준 차이 일수)
  343. var difDaysOnMonth = new Array(1, -2, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1);
  344. var difDaysTotal = getDifDays(start, end);
  345. for (i = startMonth; i < endMonth; i++) {
  346. if (i == 1 && isLeapYear(startYear)) difDaysTotal -= (difDaysOnMonth[i] + 1);
  347. else difDaysTotal -= difDaysOnMonth[i];
  348. }
  349. // because view this function
  350. //window.alert("- run getDifMonths()\n- " + start + " ~ " + end + " => " + (difDaysTotal / 30).toFixed(2));
  351. return (difDaysTotal / 30).toFixed(2);
  352. }
  353. }
  354. /**
  355. * @group :
  356. * @ver : 2009.06.29
  357. * @by : 차현철
  358. * @---------------------------------------------------
  359. * @type : function
  360. * @access : public
  361. * @desc : 개인별환경설정 및 처방환경설정에 세팅된 정보를 가져온다
  362. * @return :
  363. * @---------------------------------------------------
  364. */
  365. function fInitializsOrderBasicInfo () {
  366. if (HISSystem == "true") {
  367. model.setValue("/root/send/prcpdd", getCurrentDate());
  368. model.setValue("/root/send/instcd", getUserInfo("dutplceinstcd"));
  369. // 처방기본정보 조회
  370. setErrorOff();
  371. submit("TRZUM00302");
  372. }
  373. }
  374. function fInitializeOnLoading() {
  375. //전체 공통 세션용 변수 reset
  376. model.resetProperty();
  377. //fDelGlobalVariable();
  378. //팝업 메뉴를 보이게 할지 여부 (true: 보인다. false: 숨긴다)
  379. // 반드시 Boolean type 을 사용한다. - 김기호 2008.02.19
  380. app.showPopupMenu(new Boolean(htmlwindow.DEVSystem));
  381. //로그 파일을 삭제한다. (해당 폴더까지 삭제함)
  382. //app.deleteLog();
  383. //메인화면 상태 저장
  384. setGlobalVariable("mainclose", "N");
  385. //스크립트 버전정보 저장
  386. model.makeValue("/root/properties/jsversion",ScriptEngineMajorVersion()+"."+ScriptEngineMinorVersion()+"."+ScriptEngineBuildVersion());
  387. //사용중인 뷰어의 버전
  388. model.makeValue("/root/properties/tfviewerversion",app.appVersion );
  389. // 서버시간과 차이값을 저장해 놓는다.
  390. if (htmlwindow == null) {
  391. setGlobalVariable("timediff", "0");
  392. } else {
  393. setGlobalVariable("timediff", htmlwindow.diffTime);
  394. }
  395. // 세션 타임아웃 값을 저장해 놓는다.
  396. // XP에서는 세션타임아웃 체크 중복 되므로 주석처리 (by 김지훈)
  397. // if (htmlwindow != null) {
  398. // setGlobalVariable("session_timeout", htmlwindow.sessionTimeout);
  399. // setGlobalVariable("last_submit", (new Date()).getTime());
  400. // }
  401. //사용자 정보 저장
  402. fSetUserInfo();
  403. fSetStatusUserInfo();
  404. // initTitle();
  405. fSetMonitorInfo();
  406. fSetUrls();
  407. /* 특정 클라이언트에서 과도한 Ping 메시지 발생으로 인하여 아래의 로직은 finitialize 에서 한번만 수행함
  408. if (htmlwindow != null) {
  409. msgsvrIPKeyStr = new String(htmlwindow.msgsvrIP); // msg server connect IP
  410. msgsvrPortKeyStr = new String(htmlwindow.msgsvrPort); // msg server connect Port
  411. msgsvrRetryKeyStr = new String(htmlwindow.msgsvrRetyr) + "000"; // msg server retry time
  412. var retrymillis = parseInt(msgsvrRetryKeyStr);
  413. if (isNaN(retrymillis)) {
  414. retrymillis = 60000;
  415. }
  416. // msg server 접속 사용 여부 처리
  417. var msgsvrConnectKeyStr = new String(htmlwindow.msgsvrConnect);
  418. if (msgsvrConnectKeyStr == "true") {
  419. fConnectMsgsvr(); // msg server 접속시도
  420. gPingTimerID = window.setInterval("fMsgsvrPing()",retrymillis); // 타이머 기동
  421. }
  422. }
  423. */
  424. if (htmlwindow != null) {
  425. screenLocSave = new String(htmlwindow.screenLocSave);
  426. HISSystem = new String(htmlwindow.HISSystem);
  427. basicCodeList = new String(htmlwindow.basicCode);
  428. } else {
  429. screenLocSave = "false";
  430. HISSystem = "true";
  431. basicCodeList = "";
  432. }
  433. }
  434. function fMenuReady() {
  435. // menu가 로딩되지 않아 이중 submit 관련 처리를 해야 하는 경우
  436. //fInitializeOnLoading();
  437. if (htmlwindow.menuLoaded) {
  438. if (gMenuTimerID != "") { // 타이머 클리어
  439. window.clearInterval(gMenuTimerID);
  440. gMenuTimerID = "";
  441. }
  442. fInitialize();
  443. }
  444. }
  445. //메뉴그룹에 해당하는 정보믈 설정한다.
  446. function fSetMenuGroupInfo(){
  447. if (htmlwindow != null ) {
  448. var menuGrpInfo = new String(htmlwindow.menuGroupInfo);
  449. var menuGrpInfoArr = menuGrpInfo.split("^");
  450. //메뉴그룹 저장
  451. setGlobalVariable("menugroupcd", menuGrpInfoArr[0]);
  452. //사용부서 저장
  453. setGlobalVariable("prestdeptcd", menuGrpInfoArr[2]);
  454. // //기본화면
  455. // if( menuGrpInfoArr[1] != "" ){
  456. // fOpenMenuItem(menuGrpInfoArr[1]);
  457. // }else{
  458. // fOpenMenuItem("SMZUM00200|M|||");
  459. // }
  460. }
  461. }
  462. //메뉴에서 선택한 화면을 연다.
  463. function fOpenMenuItem(idx){
  464. var main = getViewer("bizMain");
  465. if(! isNull(idx)){
  466. var itemID = idx.split("|");
  467. var xrw = "../../../com/hismainweb/xrw/"+itemID[0]+".xrw";//xrw url
  468. var isMain = itemID[1];// M or P (or D 추가)
  469. //화면권한 생성
  470. setGlobalVariable("scrnauth", itemID[2]);
  471. //메뉴아이템 저장
  472. setGlobalVariable("menuitemcd", itemID[3]);
  473. //메뉴파라미터 저장
  474. setGlobalVariable("menuparam", itemID[4]);
  475. // 화면접근권한이 없는 경우 : scrnauth = 00000000 / r:0 x:0 p:0
  476. if (itemID[2] == "00000000") {
  477. var denyXrw = "../../../com/commonweb/xrw/SPZZZ00500_권한제한안내.xrw";
  478. //openUrl(xrw);
  479. modal("SPZZZ00500", null, null, null,"SPZZZ00500", null, null, "width:588;height:354");
  480. return;
  481. }
  482. // 보안 로깅 기능 추가. 손병은 130911
  483. model.setValue("/root/send/securitydata/menugrupcd",new String(htmlwindow.menuGroupInfo).split("^")[0].split("|")[0]);
  484. model.setValue("/root/send/securitydata/menuitemcd",itemID[3]);
  485. model.setValue("/root/send/securitydata/scrncd",itemID[0]);
  486. submit("TXZUM00305",false);
  487. //업무화면 호출
  488. if( isMain == "P" || isMain == "F"){//Modeless로 띄울 경우
  489. // 메뉴에서 설정한 권한 값을 가져온다.
  490. setScreenAuth();
  491. // 메뉴에서 설정한 사용부서 값을 가져온다.
  492. setScreenPrestDeptCd();
  493. // 메뉴Parameter정보를 설정한다.
  494. setScreenMenuParameter();
  495. //openUrl(xrw, "", "", "", itemID[3]+"_"+itemID[0]);//화면명이 id인 popup창을 띄운다.
  496. //openUrl(xrw);
  497. //메뉴에서 클릭한 경우에도 이전에 뜬 좌표 정보를 조회해서 화면을 띄워준다.
  498. //2010-03-10 오지훈
  499. var xyPos = getScreenLocation(itemID[0]);
  500. if(xyPos != ""){
  501. loc = xyPos.split("|");
  502. open(itemID[0], loc[0], loc[1], loc[2]);
  503. }else{
  504. open(itemID[0]);
  505. }
  506. //바로가기로 오픈 하는 창에 포커스를 준다.
  507. screenKey = fGetWindowKey(itemID[0]);
  508. if(screenKey != null){
  509. model.setValue("/root/properties/actscreen", screenKey);
  510. fActivateOpenWindowTimer();
  511. }
  512. }else{
  513. if (main.window.javascript.closeChildWindow != undefined) {
  514. main.window.javascript.closeChildWindow();
  515. }
  516. main.window.load(xrw);
  517. main.activate();
  518. }
  519. }
  520. }
  521. // 에러가 발생해도 에러 메시지를 보이면 안된다. 에러나면 무조건 return 처리
  522. function fCheckSign() {
  523. body.createChild("xforms:object", "id:KMClientAX; clsid:{d3c608b5-b664-4962-91b7-289da892953a}; visibility:hidden; left:0px; top:0px; width:0px; height:0px; ");
  524. var kmiip = getUserInfo("kmiip");
  525. var kmiport = getUserInfo("kmiport");
  526. var userid = getUserId();
  527. var dn = "";
  528. try {
  529. if (!KMClientAX.kmsConnect(kmiip, kmiport)) {
  530. // KMI 연결실패
  531. model.addLog("KMClientAC.kmsConnect() Fail [" + userid + "] time [" + getCurrentDateTime() + "]");
  532. return;
  533. }
  534. if (KMClientAX.kmsInit() == "") {
  535. // KMI 모듈초기화 실패
  536. KMClientAX.kmsDisconnect();
  537. model.addLog("KMClientAC.kmsInit() Fail [" + userid + "] time [" + getCurrentDateTime() + "]");
  538. return;
  539. }
  540. if ((dn = KMClientAX.GetKeyAndCert(userid)) == "") {
  541. // 인증서 획득시 오류
  542. KMClientAX.kmsDisconnect();
  543. model.addLog("KMClientAC.GetKeyAndCert() Fail [" + userid + "] time [" + getCurrentDateTime() + "]");
  544. return;
  545. }
  546. switch (KMClientAX.IsCertNew(userid, dn)) {
  547. case 2 : // 인증서 갱신실패
  548. messageBox("전자 서명을 위한 인증서 갱신에", "E009", getKMIErrMsg());
  549. break;
  550. case 3 : // 인증서 만료
  551. messageBox("전자 서명을 위한 인증서가 만료되어 사용", "E001", "인증서를 재발급 받으시기 바랍니다.");
  552. break;
  553. default :
  554. model.addLog("KMClientAX.IsCertNew() execute [" + userid + "] time [" + getCurrentDateTime() + "]");
  555. }
  556. KMClientAX.LocalDelKeyAndCert(userid, "");
  557. KMClientAX.kmsDisconnect();
  558. } catch (e) {
  559. // 예외 발생시에도 return;
  560. model.addLog("fCheckSign() Fail [" + userid + "] time [" + getCurrentDateTime() + "]");
  561. return;
  562. }
  563. }
  564. /*
  565. //전체 공통 팝업 메뉴
  566. //원본소스 보기
  567. function fViewSource(){
  568. window.viewSource();
  569. }
  570. //인스턴스 보기
  571. function fViewInstance(){
  572. window.viewInstance();
  573. }
  574. //로그보기
  575. function fViewLog(){
  576. window.viewLog();
  577. }
  578. //화면출력
  579. function fScreenPrint(){
  580. window.print();
  581. }
  582. //버전정보
  583. function fViewerAbout(){
  584. window.about();
  585. }
  586. */
  587. //경북대 - 손병은 추가
  588. //임시 공지사항 팝업 함수화. 2011-04-06
  589. function fOpenPopup(popupUrl, popupWid, w, h){
  590. var leftPosition = (htmlwindow.screen.availWidth) ? (htmlwindow.screen.availWidth-w)/2 : 0;
  591. var topPosition = (htmlwindow.screen.availHeight) ? (htmlwindow.screen.availHeight-h)/2 : 0;
  592. var prop = 'height='+h+',width='+w+',top='+topPosition+',left='+leftPosition;
  593. openHtml(getDomain() + popupUrl, popupWid, prop);
  594. }
  595. // 손병은 추가
  596. // 비밀번호 변경 공지사항 팝업
  597. function fOpenPwdNotice(){
  598. var userInstcd = getUserInfo("dutplceinstcd");
  599. var popupWid = "pwdpopup";
  600. var h = 300;
  601. var w = 400;
  602. var leftPosition = (htmlwindow.screen.availWidth) ? (htmlwindow.screen.availWidth-w)/2 : 0;
  603. var topPosition = (htmlwindow.screen.availHeight) ? (htmlwindow.screen.availHeight-h)/2 : 0;
  604. var prop = 'height='+h+',width='+w+',top='+topPosition+',left='+leftPosition;
  605. var popupUrl = "/himed/webapps/com/hismainweb/html/passwd.html";
  606. openHtml(getDomain() + popupUrl, popupWid, prop);
  607. }
  608. // 손병은 추가
  609. // 비밀번호 변경 공지사항 팝업2
  610. function fOpenPwdNotice2(){
  611. modal("SPZUM20000");
  612. }
  613. // //경북대 - 조국 추가
  614. // //공지사항 팝업메뉴 이동 : hismainweb => noticeinfoweb (2013/09/13_손성훈)
  615. // //임시 공지사항 팝업 호출
  616. // function fOpenNoticePopup() {
  617. //
  618. // var userInstcd = getUserInfo("dutplceinstcd");
  619. // var jobkindcd = getUserInfo("jobkindcd");
  620. //
  621. // if((getSystemCd().substring(0,3).toLowerCase() == "his") && (userInstcd == "031")) {
  622. // /* 본원. 의사& 간호사 공통 공지 ----------------------------------------------------- */
  623. // var popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice.html";
  624. // var popupWid = "noticepopup";
  625. //
  626. // var w = 550;
  627. // var h = 450;
  628. // /*------------------------------------------------------------------------------------- */
  629. //
  630. // // /* 본원. 의사& 간호사 개별 공지 -----------------------------------------------------
  631. // // var jobkindcd = getUserInfo("jobkindcd");
  632. // // var userInstcd = getUserInfo("dutplceinstcd");
  633. //
  634. // // var popupUrl;
  635. // // var w;
  636. // // var h;
  637. // // if(jobkindcd=="0330"){
  638. // // popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice.html";
  639. // // w = 550;
  640. // // h = 300;
  641. // // }else if(jobkindcd=="1140") {
  642. // // popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice_nurse.html";
  643. // // w = 500;
  644. // // h = 400;
  645. // // }
  646. //
  647. // var popupWid = "noticepopup";
  648. // //------------------------------------------------------------------------------------- */
  649. //
  650. // } else if((getSystemCd().substring(0,3).toLowerCase() == "his") && (userInstcd == "032")) {
  651. // var jobkindcd = getUserInfo("jobkindcd");
  652. // var userInstcd = getUserInfo("dutplceinstcd");
  653. //
  654. // var popupUrl;
  655. // var w;
  656. // var h;
  657. // if(jobkindcd=="0330"){
  658. // popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice032.html";
  659. // w = 550;
  660. // h = 450;
  661. // }else if(jobkindcd=="1140") {
  662. // popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice032_nurse.html";
  663. // w = 500;
  664. // h = 450;
  665. // }
  666. //
  667. // var popupWid = "noticepopup";
  668. //
  669. // } else if((getSystemCd().substring(0,3).toLowerCase() == "mis") && (userInstcd == "032")) {
  670. // var popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice_mis032.html";
  671. // var popupWid = "noticepopup";
  672. // var w = 550;
  673. // var h = 450;
  674. // }else if((getSystemCd().substring(0,3).toLowerCase() == "mis") && (userInstcd == "031")) {
  675. // var popupUrl = "/himed/webapps/com/hismainweb/html/tempnotice_mis031.html";
  676. // var popupWid = "noticepopup";
  677. // var w = 550;
  678. // var h = 450;
  679. // }
  680. //
  681. // var leftPosition = (htmlwindow.screen.availWidth) ? (htmlwindow.screen.availWidth-w)/2 : 0;
  682. // var topPosition = (htmlwindow.screen.availHeight) ? (htmlwindow.screen.availHeight-h)/2 : 0;
  683. // var prop = 'height='+h+',width='+w+',top='+topPosition+',left='+leftPosition;
  684. //
  685. // // 공지사항 올림 내림 설정.
  686. // if((getSystemCd().substring(0,3).toLowerCase() == "mis") && ((userInstcd == "031") || (userInstcd == "032"))) {
  687. // if(userInstcd == "031" || userInstcd == "032"){
  688. // //openHtml(getDomain() + popupUrl, popupWid, prop);
  689. // }
  690. //
  691. //
  692. // }else if((getSystemCd().substring(0,3).toLowerCase() == "his") && ((userInstcd == "031") || (userInstcd == "032"))){
  693. // if( userInstcd == "031" || userInstcd == "032"){
  694. // //openHtml(getDomain() + popupUrl, popupWid, prop);
  695. // }
  696. // }
  697. // /* */
  698. // }
  699. //
  700. // 개인별 화면 좌표 관리 기능 구현을 위한 스크립트
  701. //
  702. var gvScreenRootPath="/root/properties/screenloc";
  703. var gvScreenLocPath = "/root/properties/screenloc/scn";
  704. var gvScreenClonePath="/root/properties/clonenode/scn";
  705. var gvScreenIDNode = "sid";
  706. var gvScreenLeftPosNode = "leftpos";
  707. var gvScreenTopPosNode = "toppos";
  708. var gvScreenMonitorNoNode = "mon";
  709. var gvScreenStatusNode ="status";
  710. // 모니터 정보를 저장해 놓기 위한 변수
  711. var gvMons = 1;
  712. var gvStartXY = null;
  713. var gvWidthHeight = null;
  714. var gvMonInit = null;
  715. // 열린화면 윈도우 객체 저장을 위한 Dictionary 객체
  716. var gvDic = new ActiveXObject("Scripting.Dictionary");
  717. // 개인별 AWT 사용여부 변수
  718. var gvUserAwtYN ;
  719. var gvUserAwtGrpCd;
  720. var gvUserAwtStnsYN ;
  721. // 개인별 AWT 세팅
  722. function fSetUserAwtYN(flag){
  723. gvUserAwtYN = flag;
  724. if(getUserInfo("dutplceinstcd")== "031"){
  725. if(gvUserAwtYN == "Y"){
  726. imgawt.src = "../../../com/hismainweb/images/awt_on_031.gif";
  727. }else{
  728. imgawt.src = "../../../com/hismainweb/images/awt_off_031.gif";
  729. }
  730. }else if(getUserInfo("dutplceinstcd")== "032"){
  731. if(gvUserAwtYN == "Y"){
  732. imgawt.src = "../../../com/hismainweb/images/awt_on_032.gif";
  733. }else{
  734. imgawt.src = "../../../com/hismainweb/images/awt_off_032.gif";
  735. }
  736. }
  737. model.setValue("/root/send/awtyn", flag);
  738. submit("TXZUM00303",false);
  739. }
  740. // 개인별 AWT 사용여부 가져옴.
  741. function fGetUserAwtYN(){
  742. return gvUserAwtYN ;
  743. }
  744. // 개인별 AWT 그룹코드 세팅 2013.08.23 손병은
  745. function fSetUserAwtGrpCd(grpcd){
  746. gvUserAwtGrpCd = grpcd;
  747. model.setValue("/root/send/awtgrpcd",grpcd);
  748. submit("TXZUM00304",false);
  749. }
  750. // 개인별 AWT 그룹코드 가져옴 2013.08.23 손병은
  751. function fGetUserAwtGrpCd(){
  752. return gvUserAwtGrpCd;
  753. }
  754. // 개인별 AWT 구문 세팅
  755. function fSetUserAwtStnsYN(flag){
  756. gvUserAwtStnsYN = flag;
  757. if(getUserInfo("dutplceinstcd")== "031"){
  758. if(gvUserAwtStnsYN == "Y"){
  759. imgawtstns.src = "../../../com/hismainweb/images/awtstns_on_031.gif";
  760. }else{
  761. imgawtstns.src = "../../../com/hismainweb/images/awtstns_off_031.gif";
  762. }
  763. }else if(getUserInfo("dutplceinstcd")== "032"){
  764. if(gvUserAwtStnsYN == "Y"){
  765. imgawtstns.src = "../../../com/hismainweb/images/awtstns_on_032.gif";
  766. }else{
  767. imgawtstns.src = "../../../com/hismainweb/images/awtstns_off_032.gif";
  768. }
  769. }
  770. model.setValue("/root/send/awtstnsyn", flag);
  771. submit("TXZUM00306",false);
  772. }
  773. // 개인별 AWT 구문 세팅 가져옴 2013.12.26 손병은
  774. function fGetUserAwtStnsYN(){
  775. return gvUserAwtStnsYN;
  776. }
  777. function fGetUpdatedScreenLocations() {
  778. var nodes = instance1.selectnodes(gvScreenLocPath+"[status=&quot;I&quot;]");
  779. var sendNode = instance1.selectsinglenode("/root/send/screenloc");
  780. var node = null;
  781. for(var i=0;i<nodes.length;i++) {
  782. node = nodes.item(i).clonenode(true);
  783. sendNode.appendchild(node);
  784. }
  785. model.refresh();
  786. }
  787. /**********************************************************/
  788. /* common.js 에서 호출하는 메소드들이므로 수정하지 않는다. */
  789. /**********************************************************/
  790. function fSetStatusUserInfo() {
  791. deptNm.value = getUserInfo("dutplcenm");
  792. userNm.value = getUserName();
  793. loginDt.value = getTitleLoginDate();
  794. wsNm.value = htmlwindow.wasname;
  795. if(getUserInfo("systemcd") == "HIS031" || getUserInfo("systemcd") == "HIS032" ){
  796. imgawtstns.visible = true;
  797. imgawt.visible = true;
  798. fSetUserAwtYN(getUserInfo("awtyn"));
  799. fSetUserAwtStnsYN(getUserInfo("awtstnsyn"));
  800. }
  801. gvUserAwtGrpCd = getUserInfo("awtgrpcd");
  802. model.refresh();
  803. }
  804. function fSetStatusMessage(msg) {
  805. model.setValue("/root/main/msg",msg);
  806. htmlwindow.xxf_xpSetStatusMessage(msg);
  807. model.refresh();
  808. }
  809. // Dictionary에 열린화면 윈도우 객체를 저장한다
  810. function fAddOpenWindow(key, winObj) {
  811. gvDic.item(key) = winObj;
  812. }
  813. // Dictionary에서 주어진 key에 해당되는 윈도우 객체를 제거한다.
  814. function fRemoveOpenWindow(key) {
  815. if (gvDic.exists(key)) {
  816. gvDic.remove(key);
  817. }
  818. }
  819. // 현재 Dictionary 객체에 열린화면으로 등록되어 있는 목록을 배열로 반환한다.
  820. function fGetOpenWindowList() {
  821. var keys = (new VBArray(gvDic.keys())).toArray();
  822. htmlwindow.xxf_xpSetOpendWindows(keys); // XP에도 전달(추가 by 김지훈)
  823. return keys;
  824. }
  825. // 열린화면에서 선택한 화면을 activate() 하면 다시 뒤로 숨어버리는 문제가 있어
  826. // 이를 타이머를 사용하여 일정 시간 후에 activate() 되도록 변경함
  827. function fActivateOpenWindowTimer() {
  828. if (gActivateWindowTimerID != "") { // 타이머 클리어
  829. window.clearInterval(gActivateWindowTimerID);
  830. gActivateWindowTimerID = "";
  831. }
  832. var actScnId = model.getValue("/root/properties/actscreen");
  833. if (actScnId != null && actScnId !="") {
  834. if (actScnId == "main") { // main window activate
  835. htmlwindow.setFocus();
  836. } else {
  837. fActivateOpenWindow(actScnId);
  838. }
  839. }
  840. }
  841. // 주어진 key에 해당되는 윈도우 객체를 활성화한다.
  842. function fActivateOpenWindow(key) {
  843. if (gvDic.exists(key)) {
  844. var winObj = gvDic.item(key);
  845. if(winObj != null) {
  846. winObj.restore();
  847. winObj.activate();
  848. }
  849. }
  850. }
  851. // 열려있는 화면들 중에서 화면 ID를 사용하여 윈도우 객체를 찾아서 반환한다.
  852. function fGetOpenWindow(sid) {
  853. var wlist = fGetOpenWindowList();
  854. var wkey = null;
  855. wkey = fGetWindowKey(sid)
  856. if (wkey != null) {
  857. if (gvDic.exists(wkey)) {
  858. return gvDic.item(wkey);
  859. }
  860. }
  861. return null;
  862. }
  863. // 열려있는 팝업 화면들을 모두 닫는다.
  864. function fCloseAllWindow(key) {
  865. var wlist = null;
  866. var key = null;
  867. wlist = fGetOpenWindowList();
  868. var i = 0;
  869. // for(i=0;i<wlist.length;i++) {
  870. for(i=wlist.length-1; i>=0 ;i--) {
  871. //while (wlist.length > 0) {
  872. key = wlist[i];
  873. //alert(key+","+wlist.length);
  874. if (gvDic.exists(key)) {
  875. var winObj = gvDic.item(key);
  876. if(winObj != null && winObj.children.length == 0 && winObj.type != "main") {
  877. winObj.close();
  878. }
  879. }
  880. wlist = fGetOpenWindowList(); // 갱신된 윈도우 목록을 다시 가져온다.
  881. }
  882. }
  883. function fOpenScreenList(popupX, popupY) {
  884. //var popupX = event.ScreenX-224;
  885. //var popupY = event.ScreenY;
  886. model.resetInstanceNode("/root/properties/actscreen");
  887. window.load("SPZUM01200_열린화면.xrw", "modal", "SMZUM01200", "top:"+popupY+"px; left:"+popupX+"px; width:224px; height:301px; caption:hidden; ");
  888. var actScnId = model.getValue("/root/properties/actscreen");
  889. if (actScnId != null && actScnId !="") {
  890. gActivateWindowTimerID = window.setInterval("fActivateOpenWindowTimer()",100); // 타이머 기동으로 해결됨
  891. }
  892. /*
  893. var actScnId = model.getValue("/root/properties/actscreen");
  894. if (actScnId != null && actScnId !="") {
  895. if (actScnId == "main") { // main window activate
  896. htmlwindow.setFocus();
  897. } else {
  898. fActivateOpenWindow(actScnId);
  899. }
  900. } */
  901. }
  902. // UID로 주어진 화면보다 나중에 생성된 화면들 중에서 바로 다음에 생성된 Modal 화면의 정보를 반환한다.
  903. // 반환되는 모달 화면 정보는 "화면ID|UID|modal|화면명" 형태의 문자열이다.
  904. // 해당 Modal 화면이 없으면 "" 을 반환한다.
  905. function fGetLastModal(uid) {
  906. var wlist = fGetOpenWindowList();
  907. var modal_name = "";
  908. var split_temp = null;
  909. var uid_pattern = "|"+uid+"|";
  910. for(var i=wlist.length-1;i>=0;i--) {
  911. // find modal
  912. if ( wlist[i].indexOf(uid_pattern) >= 0) break;
  913. // modal 여부 확인
  914. split_temp = wlist[i].split("|");
  915. if (split_temp.length > 3 && split_temp[2] == "modal") {
  916. modal_name = wlist[i];
  917. }
  918. }
  919. return modal_name;
  920. }
  921. function fDecode64(inp) {
  922. inp = new String(inp);
  923. var ttb = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  924. var ret = new Array(inp.length*3/4);
  925. var c1, c2, c3;
  926. var e1, e2, e3, e4;
  927. var i = 0;
  928. var j = 0;
  929. do {
  930. e1 = ttb.indexOf(inp.charAt(i++));
  931. e2 = ttb.indexOf(inp.charAt(i++));
  932. e3 = ttb.indexOf(inp.charAt(i++));
  933. e4 = ttb.indexOf(inp.charAt(i++));
  934. c1 = (e1<<2)|(e2>>4);
  935. c2 = ((e2&15)<<4)|(e3>>2);
  936. c3 = ((e3&3)<<6)|e4;
  937. ret[j++] = c1;
  938. if (e3 != 64) {
  939. ret[j++] = c2;
  940. }
  941. if (e4 != 64) {
  942. ret[j++] = c3;
  943. }
  944. } while (i < inp.length);
  945. return ret;
  946. }
  947. function fDecodeUTF8(barr) {
  948. var str="";
  949. for(i=0; i<barr.length; i++) {
  950. if((barr[i] & 240) == 224) {
  951. c = ((barr[i]&15)<<12) | ((barr[i+1]&63)<<6) | (barr[i+2]&63) ;
  952. str += String.fromCharCode(c);
  953. i +=2;
  954. } else {
  955. str += String.fromCharCode(barr[i]);
  956. }
  957. }
  958. return str;
  959. }
  960. function fReadCookie(name) {
  961. var nameEQ = name + "=";
  962. var ca = htmldocument.cookie.split(';');
  963. for(var i=0;i < ca.length;i++) {
  964. var c = ca[i];
  965. while (c.charAt(0)==' ') c = c.substring(1,c.length);
  966. if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  967. }
  968. return null;
  969. }
  970. function fSetUserInfo() {
  971. var userInfoStr = fDecodeUTF8(fDecode64(fReadCookie(htmlwindow.sessionCookie)));
  972. var userInfoArr = userInfoStr.split("|");
  973. var userInfoKeyStr = new String(htmlwindow.sessionFormat);
  974. var userInfoKeyArr = userInfoKeyStr.split("|");
  975. var len = userInfoArr.length;
  976. for(i=0;i<len;i++) {
  977. setGlobalVariable(userInfoKeyArr[i], userInfoArr[i]);
  978. }
  979. setGlobalVariable("userinfos", userInfoStr);
  980. setGlobalVariable("domain", htmlwindow.domainName);
  981. setGlobalVariable("domainSSL", htmlwindow.domainNameSSL);
  982. setGlobalVariable("macaddr", fGetMacAddress());
  983. // 서버시간 차이 구하기
  984. var logintime = getGlobalVariable("logindt"); // yyyymmddhhmmssSSS
  985. }
  986. // 타시스템 연결 URL 정보를 프로퍼티에 담아놓는다.
  987. function fSetUrls() {
  988. var urls = new String(htmlwindow.systemUrls);
  989. var urlSplit = urls.split("|");
  990. var len = urlSplit.length;
  991. var i = 0;
  992. var sysCode = null;
  993. var sysName = null;
  994. var sysUrl = null;
  995. while(i<len-1) {
  996. sysCode = urlSplit[i++];
  997. sysName = urlSplit[i++];
  998. sysUrl = urlSplit[i++];
  999. //alert(sysCode+","+sysName+","+sysUrl);
  1000. setGlobalVariable("sysname"+sysCode, sysName);
  1001. setGlobalVariable("sysurl"+sysCode, "http://"+sysUrl);
  1002. }
  1003. }
  1004. // 화면 좌표 정보 데이터를 모두 삭제한다.(DB도 함께)
  1005. function fClearAllScreenLocation() {
  1006. submit("TXZUM00302");
  1007. }
  1008. // sid와 절대좌표를 넘기면 sid를 key로 화면의 모니터번호와 상대좌표정보를 인스턴스에 저장한다.
  1009. function fSetScreenLocation(sid, leftpos, toppos) {
  1010. var coord = fGetRelativeCoordinate(leftpos,toppos);
  1011. var mon = coord[0];
  1012. var offsetx = coord[1];
  1013. var offsety = coord[2];
  1014. var sidnode = instance1.selectsinglenode(gvScreenLocPath+"[sid=&quot;"+sid+"&quot;]");
  1015. if ( sidnode == null ) {
  1016. // screen location is not found, add a new screen location
  1017. model.setValue(gvScreenClonePath+"/"+gvScreenIDNode,sid);
  1018. model.setValue(gvScreenClonePath+"/"+gvScreenLeftPosNode,offsetx);
  1019. model.setValue(gvScreenClonePath+"/"+gvScreenTopPosNode,offsety);
  1020. model.setValue(gvScreenClonePath+"/"+gvScreenMonitorNoNode,mon);
  1021. model.setValue(gvScreenClonePath+"/"+gvScreenStatusNode,"I");
  1022. var scnnode = instance1.selectsinglenode(gvScreenClonePath).clonenode(true);
  1023. var parentnode = instance1.selectsinglenode(gvScreenRootPath);
  1024. parentnode.appendchild(scnnode);
  1025. } else {
  1026. // screen location is found
  1027. sidnode.selectsinglenode(gvScreenLeftPosNode).text=offsetx;
  1028. sidnode.selectsinglenode(gvScreenTopPosNode).text=offsety;
  1029. sidnode.selectsinglenode(gvScreenMonitorNoNode).text=mon;
  1030. sidnode.selectsinglenode(gvScreenStatusNode).text="I";
  1031. }
  1032. }
  1033. // sid를 key로 해당 화면의 절대좌표정보를 "x|y" 형태의 문자열로 반환한다. 좌표정보가 없으면 ""를 반환한다.
  1034. function fGetScreenLocation(sid) {
  1035. var sidnode = instance1.selectsinglenode(gvScreenLocPath+"[sid=&quot;"+sid+"&quot;]");
  1036. if ( sidnode == null ) {
  1037. return "";
  1038. } else {
  1039. var offsetx = parseInt(sidnode.selectsinglenode(gvScreenLeftPosNode).text);
  1040. var offsety = parseInt(sidnode.selectsinglenode(gvScreenTopPosNode).text);
  1041. var mon = parseInt(sidnode.selectsinglenode(gvScreenMonitorNoNode).text);
  1042. if (mon >= gvMons) {
  1043. mon = 0;
  1044. }
  1045. // 화면을 벗어나지 안도록 범위 체크한다.
  1046. if (offsetx >= 0 && offsetx < gvWidthHeight[mon][0]) {
  1047. offsetx = offsetx + gvStartXY[mon][0];
  1048. } else {
  1049. offsetx = gvStartXY[mon][0];
  1050. }
  1051. if (offsety >= 0 && offsety < gvWidthHeight[mon][1]) {
  1052. offsety = offsety + gvStartXY[mon][1];
  1053. } else {
  1054. offsety = gvStartXY[mon][1];
  1055. }
  1056. return offsetx+ "|" + offsety;
  1057. }
  1058. }
  1059. // 모니터 개수, 시작좌표, 화면 크기 정보를 담아놓는다.
  1060. function fSetMonitorInfo() {
  1061. if (gvMonInit != null) {
  1062. return;
  1063. }
  1064. gvMonInit = true;
  1065. var coord = app.monitorcoordinates;
  1066. var resol = app.monitorresolution;
  1067. gvMons = app.monitornumber;
  1068. model.makeValue("/root/properties/monitor/mons",gvMons);
  1069. model.makeValue("/root/properties/monitor/coord",coord);
  1070. model.makeValue("/root/properties/monitor/resol",resol);
  1071. gvStartXY = new Array(gvMons);
  1072. gvWidthHeight = new Array(gvMons);
  1073. var coord = coord.split("|");
  1074. var resol = resol.split("|");
  1075. // 판독실 모니터 3, 4개로 인한 오류사항. 디버깅 이전까지 오류를 없애기 위해 설정.
  1076. if (gvMons > 2) {
  1077. gvMons = 2;
  1078. }
  1079. // 모니터 시작 좌표와 끝좌표를 계산해 놓는다.
  1080. for(var i=0;i<gvMons;i++) {
  1081. gvStartXY[i] = coord[i].split(",");
  1082. gvWidthHeight[i] = resol[i].split(",");
  1083. gvStartXY[i][0] = parseInt(gvStartXY[i][0]);
  1084. gvStartXY[i][1] = parseInt(gvStartXY[i][1]);
  1085. gvWidthHeight[i][0] = parseInt(gvWidthHeight[i][0]);
  1086. gvWidthHeight[i][1] = parseInt(gvWidthHeight[i][1]);
  1087. }
  1088. }
  1089. // 모니터 개수를 리턴한다.
  1090. function fGetMonitorNumbers() {
  1091. return gvMons;
  1092. }
  1093. // 모니터의 시작 좌표를 리턴한다.
  1094. function fGetMonitorStartXY(monno) {
  1095. if (monno >= gvMons || monno < 0) {
  1096. monno = 0;
  1097. }
  1098. return gvStartXY[monno];
  1099. }
  1100. // 모니터의 크기를 리턴한다.
  1101. function fGetMonitorSize(monno) {
  1102. if (monno >= gvMons || monno < 0) {
  1103. monno = 0;
  1104. }
  1105. return gvWidthHeight[monno];
  1106. }
  1107. // 주어진 모니터번호와 상대좌표를 사용하여 절대 좌표를 계산하여 배열로 리턴한다.
  1108. function fGetAbsoluteCoordinate(monno,leftpos,toppos) {
  1109. if (gvMonInit == null) {
  1110. fSetMonitorInfo();
  1111. }
  1112. if (monno >= gvMons || monno < 0) {
  1113. monno = 0;
  1114. }
  1115. var absleftpos = gvStartXY[monno][0] + parseInt(leftpos);
  1116. var abstoppos = gvStartXY[monno][1] + parseInt(toppos);
  1117. var retpos = new Array(2);
  1118. retpos[0] = absleftpos;
  1119. retpos[1] = abstoppos;
  1120. return retpos;
  1121. }
  1122. // 주어진 화면 좌표를 모니터 번호와 모니터 기준의 상대좌표로 변환해서 리턴한다.
  1123. function fGetRelativeCoordinate(leftpos, toppos) {
  1124. if (gvMonInit == null) {
  1125. fSetMonitorInfo();
  1126. }
  1127. var targetmon = 0;
  1128. var targetx = 0;
  1129. var targety = 0;
  1130. var offsetx = 0;
  1131. var offsety = 0;
  1132. for(i=0;i<gvMons;i++) {
  1133. offsetx = leftpos-gvStartXY[i][0];
  1134. offsety = toppos-gvStartXY[i][1];
  1135. // 범위에 들어가는 모니터를 찾아서 모니터 번호와 상대좌표를 계산한다.
  1136. if ( offsetx >= 0 && offsetx < gvWidthHeight[i][0] && offsety >= 0 && offsety < gvWidthHeight[i][1]) {
  1137. targetmon = i;
  1138. targetx = offsetx;
  1139. targety = offsety;
  1140. break;
  1141. }
  1142. }
  1143. var relativeCoord = new Array(3);
  1144. relativeCoord[0] = targetmon;
  1145. relativeCoord[1] = targetx;
  1146. relativeCoord[2] = targety;
  1147. return relativeCoord;
  1148. }
  1149. // 로그아웃 처리 기능이다.
  1150. function fLogout(type) {
  1151. // 메시지 Ping 타이머 클리어
  1152. if (gPingTimerID != "") {
  1153. window.clearInterval(gPingTimerID);
  1154. }
  1155. // 소켓 닫기
  1156. if (isConnected) {
  1157. fSetStatusMessage("메시지 서버와의 연결을 종료합니다.");
  1158. socket.close();
  1159. isConnected = false;
  1160. }
  1161. // 열린 팝업화면들을 모두 닫는다.
  1162. fSetStatusMessage("열려있는 창을 모두 닫습니다.");
  1163. fCloseAllWindow();
  1164. // 화면 좌표 정보 저장
  1165. if (screenLocSave == "true") {
  1166. fSetStatusMessage("화면 좌표 정보를 서버에 저장합니다.");
  1167. fGetUpdatedScreenLocations();
  1168. setForceOn();
  1169. if (submit("TXZUM00301")) {
  1170. model.removeNodeset("/root/send/screenloc/scn");
  1171. }
  1172. }
  1173. //전체 공통 세션용 변수 reset
  1174. model.resetProperty();
  1175. //fDelGlobalVariable();
  1176. if (type == "session") {
  1177. htmlwindow.logout();
  1178. }
  1179. }
  1180. //세션변수 clear
  1181. // 2008-02-28 사용안함 : 김기호
  1182. // model.resetProperty() 사용
  1183. function fDelGlobalVariable(){
  1184. var propertyStr = model.propertyNames("*");
  1185. var propertyArr = propertyStr.split("*");
  1186. for(var i = 0; i < propertyArr.length; i++ ) {
  1187. if(propertyArr[i].split("_")[0] == getSystemCd()){
  1188. model.property(propertyArr[i]) = "";
  1189. }
  1190. }
  1191. }
  1192. // Macaddress 주소를 반환한다.
  1193. function fGetMacAddress() {
  1194. var maclist = app.macaddress;
  1195. // 여러개인 경우 ^ 로 구분되므로 이중에서 하나를 선택한다.
  1196. // VMware 설치시 생성되는 macaddress는 005056XXYYZZ 형태이므로 이를 제외시킨다.
  1197. var macarr = maclist.split("^");
  1198. var macaddr = "";
  1199. for(var i=0;i<macarr.length;i++) {
  1200. macaddr = macarr[i];
  1201. if ( macaddr.indexOf("005056",0) != 0 ) {
  1202. break;
  1203. }
  1204. }
  1205. return macaddr;
  1206. }
  1207. // PC의 세션타임아웃 값 설정 함수
  1208. // XP에서는 세션타임아웃 체크 중복 되므로 주석처리 (by 김지훈)
  1209. // function fSetSessionTimeout() {
  1210. // var stmnode = instance1.selectsinglenode("/root/properties/session/timeout");
  1211. // var stmvalue = "";
  1212. // if (stmnode != null) {
  1213. // stmvalue = stmnode.selectsinglenode("sessntm").text;
  1214. // if (isNaN(parseInt(stmvalue)) == false) {
  1215. // setGlobalVariable("session_timeout", stmvalue);
  1216. // }
  1217. // }
  1218. // }
  1219. //
  1220. // 사용자 설정 정보 관련 함수들
  1221. //
  1222. var gvUserConfigRootPath="/root/properties/config";
  1223. var gvUserConfigItemPath = gvUserConfigRootPath+"/item";
  1224. var gvUserConfigClonePath="/root/properties/configclone/item";
  1225. function fGetUserConfig(cfgname) {
  1226. var cfgnode = instance1.selectsinglenode(gvUserConfigItemPath+"[cfgname=&quot;"+cfgname+"&quot;]");
  1227. var cfgvalue = "";
  1228. if ( cfgnode != null ) {
  1229. // configuration is found
  1230. cfgvalue = cfgnode.selectsinglenode("cfgvalue").text;
  1231. }
  1232. //alert(cfgname+","+cfgvalue);
  1233. return cfgvalue;
  1234. }
  1235. function fSetUserConfig(cfgname, cfgvalue) {
  1236. var cfgnode = instance1.selectsinglenode(gvUserConfigItemPath+"[cfgname=&quot;"+cfgname+"&quot;]");
  1237. if ( cfgnode == null ) {
  1238. // config is not found, add a new config
  1239. model.setValue(gvUserConfigClonePath+"/cfgname",cfgname);
  1240. model.setValue(gvUserConfigClonePath+"/cfgvalue",cfgvalue);
  1241. var clonenode = instance1.selectsinglenode(gvUserConfigClonePath).clonenode(true);
  1242. var parentnode = instance1.selectsinglenode(gvUserConfigRootPath);
  1243. parentnode.appendchild(clonenode);
  1244. } else {
  1245. // screen location is found
  1246. cfgnode.selectsinglenode("cfgvalue").text=cfgvalue;
  1247. }
  1248. }
  1249. //
  1250. // 국민건강보험 연계용 함수들
  1251. //
  1252. var gvNhicUrl = null;
  1253. var gvNhicObject = null;
  1254. // NHIC Active-X 객체를 반환한다. 최초 호출시에는 객체를 생성한 후 반환한다.
  1255. // 객체가 생성되지 않는 경우에는 null을 리턴한다.
  1256. function fGetNhicObject() {
  1257. if (gvNhicObject != null) {
  1258. return gvNhicObject;
  1259. }
  1260. try {
  1261. body.createChild("xforms:object",
  1262. "id:nhicAX; clsid:{1669D75E-B1C3-46DF-A410-7FF60B39B762}; visibility:hidden; left:0px; top:0px; width:0px; height:0px; ");
  1263. gvNhicObject = nhicAX;
  1264. } catch (e) {
  1265. gvNhicObject = null;
  1266. }
  1267. return gvNhicObject;
  1268. }
  1269. // NHIC 연계 호출을 위한 공단 URL 문자열을 반환한다.
  1270. function fGetNhicURL() {
  1271. if (gvNhicUrl != null) {
  1272. return gvNhicUrl;
  1273. }
  1274. // 연계 URL 설정
  1275. if (htmlwindow != null) {
  1276. gvNhicUrl = new String(htmlwindow.nhicUrl);
  1277. } else {
  1278. gvNhicUrl = "http://nhic.codns.com:1443/services/nhic?WSDL"; // 개발용 URL
  1279. }
  1280. return gvNhicUrl;
  1281. }
  1282. //
  1283. // 전자인증 연계용 함수들
  1284. //
  1285. var _CERT_YEAR_ = 1970;
  1286. var _CERT_MONTH_ = 1;
  1287. var _CERT_DATE_ = 1;
  1288. var _CERT_UID_ = "";
  1289. var SKCommObject = null;
  1290. // SKCommAX 객체를 반환한다. 최초 호출시에는 객체를 생성한 후 반환한다.
  1291. // 객체가 생성되지 않는 경우에는 null을 리턴한다.
  1292. function fGetSKCommObject() {
  1293. if (SKCommObject != null) {
  1294. return SKCommObject;
  1295. }
  1296. try {
  1297. //body.createChild("xforms:object", "id:CertManX; clsid:{ec5d5118-9fde-4a3e-84f3-c2b711740e70}; visibility:hidden; left:0px; top:0px; width:0px; height:0px; ");
  1298. SKCommObject = CertManX;
  1299. } catch (e) {
  1300. SKCommObject = null;
  1301. }
  1302. return SKCommObject;
  1303. }
  1304. // 열려있는 화면들 중에서 화면 ID를 사용하여 화면Key를 반환한다.
  1305. function fGetWindowKey(sid) {
  1306. var wlist = fGetOpenWindowList();
  1307. var wkey = null;
  1308. for(var i = 0 ; i < wlist.length ; i++) {
  1309. if ( wlist[i].indexOf(sid) == 0 ) {
  1310. wkey = wlist[i];
  1311. }
  1312. }
  1313. return wkey;
  1314. }
  1315. //
  1316. // 공통코드 Cache 함수는 ZBC006.js 에 들어 있음
  1317. //
  1318. function fOpenPhoneInfoPopup(){
  1319. //modal("SPZUM01800", "", "1022", "151", "SPZUM01800", "", "","","","","notaskbar");
  1320. var posX = window.event.screenX-224;
  1321. var posY = window.event.screenY;
  1322. window.load("SPZUM01800_전화번호안내.xrw", "modal", "SPZUM01800", "top:"+posY+"px; left:"+posX+"px; width:245px; height:340px; caption:hidden; ");
  1323. }
  1324. function fOpenDeptInfoPopup(){
  1325. //modal("SPZUM01800", "", "1022", "151", "SPZUM01800", "", "","","","","notaskbar");
  1326. var posX = window.event.screenX-224;
  1327. var posY = window.event.screenY;
  1328. //setParameter("SPZUM01900_PARM_deptlist",htmlwindow.deptList);
  1329. window.load("SPZUM01900_부서선택.xrw", "modal", "SPZUM01900", "top:"+posY+"px; left:"+posX+"px; width:245px; height:50px; caption:hidden; ");
  1330. if(getParameter("SPZUM01900_RETN_selected") == "true"){
  1331. // 열린 팝업화면들을 모두 닫는다.
  1332. fSetStatusMessage("열려있는 창을 모두 닫습니다.");
  1333. fCloseAllWindow();
  1334. //htmlwindow.changeSession(getParameter("SPZUM01900_RETN_newsessionstr"));
  1335. fChangeDept(getParameter("SPZUM01900_RETN_newsessionstr"),getParameter("SPZUM01900_RETN_menugroupstr"));
  1336. }
  1337. }
  1338. function fChangeDept(sessionstr, menugroupstr){
  1339. fSetUserInfo();
  1340. fSetStatusUserInfo();
  1341. initTitle();
  1342. htmlwindow.changeMenu(menugroupstr);
  1343. //사용자별 바로가기 메뉴 호출
  1344. htmlwindow.getShortcutMenuItem();
  1345. // 처방기본정보 가져오기
  1346. fInitializsOrderBasicInfo();
  1347. //메뉴그룹 저장 및 기본화면 호출
  1348. fSetMenuGroupInfo();
  1349. delPatientInfos();
  1350. // 진료대상자리스트 열 때 진료과 디폴트 셋팅이 로그인한 진료과로 설정 되도록 수정
  1351. setGlobalVariable("ordtab", "");
  1352. if(getUserInfo("dutplceinstcd")== "032") {
  1353. caption1.attribute("background-color") = "#fdc87e";
  1354. } else {
  1355. caption1.attribute("background-color") = "#99ccff";
  1356. }
  1357. // 이미지변환
  1358. htmlwindow.changeImage(getUserInfo("dutplceinstcd"));
  1359. }
  1360. /********************************************
  1361. * 화면 클릭 저장 이벤트 (by 김지훈)
  1362. *********************************************/
  1363. var sClickCount = 0;
  1364. // 의사 화면 클릭 카운트
  1365. function fClickCount(screenid){
  1366. // TsetTest(); // 1만건 저장 테스트
  1367. if(getSystemCd().substring(0,3).toLowerCase() == "his"){ // mis는 미적용
  1368. sClickCount++;
  1369. model.makeValue("/root/send/mouseclick[" + sClickCount + "]/screenid", screenid);
  1370. model.makeValue("/root/send/mouseclick[" + sClickCount + "]/seqno", sClickCount);
  1371. model.makeValue("/root/send/mouseclick[" + sClickCount + "]/clickdate", getCurrentDate());
  1372. model.makeValue("/root/send/mouseclick[" + sClickCount + "]/clicktime", getCurrentTime());
  1373. }
  1374. }
  1375. // 화면 클릭 리스트 저장(로그아웃 or 익스플로러 닫기 버튼)
  1376. htmlwindow.onbeforeunload = function (){ fSaveMouseClick() };
  1377. function fSaveMouseClick() {
  1378. if(gMouseCountFlag == false){
  1379. return;
  1380. }
  1381. if(sClickCount == 0) {
  1382. return;
  1383. }
  1384. if( submit("TXZHM00401") ) {
  1385. model.resetInstanceNode("/root/send/mouseclick");
  1386. sClickCount = 0;
  1387. }
  1388. }
  1389. function xxf_xpCall(fnStr){
  1390. htmlwindow.xxf_xpCall(fnStr);
  1391. }
  1392. var callFuncKey = "";
  1393. var callFuncVal = "";
  1394. var callFuncBiz = "";
  1395. function xxf_tfSetParameter(){
  1396. setParameter(callFuncKey, callFuncVal);
  1397. callFuncKey = "";
  1398. callFuncVal = "";
  1399. }
  1400. function xxf_tfSetGlobalVariable() {
  1401. setGlobalVariable(callFuncKey, callFuncVal, callFuncBiz);
  1402. callFuncKey = "";
  1403. callFuncVal = "";
  1404. callFuncBiz = "";
  1405. }
  1406. function xxf_tfSetModelProperty(){
  1407. model.property(callFuncKey) = callFuncVal;
  1408. callFuncKey = "";
  1409. callFuncVal = "";
  1410. }
  1411. function xxf_tfSetModelAttribute(){
  1412. model.setAttribute(callFuncKey, callFuncVal);
  1413. callFuncKey = "";
  1414. callFuncVal = "";
  1415. }
  1416. function xxf_tfCall(fnStr,callbackFn){
  1417. eval(fnStr);
  1418. }
  1419. function xxf_tfModal(id,monNo,xPos,yPos,wid,refcsv,resultref,resultid,userProp,prevPos, authCode, resizeType){
  1420. var ref = "/root/hidden/dataset";
  1421. model.removenode(ref);
  1422. model.makeNode(ref);
  1423. if(!isNull(resultid))
  1424. setCSVToNode(ref, refcsv, resultid);
  1425. modal(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode, resizeType);
  1426. }
  1427. function xxf_tfOpen(id,monNo,xPos,yPos,wid,refcsv,resultref,resultid,userProp,prevPos, authCode, resizeType){
  1428. var ref = "/root/hidden/dataset";
  1429. model.removenode(ref);
  1430. model.makeNode(ref);
  1431. if(!isNull(resultid))
  1432. setCSVToNode(ref, refcsv, resultid);
  1433. open(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode, resizeType);
  1434. }
  1435. //선택한 화면 열기
  1436. function xxf_tfOpenMenuItem(idx){
  1437. fOpenMenuItem(idx);
  1438. }
  1439. function xxf_tfChangeDept(dutplceinstcd, dutplcecd) {
  1440. model.setValue("/root/send/chngdept/userid", getUserId());
  1441. model.setValue("/root/send/chngdept/sessionstr", getGlobalVariable("userinfos"));
  1442. model.setValue("/root/send/chngdept/dutplceinstcd", dutplceinstcd);
  1443. model.setValue("/root/send/chngdept/dutplcecd", dutplcecd);
  1444. submit("TXZUM01901",false);
  1445. var submitID = "TXZUM01902";
  1446. var sid = document.all(submitID);
  1447. sid.attribute("action") = getDomain()+"/himed/chngsess.live?sessstr="+model.getValue("/root/hidden/retlist/newsessionstr");
  1448. model.send(submitID,false,false,true);
  1449. model.refresh();
  1450. fSetUserInfo();
  1451. fSetStatusUserInfo();
  1452. initTitle();
  1453. //htmlwindow.changeMenu(menugroupstr);
  1454. //사용자별 바로가기 메뉴 호출
  1455. //htmlwindow.getShortcutMenuItem();
  1456. // 처방기본정보 가져오기
  1457. fInitializsOrderBasicInfo();
  1458. //메뉴그룹 저장 및 기본화면 호출
  1459. fSetMenuGroupInfo();
  1460. delPatientInfos();
  1461. // 진료대상자리스트 열 때 진료과 디폴트 셋팅이 로그인한 진료과로 설정 되도록 수정
  1462. setGlobalVariable("ordtab", "");
  1463. if(getUserInfo("dutplceinstcd")== "032") {
  1464. caption1.attribute("background-color") = "#fdc87e";
  1465. } else {
  1466. caption1.attribute("background-color") = "#99ccff";
  1467. }
  1468. // 이미지변환
  1469. //htmlwindow.changeImage(getUserInfo("dutplceinstcd"));
  1470. }
  1471. /*
  1472. opener.invoke = function(
  1473. window.TOBEHTML.FireUserNotify = function(userdata) {
  1474. var parent = window.TOBEWEBBROWSER;
  1475. if (parent) {
  1476. parent.$fire_onusernotify(parent, userdata);
  1477. } else {
  1478. window.document.title = userdata;
  1479. }
  1480. }
  1481. */
  1482. // ----------------- 속도 체크를 위한 변수 및 함수 추가 (2015.07.29 smkim)--------------------
  1483. var arryStartLogTime;
  1484. var modalCallCnt = 0;
  1485. function startLogCheck(logickind) {
  1486. if(arryStartLogTime == null) arryStartLogTime = new Array();
  1487. if(arryStartLogTime[logickind] != null && arryStartLogTime[logickind] != undefined)
  1488. delete arryStartLogTime[logickind];
  1489. arryStartLogTime[logickind] = new Date().getTime();
  1490. }
  1491. function endLogCheck(logickind, logdata) {
  1492. if(arryStartLogTime == null || arryStartLogTime[logickind] == null || arryStartLogTime[logickind] == undefined)
  1493. return;
  1494. var elapsedTime = new Date().getTime() - arryStartLogTime[logickind];
  1495. model.makeValue("/root/hidden/temp/logcheck/logickind", logickind);
  1496. model.makeValue("/root/hidden/temp/logcheck/elapsedTime", elapsedTime);
  1497. if(logdata != null && logdata != undefined) {
  1498. var rowdata = logdata.split('|');
  1499. for(var i = 0; i < rowdata.length; i++) {
  1500. model.makeValue("/root/hidden/temp/logcheck/data" + i, rowdata[i]);
  1501. }
  1502. }
  1503. // <submission id="TRZHM00500" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/hidden/temp/logcheck" resultref="/root/temp"/>
  1504. submit ("TRZHM00500", false); // submission 선언은 상태메시지 창에 있음
  1505. model.removeNodeset("/root/hidden/temp/logcheck");
  1506. delete arryStartLogTime[logickind];
  1507. }
  1508. function startLogTempCheck(logickind) {
  1509. if(arryStartLogTime == null) arryStartLogTime = new Array();
  1510. if(arryStartLogTime[logickind] != null && arryStartLogTime[logickind] != undefined)
  1511. delete arryStartLogTime[logickind];
  1512. arryStartLogTime[logickind] = new Date().getTime();
  1513. }
  1514. function endLogTempCheck(logickind) {
  1515. if(arryStartLogTime == null || arryStartLogTime[logickind] == null || arryStartLogTime[logickind] == undefined)
  1516. return 0;
  1517. var elapsedTime = new Date().getTime() - arryStartLogTime[logickind];
  1518. delete arryStartLogTime[logickind];
  1519. return elapsedTime;
  1520. }
  1521. function beforeTimeCheck() {
  1522. if(arryStartLogTime == null) {
  1523. arryStartLogTime = 0;
  1524. return;
  1525. }
  1526. modalCallCnt++;
  1527. if(modalCallCnt == 1)
  1528. return new Date().getTime();
  1529. else
  1530. return 0;
  1531. }
  1532. function exceptPopupTime(beforeTime) {
  1533. if(arryStartLogTime == null) {
  1534. arryStartLogTime = 0;
  1535. return;
  1536. }
  1537. modalCallCnt--;
  1538. if(modalCallCnt != 0) return;
  1539. var currentTime = new Date().getTime();
  1540. for(var i in arryStartLogTime) {
  1541. var elapseTime = (currentTime - beforeTime);
  1542. arryStartLogTime[i] += elapseTime;
  1543. }
  1544. }
  1545. function fSetInitPatientInfo(param) {
  1546. htmlwindow.xxf_xpSetInitPatientInfo(param);
  1547. }
  1548. function fPatientInfoLoadingToXP(isStart) {
  1549. if(isStart) {
  1550. modal("SPZUM03000", null, null, null,null, null, null, "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  1551. } else {
  1552. var mainObj = getMainViewer();
  1553. var curLoadingObj = mainObj.javascript.getOpenWindow("SPZUM03000");
  1554. if(curLoadingObj != null)
  1555. curLoadingObj.javascript.fClose();
  1556. }
  1557. }
  1558. // ------------------------------------------------------------------------
  1559. ]]>
  1560. </script>
  1561. </xhtml:head>
  1562. <xhtml:body guideline="1,566;">
  1563. <object id="CertManX" clsid="{ec5d5118-9fde-4a3e-84f3-c2b711740e70}" visibility="hidden" style="left:0px; top:0px; width:0px; height:0px; "/>
  1564. <object id="socket" clsid="{81e9de7e-90be-4958-bbda-ac731c05aba8}" visibility="hidden" style="left:0px; top:0px; width:0px; height:0px; ">
  1565. <!-- 소켓 받은 메시지 이벤트 -->
  1566. <script type="javascript" ev:event="OnReceive(nDataLength, szID)">
  1567. <![CDATA[
  1568. var msg = socket.recvString(); // 받은 메시지
  1569. fSetMessage(msg);
  1570. if (msg == "z") {
  1571. var tTime = new Date();
  1572. endTime = getDateTime( tTime ,'S');
  1573. }
  1574. ]]>
  1575. </script>
  1576. <!-- 소켓 에러 이벤트 -->
  1577. <script type="javascript" ev:event="OnError(lError, szMsg)">
  1578. <![CDATA[
  1579. fSetStatusMessage("메시지 서버 연결에 실패했습니다. ");
  1580. socket.close(); // 소켓 닫기
  1581. isConnected = false; // 접속 여부 false
  1582. htmlwindow.changeMsgIcon("N"); // 메인 화면에 연결 끊김 표시
  1583. ]]>
  1584. </script>
  1585. <!-- 소켓 연결 이벤트 -->
  1586. <script type="javascript" ev:event="OnConnect(szID)">
  1587. <![CDATA[
  1588. isConnected = true; // 접속 여부 false
  1589. fSetStatusMessage("메시지 서버에 연결되었습니다.");
  1590. msg = fMakeLoginMessage(getUserId()); // 로그인 메시지를 생성한다.
  1591. socket.sendString(msg); // 로그인 메시지를 전송한다.
  1592. htmlwindow.changeMsgIcon("E"); // 연결 확인
  1593. ]]>
  1594. </script>
  1595. <!-- 소켓 close 이벤트 -->
  1596. <script type="javascript" ev:event="OnClose(szID)">
  1597. <![CDATA[
  1598. isConnected = false; // 접속 여부 false
  1599. htmlwindow.changeMsgIcon("N");
  1600. ]]>
  1601. </script>
  1602. </object>
  1603. <caption id="caption1" visibility="hidden" style="left:0px; top:0px; width:1203px; height:23px; vertical-align:middle; background-color:#99ccff; "/>
  1604. <output id="msg" ref="/root/main/msg" class="output_message_b" visibility="hidden" style="left:10px; top:3px; width:445px; height:19px; "/>
  1605. <output id="deptNm" ref="/root/main/userinfo/deptnm" class="output_userinfo" visibility="hidden" style="left:460px; top:3px; width:200px; height:19px; text-align:right; "/>
  1606. <output id="userNm" ref="/root/main/userinfo/usernm" class="output_userinfo" visibility="hidden" style="left:665px; top:3px; width:125px; height:19px; "/>
  1607. <caption id="caption2" class="output_userinfo" visibility="hidden" style="left:795px; top:3px; width:82px; height:19px; ">최초접속시간:</caption>
  1608. <output id="loginDt" ref="/root/main/userinfo/logindt" class="output_userinfo" visibility="hidden" style="left:877px; top:3px; width:168px; height:19px; "/>
  1609. <script type="javascript" ev:event="onmousedown">
  1610. <![CDATA[
  1611. //setPopupMenu("body", false, gvPopupMenuPath+"/items", "name", "func");
  1612. ]]>
  1613. </script>
  1614. <script type="javascript" ev:event="DOMFocusOut">
  1615. <![CDATA[
  1616. //initPopupMenu();
  1617. ]]>
  1618. </script>
  1619. <output id="wsNm" ref="/root/main/userinfo/wsnm" class="output_userinfo" visibility="hidden" style="left:1050px; top:3px; width:55px; height:19px; "/>
  1620. <img id="imgawt" visibility="hidden" style="left:1155px; top:6px; width:38px; height:11px; background-stretch:stretch; ">
  1621. <script type="javascript" ev:event="onclick">
  1622. <![CDATA[
  1623. var flag = fGetUserAwtYN();
  1624. if(flag == "Y"){
  1625. fSetUserAwtYN("N");
  1626. }else{
  1627. fSetUserAwtYN("Y");
  1628. }
  1629. model.refresh();
  1630. ]]>
  1631. </script>
  1632. </img>
  1633. <img id="imgawtstns" visibility="hidden" style="left:1110px; top:6px; width:38px; height:11px; background-stretch:stretch; ">
  1634. <script type="javascript" ev:event="onclick">
  1635. <![CDATA[
  1636. var flag = fGetUserAwtStnsYN();
  1637. if(flag == "Y"){
  1638. fSetUserAwtStnsYN("N");
  1639. }else{
  1640. fSetUserAwtStnsYN("Y");
  1641. }
  1642. model.refresh();
  1643. ]]>
  1644. </script>
  1645. </img>
  1646. </xhtml:body>
  1647. </xhtml:html>