SSMRC03130.js 81 KB

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