SSMRC03110.js 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504
  1. /*
  2. - =======================================================================================
  3. Image EMR Viewer Program (SSMRC03100.js)
  4. - Version :
  5. 1) : Ver.1.00.00
  6. - =======================================================================================
  7. */
  8. // 다중 페이지 지원을 위한 파일 패스와 페이지 정보
  9. var g_path;
  10. var g_page;
  11. var g_page_lut;
  12. var g_form_count;
  13. var g_printer_name;
  14. var g_last_print_page;
  15. var g_last_select_page;
  16. var g_printed_page;
  17. var splittxt = "";
  18. /**
  19. * @group :
  20. * @ver : 2007.05.21
  21. * @by : 김재홍
  22. * @---------------------------------------------------
  23. * @type : function
  24. * @access : public
  25. * @desc : 초기화 함수
  26. * @return :
  27. * @---------------------------------------------------
  28. */
  29. function fInitilize()
  30. {
  31. //2014.01.16 Start 사본발행시 Split구분값 설정
  32. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp/hardcd4", 5623);
  33. splittxt = model.getValue("/root/temp/hardcd4/hardcd/hardcd");
  34. //2014.01.16 End
  35. // 사용하는 개체를 초기화 한다.
  36. btnNextCharts.attribute("visibility") = "hidden";
  37. if(opener.javascript.getScreenID() == "SMMRI00400")
  38. {
  39. btnNextCharts.attribute("visibility") = "visible";
  40. }
  41. fSet_OCX_PageViewer();
  42. fSet_OCX_ThumbViewer();
  43. fSet_OCX_ChartViewer();
  44. fSet_OCX_PreViewer();
  45. // 페이지 데이터 초기화
  46. g_path = new Array();
  47. g_page = new Array();
  48. g_page_lut = new Array();
  49. g_form_count = new Array();
  50. model.setValue("/root/main/chartinfo/pagetotal", "0");
  51. model.setValue("/root/main/chartinfo/pagecurrent", "0");
  52. model.refresh();
  53. // 모든 버튼 이미지를 설정한다.
  54. setupAllButtons();
  55. // 토글 버튼의 기본값 설정
  56. //processToggleButton("btnFitBest");
  57. processToggleButton("btnPageMouseNormal");
  58. processToggleButton("btnChartMouseNormal");
  59. // 페이지뷰의 페이지 이동 버튼 설정
  60. setupMoveButton();
  61. // 보기 방법의 기본값 설정
  62. setupChart("ChartView");
  63. // 데이터 초기화
  64. resetData();
  65. // 뷰어를 IMPORT 된 크기로 FIT 시킨다.
  66. // if(document.body.isChild("importIemr") == true)
  67. if(window.type == "iviewer")
  68. {
  69. fitToImportArea();
  70. }
  71. // 썸네일 뷰어의 레이아웃 설정
  72. objThumbView.SetThumbLayout(4, 3);
  73. }
  74. /**
  75. * @group :
  76. * @ver : 2007.05.21
  77. * @by : 김재홍
  78. * @---------------------------------------------------
  79. * @type : function
  80. * @access : public
  81. * @desc : 입력받은 YYYYMMDD를 YYYY-MM-DD 로 반환한다.
  82. * @return :
  83. * @---------------------------------------------------
  84. */
  85. function formatDate(value)
  86. {
  87. return value.substr(0, 4) + "-" +
  88. value.substr(4, 2) + "-" +
  89. value.substr(6, 2);
  90. }
  91. /**
  92. * @group :
  93. * @ver : 2007.05.21
  94. * @by : 김재홍
  95. * @---------------------------------------------------
  96. * @type : function
  97. * @access : public
  98. * @desc : PageViewer OCX 초기화
  99. * @return :
  100. * @---------------------------------------------------
  101. */
  102. function fSet_OCX_PageViewer()
  103. {
  104. objPageView.BorderStyle = 1;
  105. objPageView.BackColor = 0xffffff;//0xe0e0e0;
  106. objPageView.BestFit();
  107. objPageView.HorzAlignMode = 1;
  108. objPageView.VertAlignMode = 1;
  109. objPageView.MouseMode = 4;
  110. objPageView.MagnifyingGlassWidth = 700;
  111. objPageView.MagnifyingGlassHeight = 400;
  112. //objPageView.MagnifyingGlassHeight = 300;
  113. //objPageView.MagnifyingGlassWidth = objPageView.ImageWidth;
  114. objPageView.MagnifyingGlassRatio = 1.0;
  115. }
  116. /**
  117. * @group :
  118. * @ver : 2007.05.21
  119. * @by : 김재홍
  120. * @---------------------------------------------------
  121. * @type : function
  122. * @access : public
  123. * @desc : PreViewer OCX 초기화
  124. * @return :
  125. * @---------------------------------------------------
  126. */
  127. function fSet_OCX_PreViewer()
  128. {
  129. objPreview.BorderStyle = 1;
  130. objPreview.BackColor = 0xffffff;//0xe0e0e0;
  131. objPreview.BestFit();
  132. objPreview.HorzAlignMode = 1;
  133. objPreview.VertAlignMode = 1;
  134. }
  135. /**
  136. * @group :
  137. * @ver : 2007.05.21
  138. * @by : 김재홍
  139. * @---------------------------------------------------
  140. * @type : function
  141. * @access : public
  142. * @desc : ThumbViewer OCX 초기화
  143. * @return :
  144. * @---------------------------------------------------
  145. */
  146. function fSet_OCX_ThumbViewer()
  147. {
  148. objThumbView.BorderStyle = 1;
  149. objThumbView.BackColor = 0xffffff;
  150. objThumbView.BorderColor = 0xf4f4f4;
  151. objThumbView.SelectColor = 0xc8a8c0;
  152. objThumbView.TextColor = 0x000000;
  153. objThumbView.ShowFilename = true;
  154. // objThumbView.ShowFilename = false;
  155. objThumbView.ShowIndex = false;
  156. objThumbView.ShowPage = false;
  157. objThumbView.MultiSelect = true;
  158. }
  159. /**
  160. * @group :
  161. * @ver : 2007.05.21
  162. * @by : 김재홍
  163. * @---------------------------------------------------
  164. * @type : function
  165. * @access : public
  166. * @desc : ChartViewer OCX 초기화
  167. * @return :
  168. * @---------------------------------------------------
  169. */
  170. function fSet_OCX_ChartViewer()
  171. {
  172. objChartView.BackColor = 0xffffff;
  173. objChartView.CaptionForeColor = 0xffffff;
  174. objChartView.CaptionBackColor = 0xb99a5c;
  175. objChartView.CaptionFont = "돋움";
  176. objChartView.CaptionHeight = 20;
  177. objChartView.CaptionBold = true;
  178. objChartView.CaptionItalic = false;
  179. objChartView.CaptionStrikeOut = false;
  180. objChartView.CaptionUnderline = false;
  181. objChartView.MouseMode = 0;
  182. objChartView.MagnifyingGlassWidth = 700;
  183. objChartView.MagnifyingGlassHeight = 400;
  184. objChartView.MagnifyingGlassRatio = 2.3;
  185. objChartView.DefaultRegionAnalyzeMethod =
  186. "Method=2;" +
  187. "MarginX=20;" +
  188. "MarginY=20;" +
  189. "HyphenWidthMin=7;" +
  190. "HyphenWidthMax=15;" +
  191. "HyphenHeightMin=2;" +
  192. "HyphenHeightMax=8;" +
  193. "HyphenMaxDifY=4;" +
  194. "HyphenAgreeMin=8;" +
  195. "HyphenSpaceMin=20;" +
  196. "HyphenSpaceMax=30;" +
  197. "LineMergeHeight=40;" +
  198. "LineTopEraseMargin=12;" +
  199. "LineBottomEraseMargin=0;" +
  200. "LineTop=0;" +
  201. "LineBottom=0"
  202. }
  203. /**
  204. * @group :
  205. * @ver : 2007.05.21
  206. * @by : 김재홍
  207. * @---------------------------------------------------
  208. * @type : function
  209. * @access : public
  210. * @desc : XPath로 부터 Button image Load
  211. * @return :
  212. * @---------------------------------------------------
  213. */
  214. function getXPathButtonImage(button)
  215. {
  216. return button == null ? "/root/hidden/buttonImage" : "/root/hidden/buttonImage/" + button;
  217. }
  218. /**
  219. * @group :
  220. * @ver : 2007.05.21
  221. * @by : 김재홍
  222. * @---------------------------------------------------
  223. * @type : function
  224. * @access : public
  225. * @desc : XPath로 부터 ToggleButton image Load
  226. * @return :
  227. * @---------------------------------------------------
  228. */
  229. function getXPathToggleButton(button)
  230. {
  231. return button == null ? "/root/hidden/buttonToggle" : "/root/hidden/buttonToggle/" + button;
  232. }
  233. /**
  234. * @group :
  235. * @ver : 2007.05.21
  236. * @by : 김재홍
  237. * @---------------------------------------------------
  238. * @type : function
  239. * @access : public
  240. * @desc : 등록되어 있는 모든 버튼 이미지를 설정한다.
  241. * @return :
  242. * @---------------------------------------------------
  243. */
  244. function setupAllButtons()
  245. {
  246. var node = instance1.selectSingleNode( getXPathButtonImage() );
  247. var list = node.childNodes;
  248. var total = list.length;
  249. var i;
  250. for (i = 0; i < total; i++)
  251. {
  252. setupButton( list.item(i).nodeName );
  253. }
  254. }
  255. /**
  256. * @group :
  257. * @ver : 2007.05.21
  258. * @by : 김재홍
  259. * @---------------------------------------------------
  260. * @type : function
  261. * @access : public
  262. * @desc : 토글 버튼의 속성을 반환하거나 설정한다.
  263. * @return :
  264. * @---------------------------------------------------
  265. */
  266. function toggleButton(button, property, value)
  267. {
  268. if (button == null || property == null) return;
  269. var path = getXPathToggleButton(button) + "/" + property;
  270. if (value == null)
  271. {
  272. return model.getValue(path);
  273. }
  274. else
  275. {
  276. if (model.getValue(path) != value)
  277. {
  278. model.setValue(path, value);
  279. setupButton(button);
  280. }
  281. }
  282. }
  283. /**
  284. * @group :
  285. * @ver : 2007.05.21
  286. * @by : 김재홍
  287. * @---------------------------------------------------
  288. * @type : function
  289. * @access : public
  290. * @desc : 버튼의 현재 상황에 맞게 이미지를 설정한다.
  291. * @return :
  292. * @---------------------------------------------------
  293. */
  294. function setupButton(button)
  295. {
  296. var path = model.getValue("/root/hidden/buttonImageHome") + model.getValue(getXPathButtonImage(button));
  297. var ext = model.getValue("/root/hidden/buttonImageExt");
  298. var objButton = document.controls.item(button);
  299. // 버튼 상태에 따라 이미지 설정
  300. if(toggleButton(button, "value") == "1")
  301. {
  302. objButton.attribute("background-image") = path + "_c" + ext;
  303. objButton.attribute("down.background-image") = path + "_c" + ext;
  304. objButton.attribute("hover.background-image") = path + "_c" + ext;
  305. objButton.attribute("disable.background-image") = path + "_d" + ext;
  306. }
  307. else
  308. {
  309. objButton.attribute("background-image") = path + ext;
  310. objButton.attribute("down.background-image") = path + "_c" + ext;
  311. objButton.attribute("hover.background-image") = path + "_h" + ext;
  312. objButton.attribute("disable.background-image") = path + "_d" + ext;
  313. }
  314. // disable 처리
  315. var btnDis = toggleButton(button, "disable") == "1" ? true : false;
  316. objButton.disabled = btnDis;
  317. // 버튼을 화면에 갱신
  318. objButton.refresh();
  319. }
  320. /**
  321. * @group :
  322. * @ver : 2007.05.21
  323. * @by : 김재홍
  324. * @---------------------------------------------------
  325. * @type : function
  326. * @access : public
  327. * @desc : 토글 버튼을 처리한다.
  328. * @return :
  329. * @---------------------------------------------------
  330. */
  331. function processToggleButton(button)
  332. {
  333. var node = instance1.selectSingleNode(getXPathToggleButton());
  334. var list = node.childNodes;
  335. var total = list.length;
  336. var curName;
  337. var name;
  338. var i;
  339. if (objChartView.TotalChart == 0)
  340. {
  341. return;
  342. }
  343. // 이미 켜져 있다면 처리가 필요 없음
  344. if(toggleButton(button, "value") == "1") return;
  345. // 영역확대, 확대, 축소 버튼일 경우 실제크기보기, 최적크기보기, 가로크기보기 버튼 끔
  346. if(button == "btnPageMouseRegionZoom" || button == "btnZoomIn" || button == "btnZoomOut")
  347. {
  348. if(toggleButton("btnFitBest", "value") == "1")
  349. {
  350. toggleButton("btnFitBest", "value", "0");
  351. }
  352. if(toggleButton("btnFitActual", "value") == "1")
  353. {
  354. toggleButton("btnFitActual", "value", "0");
  355. }
  356. if(toggleButton("btnFitWidth", "value") == "1")
  357. {
  358. toggleButton("btnFitWidth", "value", "0");
  359. }
  360. }
  361. // 확대, 축소 버튼의 경우 의미없음
  362. if(button == "btnZoomIn" || button == "btnZoomOut") return;
  363. curName = toggleButton(button, "name");
  364. for (i = 0; i < total; i++)
  365. {
  366. name = list.item(i).nodeName;
  367. if(toggleButton(name, "name") == curName && toggleButton(name, "value") == "1")
  368. {
  369. toggleButton(name, "value", "0");
  370. // 핸들러 호출
  371. eval(name + "_Changed()");
  372. }
  373. }
  374. toggleButton(button, "value", "1");
  375. // 핸들러 호출
  376. eval(button + "_Changed()");
  377. }
  378. /**
  379. * @group :
  380. * @ver : 2007.05.21
  381. * @by : 김재홍
  382. * @---------------------------------------------------
  383. * @type : function
  384. * @access : public
  385. * @desc : 뷰어 정보를 초기화 한다.
  386. * @return :
  387. * @---------------------------------------------------
  388. */
  389. function resetData()
  390. {
  391. objChartView.AutoRefresh = false;
  392. objThumbView.ClearPage();
  393. objChartView.ChartRemove(0, 0);
  394. objPageView.CurrentPage = 0;
  395. objChartView.AutoRefresh = true;
  396. model.removeNode("/root/hidden/tempcharts");
  397. model.removeNode("/root/main/charts");
  398. model.refresh();
  399. setupMoveButton();
  400. }
  401. /**
  402. * @group :
  403. * @ver : 2007.05.21
  404. * @by : 김재홍
  405. * @---------------------------------------------------
  406. * @type : function
  407. * @access : public
  408. * @desc : 차트뷰의 끌기 마우스 커서 버튼 핸들러
  409. * @return :
  410. * @---------------------------------------------------
  411. */
  412. function btnChartMousePanning_Changed()
  413. {
  414. if(getToggleValue("ModeChartMouse") == "btnChartMousePanning")
  415. {
  416. objChartView.MouseMode = 1;
  417. }
  418. }
  419. /**
  420. * @group :
  421. * @ver : 2007.05.21
  422. * @by : 김재홍
  423. * @---------------------------------------------------
  424. * @type : function
  425. * @access : public
  426. * @desc : 차트뷰의 돋보기 마우스 커서 버튼 핸들러
  427. * @return :
  428. * @---------------------------------------------------
  429. */
  430. function btnChartMouseMagnifyingGlass_Changed()
  431. {
  432. if(getToggleValue("ModeChartMouse") == "btnChartMouseMagnifyingGlass")
  433. {
  434. objChartView.MouseMode = 2;
  435. }
  436. }
  437. /**
  438. * @group :
  439. * @ver : 2007.05.21
  440. * @by : 김재홍
  441. * @---------------------------------------------------
  442. * @type : function
  443. * @access : public
  444. * @desc : 차트뷰의 디폴트 마우스 커서 버튼 핸들러
  445. * @return :
  446. * @---------------------------------------------------
  447. */
  448. function btnChartMouseNormal_Changed()
  449. {
  450. if(getToggleValue("ModeChartMouse") == "btnChartMouseNormal")
  451. {
  452. objChartView.MouseMode = 0;
  453. }
  454. }
  455. /**
  456. * @group :
  457. * @ver : 2007.05.21
  458. * @by : 김재홍
  459. * @---------------------------------------------------
  460. * @type : function
  461. * @access : public
  462. * @desc : 실제 크기 맞추기 버튼 핸들러
  463. * @return :
  464. * @---------------------------------------------------
  465. */
  466. function btnFitActual_Changed()
  467. {
  468. if(getToggleValue("ModeFit") == "btnFitActual")
  469. {
  470. objPageView.ActualSize();
  471. processToggleButton("btnPageMousePanning");
  472. }
  473. }
  474. /**
  475. * @group :
  476. * @ver : 2007.05.21
  477. * @by : 김재홍
  478. * @---------------------------------------------------
  479. * @type : function
  480. * @access : public
  481. * @desc : 최적 크기 맞추기 버튼 핸들러
  482. * @return :
  483. * @---------------------------------------------------
  484. */
  485. function btnFitBest_Changed()
  486. {
  487. if(getToggleValue("ModeFit") == "btnFitBest")
  488. {
  489. objPageView.BestFit();
  490. //processToggleButton("btnPageMouseMagnifyingGlass");
  491. }
  492. }
  493. /**
  494. * @group :
  495. * @ver : 2007.05.21
  496. * @by : 김재홍
  497. * @---------------------------------------------------
  498. * @type : function
  499. * @access : public
  500. * @desc : 가로 크기 맞추기 버튼 핸들러
  501. * @return :
  502. * @---------------------------------------------------
  503. */
  504. function btnFitWidth_Changed()
  505. {
  506. if(getToggleValue("ModeFit") == "btnFitWidth")
  507. {
  508. objPageView.FitToWidth();
  509. processToggleButton("btnPageMousePanning");
  510. }
  511. }
  512. /**
  513. * @group :
  514. * @ver : 2007.05.21
  515. * @by : 김재홍
  516. * @---------------------------------------------------
  517. * @type : function
  518. * @access : public
  519. * @desc : 일반 마우스 커서 버튼 핸들러
  520. * @return :
  521. * @---------------------------------------------------
  522. */
  523. function btnPageMouseNormal_Changed()
  524. {
  525. if(getToggleValue("ModePageMouse") == "btnPageMouseNormal")
  526. {
  527. objPageView.MouseMode = 0;
  528. }
  529. }
  530. /**
  531. * @group :
  532. * @ver : 2007.05.21
  533. * @by : 김재홍
  534. * @---------------------------------------------------
  535. * @type : function
  536. * @access : public
  537. * @desc : 영역 확대 마우스 커서 버튼 핸들러
  538. * @return :
  539. * @---------------------------------------------------
  540. */
  541. function btnPageMouseRegionZoom_Changed()
  542. {
  543. if(getToggleValue("ModePageMouse") == "btnPageMouseRegionZoom")
  544. {
  545. objPageView.MouseMode = 2;
  546. }
  547. }
  548. /**
  549. * @group :
  550. * @ver : 2007.05.21
  551. * @by : 김재홍
  552. * @---------------------------------------------------
  553. * @type : function
  554. * @access : public
  555. * @desc : 돋보기 마우스 커서 버튼 핸들러
  556. * @return :
  557. * @---------------------------------------------------
  558. */
  559. function btnPageMouseMagnifyingGlass_Changed()
  560. {
  561. if(getToggleValue("ModePageMouse") == "btnPageMouseMagnifyingGlass")
  562. {
  563. objPageView.MouseMode = 4;
  564. }
  565. }
  566. /**
  567. * @group :
  568. * @ver : 2007.05.21
  569. * @by : 김재홍
  570. * @---------------------------------------------------
  571. * @type : function
  572. * @access : public
  573. * @desc : 끌기 마우스 커서 버튼 핸들러
  574. * @return :
  575. * @---------------------------------------------------
  576. */
  577. function btnPageMousePanning_Changed()
  578. {
  579. if(getToggleValue("ModePageMouse") == "btnPageMousePanning")
  580. {
  581. objPageView.MouseMode = 1;
  582. }
  583. }
  584. /**
  585. * @group :
  586. * @ver : 2007.05.21
  587. * @by : 김재홍
  588. * @---------------------------------------------------
  589. * @type : function
  590. * @access : public
  591. * @desc : 차트 정보의 xpath를 반환한다.
  592. * @return :
  593. * @---------------------------------------------------
  594. */
  595. function getXPathChart(page, value)
  596. {
  597. return "/root/main/charts[" + page + "]" + ((value == null) ? "" : "/" + value);
  598. }
  599. /**
  600. * @group :
  601. * @ver : 2007.05.21
  602. * @by : 김재홍
  603. * @---------------------------------------------------
  604. * @type : function
  605. * @access : public
  606. * @desc : 보기 모드와 현재 페이지에 따라 적당한 차트가 보이도록 설정한다.
  607. * @return :
  608. * @---------------------------------------------------
  609. */
  610. function setupChart(ViewMode)
  611. {
  612. fGetResize();
  613. if(ViewMode == null)
  614. {
  615. // 보기 모드가 지정되지 않았다면 현재의 값을 사용한다.
  616. ViewMode = model.getValue("/root/hidden/currentViewMode");
  617. }
  618. else
  619. {
  620. // 보기 모드에 따라 스위치를 설정한다.
  621. switch(ViewMode)
  622. {
  623. case "PageView":
  624. model.toggle("swViewModeCase3");
  625. document.controls.item("btnPageView").selected = true;
  626. break;
  627. case "ThumbView":
  628. model.toggle("swtViewModeCase1");
  629. document.controls.item("btnThumbView").selected = true;
  630. break;
  631. case "ChartView":
  632. model.toggle("swViewModeCase2");
  633. document.controls.item("btnChartView").selected = true;
  634. break;
  635. }
  636. // 현재 보기 모드를 저장한다.
  637. model.setValue("/root/hidden/currentViewMode", ViewMode);
  638. }
  639. var pageTotal = parseInt(model.getValue("/root/main/chartinfo/pagetotal"));
  640. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  641. var nPrv;
  642. var nCur;
  643. var nPage;
  644. var i;
  645. var j;
  646. var count;
  647. var imgemrcount;
  648. var totalemrorddate;
  649. var totalemrformnm;
  650. var totalemrformcd;
  651. var totalemrdeptnm;
  652. var totalemrdeptcd;
  653. var totalemrpage;
  654. var totalemrhiddenmsg;
  655. var emrorddate;
  656. var emrformnm;
  657. var emrformcd;
  658. var emrdeptnm;
  659. var emrdeptcd;
  660. var emrpage;
  661. var emrhiddenmsg;
  662. var counttemp = 0;
  663. var countnull = 0;
  664. switch(ViewMode)
  665. {
  666. case "PageView":
  667. if (pageCurrent != 0)
  668. {
  669. objPageView.Load(g_path[pageCurrent], g_page[pageCurrent]);
  670. }
  671. processToggleButton("btnPageMouseNormal");
  672. break;
  673. case "ThumbView":
  674. model.setValue("/root/main/chartinfo/pagecurrent", objThumbView.TotalSelectedThumbnail);
  675. model.refresh();
  676. if (objThumbView.TotalThumbnail == 0)
  677. {
  678. objThumbView.ThumbGen = false;
  679. objThumbView.Redraw = false;
  680. for (i = 0; i < pageTotal; i++)
  681. {
  682. // 썸네일 추가
  683. nPrv = objThumbView.TotalThumbnail;
  684. objThumbView.AppendPage(g_path[i + 1], g_page[i + 1], g_page[i + 1]);
  685. nCur = objThumbView.TotalThumbnail;
  686. nPage = g_page_lut[i + 1];
  687. for (j = nPrv; j < nCur; j++)
  688. {
  689. // 장비연동 검사지가 아닌경우
  690. if (model.getValue("/root/main/charts[" + nPage + "]/cmc_orddate") == null || model.getValue("/root/main/charts[" + nPage + "]/cmc_orddate") == "")
  691. {
  692. // objThumbView.ThumbText(j + 1) = "[" +
  693. // model.getValue(getXPathChart(nPage, "chrtpage")) +
  694. // "] " +
  695. // model.getValue(getXPathChart(nPage, "docunm")) + " " +
  696. // model.getValue(getXPathChart(nPage, "cmc_orddate"));
  697. objThumbView.ThumbText(j + 1) = "[" +
  698. model.getValue(getXPathChart(nPage, "chrtpage")) +
  699. "] " +
  700. model.getValue(getXPathChart(nPage, "indd")) + " " +
  701. model.getValue(getXPathChart(nPage, "docunm"));
  702. }
  703. // 장비연동 검사지인 경우
  704. else
  705. {
  706. objThumbView.ThumbText(j + 1) = "[" +
  707. model.getValue(getXPathChart(nPage, "chrtpage")) +
  708. "] " +
  709. model.getValue(getXPathChart(nPage, "cmc_orddate")) + " / " +
  710. model.getValue(getXPathChart(nPage, "cmc_acptime")) + " " +
  711. model.getValue(getXPathChart(nPage, "cmc_examname"));
  712. }
  713. }
  714. }
  715. // EMR append 서식 썸네일텍스트 변경
  716. if (model.getValue("/root/main/emrpath") != null && model.getValue("/root/main/emrpath") != "")
  717. {
  718. imgemrcount = 0;
  719. totalemrpage = model.getValue("/root/main/emrpage");
  720. totalemrformnm = model.getValue("/root/main/emrformnm");
  721. totalemrhiddenmsg = model.getValue("/root/main/emrhiddenmsg");
  722. totalemrorddate = model.getValue("/root/main/emrorddate");
  723. emrpage = totalemrpage.split("|");
  724. emrformnm = totalemrformnm.split("|");
  725. emrhiddenmsg = totalemrhiddenmsg.split("|");
  726. emrorddate = totalemrorddate.split("|");
  727. countnull = 0;
  728. counttemp = 0;
  729. for (count = 0; count < emrpage.length; count++)
  730. {
  731. if (emrpage[count].substring(0, 1) == "*")
  732. {
  733. // imgemrcount = model.getValue("/root/main/chartinfo/filetotal") - 1;
  734. imgemrcount = g_form_count[counttemp];
  735. counttemp++;
  736. }
  737. else
  738. {
  739. objThumbView.ThumbText(parseInt(count) + parseInt(imgemrcount) + 1 - parseInt(counttemp)) = "[" +
  740. emrpage[count] +
  741. "] " +
  742. emrorddate[count] + " " +
  743. emrformnm[count];
  744. objThumbView.ThumbUserText(parseInt(count) + parseInt(imgemrcount) + 1 - parseInt(counttemp)) = emrhiddenmsg[count];
  745. }
  746. }
  747. }
  748. objThumbView.Redraw = true;
  749. objThumbView.ThumbGen = true;
  750. }
  751. break;
  752. case "ChartView":
  753. if (objChartView.TotalChart == 0)
  754. {
  755. objChartView.AutoRefresh = false;
  756. for (i = 0; i < pageTotal; i++)
  757. {
  758. // 차트 추가
  759. nPrv = objChartView.TotalChart;
  760. objChartView.ChartAppend(g_path[i + 1], g_page[i + 1], g_page[i + 1]);
  761. nCur = objChartView.TotalChart;
  762. nPage = g_page_lut[i + 1];
  763. for (j = nPrv; j < nCur; j++)
  764. {
  765. // 장비연동 검사지가 아닌경우
  766. if (model.getValue("/root/main/charts[" + nPage + "]/cmc_orddate") == null || model.getValue("/root/main/charts[" + nPage + "]/cmc_orddate") == "")
  767. {
  768. objChartView.OuterCaption(j + 1) = formatDate(model.getValue(getXPathChart(nPage, "indd"))) + " " +
  769. model.getValue(getXPathChart(nPage, "orddeptnm")) + " " +
  770. model.getValue(getXPathChart(nPage, "docunm")) + " " +
  771. model.getValue(getXPathChart(nPage, "chrtpage"));
  772. }
  773. // 장비연동 검사지인 경우
  774. else
  775. {
  776. objChartView.OuterCaption(j + 1) = formatDate(model.getValue(getXPathChart(nPage, "cmc_orddate"))) + " / " +
  777. formatDate(model.getValue(getXPathChart(nPage, "cmc_acptime"))) + " " +
  778. model.getValue(getXPathChart(nPage, "orddeptnm")) + " " +
  779. model.getValue(getXPathChart(nPage, "cmc_examname")) + " " +
  780. "";
  781. // model.getValue(getXPathChart(nPage, "docunm")) + " " +
  782. // model.getValue(getXPathChart(nPage, "chrtpage"));
  783. }
  784. }
  785. }
  786. // EMR append 서식 OuterCaption 변경
  787. if (model.getValue("/root/main/emrpath") != null && model.getValue("/root/main/emrpath") != "")
  788. {
  789. imgemrcount = 0;
  790. totalemrpage = model.getValue("/root/main/emrpage");
  791. totalemrformnm = model.getValue("/root/main/emrformnm");
  792. totalemrorddate = model.getValue("/root/main/emrorddate");
  793. totalemrdeptnm = model.getValue("/root/main/emrdeptnm");
  794. totalemrhiddenmsg = model.getValue("/root/main/emrhiddenmsg");
  795. emrpage = totalemrpage.split("|");
  796. emrformnm = totalemrformnm.split("|");
  797. emrorddate = totalemrorddate.split("|");
  798. emrdeptnm = totalemrdeptnm.split("|");
  799. emrhiddenmsg = totalemrhiddenmsg.split("|");
  800. countnull = 0;
  801. counttemp = 0;
  802. for (count = 0; count < emrpage.length; count++)
  803. {
  804. if (emrpage[count].substring(0, 1) == "*")
  805. {
  806. // imgemrcount = model.getValue("/root/main/chartinfo/filetotal") - 1;
  807. imgemrcount = g_form_count[counttemp];
  808. counttemp++;
  809. }
  810. else
  811. {
  812. objChartView.OuterCaption(parseInt(count) + parseInt(imgemrcount) + 1 - parseInt(counttemp)) = emrorddate[count].substr(0, 4) + "-" + emrorddate[count].substr(4, 2) + "-" + emrorddate[count].substr(6, 2) + " " +
  813. emrdeptnm[count] + " " +
  814. emrformnm[count] + " " +
  815. emrpage[count];
  816. objChartView.UserText(parseInt(count) + parseInt(imgemrcount) + 1 - parseInt(counttemp)) = emrhiddenmsg[count];
  817. }
  818. }
  819. }
  820. objChartView.AutoRefresh = true;
  821. }
  822. processToggleButton("btnChartMouseNormal");
  823. break;
  824. }
  825. model.refresh();
  826. }
  827. /**
  828. * @group :
  829. * @ver : 2007.05.21
  830. * @by : 김재홍
  831. * @---------------------------------------------------
  832. * @type : function
  833. * @access : public
  834. * @desc : 페이지뷰 툴바에 있는 페이지 이동 버튼의 활성화 여부를 처리한다.
  835. * @return :
  836. * @---------------------------------------------------
  837. */
  838. function setupMoveButton()
  839. {
  840. var pageTotal = parseInt(model.getValue("/root/main/chartinfo/pagetotal"));
  841. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  842. var prev = "1";
  843. var next = "1";
  844. if (pageCurrent > 1) prev = "0";
  845. if (pageCurrent < pageTotal) next = "0";
  846. toggleButton("btnMoveFirst", "disable", prev);
  847. toggleButton("btnMovePrev", "disable", prev);
  848. toggleButton("btnMoveLast", "disable", next);
  849. toggleButton("btnMoveNext", "disable", next);
  850. }
  851. /**
  852. * @group :
  853. * @ver : 2007.05.21
  854. * @by : 김재홍
  855. * @---------------------------------------------------
  856. * @type : function
  857. * @access : public
  858. * @desc : 프린터 설정
  859. * @return :
  860. * @---------------------------------------------------
  861. */
  862. function printSetup(hWND)
  863. {
  864. if (objBIP.PrinterSetup(hWND) == true)
  865. {
  866. return true;
  867. }
  868. else
  869. {
  870. return false;
  871. }
  872. }
  873. /**
  874. * @group :
  875. * @ver : 2007.05.21
  876. * @by : 김재홍
  877. * @---------------------------------------------------
  878. * @type : function
  879. * @access : public
  880. * @desc : 출력 로그 설정
  881. * @return :
  882. * @---------------------------------------------------
  883. */
  884. function printLog(page)
  885. {
  886. page = g_page_lut[page];
  887. return model.getValue(getXPathChart(page, "chrtpage")) + "|" +
  888. model.getValue(getXPathChart(page, "ordno")) + "|" +
  889. model.getValue(getXPathChart(page, "pageno")) + "|" +
  890. model.getValue(getXPathChart(page, "docucd")) + "|" +
  891. model.getValue(getXPathChart(page, "orddeptcd")) + "|" +
  892. model.getValue(getXPathChart(page, "ptdt")) + "|" +
  893. model.getValue(getXPathChart(page, "usercd")) + "|" +
  894. model.getValue(getXPathChart(page, "indd")) + "|" +
  895. model.getValue(getXPathChart(page, "outdd")) + "|" +
  896. model.getValue(getXPathChart(page, "remtip")) + "|" +
  897. model.getValue(getXPathChart(page, "remtport"));
  898. }
  899. /**
  900. * @group :
  901. * @ver : 2007.05.21
  902. * @by : 김재홍
  903. * @---------------------------------------------------
  904. * @type : function
  905. * @access : public
  906. * @desc : 현재 보이는 차트를 출력한다.
  907. * @return :
  908. * @---------------------------------------------------
  909. */
  910. function printChart(docName)
  911. {
  912. var strPage;
  913. var strPage;
  914. var strPrintLog;
  915. var bFirstPage;
  916. //출력지 모이는 현상
  917. //0 BIPPM_SMART_FIT
  918. //1 BIPPM_ACTUAL_SIZE
  919. //2 BIPPM_PAGE_FIT
  920. objBIP.PrintMethod = 2
  921. switch(model.getValue("/root/hidden/currentViewMode"))
  922. {
  923. case "PageView":
  924. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  925. if(pageCurrent > 0)
  926. {
  927. strPath = g_path[pageCurrent];
  928. strPage = g_page[pageCurrent];
  929. // objBIP.StartDoc(docName);
  930. if (objBIP.StartDoc(docName) == false)
  931. {
  932. return false;
  933. }
  934. // objBIP.PrintImage(g_path[pageCurrent], g_page[pageCurrent]);
  935. if (objBIP.PrintImage(g_path[pageCurrent], g_page[pageCurrent]) == false)
  936. {
  937. return false;
  938. }
  939. // objBIP.EndDoc();
  940. if (objBIP.EndDoc() == false)
  941. {
  942. return false;
  943. }
  944. // 출력 통보
  945. model.setAttribute("sCMR_Param", printLog(pageCurrent));
  946. }
  947. else
  948. {
  949. alert("출력할 페이지가 없습니다.");
  950. return false;
  951. }
  952. break;
  953. case "ThumbView":
  954. if(objThumbView.TotalSelectedThumbnail == 0)
  955. {
  956. alert("선택된 차트가 없습니다.");
  957. return;
  958. }
  959. else
  960. {
  961. if (objBIP.StartDoc(docName) == false)
  962. {
  963. return false;
  964. }
  965. bFirstPage = true;
  966. strPrintLog = "";
  967. for(i = 1; i <= objThumbView.TotalThumbnail; i++)
  968. {
  969. if(objThumbView.Select(i) == true)
  970. {
  971. if(bFirstPage == false)
  972. {
  973. if (objBIP.NewPage() == false)
  974. {
  975. return false;
  976. }
  977. strPrintLog += ",";
  978. }
  979. else
  980. {
  981. bFirstPage = false;
  982. }
  983. if (objBIP.PrintImage(objThumbView.FileName(i), objThumbView.Page(i)) == false)
  984. {
  985. return false;
  986. }
  987. strPrintLog += printLog(i);
  988. }
  989. }
  990. if (objBIP.EndDoc() == false)
  991. {
  992. return false;
  993. }
  994. model.setAttribute("sCMR_Param", strPrintLog);
  995. break;
  996. }
  997. case "ChartView":
  998. alert("'연속보기' 에서는 출력할 수 없습니다.");
  999. return false;
  1000. break;
  1001. }
  1002. return true;
  1003. }
  1004. /**
  1005. * @group :
  1006. * @ver : 2007.05.21
  1007. * @by : 김재홍
  1008. * @---------------------------------------------------
  1009. * @type : function
  1010. * @access : public
  1011. * @desc : 검색 조건에 의해 검색을 하고 검색된 차트를 출력한다.
  1012. * @return :
  1013. * @---------------------------------------------------
  1014. */
  1015. function printChartBySearch(docName, param)
  1016. {
  1017. resetData();
  1018. // 전송할 데이터를 만든다.
  1019. var destNode = instance1.selectSingleNode("/root/_send/data1");
  1020. model.copyNode(destNode, param);
  1021. model.setValue("/root/main/chartinfo/filetotal", model.getValue("/root/_send/data1/pgto"));
  1022. // 전송
  1023. submit("TRMRC00105");
  1024. // 만들었던 데이터 삭제
  1025. model.resetInstanceNode("/root/_send");
  1026. // 페이지 정보를 조정한다.
  1027. model.setValue("/root/main/chartinfo/pagecurrent", model.getValue("/root/main/chartinfo/pagetotal") != "0" ? "1" : "0");
  1028. model.refresh();
  1029. // 차트 파일을 다운로드 받는다.
  1030. downloadChart();
  1031. // 차트를 출력한다.
  1032. printChart(docName);
  1033. }
  1034. /**
  1035. * @group :
  1036. * @ver : 2007.05.21
  1037. * @by : 김재홍
  1038. * @---------------------------------------------------
  1039. * @type : function
  1040. * @access : public
  1041. * @desc : 검색 조건에 의해 검색을 하고 검색된 차트를 보여준다.
  1042. * @return :
  1043. * @---------------------------------------------------
  1044. */
  1045. function searchChart(param)
  1046. {
  1047. var count;
  1048. var r, re;
  1049. resetData();
  1050. // alert(instance1.selectSingleNode("/root/hidden/temp").xml);
  1051. // 전송할 데이터를 만든다.
  1052. var destNode = instance1.selectSingleNode("/root/_send/data1");
  1053. model.copyNode(destNode, param);
  1054. // if (destNode.cmc_spcid.nodeValue != null && destNode.cmc_spcid.nodeValue != "")
  1055. // {
  1056. // destNode.cmc_spcid.nodeValue = "'" + destNode.cmc_spcid.nodeValue.setReplaceWord(r, re) + "'";
  1057. // }
  1058. // if (destNode.cmc_orddate.nodeValue != null && destNode.cmc_orddate.nodeValue != "")
  1059. // {
  1060. // destNode.cmc_orddate.nodeValue = "'" + destNode.cmc_orddate.nodeValue.setReplaceWord(r, re) + "'";
  1061. // }
  1062. // 전송
  1063. submit("TRMRC03102");
  1064. count = 1;
  1065. // alert(instance1.selectSingleNode("/root/hidden/temp").xml);
  1066. /*
  1067. if (model.getValue("/root/main/charts[" + count + "]/chrtpage") == null || model.getValue("/root/main/charts[" + count + "]/chrtpage") == "")
  1068. {
  1069. alert("해당 데이터가 없습니다.");
  1070. }
  1071. */
  1072. // 보여줄 페이지 수를 센다.
  1073. while(model.getValue("/root/main/charts[" + count + "]/chrtpage") != null && model.getValue("/root/main/charts[" + count + "]/chrtpage") != "")
  1074. {
  1075. count++;
  1076. }
  1077. model.makeNode("/root/_send/data1/pagetot");
  1078. model.setValue("/root/_send/data1/pagetot", count - 1);
  1079. model.setValue("/root/main/chartinfo/filetotal", model.getValue("/root/_send/data1/pagetot"));
  1080. g_form_count[0] = model.getValue("/root/main/chartinfo/filetotal");
  1081. // 만들었던 데이터 삭제
  1082. model.resetInstanceNode("/root/_send");
  1083. // 페이지 정보를 조정한다.
  1084. model.setValue("/root/main/chartinfo/pagecurrent", model.getValue("/root/main/chartInfo/pagetotal") != "0" ? "1" : "0");
  1085. model.refresh();
  1086. }
  1087. /**
  1088. * @group :
  1089. * @ver : 2007.05.21
  1090. * @by : 김재홍
  1091. * @---------------------------------------------------
  1092. * @type : function
  1093. * @access : public
  1094. * @desc : 검색 조건에 의해 검색을 하고 검색된 차트를 보여준다.
  1095. * @return :
  1096. * @---------------------------------------------------
  1097. */
  1098. function searchChart_EMR(param)
  1099. {
  1100. var count;
  1101. var r, re;
  1102. r = ",";
  1103. re = "','";
  1104. var treatno;
  1105. var docucd;
  1106. var temptreatno;
  1107. var tempdocucd;
  1108. var count;
  1109. var countmain;
  1110. var counthidden;
  1111. resetData();
  1112. // 전송할 데이터를 만든다.
  1113. var destNode = instance1.selectSingleNode("/root/_send/data1");
  1114. model.copyNode(destNode, param);
  1115. temptreatno = destNode.treatno.nodeValue;
  1116. tempdocucd = destNode.docucd.nodeValue;
  1117. treatno = temptreatno.split(",");
  1118. docucd = tempdocucd.split(",");
  1119. model.makeNode("/root/hidden/tempcharts");
  1120. counthidden = 1;
  1121. for (count = 1; count < treatno.length + 1; count++)
  1122. {
  1123. destNode.treatno.nodeValue = treatno[count - 1];
  1124. destNode.docucd.nodeValue = docucd[count - 1];
  1125. submit("TRMRC03102");
  1126. g_form_count[count - 1] = counthidden - 1;
  1127. countmain = 1;
  1128. while(model.getValue("/root/main/charts[" + countmain + "]/chrtpage") != null && model.getValue("/root/main/charts[" + countmain + "]/chrtpage") != "")
  1129. {
  1130. model.makeNode("/root/hidden/tempcharts[" + counthidden + "]");
  1131. model.copyNode("/root/hidden/tempcharts[" + counthidden + "]", "/root/main/charts[" + countmain + "]");
  1132. countmain++;
  1133. counthidden++;
  1134. }
  1135. g_form_count[count - 1] = counthidden - 1;
  1136. model.refresh();
  1137. }
  1138. model.removeNode("/root/main/charts");
  1139. model.makeNode("/root/main/charts");
  1140. for (count = 1; count <= counthidden; count++)
  1141. {
  1142. model.makeNode("root/main/charts[" + count + "]");
  1143. model.copyNode("root/main/charts[" + count + "]", "root/hidden/tempcharts[" + count + "]");
  1144. }
  1145. count = 1;
  1146. // 보여줄 페이지 수를 센다.
  1147. while(model.getValue("/root/main/charts[" + count + "]/chrtpage") != null && model.getValue("/root/main/charts[" + count + "]/chrtpage") != "")
  1148. {
  1149. count++;
  1150. }
  1151. model.makeNode("/root/_send/data1/pagetot");
  1152. model.setValue("/root/_send/data1/pagetot", count - 1);
  1153. model.setValue("/root/main/chartinfo/filetotal", model.getValue("/root/_send/data1/pagetot"));
  1154. // 만들었던 데이터 삭제
  1155. model.resetInstanceNode("/root/_send");
  1156. // 페이지 정보를 조정한다.
  1157. model.setValue("/root/main/chartinfo/pagecurrent", model.getValue("/root/main/chartInfo/pagetotal") != "0" ? "1" : "0");
  1158. model.refresh();
  1159. }
  1160. /**
  1161. * @group :
  1162. * @ver : 2007.05.21
  1163. * @by : 김재홍
  1164. * @---------------------------------------------------
  1165. * @type : function
  1166. * @access : public
  1167. * @desc : 토글 버튼 그룹에서 눌려져 있는 버튼 이름을 반환한다.
  1168. * @return :
  1169. * @---------------------------------------------------
  1170. */
  1171. function getToggleValue(group)
  1172. {
  1173. var node = instance1.selectSingleNode( getXPathToggleButton() );
  1174. var list = node.childNodes;
  1175. var total = list.length;
  1176. var name;
  1177. var i;
  1178. for(i = 0; i < total; i++)
  1179. {
  1180. name = list.item(i).nodeName;
  1181. if(toggleButton(name, "name") == group && toggleButton(name, "value") == "1")
  1182. {
  1183. return name;
  1184. }
  1185. }
  1186. return "";
  1187. }
  1188. /**
  1189. * @group :
  1190. * @ver : 2007.05.21
  1191. * @by : 김재홍
  1192. * @---------------------------------------------------
  1193. * @type : function
  1194. * @access : public
  1195. * @desc : 차트 파일을 받아올 폴더를 만들고 내용을 정리한다.
  1196. * @return :
  1197. * @---------------------------------------------------
  1198. */
  1199. function setupRecvPath(fso)
  1200. {
  1201. var pathRecv;
  1202. var path;
  1203. var curFolder;
  1204. var curFile;
  1205. // 개체에 이미지가 등록되어 있다면 해지한다.
  1206. objChartView.AutoRefresh = false;
  1207. objChartView.ChartRemove(0, 0);
  1208. objPageView.CurrentPage = 0;
  1209. objThumbView.ClearPage();
  1210. objChartView.AutoRefresh = true;
  1211. // 개체의 쓰레드가 종료될때 까지 기다린다.
  1212. while(objThumbView.IsThreadDone() == false);
  1213. path = fso.GetSpecialFolder(2) + "\\bitnixViewer\\";
  1214. pathRecv = fso.GetSpecialFolder(2) + "\\bitnixViewer\\CDIS\\";
  1215. // 차트를 다운받을 폴더가 없다면 만든다.
  1216. if( fso.FolderExists(path) == false)
  1217. {
  1218. fso.CreateFolder(path);
  1219. }
  1220. if( fso.FolderExists(pathRecv) == false)
  1221. {
  1222. fso.CreateFolder(pathRecv);
  1223. }
  1224. // 폴더안에 있는 모든 파일을 삭제한다.
  1225. curFolder = fso.GetFolder(pathRecv);
  1226. curFile = new Enumerator(curFolder.Files);
  1227. for(; !curFile.atEnd(); curFile.moveNext())
  1228. {
  1229. fso.DeleteFile(curFile.item().Path, true);
  1230. }
  1231. // 차트 폴더를 저장
  1232. model.setValue("/root/hidden/chartImageHome", pathRecv);
  1233. }
  1234. /**
  1235. * @group :
  1236. * @ver : 2007.05.21
  1237. * @by : 김재홍
  1238. * @---------------------------------------------------
  1239. * @type : function
  1240. * @access : public
  1241. * @desc : SFT서버에서 GetFiles()를 이용해서 파일을 받는다.
  1242. * @return :
  1243. * @---------------------------------------------------
  1244. */
  1245. function getFiles(host, port, user, pass, pathRemote, pathLocal)
  1246. {
  1247. var result;
  1248. objSFT.Host = host;
  1249. objSFT.Port = port;
  1250. objSFT.Account = user;
  1251. objSFT.Password = pass;
  1252. objSFT.Connect();
  1253. if(objSFT.IsOnline() == false) return false;
  1254. result = objSFT.GetFiles(pathRemote, pathLocal);
  1255. objSFT.Close();
  1256. return result;
  1257. }
  1258. /**
  1259. * @group :
  1260. * @ver : 2007.05.21
  1261. * @by : 김재홍
  1262. * @---------------------------------------------------
  1263. * @type : function
  1264. * @access : public
  1265. * @desc : 필요한 차트 파일을 SFT서버로 부터 다운로드 받는다.
  1266. * @return :
  1267. * @---------------------------------------------------
  1268. */
  1269. function downloadChart()
  1270. {
  1271. var fso;
  1272. var curAddr = "";
  1273. var curHost = "";
  1274. var curPort = "";
  1275. var xpathChart;
  1276. var pathRemote = "";
  1277. var pathLocal = "";
  1278. var pathSrc;
  1279. var pathDst;
  1280. var pageDemand;
  1281. var filename;
  1282. var pathname;
  1283. var rmad;
  1284. var rmpo;
  1285. var i;
  1286. var j;
  1287. fso = new ActiveXObject("Scripting.FileSystemObject");
  1288. // 차트 파일을 다운로드 받을 폴더를 준비한다.
  1289. setupRecvPath(fso);
  1290. var fileTotal = model.getValue("/root/main/chartinfo/filetotal");
  1291. var pathRecv = model.getValue("/root/hidden/chartImageHome");
  1292. if (fileTotal >= 1)
  1293. {
  1294. body.disabled = false;
  1295. pageDemand = 0;
  1296. for(i = 0; i < fileTotal; i++ )
  1297. {
  1298. // 작업할 차트 정보를 갖고 있는 xpath를 만든다.
  1299. xpathChart = getXPathChart(i + 1);
  1300. // 다운로드 받을 파일이 있는 서버 정보를 얻는다.
  1301. rmad = model.getValue(xpathChart + "/remtip");
  1302. rmpo = model.getValue(xpathChart + "/remtport");
  1303. // rmad가 비어 있다면 로컬 디스크 상에 파일이 있는걸로 간주한다.
  1304. if(rmad != "")
  1305. {
  1306. // 다운로드 받을 파일의 패스를 만든다.
  1307. filename = model.getValue(xpathChart + "/pageno");
  1308. pathname = "000" + filename;
  1309. pathSrc = model.getValue(xpathChart + "/remtpath") + "\\" + pathname.substr(pathname.length - 4, 4) + "\\" + filename + "." + model.getValue(xpathChart+ "/fileextn ");
  1310. pathDst = pathRecv + filename;
  1311. // 파일을 다운로드 받거나 패스 문자열을 만든다.
  1312. if(curAddr == rmad && curPort == rmpo)
  1313. {
  1314. // 이미 존재하는 내용이 있다면 연결 문자를 추가한다.
  1315. if( pathRemote.length != 0 )
  1316. {
  1317. // pathRemote = pathRemote + "|";
  1318. // pathLocal = pathLocal + "|";
  1319. pathRemote = pathRemote + splittxt;
  1320. pathLocal = pathLocal + splittxt;
  1321. }
  1322. // 받을 파일을 추가한다.
  1323. pathRemote = pathRemote + pathSrc;
  1324. pathLocal = pathLocal + pathDst;
  1325. }
  1326. else
  1327. {
  1328. // 필요하다면 파일을 다운로드 받는다.
  1329. if(pathRemote.length != 0 )
  1330. {
  1331. if(getFiles(curAddr, curPort, model.getValue(xpathChart+ "/remtuser"), model.getValue(xpathChart+ "/remtpwd"), pathRemote, pathLocal) == false) return false;
  1332. }
  1333. // 현재 상태를 초기화 한다.
  1334. pathRemote = pathSrc;
  1335. pathLocal = pathDst;
  1336. curAddr = rmad;
  1337. curPort = rmpo;
  1338. }
  1339. // 파일 패스와 페이지 번호 저장
  1340. g_path[pageDemand + 1] = pathDst;
  1341. g_page[pageDemand + 1] = 1;
  1342. g_page_lut[pageDemand + 1] = i + 1;
  1343. pageDemand += 1;
  1344. }
  1345. else
  1346. {
  1347. // 로컬 디스크에 파일이 있을경우 그 패스는 rmpt에 들어가 있게 된다.
  1348. // pageno에 보여질 이미지 파일의 파일 이름을 저장해 두게 된다.
  1349. // 원본과 복사본 파일 패스
  1350. filename = "local" + i + ".txt";
  1351. pathSrc = model.getValue(xpathChart + "/remtpath");
  1352. pathDst = pathRecv + filename;
  1353. // 파일 복사
  1354. fso.CopyFile(pathSrc, pathDst, true);
  1355. // 파일 이름을 pageno에 저장
  1356. model.setValue(xpathChart + "/pageno", filename);
  1357. // 파일 패스와 페이지 번호 저장
  1358. objPreview.Load(pathDst, 1);
  1359. for(j = 0; j < objPreview.TotalPage; j++)
  1360. {
  1361. g_path[pageDemand + 1] = pathDst;
  1362. g_page[pageDemand + 1] = j + 1;
  1363. g_page_lut[pageDemand + 1] = i + 1;
  1364. pageDemand += 1;
  1365. }
  1366. objPreview.ImageFilePath = "";
  1367. }
  1368. }
  1369. // 필요하다면 파일을 다운로드 받는다.
  1370. if( pathRemote.length != 0 )
  1371. {
  1372. if(getFiles(curAddr, curPort, model.getValue(xpathChart+ "/remtuser"), model.getValue(xpathChart+ "/remtpwd"), pathRemote, pathLocal) == false) return false;
  1373. }
  1374. // EMR 차트 append.
  1375. if (model.getValue("/root/main/emrpath") != null && model.getValue("/root/main/emrpath") != "")
  1376. {
  1377. pageDemand = appendEMRChart();
  1378. }
  1379. // 총 페이지 / 현재 페이지 저장
  1380. model.setValue("/root/main/chartinfo/pagecurrent", pageDemand == 0 ? 0 : 1);
  1381. model.setValue("/root/main/chartinfo/pagetotal", pageDemand);
  1382. model.refresh();
  1383. setupMoveButton();
  1384. return true;
  1385. }
  1386. else if (model.getValue("/root/main/emrpath") != null && model.getValue("/root/main/emrpath") != "")
  1387. {
  1388. pageDemand = appendEMRChart();
  1389. model.setValue("/root/main/chartinfo/pagecurrent", pageDemand == 1 ? 0 : 1);
  1390. model.setValue("/root/main/chartinfo/pagetotal", pageDemand);
  1391. model.refresh();
  1392. setupMoveButton();
  1393. return true;
  1394. }
  1395. else
  1396. {
  1397. alert("해당 데이터에 대한 이미지가 없습니다.");
  1398. setupChart("PageView");
  1399. body.disabled = true;
  1400. return false;
  1401. }
  1402. }
  1403. /**
  1404. * @group :
  1405. * @ver : 2007.05.21
  1406. * @by : 김재홍
  1407. * @---------------------------------------------------
  1408. * @type : function
  1409. * @access : public
  1410. * @desc : 필요한 차트 파일을 SFT서버로 부터 다운로드 받는다.
  1411. * @return :
  1412. * @---------------------------------------------------
  1413. */
  1414. function appendEMRChart()
  1415. {
  1416. var i, j;
  1417. var count = 0;
  1418. var emrTotalPath;
  1419. var emrPagePath;
  1420. var emrPageTotal;
  1421. var temp_path;
  1422. var temp_page;
  1423. var temp_page_lut;
  1424. var countform = 0;
  1425. var counttemp = 0;
  1426. temp_path = new Array();
  1427. temp_page = new Array();
  1428. temp_page_lut = new Array();
  1429. if (model.getValue("/root/main/emrpath") != null && model.getValue("/root/main/emrpath") != "")
  1430. {
  1431. emrTotalPath = model.getValue("/root/main/emrpath");
  1432. // emrPagePath = emrTotalPath.split("|");
  1433. emrPagePath = emrTotalPath.split(splittxt);
  1434. for (i = 1; i <= emrPagePath.length; i++)
  1435. {
  1436. if (emrPagePath[i - 1].substring(0, 1) == "*")
  1437. {
  1438. for (j = counttemp + 1; j <= g_form_count[countform]; j++)
  1439. {
  1440. temp_path[count + 1] = g_path[j];
  1441. temp_page[count + 1] = g_page[j];
  1442. temp_page_lut[count + 1] = g_page_lut[j];
  1443. count++;
  1444. }
  1445. countform++;
  1446. counttemp = g_form_count[countform - 1];
  1447. // for (j = 1; j < g_path.length; j++)
  1448. // {
  1449. // temp_path[count] = g_path[j];
  1450. // temp_page[count] = g_page[j];
  1451. // temp_page_lut[count] = g_page_lut[j];
  1452. // count = count + 1;
  1453. // }
  1454. }
  1455. else
  1456. {
  1457. temp_path[count + 1] = emrPagePath[i - 1];
  1458. temp_page[count + 1] = 1;
  1459. temp_page_lut[count + 1] = 1;
  1460. count++;
  1461. }
  1462. }
  1463. g_path = temp_path;
  1464. g_page = temp_page;
  1465. g_page_lut = temp_page_lut;
  1466. }
  1467. return count;
  1468. }
  1469. /**
  1470. * @group :
  1471. * @ver : 2007.05.21
  1472. * @by : 김재홍
  1473. * @---------------------------------------------------
  1474. * @type : function
  1475. * @access : public
  1476. * @desc : 다음 Chart를 가져온다.
  1477. * @return :
  1478. * @---------------------------------------------------
  1479. */
  1480. function fMoveNext()
  1481. {
  1482. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  1483. model.setValue("/root/main/chartinfo/pagecurrent", pageCurrent + 1);
  1484. setupMoveButton();
  1485. model.refresh();
  1486. setupChart();
  1487. }
  1488. /**
  1489. * @group :
  1490. * @ver : 2007.05.21
  1491. * @by : 김재홍
  1492. * @---------------------------------------------------
  1493. * @type : function
  1494. * @access : public
  1495. * @desc : 이전 Chart를 가져온다.
  1496. * @return :
  1497. * @---------------------------------------------------
  1498. */
  1499. function fMovePrev()
  1500. {
  1501. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  1502. model.setValue("/root/main/chartinfo/pagecurrent", pageCurrent - 1);
  1503. setupMoveButton();
  1504. model.refresh();
  1505. setupChart();
  1506. }
  1507. /**
  1508. * @group :
  1509. * @ver : 2007.05.21
  1510. * @by : 김재홍
  1511. * @---------------------------------------------------
  1512. * @type : function
  1513. * @access : public
  1514. * @desc : 마지막 Chart를 가져온다.
  1515. * @return :
  1516. * @---------------------------------------------------
  1517. */
  1518. function fMoveLast()
  1519. {
  1520. model.setValue("/root/main/chartinfo/pagecurrent", model.getValue("/root/main/chartinfo/pagetotal"));
  1521. setupMoveButton();
  1522. model.refresh();
  1523. setupChart();
  1524. }
  1525. /**
  1526. * @group :
  1527. * @ver : 2007.05.21
  1528. * @by : 김재홍
  1529. * @---------------------------------------------------
  1530. * @type : function
  1531. * @access : public
  1532. * @desc : 처음 Chart를 가져온다.
  1533. * @return :
  1534. * @---------------------------------------------------
  1535. */
  1536. function fMoveFirst()
  1537. {
  1538. model.setValue("/root/main/chartinfo/pagecurrent", "1");
  1539. setupMoveButton();
  1540. model.refresh();
  1541. setupChart();
  1542. }
  1543. /**
  1544. * @group :
  1545. * @ver : 2007.05.21
  1546. * @by : 김재홍
  1547. * @---------------------------------------------------
  1548. * @type : function
  1549. * @access : public
  1550. * @desc : 챠트 미리보기 시작
  1551. * @return :
  1552. * @---------------------------------------------------
  1553. */
  1554. function fShow_TruePreviewChart(Button, Shift, Index, Path, Page)
  1555. {
  1556. if(Button == 2)
  1557. {
  1558. objPreview.Load(Path, Page);
  1559. if(objPreview.CurrentPage != 0)
  1560. {
  1561. groupThumbView.attribute("visibility") = "hidden";
  1562. groupPreview.attribute("visibility") = "visible";
  1563. }
  1564. }
  1565. }
  1566. /**
  1567. * @group :
  1568. * @ver : 2007.05.21
  1569. * @by : 김재홍
  1570. * @---------------------------------------------------
  1571. * @type : function
  1572. * @access : public
  1573. * @desc : 챠트 미리보기를 종료
  1574. * @return :
  1575. * @---------------------------------------------------
  1576. */
  1577. function fShow_FalsePreviewChart(Button, Shift, x, y)
  1578. {
  1579. objPreview.CurrentPage = 0;
  1580. groupThumbView.attribute("visibility") = "visible";
  1581. groupPreview.attribute("visibility") = "hidden";
  1582. }
  1583. /**
  1584. * @group :
  1585. * @ver : 2007.05.21
  1586. * @by : 김재홍
  1587. * @---------------------------------------------------
  1588. * @type : function
  1589. * @access : public
  1590. * @desc : 뷰어의 크기를 설정
  1591. * @return :
  1592. * @---------------------------------------------------
  1593. */
  1594. function setChartViewerSize(newWidth, newHeight)
  1595. {
  1596. //var strChartToogleButton = new Array("btnChartMousePanning", "btnChartMouseMagnifyingGlass");
  1597. //var strPageToogleButton = new Array ("btnMoveFirst", "btnMoveLast", "btnMovePrev", "btnMoveNext", "btnFitActual", "btnFitBest", "btnFitWidth", "btnPageMouseNormal", "btnPageMouseRegionZoom", "btnPageMouseMagnifyingGlass", "btnPageMousePanning", "btnRotateLeft", "btnRotateRight", "btnZoomIn", "btnZoomOut");
  1598. var strSwitchButton = new Array("btnThumbView", "btnChartView", "btnPageView");
  1599. var strCase = new Array("swtViewModeCase1", "swViewModeCase2", "swViewModeCase3");
  1600. var strToolbar = new Array("recSwitchToolbar1", "recSwitchToolbar2", "recSwitchToolbar3");
  1601. var strActiveX = new Array("objPageView", "objChartView");
  1602. var obj;
  1603. var i;
  1604. var marginright = 2;
  1605. var marginbottom = 2;
  1606. var toolbarmargin = 3;
  1607. // 스위치 버튼 위치 조정
  1608. btnThumbView.attribute("left") = 0;
  1609. btnChartView.attribute("left") = parseInt(btnThumbView.attribute("left")) + parseInt(btnThumbView.attribute("width"));
  1610. btnPageView.attribute("left") = parseInt(btnChartView.attribute("left")) + parseInt(btnChartView.attribute("width"));
  1611. // 페이지 정보 위치 조정
  1612. captionPage.attribute("left") = newWidth - parseInt(captionPage.attribute("width")) - marginright;
  1613. optPageCurrent.attribute("left") = captionPage.attribute("left");
  1614. optPageTotal.attribute("left") = parseInt(captionPage.attribute("left")) + parseInt(captionPage.attribute("width")) - parseInt(optPageTotal.attribute("width"));
  1615. // SwitchView 크기, 위치 조정
  1616. switchView.attribute("left") = 0;
  1617. switchView.attribute("top") = parseInt(btnThumbView.attribute("top")) + parseInt(btnThumbView.attribute("height"));
  1618. switchView.attribute("width") = newWidth - marginright;
  1619. switchView.attribute("height") = newHeight - parseInt(switchView.attribute("top")) - marginbottom;
  1620. /*
  1621. // Case 크기, 위치 조정
  1622. for(i = 0; i < strCase.length; i++){
  1623. obj = document.controls.item(strCase[i]);
  1624. obj.attribute("left") = 0;
  1625. obj.attribute("top") = 0;
  1626. obj.attribute("width") = switchView.attribute("width");
  1627. obj.attribute("height") = switchView.attribute("height");
  1628. }
  1629. */
  1630. // 툴바 크기 조정
  1631. for(i = 0; i < strToolbar.length; i++){
  1632. obj = document.controls.item(strToolbar[i]);
  1633. obj.attribute("left") = 0;
  1634. obj.attribute("top") = toolbarmargin;
  1635. obj.attribute("width") = switchView.attribute("width") - marginright;
  1636. obj.attribute("height") = 36;
  1637. }
  1638. // 그룹 크기 조정
  1639. groupPreview.attribute("left") = 0;
  1640. groupPreview.attribute("top") = toolbarmargin + parseInt(recSwitchToolbar1.attribute("height")) + toolbarmargin;
  1641. groupPreview.attribute("width") = switchView.attribute("width") - marginright;
  1642. groupPreview.attribute("height") = parseInt(switchView.attribute("height")) - parseInt(groupPreview.attribute("top")) - marginbottom;
  1643. groupThumbView.attribute("left") = 0;
  1644. groupThumbView.attribute("top") = toolbarmargin + parseInt(recSwitchToolbar1.attribute("height")) + toolbarmargin;
  1645. groupThumbView.attribute("width") = switchView.attribute("width") - marginright;
  1646. groupThumbView.attribute("height") = parseInt(switchView.attribute("height")) - parseInt(groupThumbView.attribute("top")) - marginbottom;
  1647. // ActiveX 컨트롤 크기 조정
  1648. // ActiveX 컨트롤 중 "objPreview", "objThumbView" 는 각각의 그룹에 속함
  1649. obj = document.controls.item("objPreview");
  1650. obj.attribute("left") = 0;
  1651. obj.attribute("top") = 0;
  1652. obj.attribute("width") = groupPreview.attribute("width");
  1653. obj.attribute("height") = groupPreview.attribute("height");
  1654. obj = document.controls.item("objThumbView");
  1655. obj.attribute("left") = 0;
  1656. obj.attribute("top") = 0;
  1657. obj.attribute("width") = groupThumbView.attribute("width");
  1658. obj.attribute("height") = groupThumbView.attribute("height");
  1659. // "objPageView", "objChartView"
  1660. for(i = 0; i < strActiveX.length; i++){
  1661. obj = document.controls.item(strActiveX[i]);
  1662. obj.attribute("left") = 0;
  1663. obj.attribute("top") = toolbarmargin + parseInt(recSwitchToolbar1.attribute("height")) + toolbarmargin;
  1664. obj.attribute("width") = switchView.attribute("width") - marginright;
  1665. obj.attribute("height") = parseInt(switchView.attribute("height")) - parseInt(obj.attribute("top")) - marginbottom;
  1666. }
  1667. }
  1668. /**
  1669. * @group :
  1670. * @ver : 2007.05.21
  1671. * @by : 김재홍
  1672. * @---------------------------------------------------
  1673. * @type : function
  1674. * @access : public
  1675. * @desc : 뷰어를 임포트 영역에 FIT
  1676. * @return :
  1677. * @---------------------------------------------------
  1678. */
  1679. function fitToImportArea()
  1680. {
  1681. // 임포트 영역 크기 산출
  1682. // var strWidth = parseInt(window.parent.document.body.children("iviewerIemr").attribute("width"));
  1683. // var strHeight = parseInt(window.parent.document.body.children("iviewerIemr").attribute("height"));
  1684. var strWidth = parseInt(window.parent.document.controls("iviewerIemr").attribute("width"));
  1685. var strHeight = parseInt(window.parent.document.controls("iviewerIemr").attribute("height"));
  1686. setChartViewerSize(strWidth, strHeight);
  1687. body.attribute("pagewidth") = strWidth;
  1688. body.attribute("pageheight") = strHeight;
  1689. body.refresh();
  1690. }
  1691. /**
  1692. * @group :
  1693. * @ver : 2007.05.21
  1694. * @by : 김재홍
  1695. * @---------------------------------------------------
  1696. * @type : function
  1697. * @access : public
  1698. * @desc : 페이지 비교 화면을 호출한다.
  1699. * @return :
  1700. * @---------------------------------------------------
  1701. */
  1702. function comparePage(path)
  1703. {
  1704. model.setValue("/root/main/chartpath", path);
  1705. window.load("SPMRC03110.xrw", "modeless", "imgemrviewer", "", "/root/main/chartpath", "/root/main/chartpath");
  1706. }
  1707. /**
  1708. * @group :
  1709. * @ver : 2007.05.21
  1710. * @by : 김재홍
  1711. * @---------------------------------------------------
  1712. * @type : function
  1713. * @access : public
  1714. * @desc : 사본신청에 해당하는 값을 리턴한다.
  1715. * @return :
  1716. * @---------------------------------------------------
  1717. */
  1718. function setCopy(getValue)
  1719. {
  1720. var setValue = "";
  1721. var tempValue = "";
  1722. var count;
  1723. var valuecount = 0;
  1724. var tempcount = 1;
  1725. if (getValue == true)
  1726. {
  1727. switch(model.getValue("/root/hidden/currentViewMode"))
  1728. {
  1729. case "PageView":
  1730. alert("사본신청은 '여러페이지보기' 에서만 가능합니다.");
  1731. return setValue;
  1732. break;
  1733. case "ThumbView":
  1734. if(objThumbView.TotalSelectedThumbnail == 0)
  1735. {
  1736. alert("선택된 차트가 없습니다.");
  1737. return setValue;
  1738. }
  1739. else
  1740. {
  1741. for (count = 1; count <= objThumbView.TotalThumbnail; count++)
  1742. {
  1743. if (objThumbView.Select(count) == true)
  1744. {
  1745. if(objThumbView.ThumbUserText(count) == "" || objThumbView.ThumbUserText(count) == null)
  1746. {
  1747. //arrValue[valuecount] = "I" + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/ordno") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/docucd");
  1748. //valuecount = valuecount + 1;
  1749. if (tempValue != "I" + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/ordno") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/docucd") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/pagecnt"))
  1750. {
  1751. setValue = setValue + "I" + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/ordno") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/docucd") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/pagecnt") + "|";
  1752. tempValue = "I" + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/ordno") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/docucd") + "▦" + model.getValue("/root/main/charts[" + tempcount + "]/pagecnt");
  1753. }
  1754. }
  1755. else
  1756. {
  1757. //arrvalue[valuecount] = "e" + "▦" + objthumbview.thumbusertext(count);
  1758. //valuecount = valuecount + 1;
  1759. setValue = setValue + "E" + "▦" + objThumbView.ThumbUserText(count) + "|";
  1760. }
  1761. }
  1762. if(objThumbView.ThumbUserText(count) == "" || objThumbView.ThumbUserText(count) == null)
  1763. {
  1764. tempcount = tempcount + 1;
  1765. }
  1766. }
  1767. setValue = setValue.substr(0, setValue.length - 1);
  1768. // alert(setValue);
  1769. return setValue;
  1770. break;
  1771. }
  1772. case "ChartView":
  1773. alert("사본신청은 '여러페이지보기' 에서만 가능합니다.");
  1774. return setValue;
  1775. break;
  1776. }
  1777. }
  1778. else
  1779. {
  1780. return setValue;
  1781. }
  1782. }
  1783. /**
  1784. * @group :
  1785. * @ver : 2007.05.21
  1786. * @by : 김재홍
  1787. * @---------------------------------------------------
  1788. * @type : function
  1789. * @access : public
  1790. * @desc : 사용중인 팝업 뷰어화면을 닫지 않고 새로운 차트를 리로드 한다.
  1791. * @return :
  1792. * @---------------------------------------------------
  1793. */
  1794. function reloadChart(param)
  1795. {
  1796. var ViewMode;
  1797. // var destNode = instance1.selectSingleNode("/root/hidden/temp");
  1798. // model.copyNode(destNode, param);
  1799. // searchChart("/root/hidden/temp");
  1800. searchChart(param);
  1801. if (downloadChart() == true)
  1802. {
  1803. ViewMode = model.getValue("/root/hidden/currentViewMode");
  1804. if (ViewMode == null || ViewMode == "")
  1805. {
  1806. setupChart("ChartView");
  1807. }
  1808. else
  1809. {
  1810. setupChart(ViewMode);
  1811. }
  1812. }
  1813. }
  1814. /**
  1815. * @group :
  1816. * @ver : 2007.05.21
  1817. * @by : 김재홍
  1818. * @---------------------------------------------------
  1819. * @type : function
  1820. * @access : public
  1821. * @desc : IVIEWER에서 인스턴스 값 리셋.
  1822. * @return :
  1823. * @---------------------------------------------------
  1824. */
  1825. function resetInstance_EMR()
  1826. {
  1827. model.resetInstanceNode("/root/main/emrpath");
  1828. model.resetInstanceNode("/root/main/emrorddate");
  1829. model.resetInstanceNode("/root/main/emrformnm");
  1830. model.resetInstanceNode("/root/main/emrformcd");
  1831. model.resetInstanceNode("/root/main/emrdeptnm");
  1832. model.resetInstanceNode("/root/main/emrdeptcd");
  1833. model.resetInstanceNode("/root/main/emrpage");
  1834. model.resetInstanceNode("/root/main/emrhiddenmsg");
  1835. }
  1836. /**
  1837. * @group :
  1838. * @ver : 2007.05.21
  1839. * @by : 김재홍
  1840. * @---------------------------------------------------
  1841. * @type : function
  1842. * @access : public
  1843. * @desc : IVEWER에서 초기화 함수
  1844. * @return :
  1845. * @---------------------------------------------------
  1846. */
  1847. function cleanViewer()
  1848. {
  1849. // 사용하는 개체를 초기화 한다.
  1850. fSet_OCX_PageViewer();
  1851. fSet_OCX_ThumbViewer();
  1852. fSet_OCX_ChartViewer();
  1853. fSet_OCX_PreViewer();
  1854. model.setValue("/root/main/chartinfo/pagetotal", "0");
  1855. model.setValue("/root/main/chartinfo/pagecurrent", "0");
  1856. model.refresh();
  1857. // 모든 버튼 이미지를 설정한다.
  1858. setupAllButtons();
  1859. // 토글 버튼의 기본값 설정
  1860. processToggleButton("btnChartMouseNormal");
  1861. //processToggleButton("btnFitBest");
  1862. processToggleButton("btnPageMouseNormal");
  1863. // 페이지뷰의 페이지 이동 버튼 설정
  1864. setupMoveButton();
  1865. // 데이터 초기화
  1866. resetData();
  1867. // 뷰어를 IMPORT 된 크기로 FIT 시킨다.
  1868. // if(document.body.isChild("importIemr") == true)
  1869. if(window.type == "iviewer")
  1870. {
  1871. fitToImportArea();
  1872. }
  1873. // 썸네일 뷰어의 레이아웃 설정
  1874. objThumbView.SetThumbLayout(4, 3);
  1875. }
  1876. /**
  1877. * @group :
  1878. * @ver : 2007.05.21
  1879. * @by : 김재홍
  1880. * @---------------------------------------------------
  1881. * @type : function
  1882. * @access : public
  1883. * @desc : 이미지파일 다운로드
  1884. * @return :
  1885. * @---------------------------------------------------
  1886. */
  1887. function downloadFile()
  1888. {
  1889. var strpath = "";
  1890. var strfilename = "";
  1891. var fso;
  1892. var count;
  1893. fso = new ActiveXObject("Scripting.FileSystemObject");
  1894. if (objThumbView.TotalSelectedThumbnail == 0)
  1895. {
  1896. return;
  1897. }
  1898. strpath = window.folderDialog("Choose a folder to download Image");
  1899. if (strpath == "")
  1900. {
  1901. return;
  1902. }
  1903. for (count = 1; count <= objThumbView.TotalThumbnail; count++)
  1904. {
  1905. if (objThumbView.Select(count) == true)
  1906. {
  1907. strfilename = objThumbView.ThumbText(count);
  1908. strfilename = strfilename.setReplaceWord("/", "_")
  1909. fso.CopyFile(objThumbView.FileName(count), strpath + "/" + strfilename + "_" + count + ".jpg", true);
  1910. }
  1911. }
  1912. alert("다운로드 완료.");
  1913. }
  1914. /**
  1915. * @group :
  1916. * @ver : 2007.05.21
  1917. * @by : 김재홍
  1918. * @---------------------------------------------------
  1919. * @type : function
  1920. * @access : public
  1921. * @desc : 현재 보이는 차트를 출력한다.
  1922. * @return :
  1923. * @---------------------------------------------------
  1924. */
  1925. function printChart_SpoolCheck(docName, indexLast)
  1926. {
  1927. var strPage;
  1928. var strPage;
  1929. var strPrintLog;
  1930. var bFirstPage;
  1931. var nextPage;
  1932. var currPage;
  1933. // objBiAutoPrint.BIAPInitialize();
  1934. // g_printer_name = objBiAutoPrint.BIAPGetDefaultPrinter();
  1935. // objBiPrnDrv.StartCapture(g_printer_name, 2);
  1936. switch(model.getValue("/root/hidden/currentViewMode"))
  1937. {
  1938. case "PageView":
  1939. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  1940. if(pageCurrent > 0)
  1941. {
  1942. strPath = g_path[pageCurrent];
  1943. strPage = g_page[pageCurrent];
  1944. if (objBIP.StartDoc(docName) == false)
  1945. {
  1946. return false;
  1947. }
  1948. if (objBIP.PrintImage(g_path[pageCurrent], g_page[pageCurrent]) == false)
  1949. {
  1950. return false;
  1951. }
  1952. if (objBIP.EndDoc() == false)
  1953. {
  1954. return false;
  1955. }
  1956. // 출력 통보
  1957. model.setAttribute("sCMR_Param", printLog(pageCurrent));
  1958. }
  1959. else
  1960. {
  1961. alert("출력할 페이지가 없습니다.");
  1962. return false;
  1963. }
  1964. break;
  1965. case "ThumbView":
  1966. if(objThumbView.TotalSelectedThumbnail == 0)
  1967. {
  1968. alert("선택된 차트가 없습니다.");
  1969. return;
  1970. }
  1971. else
  1972. {
  1973. g_last_print_page = 0;
  1974. currPage = 0;
  1975. nextPage = objThumbView.TotalThumbnail;
  1976. for(i = objThumbView.TotalThumbnail; i >= 1; i--)
  1977. {
  1978. if (objThumbView.Select(i) == true)
  1979. {
  1980. g_last_select_page = i;
  1981. break;
  1982. }
  1983. }
  1984. if (objBIP.StartDoc(docName) == false)
  1985. {
  1986. return false;
  1987. }
  1988. bFirstPage = true;
  1989. strPrintLog = "";
  1990. for(i = indexLast + 1; i <= objThumbView.TotalThumbnail; i++)
  1991. {
  1992. if(objThumbView.Select(i) == true)
  1993. {
  1994. g_printed_page++;
  1995. if(bFirstPage == false)
  1996. {
  1997. if (objBIP.NewPage() == false)
  1998. {
  1999. return false;
  2000. }
  2001. strPrintLog += ",";
  2002. }
  2003. else
  2004. {
  2005. bFirstPage = false;
  2006. }
  2007. if (objBIP.PrintImage(objThumbView.FileName(i), objThumbView.Page(i)) == false)
  2008. {
  2009. return false;
  2010. }
  2011. strPrintLog += printLog(i);
  2012. currPage++;
  2013. if (currPage >= 50)
  2014. {
  2015. break;
  2016. }
  2017. }
  2018. }
  2019. if (objBIP.EndDoc() == false)
  2020. {
  2021. return false;
  2022. }
  2023. for(i; i <= objThumbView.TotalThumbnail; i++)
  2024. {
  2025. if (objThumbView.Select(i) == true)
  2026. {
  2027. nextPage = i;
  2028. break;
  2029. }
  2030. else
  2031. {
  2032. nextPage = i;
  2033. }
  2034. }
  2035. g_last_print_page = nextPage;
  2036. // alert("g_last_print_page/g_printed_page : " + g_last_print_page + "/" + g_printed_page);
  2037. model.setAttribute("sCMR_Param", strPrintLog);
  2038. if (g_last_select_page <= g_last_print_page)
  2039. {
  2040. break;
  2041. }
  2042. else
  2043. {
  2044. if (model.alert("현재까지 전체 " + objThumbView.TotalSelectedThumbnail + "중에서 " + g_printed_page + "장을 출력하였습니다." + "\n계속하려면 예를 누르고 중지하려면 아니오를 누르십시오.", "출력", 0x20 | 4) == 6)
  2045. {
  2046. printChart_SpoolCheck("출력", g_last_print_page);
  2047. }
  2048. else
  2049. {
  2050. alert("출력이 중지되었습니다.");
  2051. return false;
  2052. }
  2053. }
  2054. break;
  2055. }
  2056. case "ChartView":
  2057. alert("'연속보기' 에서는 출력할 수 없습니다.");
  2058. return false;
  2059. break;
  2060. }
  2061. return true;
  2062. }
  2063. /**
  2064. * @group :
  2065. * @ver : 2009-06-12 오후 3:24:11
  2066. * @by : 강지훈
  2067. * @---------------------------------------------------
  2068. * @type : function
  2069. * @access : public
  2070. * @desc : 이미지 - 기록 연동 저장
  2071. * @return :
  2072. * @---------------------------------------------------
  2073. */
  2074. function fixDownloadFile()
  2075. {
  2076. var strpath = "";
  2077. var strfilename = "";
  2078. var fso;
  2079. var count;
  2080. fso = new ActiveXObject("Scripting.FileSystemObject");
  2081. if (objThumbView.TotalSelectedThumbnail == 0)
  2082. {
  2083. return;
  2084. }
  2085. fExistFolder("C:\\CdisImage");
  2086. strpath = "C:\\CdisImage";
  2087. getCurrentDate() + getCurrentTime()
  2088. var curDate = getCurrentDate();
  2089. var curTime = getCurrentTime();
  2090. var pid = parent.model.getValue("/root/main/patinfo/patinfolist/pid");
  2091. for (count = 1; count <= objThumbView.TotalThumbnail; count++)
  2092. {
  2093. if (objThumbView.Select(count) == true)
  2094. {
  2095. strfilename = objThumbView.ThumbText(count);
  2096. //저장되는 파일형식 : 저장일_저장시간_환자번호_파일명
  2097. strfilename = curDate + "_" + curTime + "_" + pid + "_" + strfilename.setReplaceWord("/", "_");
  2098. var f = fso.GetFile(objThumbView.FileName(count));
  2099. if (f.size > 2048000){
  2100. messageBox(objThumbView.ThumbText(count) + " 파일 크기가 최대 크기인 2M를","E003");
  2101. }
  2102. else{
  2103. fso.CopyFile(objThumbView.FileName(count), strpath + "/" + strfilename + "_" + count + ".jpg", true);
  2104. }
  2105. }
  2106. }
  2107. messageBox("이미지 저장이 ","I002");
  2108. }
  2109. /* @group : 폴더 존재여부 파악
  2110. * @ver : 2009-06-12 오후 3:58:23
  2111. * @by : 강지훈
  2112. * @-----------------------------------
  2113. * @type : function
  2114. * @access : public
  2115. * @desc :
  2116. */
  2117. function fExistFolder(foldernm)
  2118. {
  2119. var fso, folder, s;
  2120. fso = new ActiveXObject("Scripting.FileSystemObject");
  2121. try
  2122. {
  2123. folder = fso.GetFolder(foldernm);
  2124. s = folder.DateCreated;
  2125. //alert(s);
  2126. if (s == "")
  2127. {
  2128. var a = fso.CreateFolder(foldernm);
  2129. }
  2130. else{
  2131. return;
  2132. }
  2133. }
  2134. catch (e)
  2135. {
  2136. var a = fso.CreateFolder(foldernm);
  2137. }
  2138. }
  2139. /* @group : Resize 화면
  2140. * @ver : 2010-01-27 오후 3:58:23
  2141. * @by : 전홍진
  2142. * @-----------------------------------
  2143. * @type : function
  2144. * @access : public
  2145. * @desc :
  2146. */
  2147. function fGetResize()
  2148. {
  2149. var windowwidth;
  2150. var windowheight;
  2151. var obj_TV , obj_CV , obj_PV ;
  2152. var objtop , m_width;
  2153. var path;
  2154. //groupPreview , objPreview , objChartView , objPageView
  2155. //switchView
  2156. //recSwitchToolbar1 ,2 ,3
  2157. windowwidth = parseInt(window.width);
  2158. windowheight = parseInt(window.height);
  2159. // alert("[" + windowwidth+ "]" + "[" + windowwidth+ "]");
  2160. obj_TV = document.controls.item("objPreview");
  2161. obj_TTV = document.controls.item("objThumbView");
  2162. obj_CV = document.controls.item("objChartView");
  2163. obj_PV = document.controls.item("objPageView");
  2164. objtop = 100;
  2165. m_width = 40;
  2166. obj_TTV.attribute("height") = windowheight - (objtop +20);
  2167. obj_TTV.attribute("width") = windowwidth - m_width;
  2168. // alert("obj_TTV[" + obj_TTV.attribute("height") + "]" + "[" + obj_TTV.attribute("width") + "]");
  2169. obj_TV.attribute("height") = windowheight - (objtop +20);
  2170. obj_TV.attribute("width") = windowwidth - m_width;
  2171. // alert("obj_TV[" + obj_TV.attribute("height") + "]" + "[" + obj_TV.attribute("width") + "]");
  2172. obj_CV.attribute("height") = windowheight - (objtop +20);
  2173. obj_CV.attribute("width") = windowwidth - m_width;
  2174. // alert("obj_CV[" + obj_CV.attribute("height") + "]" + "[" + obj_CV.attribute("width") + "]");
  2175. obj_PV.attribute("height") = windowheight - (objtop +20);
  2176. obj_PV.attribute("width") = windowwidth - m_width;
  2177. // alert("obj_PV[" + obj_PV.attribute("height") + "]" + "[" + obj_PV.attribute("width") + "]");
  2178. groupThumbView.attribute("height") = windowheight - objtop;
  2179. groupThumbView.attribute("width") = windowwidth - m_width;
  2180. groupPreview.attribute("height") = windowheight - objtop;
  2181. groupPreview.attribute("width") = windowwidth - m_width;
  2182. recSwitchToolbar1.attribute("width") = windowwidth - m_width;
  2183. recSwitchToolbar2.attribute("width") = windowwidth - m_width;
  2184. recSwitchToolbar3.attribute("width") = windowwidth - m_width;
  2185. swtViewModeCase1.attribute("width") = windowwidth - 30;
  2186. swViewModeCase2.attribute("width") = windowwidth - 30;
  2187. swViewModeCase3.attribute("width") = windowwidth - 30;
  2188. switchView.attribute("width") = windowwidth - 30;
  2189. switchView.attribute("height") = windowheight - objtop + 25;
  2190. //
  2191. //////////////////////////////////////////////////////////////////
  2192. // setChartViewerSize(windowwidth - 30, windowheight - objtop + 25);
  2193. switchView.refresh();
  2194. model.refresh();
  2195. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2196. }