SSMRC03150.js 80 KB

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