SSMRC03300.js 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993
  1. /*
  2. - =======================================================================================
  3. Image EMR Viewer Program (SSMRC03300.js)
  4. - Version :
  5. 1) : Ver.1.00.00
  6. - =======================================================================================
  7. */
  8. //function subsizeinit(window) '각각의 obj 사이즈 조정
  9. //function menuinit() 'g_menu의 메뉴 visible 설정
  10. //function scanview_setupChart(ViewMode) '스캔 이미지 모드 설정
  11. //function scanview_setChartViewerSize 'import 사이즈 조정
  12. //function scanview_fInitilize
  13. //function scanview_resetPageRemove '뷰어에 띄운 이미지 클리어
  14. //function RefreshFalse 'AutoReflash = False
  15. //function RefreshTrue 'AutoReflash = True
  16. //function ClearChart 'PageRemove
  17. //function PvMovePage '페이지 이동 이벤트
  18. //function PvMousePage '마우스 이동 이벤트
  19. //function PvFit '쪽 맞춤
  20. //function PvTurn '페이지모드 이미지 회전
  21. //function TvTurn '썸네일모드 이미지 회전
  22. //function TVSelect '이미지 선택 /취소
  23. //function TVScreen '행 이미지 갯수 설정
  24. //function MouseUp
  25. //function ThumbnailClick_event '썸네일 모드 시 클릭 이벤트
  26. //function ImageClick_event '이미지 모드 시 클릭 이벤트
  27. //function ThumbnailDblClick_event '썸네일 모드 더블 클릭 이벤트
  28. //function ImageDblClick_event '이미지 모드 더블 클릭 이벤트
  29. //function openImageFileDialogs '로컬 파일 열기 창 활성화
  30. //function scanLoad '
  31. //function scanInsLoad '
  32. //function SelectLoadChart '파일 뷰어에 APPEND
  33. //function SelectInsLoadChart '파일 뷰어에 APPEND
  34. //function OcrScanInsert '불러 온 파일 T_SCAN에 INSERT
  35. //function LocalLoadPath
  36. //function LTPInit 'LTP 연결
  37. //function LTPClose 'LTP 연결해제
  38. //function LTPFileGet '파일 다운로드
  39. //function LTPFilePut '파일 전송
  40. //function LTPFilesGet '복수파일 다운로드
  41. //function LTPFilesPut '복수파일 전송
  42. //function getFiles 'LTP 연결 후 파일 가져오기
  43. //function getltpInfo 'LTP 정보 SELECT
  44. //function imgload 'T_SCAN의 파일 열기
  45. //function appendchart '
  46. //function downloadChart 'for문으로 getFiles
  47. //function DelScanImg 'T_SCAN 및 파일 삭제
  48. //function DelIndexImg 'CHARTPAGET PAGET DB 및 파일 삭제
  49. //function BlankPage '5kb미만 이미지 공백제거에 PageAppend
  50. //function IndexInsert '일반스캔 CHARTPAGT PAGET INSERT
  51. //function OcrIndexInsert 'OCR스캔 CHARTPAGT PAGET INSERT
  52. //function Scan '스캔
  53. //function scanInsert '???
  54. //function findIndex '그리드에서 like 찾기
  55. //function scanSetting '스캔설정 불러오기
  56. //function saveImageFileDialogs ' 이미지 로컬에 저장
  57. //function OcrImageLoad 'OCR 인식
  58. //function RefreshPaperList '???
  59. //function scansetting '왜 2개??
  60. //function DelLocalFolder '로컬 다운로드 임시 폴더 삭제
  61. //function copyfile '파일 복사
  62. //function Trash '복원에 필요 trash 폴더 임시 생성해서 파일 복사
  63. var gScanServer;
  64. var gScanPort;
  65. var gScanUser;
  66. var gScanRootPath;
  67. var gIndexServer;
  68. var gIndexPort;
  69. var gIndexUser;
  70. var gIndexRootPath;
  71. var subwidth = 1125;
  72. var subheight = 790;
  73. var subsplit = 10;
  74. var g_path;
  75. function subsizeinit(window)
  76. {
  77. window.attribute("visibility") = true;
  78. // window.attribute("left") = parseInt(g_menu.attribute("left")) +
  79. // parseInt(g_menu.attribute("width")) + subsplit;
  80. // window.attribute("top") = g_menu.attribute("top");
  81. window.attribute("left") = 1;
  82. window.attribute("top") = 30;
  83. window.attribute("width") = subwidth + 115;
  84. window.attribute("height") = subheight + 123;
  85. }
  86. function menuinit()
  87. {
  88. g_submain.visible = false;
  89. iv_ocr.visible = false;
  90. iv_scan.visible = false;
  91. iv_comp.visible = false;
  92. iv_etc.visible = false;
  93. g_Setting.visible = false;
  94. }
  95. function scanview_setupChart(ViewMode, opener)
  96. {
  97. switch(ViewMode)
  98. {
  99. case "TV":
  100. model.toggle("case1");
  101. model.setValue("/root/cond/rdo_viewmode", "TV");
  102. model.refresh();
  103. f_View.ViewMode = 2;
  104. // parent.model.setValue("/root/cond/viewmode", "tv");
  105. break;
  106. case "PV":
  107. model.toggle("case2");
  108. model.setValue("/root/cond/rdo_viewmode", "PV");
  109. model.refresh();
  110. f_View.ViewMode = 0;
  111. f_View.fitmode = 3;
  112. if(optPageCurrent.text == "" ){
  113. }
  114. else{
  115. f_View.PageCurrent = optPageCurrent.text;
  116. }
  117. // parent.model.setValue("/root/cond/viewmode", "pv");
  118. break;
  119. }
  120. }
  121. function scanview_setChartViewerSize(newWidth, newHeight, grpheight, grptop)
  122. {
  123. var obj;
  124. var obj2;
  125. obj2 = document.body;
  126. obj2.attribute("width") = newWidth;
  127. obj2.attribute("height") = newHeight;
  128. group1.attribute("top") =3;
  129. group1.attribute("left") =3;
  130. group1.attribute("height") = grpheight;
  131. group1.attribute("width") = obj2.attribute("width")- 6;
  132. obj = document.controls.item("f_View");
  133. obj.attribute("left") = 3;
  134. obj.attribute("top") = grptop ;
  135. obj.attribute("width") = obj2.attribute("width") - 6;
  136. obj.attribute("height") = obj2.attribute("height") - group1.attribute("height") - 9;
  137. f_View.ViewMode = 1;
  138. }
  139. function scanview_fInitilize()
  140. {
  141. g_path == new Array();
  142. // 보기 방법의 기본값 설정
  143. // 기본 폼 디자인에서 "TV"로 설정 되어 있기 때문
  144. scanview_setupChart("TV");
  145. // 데이터 초기화
  146. scanview_resetPageRemove();
  147. // 썸네일 뷰어의 레이아웃 설정
  148. // TVScreen(4);
  149. }
  150. function scanview_resetPageRemove()
  151. {
  152. // 개체에 이미지가 등록되어 있다면 해지한다.
  153. RefreshFalse();
  154. ClearChart();
  155. RefreshTrue();
  156. /*
  157. * model.removeNode("/root/hidden/tempcharts");
  158. * model.removeNode("/root/main/charts"); model.refresh();
  159. */
  160. }
  161. function RefreshFalse()
  162. {
  163. f_View.AutoRefresh = false;
  164. }
  165. function RefreshTrue()
  166. {
  167. f_View.AutoRefresh = true;
  168. }
  169. function ClearChart()
  170. {
  171. f_View.pageremove(0,0);
  172. // scanview_setupChart("TV");
  173. }
  174. function PvMovePage(Mode)
  175. {
  176. switch(Mode)
  177. {
  178. case "first":
  179. f_View.PageCurrent = 1;
  180. f_View.actionsingle = 2;
  181. f_View.fitmode = 3;
  182. model.refresh();
  183. break;
  184. case "prev":
  185. f_View.actionsingle = 4;
  186. f_View.fitmode = 3;
  187. break;
  188. case "next":
  189. f_View.actionsingle = 5;
  190. f_View.fitmode = 3;
  191. break;
  192. case "last":
  193. f_View.PageCurrent = f_View.pagetotal;
  194. f_View.actionsingle = 3;
  195. f_View.fitmode = 3;
  196. model.refresh();
  197. }
  198. }
  199. function PvMousePage(Mode)
  200. {
  201. switch(Mode)
  202. {
  203. case "normal":
  204. f_View.actionsingle =0;
  205. break;
  206. case "panning":
  207. f_View.actionsingle = 21;
  208. break;
  209. case "zoom":
  210. f_View.actionsingle = 22;
  211. break;
  212. case "regionzoom":
  213. f_View.actionsingle = 23;
  214. break;
  215. }
  216. }
  217. function PvFit()
  218. {
  219. f_View.fitmode = 3;
  220. }
  221. function PvTurn(Mode)
  222. {
  223. switch(Mode)
  224. {
  225. case "left":
  226. f_View.actionsingle = 7;
  227. f_View.ThumbnailSelect(f_View.PageCurrent, true);
  228. f_View.actionthumbnail = 12;
  229. f_View.actionthumbnail = 3;
  230. break;
  231. case "right":
  232. f_View.actionsingle = 6;
  233. f_View.ThumbnailSelect(f_View.PageCurrent, true);
  234. f_View.actionthumbnail = 11;
  235. f_View.actionthumbnail = 3;
  236. break;
  237. case "180":
  238. f_View.actionsingle = 8;
  239. f_View.ThumbnailSelect(f_View.PageCurrent, true);
  240. f_View.actionthumbnail = 13;
  241. f_View.actionthumbnail = 3;
  242. break;
  243. }
  244. }
  245. function TvTurn(Mode)
  246. {
  247. switch(Mode)
  248. {
  249. case "left":
  250. f_View.actionthumbnail = 12;
  251. break;
  252. case "right":
  253. f_View.actionthumbnail = 11;
  254. break;
  255. case "180":
  256. f_View.actionthumbnail = 13;
  257. break;
  258. }
  259. // TVSelect("none")
  260. }
  261. function TVSelect(Mode)
  262. {
  263. switch(Mode)
  264. {
  265. case "all":
  266. f_View.actionthumbnail = 2;
  267. break;
  268. case "none":
  269. f_View.actionthumbnail = 3;
  270. break;
  271. }
  272. }
  273. function TVScreen(Mode)
  274. {
  275. var obj
  276. obj = document.controls.item("f_View");
  277. // 정보를 구하지 못함
  278. switch(Mode)
  279. {
  280. case "1":
  281. // f_View.thumbnailwidth = (obj.attribute("width") - 30) / 2 ;
  282. f_View.thumbnailwidth = (obj.attribute("width") - 120);
  283. f_View.thumbnailheight = f_View.thumbnailwidth * 1.41 ;
  284. f_View.focus;
  285. break;
  286. case "2":
  287. f_View.thumbnailwidth = (obj.attribute("width") - 80) / 2 ;
  288. f_View.thumbnailheight = f_View.thumbnailwidth * 1.41 ;
  289. f_View.focus;
  290. break;
  291. case "3":
  292. f_View.thumbnailwidth = (obj.attribute("width") - 105) / 3;
  293. f_View.thumbnailheight = f_View.thumbnailwidth * 1.41;
  294. break;
  295. case "4":
  296. f_View.thumbnailwidth = (obj.attribute("width") - 110) / 4;
  297. f_View.thumbnailheight = f_View.thumbnailwidth * 1.41;
  298. break;
  299. case "5":
  300. f_View.thumbnailwidth = (obj.attribute("width") - 150) / 5;
  301. f_View.thumbnailheight = f_View.thumbnailwidth * 1.41;
  302. break;
  303. case "6":
  304. f_View.thumbnailwidth = (obj.attribute("width") - 170) / 6;
  305. f_View.thumbnailheight = f_View.thumbnailwidth * 1.41;
  306. break;
  307. }
  308. }
  309. function MouseUp(mode)
  310. {
  311. if(model.getValue("/root/cond/rdo_viewmode") == "TV")
  312. {
  313. // f_View.ViewMode = 2;
  314. }
  315. var obj;
  316. if (mode == "blank")
  317. {
  318. obj = document.controls.item("f_preview");
  319. obj.attribute("visibility") = "hidden";
  320. f_preview.PageRemove(0,0);
  321. }
  322. else
  323. {
  324. obj = parent.document.controls.item("f_preview");
  325. obj.attribute("visibility") = "hidden";
  326. parent.f_preview.PageRemove(0,0);
  327. }
  328. }
  329. function ThumbnailClick_event(fv, page, shift, button, x, y, fv_temp, type, mode)
  330. {
  331. var LocalPath;
  332. var RemotePath;
  333. var fso = new ActiveXObject("Scripting.FileSystemObject");
  334. var scanSaveData = "status▦fileno▦page▦instcd▩";
  335. var indexSaveData = "status▦pageno▦page▦instcd▩";
  336. var indexinfo;
  337. var patno = "undo";
  338. TrashFolder()
  339. if (page == 0)
  340. {
  341. }
  342. else
  343. {
  344. if(button == 1)
  345. {
  346. if(shift == 1)
  347. {
  348. var i = 0;
  349. var first = 0;
  350. var last = page;
  351. var count = 0;
  352. for(i=1; i <= fv.PageTotal; i++)
  353. {
  354. if(fv.ThumbnailSelect(i) == true)
  355. {
  356. if(first == 0)
  357. {
  358. first = i;
  359. }
  360. }
  361. }
  362. if(page >= first)
  363. {
  364. count = last - first;
  365. for(i=1; i <= count; i++)
  366. {
  367. fv.ThumbnailSelect(first + i, true);
  368. }
  369. }
  370. else
  371. {
  372. count = first - last;
  373. for(i=0; i <= count; i++)
  374. {
  375. fv.ThumbnailSelect(last + i, true);
  376. }
  377. }
  378. }
  379. else if (shift == 0)
  380. {
  381. if(fv.ThumbnailSelect(page) == false)
  382. {
  383. fv.ThumbnailSelect(page, true);
  384. // 현재 페이지 입력
  385. model.setValue("/root/main/chartinfo/pagecurrent", page);
  386. model.refresh();
  387. }
  388. else
  389. {
  390. fv.ThumbnailSelect(page,false);
  391. }
  392. }
  393. else if (shift == 2)
  394. {
  395. // 스캔이미지 위치 바꾸기
  396. var Imageno = new Array(fv.PageTotal - 1);
  397. var cnt = 0;
  398. var i = 0;
  399. fv_preview.ViewMode = 2;
  400. fv_preview.PageRemove(0,0);
  401. if(page == 0)
  402. {
  403. for(i=fv.PageTotal; i >= 1; i--)
  404. {
  405. if(fv.ThumbnailSelect(i) == true)
  406. {
  407. fv.PageAppend(fv.PageFilePath(i), 1, 1);
  408. fv.PageCurrent = 1;
  409. fv.PageHiddenText(fv_temp.PageTotal) = fv.PageHiddenText(i);
  410. fv.PageRemove(i, i);
  411. }
  412. }
  413. for(i=fv_preview.PageTotal; i >= 1; i--)
  414. {
  415. fv.PageAppend(fv_preview.PageFilePath(i), 1, 1);
  416. fv.PageCurrent = 1;
  417. fv.PageHiddenText(fv.PageTotal) = fv.PageHiddenText(i);
  418. }
  419. }
  420. else
  421. {
  422. cnt = page;
  423. for(i=fv.PageTotal; i >= 1; i--)
  424. {
  425. if(fv.ThumbnailSelect(i) == true)
  426. {
  427. fv_temp.PageAppend(fv.PageFilePath(i), 1, 1);
  428. fv_temp.PageCurrent = 1;
  429. fv_temp.PageHiddenText(fv_temp.PageTotal) = fv.PageHiddenText(i);
  430. fv.PageRemove(i, i);
  431. if(cnt > i)
  432. {
  433. cnt = cnt - 1;
  434. }
  435. }
  436. }
  437. for(i=fv_temp.PageTotal ; i >= 1 ; i--)
  438. {
  439. fv.PageInsert(cnt, fv_temp.PageFilePath(i), 1, 1);
  440. fv.PageCurrent = i;
  441. fv.PageHiddenText(cnt) = fv_temp.PageHiddenText(i);
  442. }
  443. }
  444. for(i=1; i<=fv.PageTotal; i++)
  445. {
  446. // Imageno[i] = fv.PageFilePath(i);
  447. fv.PageText(i, i)
  448. // page insert
  449. if (type == "index")
  450. {
  451. indexSaveData += "d▦" + fso.GetBaseName(fv.PageHiddenText(i)) + "▦" + i + "▦" + parent.parent.model.getValue("/root/user/instcd") + "▩";
  452. /*
  453. * model.setValue("/root/send/paget/pageno",
  454. * fso.GetBaseName(fv.PageHiddenText(i)));
  455. * model.setValue("/root/send/paget/treatno",
  456. * parent.model.getValue("/root/send/chartpaget/treatno"));
  457. * model.setValue("/root/send/paget/formcode",
  458. * parent.model.getValue("/root/send/chartpaget/formcode"));
  459. * model.setValue("/root/send/paget/page", i);
  460. * model.setValue("/root/send/paget/instcd",
  461. * parent.parent.model.getValue("/root/user/instcd"));
  462. *
  463. * model.refresh();
  464. */
  465. }
  466. else if (type == "scan")
  467. {
  468. scanSaveData += "d▦" + fv.PageHiddenText(i) + "▦" + i + "▦" + parent.parent.model.getValue("/root/user/instcd") + "▩";
  469. /*
  470. * model.setValue("/root/send/scaninfo/fileno",
  471. * fv.PageHiddenText(i));
  472. * model.setValue("/root/send/scaninfo/page", i);
  473. * model.setValue("/root/send/scaninfo/instcd",
  474. * parent.parent.model.getValue("/root/user/instcd"));
  475. *
  476. * model.refresh();
  477. */
  478. }
  479. }
  480. if (type == "index")
  481. {
  482. model.setValue("/root/send/paget/pageno", indexSaveData);
  483. submit("TXMPL03322");
  484. }
  485. else if (type == "scan")
  486. {
  487. model.setValue("/root/send/scaninfo/fileno", scanSaveData);
  488. submit("TXMPL03323");
  489. }
  490. fv_preview.PageRemove(0,0);
  491. fv_preview.ViewMode = 0;
  492. }
  493. else if (shift == 3)
  494. {
  495. // 흰색으로 채우기 CTRL + SHFIT + M(L)
  496. copyfile(fv.PageFilePath(page), page, "R")
  497. fv.PageCurrent = page;
  498. fv.ActionParamINT1 = x;
  499. fv.ActionParamINT2 = y;
  500. fv.ActionParamINT3 = 16777215;
  501. fv.ActionParamINT4 = 10;
  502. fv.ActionSingle = 20;
  503. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  504. fv.ActionParamINT1 = page;
  505. fv.ActionThumbnail = 1;
  506. // alert("흰색채우기");
  507. // 로컬 -> 서버 FilePut
  508. LocalPath = fv.PageFilePath(page);
  509. RemotePath = fv.PageHiddenText(page);
  510. LTPFilePut(RemotePath, LocalPath);
  511. }
  512. else if (shift == 4)
  513. {
  514. // 잘라내기 ALT + M(L)
  515. copyfile(fv.PageFilePath(page), page, "R")
  516. fv.PageCurrent = page;
  517. /*
  518. * if (y < (fv.PageHeight / 2) && x < (fv.PageWidth / 2)) {
  519. * fv.ActionParamINT1 = x; fv.ActionParamINT2 = y;
  520. * fv.ActionParamINT3 = fv.PageWidth - 1; fv.ActionParamINT4 =
  521. * fv.PageHeight - 1; } else if (y > (fv.PageHeight / 2) && x >
  522. * (fv.PageWidth / 2)) { fv.ActionParamINT1 = 0;
  523. * fv.ActionParamINT2 = 0; fv.ActionParamINT3 = x;
  524. * fv.ActionParamINT4 = y; } else if (y > (fv.PageHeight / 2) &&
  525. * x < (fv.PageWidth / 2)) { fv.ActionParamINT1 = x;
  526. * fv.ActionParamINT2 = 0; fv.ActionParamINT3 = fv.PageWidth -
  527. * 1; fv.ActionParamINT4 = y; } else if (y < (fv.PageHeight / 2) &&
  528. * x > (fv.PageWidth / 2)) { fv.ActionParamINT1 = 0;
  529. * fv.ActionParamINT2 = y; fv.ActionParamINT3 = x;
  530. * fv.ActionParamINT4 = PageHeight - 1; }
  531. */
  532. if (y > (fv.PageHeight / 2) && x > (fv.PageWidth / 2))
  533. {
  534. fv.ActionParamINT1 = 0;
  535. fv.ActionParamINT2 = 0;
  536. fv.ActionParamINT3 = x;
  537. fv.ActionParamINT4 = y;
  538. }
  539. else if (y < (fv.PageHeight / 2) && x > (fv.PageWidth / 2))
  540. {
  541. fv.ActionParamINT1 = 0;
  542. fv.ActionParamINT2 = y;
  543. fv.ActionParamINT3 = x;
  544. fv.ActionParamINT4 = PageHeight - 1;
  545. }
  546. copyfile(fv.PageFilePath(page), page, "R")
  547. // fv.ActionSingle = 10;
  548. fv.ActionParamINT1 = 16777215;
  549. fv.ActionSingle = 16;
  550. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  551. fv.ActionParamINT1 = page;
  552. fv.ActionThumbnail = 1;
  553. // 로컬 -> 서버 FilePut
  554. LocalPath = fv.PageFilePath(page);
  555. RemotePath = fv.PageHiddenText(page);
  556. LTPFilePut(RemotePath, LocalPath);
  557. }
  558. }
  559. else if(button == 2)
  560. {
  561. if(shift == 0)
  562. {
  563. if(page == 0 )
  564. {
  565. }
  566. else
  567. {
  568. if (mode != "blank")
  569. {
  570. var obj;
  571. obj = parent.document.controls.item("f_preview");
  572. // parent.f_preview.PageRemove(1,1);
  573. obj.attribute("visibility") = "";
  574. parent.f_preview.pageappend(fv.PageFilePath(page),1,1)
  575. parent.f_preview.PageCurrent = page;
  576. parent.f_preview.fitmode = 3;
  577. obj.attribute("visibility") = "";
  578. // fv.ViewMode = 0;
  579. // fv.BestFit;
  580. // fv.PageCurrent = page;
  581. }
  582. }
  583. }
  584. else if(shift == 1)
  585. {
  586. // alert("shift1");
  587. }
  588. else if(shift == 2)
  589. {
  590. // 텍스트 입력 CTRL + M(R)
  591. copyfile(fv.PageFilePath(page), page, "R")
  592. fv.ActionSingle = 10;
  593. fv.PageCurrent = page;
  594. fv.ActionParamINT1 = page;
  595. fv.DrawString(x, y, parent.rgb(0, 0, 0), parent.rgb(255, 255, 255), cbo_imgstate.value, "굴림체", 20, true, false, false, false);
  596. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  597. fv.ActionParamINT1 = page;
  598. fv.ActionThumbnail = 1;
  599. LocalPath = fv.PageFilePath(page);
  600. RemotePath = fv.PageHiddenText(page);
  601. LTPFilePut(RemotePath, LocalPath);
  602. }
  603. else if(shift == 3)
  604. {
  605. // 기울기 보정
  606. // alert("R shift == 3");
  607. copyfile(fv.PageFilePath(page), page, "R")
  608. Deskew(fv, page)
  609. // 로컬 -> 서버 FilePut
  610. LocalPath = fv.PageFilePath(page);
  611. RemotePath = fv.PageHiddenText(page);
  612. LTPFilePut(RemotePath, LocalPath);
  613. }
  614. else if(shift == 4)
  615. {
  616. // 가로로 자르기 ALT + M(R)
  617. copyfile(fv.PageFilePath(page), page, "R")
  618. fv.PageCurrent = page;
  619. if(y < (fv.PageHeight / 2))
  620. {
  621. fv.ActionParamINT1 = 0;
  622. fv.ActionParamINT2 = y;
  623. fv.ActionParamINT3 = fv.PageWidth - 1;
  624. fv.ActionParamINT4 = fv.PageHeight - 1;
  625. }
  626. else if(y > (fv.PageHeight / 2))
  627. {
  628. fv.ActionParamINT1 = 0;
  629. fv.ActionParamINT2 = 0;
  630. fv.ActionParamINT3 = fv.PageWidth - 1;
  631. fv.ActionParamINT4 = y;
  632. }
  633. fv.ActionSingle = 10;
  634. fv.ActionParamINT1 = 16777215;
  635. fv.ActionSingle = 16;
  636. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  637. fv.ActionParamINT1 = page;
  638. fv.ActionThumbnail = 1;
  639. // 로컬 -> 서버 FilePut
  640. LocalPath = fv.PageFilePath(page);
  641. RemotePath = fv.PageHiddenText(page);
  642. LTPFilePut(RemotePath, LocalPath);
  643. }
  644. }
  645. }
  646. }
  647. function ImageClick_event(fv, page, shift, button, x, y, fv_temp, type )
  648. {
  649. var LocalPath;
  650. var RemotePath;
  651. var fso = new ActiveXObject("Scripting.FileSystemObject");
  652. var scanSaveData = "status▦fileno▦page▦instcd▩";
  653. var indexSaveData = "status▦pageno▦page▦instcd▩";
  654. var indexinfo;
  655. TrashFolder()
  656. if(button == 1)
  657. {
  658. if(shift == 0)
  659. {
  660. }
  661. else if (shift == 3)
  662. {
  663. // 흰색으로 채우기 CTRL + SHFIT + M(L)
  664. copyfile(fv.PageFilePath(page), page, "R")
  665. fv.PageCurrent = page;
  666. fv.ActionParamINT1 = x;
  667. fv.ActionParamINT2 = y;
  668. fv.ActionParamINT3 = 16777215;
  669. fv.ActionParamINT4 = 10;
  670. fv.ActionSingle = 20;
  671. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  672. fv.ActionParamINT1 = page;
  673. fv.ActionThumbnail = 1;
  674. // alert("흰색채우기");
  675. // 로컬 -> 서버 FilePut
  676. LocalPath = fv.PageFilePath(page);
  677. RemotePath = fv.PageHiddenText(page);
  678. LTPFilePut(RemotePath, LocalPath);
  679. }
  680. }
  681. else if (button == 2)
  682. {
  683. // f_View.fitmode = 3;
  684. if(shift == 0)
  685. {
  686. if(page == 0 )
  687. {
  688. }
  689. else
  690. {
  691. parent.f_preview.pageappend(fv.PageFilePath(page),1,1)
  692. parent.f_preview.PageCurrent = page;
  693. var obj;
  694. obj = parent.document.controls.item("f_preview");
  695. obj.attribute("visibility") = "";
  696. // fv.ViewMode = 0;
  697. // fv.BestFit;
  698. // fv.PageCurrent = page;
  699. }
  700. }
  701. else if(shift == 2)
  702. {
  703. // 텍스트 입력 CTRL + M(R)
  704. copyfile(fv.PageFilePath(page), page, "R")
  705. fv.ActionSingle = 10;
  706. fv.PageCurrent = page;
  707. fv.ActionParamINT1 = page;
  708. fv.DrawString(x, y, parent.rgb(0, 0, 0), parent.rgb(255, 255, 255), cbo_imgstate.value, "굴림체", 20, true, false, false, false);
  709. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  710. fv.ActionParamINT1 = page;
  711. fv.ActionThumbnail = 1;
  712. LocalPath = fv.PageFilePath(page);
  713. RemotePath = fv.PageHiddenText(page);
  714. LTPFilePut(RemotePath, LocalPath);
  715. }
  716. else if(shift == 4)
  717. {
  718. // 가로로 자르기 ALT + M(R)
  719. copyfile(fv.PageFilePath(page), page, "R")
  720. fv.PageCurrent = page;
  721. if(y < (fv.PageHeight / 2))
  722. {
  723. fv.ActionParamINT1 = 0;
  724. fv.ActionParamINT2 = y;
  725. fv.ActionParamINT3 = fv.PageWidth - 1;
  726. fv.ActionParamINT4 = fv.PageHeight - 1;
  727. }
  728. else if(y > (fv.PageHeight / 2))
  729. {
  730. fv.ActionParamINT1 = 0;
  731. fv.ActionParamINT2 = 0;
  732. fv.ActionParamINT3 = fv.PageWidth - 1;
  733. fv.ActionParamINT4 = y;
  734. }
  735. fv.ActionSingle = 10;
  736. fv.ActionParamINT1 = 16777215;
  737. fv.ActionSingle = 16;
  738. fv.FileSaveCreate(fv.PageFilePath(page), -1);
  739. fv.ActionParamINT1 = page;
  740. fv.ActionThumbnail = 1;
  741. // 로컬 -> 서버 FilePut
  742. LocalPath = fv.PageFilePath(page);
  743. RemotePath = fv.PageHiddenText(page);
  744. LTPFilePut(RemotePath, LocalPath);
  745. }
  746. }
  747. }
  748. function ThumbnailDblClick_event(page)
  749. {
  750. scanview_setupChart("PV");
  751. f_View.PageCurrent = page;
  752. }
  753. function ImageDblClick_event(page)
  754. { selectpage
  755. scanview_setupChart("TV");
  756. f_View.actionparamint1 = page;
  757. f_View.actionnail = 10;
  758. }
  759. function LocalLoadPath(filePath)
  760. {
  761. var filePath;
  762. filePath = g_path[filePath.length]
  763. }
  764. function openImageFileDialogs() {
  765. var file = window.fileDialog("open","|",true,"","","All Files (*.*)|*.*|JPEG Files(*.jpg)|*.jpg|TIFF Files(*.tif)|*.tif");
  766. return file;
  767. }
  768. function scanLoad(file) {
  769. // RefreshFalse();
  770. // ClearChart();
  771. SelectLoadChart(file);
  772. // scanview_setupChart("TV");
  773. // RefreshTrue();
  774. }
  775. function scanInsLoad(file, page) {
  776. RefreshFalse();
  777. // ClearChart();
  778. SelectInsLoadChart(file, page);
  779. scanview_setupChart("TV");
  780. RefreshTrue();
  781. }
  782. function SelectLoadChart(files)
  783. {
  784. var l_files;
  785. var i = 0;
  786. var filename;
  787. var addpage;
  788. var fso = new ActiveXObject("Scripting.FileSystemObject");
  789. var file;
  790. var scancolor;
  791. var scanfolder = fso.GetSpecialFolder(2) + "\\LCViewer";
  792. var dfile;
  793. var bPage;
  794. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer\\") == false)
  795. {
  796. fso.CreateFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\");
  797. }
  798. if (files == "")
  799. {
  800. return false;
  801. }
  802. else
  803. {
  804. l_files = files.split("|");
  805. // f_View.AutoRefresh = false;
  806. for(i=0 ; i <= l_files.length -1 ; i++)
  807. {
  808. scancolor = fso.GetExtensionName(l_files[i]);
  809. file = scanfolder + "\\" + getTime() + getMilliseconds() + "." + scancolor;
  810. dfile = fso.GetFile(l_files[i]);
  811. dfile.Copy(fso.GetSpecialFolder(2) + "\\LCViewer\\" + fso.GetFileName(file));
  812. f_View.pageappend(file,1,1);
  813. f_View.ActionParamINT1 = f_View.PageTotal;
  814. f_View.ActionThumbnail = 10;
  815. f_View.PageCurrent = f_View.PageTotal;
  816. f_View.ActionSingle = 3;
  817. // f_View.PageText(i) = (f_View.PageTotal, f_View.PageTotal);
  818. /*
  819. * switch(parent.model.getValue("/root/send/rotate/front")) { case
  820. * "Front90": f_View.actionsingle = 6; break; case "Front270":
  821. * f_View.actionsingle = 7; break; case "Front180":
  822. * f_View.actionsingle = 8; break; }
  823. * f_View.FileSaveCreate(l_files[i], -1);
  824. */
  825. }
  826. // f_View.AutoRefresh = true;
  827. }
  828. }
  829. function SelectInsLoadChart(files, page)
  830. {
  831. var l_files;
  832. var i = 0;
  833. var filename;
  834. if (files == "")
  835. {
  836. return false;
  837. }
  838. else
  839. {
  840. l_files = files.split("|");
  841. f_View.AutoRefresh = false;
  842. for(i=0 ; i <= l_files.length -1 ; i++)
  843. {
  844. f_View.PageInsert(page, l_files[i],1,1);
  845. f_View.PageHiddenText(i) = l_files[i]
  846. }
  847. f_View.AutoRefresh = true;
  848. }
  849. }
  850. function OcrScanInsert(file, blk) {
  851. var l_file;
  852. var i ;
  853. var remotePath;
  854. var remoteFileName;
  855. var remoteFullPath;
  856. var localPath;
  857. var dirs = new Array();
  858. var savefile;
  859. var SaveIP;
  860. var stryear = getYear();
  861. var strmonth = getMonth();
  862. var strday = getDay();
  863. var strtime
  864. var strmilliseconds
  865. remotePath = parent.model.getvalue("root/main/ltpscaninfo/ltpscanpath")
  866. parent.f_ltp.FolderCreate(remotePath);
  867. l_file = file.split("|");
  868. // f_View.AutoRefresh = false;
  869. for(i=0; i <= l_file.length - 1 ; i++)
  870. {
  871. strmilliseconds = getMilliseconds();
  872. strtime =getTime();
  873. remoteFileName = stryear + "" + strmonth + "" + strday + "" + strtime + "" + strmilliseconds
  874. if (blk == "1")
  875. {
  876. remoteFileName = "\\" + remoteFileName + ".tif"
  877. }
  878. else
  879. {
  880. remoteFileName = "\\" + remoteFileName + ".jpg"
  881. }
  882. remoteFullPath = remotePath + remoteFileName;
  883. model.setvalue("/root/send/ocrscaninfo/fileno", remoteFullPath);
  884. submit("TXMPL03305");
  885. localpath = l_file[i];
  886. LTPFilePut(remoteFullPath, localpath, "parent");
  887. }
  888. // f_View.AutoRefresh = true;
  889. }
  890. function LTPInit(server, port, user, sub)
  891. {
  892. if (sub == "parent")
  893. {
  894. if(parent.f_ltp.IsOnline)
  895. {
  896. }
  897. else
  898. {
  899. parent.f_ltp.server = server;
  900. parent.f_ltp.port = '2500';
  901. parent.f_ltp.account = 'user';
  902. if(parent.f_ltp.Connect())
  903. {
  904. }
  905. else
  906. {
  907. alert('LTP 데몬과의 접속이 실패하였습니다.');
  908. }
  909. }
  910. }
  911. else if (sub == "parentparent")
  912. {
  913. if(parent.parent.f_ltp.IsOnline)
  914. {
  915. }
  916. else
  917. {
  918. parent.parent.f_ltp.server = server;
  919. parent.parent.f_ltp.port = '2500';
  920. parent.parent.f_ltp.account = 'user';
  921. if(parent.parent.f_ltp.Connect())
  922. {
  923. }
  924. else
  925. {
  926. alert('LTP 데몬과의 접속이 실패하였습니다.');
  927. }
  928. }
  929. }
  930. else if (sub == "trash")
  931. {
  932. if(opener.parent.f_ltp.IsOnline)
  933. {
  934. }
  935. else
  936. {
  937. opener.parent.f_ltp.server = server;
  938. opener.parent.f_ltp.port = '2500';
  939. opener.parent.f_ltp.account = 'user';
  940. if(opener.parent.f_ltp.Connect())
  941. {
  942. }
  943. else
  944. {
  945. alert('LTP 데몬과의 접속이 실패하였습니다.');
  946. }
  947. }
  948. }
  949. else
  950. {
  951. if(f_ltp.IsOnline)
  952. {
  953. }
  954. else
  955. {
  956. f_ltp.server = server;
  957. f_ltp.port = '2500';
  958. f_ltp.account = 'user';
  959. if(f_ltp.Connect())
  960. {
  961. }
  962. else
  963. {
  964. alert('LTP 데몬과의 접속이 실패하였습니다.');
  965. }
  966. }
  967. }
  968. }
  969. // LTP 연결 해제
  970. function LTPClose()
  971. {
  972. f_ltp.Close();
  973. }
  974. function LTPFileGet(remotePath, localPath)
  975. {
  976. LTPInit(model.getvalue("/root/main/ltpscaninfo/ltpscanserver"), model.getvalue("/root/main/ltpscaninfo/ltpscanport"), model.getvalue("/root/main/ltpscaninfo/ltpscanuser"));
  977. var is_succeed = f_ltp.FileGet(remotePath, localPath);
  978. if (is_succeed == false)
  979. {
  980. alert("파일다운로드에 실패하였습니다.");
  981. }
  982. return is_succeed;
  983. }
  984. function LTPFilePut(remotePath, localPath, sub)
  985. {
  986. if (sub == "parent")
  987. {
  988. LTPInit(parent.model.getvalue("/root/main/ltpscaninfo/ltpscanserver"), parent.model.getvalue("/root/main/ltpscaninfo/ltpscanport"), parent.model.getvalue("/root/main/ltpscaninfo/ltpscanuser"), "parent");
  989. var is_succeed = parent.f_ltp.FilePut(remotePath, localPath);
  990. }
  991. else if(sub == "trash")
  992. {
  993. LTPInit(opener.model.getvalue("/root/main/ltpscaninfo/ltpscanserver"), opener.model.getvalue("/root/main/ltpscaninfo/ltpscanport"), opener.model.getvalue("/root/main/ltpscaninfo/ltpscanuser"), "trash");
  994. var is_succeed = opener.parent.f_ltp.FilePut(remotePath, localPath);
  995. }
  996. else
  997. {
  998. LTPInit(model.getvalue("/root/main/ltpscaninfo/ltpscanserver"), model.getvalue("/root/main/ltpscaninfo/ltpscanport"), model.getvalue("/root/main/ltpscaninfo/ltpscanuser"));
  999. var is_succeed = f_ltp.FilePut(remotePath, localPath);
  1000. }
  1001. if (is_succeed == false)
  1002. {
  1003. alert("파일업로드에 실패하였습니다.");
  1004. }
  1005. return is_succeed;
  1006. }
  1007. function LTPFilesGet(remotePath, localPath, sub)
  1008. {
  1009. if (sub == "trash")
  1010. {
  1011. LTPInit(model.getvalue("/root/main/ltpscaninfo/ltpscanserver"), model.getvalue("/root/main/ltpscaninfo/ltpscanport"), model.getvalue("/root/main/ltpscaninfo/ltpscanuser"), "trash");
  1012. return opener.parent.f_ltp.FilesGet(remotePath, localPath);
  1013. }
  1014. else
  1015. {
  1016. LTPInit(model.getvalue("/root/main/ltpscaninfo/ltpscanserver"), model.getvalue("/root/main/ltpscaninfo/ltpscanport"), model.getvalue("/root/main/ltpscaninfo/ltpscanuser"));
  1017. return f_ltp.FilesGet(remotePath, localPath);
  1018. }
  1019. }
  1020. function LTPFilesPut(remotePath, localPath, sub)
  1021. {
  1022. return f_ltp.FilesPut(remotePath, localPath);
  1023. }
  1024. function getFiles(host, port, user, pass, pathRemote, pathLocal, sub)
  1025. {
  1026. var result;
  1027. if (sub == "trash")
  1028. {
  1029. LTPInit(host, port, user, "trash");
  1030. result = LTPFilesGet(pathRemote, pathLocal, "trash");
  1031. }
  1032. else if (sub == "parent")
  1033. {
  1034. LTPInit(host, port, user, "parent");
  1035. result = LTPFilesGet(pathRemote, pathLocal);
  1036. }
  1037. else
  1038. {
  1039. LTPInit(host, port, user);
  1040. result = LTPFilesGet(pathRemote, pathLocal);
  1041. }
  1042. // LTPClose();
  1043. return result;
  1044. }
  1045. function getYear() {
  1046. var now = new Date();
  1047. return now.getFullYear();
  1048. }
  1049. function getMonth() {
  1050. var now = new Date();
  1051. var month = now.getMonth() + 1; // 1월=0,12월=11이므로 1 더함
  1052. if (("" + month).length == 1) { month = "0" + month; }
  1053. return month;
  1054. }
  1055. function getDay() {
  1056. var now = new Date();
  1057. var day = now.getDate();
  1058. if (("" + day).length == 1) { day = "0" + day; }
  1059. return day;
  1060. // return getCurrentTime().substr(6,2);
  1061. // return getCurrentTime();
  1062. }
  1063. function getTime() {
  1064. return getCurrentTime();
  1065. }
  1066. function getMilliseconds() {
  1067. var now = new Date();
  1068. return now.getMilliseconds();
  1069. }
  1070. function imgload(count, type, row){
  1071. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1072. var locaffullpath;
  1073. var i;
  1074. var trashpageno;
  1075. var extension;
  1076. var remotepath
  1077. if (type == "scan")
  1078. {
  1079. RefreshFalse();
  1080. }
  1081. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer\\") == false)
  1082. {
  1083. fso.CreateFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\");
  1084. }
  1085. for (i=1; i <= count; i++)
  1086. {
  1087. if (type == "scan")
  1088. {
  1089. remotepath = parent.model.getValue("/root/main/scaninfo[" + i + "]/fileno");
  1090. }
  1091. else if (type == "trash")
  1092. {
  1093. trashpageno = dg_trash.valueMatrix(dg_trash.row, dg_trash.colref("pageno"));
  1094. extension = dg_trash.valueMatrix(dg_trash.row, dg_trash.colref("extension"));
  1095. remotepath = trashpageno + "." + extension;
  1096. }
  1097. locaffullpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + fso.GetFileName(remotepath);
  1098. f_View.PageAppend(locaffullpath, 1, 1);
  1099. f_View.ActionParamInt1 = i;
  1100. f_View.PageHiddenText(i) = remotepath;
  1101. f_View.PageText(i) = (f_View.PageTotal, f_View.PageTotal);
  1102. if (type == "scan")
  1103. {
  1104. // scanview_setupChart("TV");
  1105. model.setValue("/root/main/chartinfo/pagecurrent", 1);
  1106. }
  1107. else if (type == "trash")
  1108. {
  1109. model.setValue("/root/send/scaninfo/fileno", locaffullpath);
  1110. model.setValue("/root/send/scaninfo/pageno", fso.GetBaseName(remotepath));
  1111. }
  1112. }
  1113. if (type == "scan")
  1114. {
  1115. RefreshTrue();
  1116. model.setValue("/root/main/chartinfo/pagetotal", f_View.PageTotal);
  1117. }
  1118. f_View.PageCurrent = 1;
  1119. f_View.actionthumbnail = 4;
  1120. model.refresh();
  1121. }
  1122. function indeximg() {
  1123. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1124. var path = model.getvalue("root/main/ltpindexinfo/ltpindexserver")
  1125. var year = getYear();
  1126. var month = getMonth();
  1127. var day = getDay();
  1128. var remotepath;
  1129. var localpath;
  1130. remotepath = path + "\\" + year + "" + month
  1131. f_ltp.FolderCreate(remotepath);
  1132. remotepath = remotepath + "\\" + day
  1133. f_ltp.FolderCreate(remotepath);
  1134. localpath = f_View.PageFilePath(model.getValue("/root/main/chartinfo/pagecurrent"));
  1135. remotepath = remotepath + "\\" + fso.GetFileName(localpath);
  1136. LTPFilePutIndex(remotepath, localpath)
  1137. /*
  1138. * switch(model.getValue("/root/cond/radio")) { case "PV": localpath =
  1139. * f_view.PageFilePath(remotepath)
  1140. *
  1141. * case "TV":
  1142. *
  1143. * for (count = 1; count <= f_View.PageTotal; count++) {
  1144. * if(f_View.ThumbnailSelect(count) == true) { } } }
  1145. */
  1146. }
  1147. function LTPFilePutIndex(remotePath, localPath)
  1148. {
  1149. LTPInit(model.getvalue("/root/main/ltpindexinfo/ltpindexserver"), model.getvalue("/root/main/ltpindexinfo/ltpindexport"), model.getvalue("/root/main/ltpindexinfo/ltpindexuser"));
  1150. var is_succeed = f_ltp.FilePut(remotePath, localPath);
  1151. if (is_succeed == false)
  1152. {
  1153. alert("파일업로드에 실패하였습니다.");
  1154. }
  1155. return is_succeed;
  1156. }
  1157. function appendchart(totpage, shortkey)
  1158. {
  1159. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1160. var filename;
  1161. var fullfilename;
  1162. var remotepath;
  1163. var localpath;
  1164. var cdate;
  1165. var cdateyyyymm;
  1166. var cdatedd;
  1167. var path = parent.parent.model.getValue("/root/main/ltpindexinfo/ltpindexpath");
  1168. f_View.AutoRefresh = false;
  1169. for (i = 1; i <= totpage; i++)
  1170. {
  1171. if (shortkey == "shortkey")
  1172. {
  1173. cdate = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /cdate");
  1174. cdateyyyymm = cdate.substr(0,6);
  1175. cdatedd = cdate.substr(6,2)
  1176. filename = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /pageno")
  1177. fullfilename = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /pageno") + "." + parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /extension");
  1178. }
  1179. else
  1180. {
  1181. cdate = parent.model.getValue("/root/main/imgpath[" + i + "] /cdate");
  1182. cdateyyyymm = cdate.substr(0,6);
  1183. cdatedd = cdate.substr(6,2);
  1184. filename = parent.model.getValue("/root/main/imgpath[" + i + "] /pageno")
  1185. fullfilename = parent.model.getValue("/root/main/imgpath[" + i + "] /pageno") + "." + parent.model.getValue("/root/main/imgpath[" + i + "] /extension");
  1186. }
  1187. remotepath = path + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + filename.substr(filename.length - 1, 1) + "\\" + fullfilename;
  1188. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + fullfilename;
  1189. f_View.PageAppend(localpath, 1, 1);
  1190. f_View.PageHiddenText(i) = remotepath;
  1191. f_View.PageText(i) = (f_View.PageTotal, f_View.PageTotal);
  1192. f_View.ActionParamInt1 = i;
  1193. model.setValue("/root/main/chartinfo/pagecurrent", 1);
  1194. }
  1195. f_View.AutoRefresh = true;
  1196. f_View.PageCurrent = f_View.PageTotal;
  1197. f_View.ActionThumbnail = 1;
  1198. f_View.actionsingle = 2;
  1199. model.setValue("/root/main/chartinfo/pagetotal", f_View.PageTotal);
  1200. model.refresh();
  1201. }
  1202. function downloadChart(totpage, type, row, shortkey)
  1203. {
  1204. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1205. var filename;
  1206. var fullfilename;
  1207. var remotepath;
  1208. var pathRemote;
  1209. var localpath;
  1210. var pathLocal;
  1211. var cdate;
  1212. var cdateyyyymm;
  1213. var cdatedd;
  1214. var path;
  1215. var trashpath = opener.parent.model.getValue("/root/main/ltpindexinfo/ltpindexpath") + "\\" + "delfolder\\";
  1216. var trashpageno;
  1217. var extension;
  1218. for (i = 1; i <= totpage; i++)
  1219. {
  1220. if (type == "index")
  1221. {
  1222. if (shortkey == "shortkey")
  1223. {
  1224. cdate = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /cdate");
  1225. cdateyyyymm = cdate.substr(0,6);
  1226. cdatedd = cdate.substr(6,2)
  1227. filename = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /pageno")
  1228. fullfilename = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /pageno") + "." + parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "] /extension");
  1229. path = parent.iviewer1.model.getValue("/root/main/imgpath[" + i + "]/ltppath");
  1230. remotepath = path + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + filename.substr(filename.length - 1, 1) + "\\" + fullfilename;
  1231. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + fullfilename;
  1232. }
  1233. else
  1234. {
  1235. cdate = parent.model.getValue("/root/main/imgpath[" + i + "] /cdate");
  1236. cdateyyyymm = cdate.substr(0,6);
  1237. cdatedd = cdate.substr(6,2)
  1238. filename = parent.model.getValue("/root/main/imgpath[" + i + "] /pageno")
  1239. fullfilename = parent.model.getValue("/root/main/imgpath[" + i + "] /pageno") + "." + parent.model.getValue("/root/main/imgpath[" + i + "] /extension");
  1240. path = parent.model.getValue("/root/main/imgpath[" + i + "]/ltppath");
  1241. remotepath = path + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + filename.substr(filename.length - 1, 1) + "\\" + fullfilename;
  1242. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + fullfilename;
  1243. }
  1244. }
  1245. else if (type == "scan")
  1246. {
  1247. remotepath = parent.model.getValue("/root/main/scaninfo[" + i + "]/fileno");
  1248. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + fso.GetFileName(remotepath);
  1249. }
  1250. else if (type == "trash")
  1251. {
  1252. trashpageno = dg_trash.valueMatrix(dg_trash.row, dg_trash.colref("pageno"));
  1253. extension = dg_trash.valueMatrix(dg_trash.row, dg_trash.colref("extension"));
  1254. remotepath = trashpath + trashpageno + "." + extension;
  1255. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + fso.GetFileName(remotepath);
  1256. }
  1257. pathRemote = pathRemote + "|";
  1258. pathLocal = pathLocal + "|";
  1259. pathRemote = pathRemote + remotepath;
  1260. pathLocal = pathLocal + localpath;
  1261. }
  1262. if (type == "trash")
  1263. {
  1264. getFiles(opener.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexserver"), opener.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexport"), opener.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexuser"), "", pathRemote, pathLocal, "trash");
  1265. }
  1266. else
  1267. {
  1268. getFiles(parent.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexserver"), parent.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexport"), parent.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexuser"), "", pathRemote, pathLocal, "parentparent");
  1269. }
  1270. }
  1271. function scantest(ScanServer, ScanPort, ScanUser)
  1272. {
  1273. f_Twain.ShowAcquireUI = true;
  1274. f_Twain.Acquire("C:\SCHTEST\test.tif");
  1275. // f_Twain.ShowDialogSelect();
  1276. }
  1277. function f_Twain_PageEnd(PageSeq, PageInFile, FilePath, twRC)
  1278. {
  1279. if (twRC == 0) then
  1280. {
  1281. }
  1282. }
  1283. function DelScanImg(fv, delboolean, workmode, comp)
  1284. {
  1285. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1286. var fileno;
  1287. var filename;
  1288. var filehidden;
  1289. var instcd;
  1290. var patno;
  1291. var ioflag;
  1292. var sSaveData = "status▦patno▦ioflag▦fileno▦instcd▩";
  1293. var sSaveDataDel = "status▦patno▦ioflag▦page▦instcd▩";
  1294. var i;
  1295. var j;
  1296. var instcd = parent.model.getValue("/root/user/instcd");;
  1297. var delpage = 0;
  1298. var dfile;
  1299. var gridpath;
  1300. // getUserInfo("dutplceinstcd")
  1301. fv.AutoRefresh = false;
  1302. TrashFolder()
  1303. if (delboolean == "del")
  1304. {
  1305. if (parent.model.getValue("/root/cond/gubun") == "SCAN")
  1306. {
  1307. patno = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  1308. ioflag = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("class"));
  1309. }
  1310. else
  1311. {
  1312. patno = parent.parent.model.getValue("/root/user/scanuser");
  1313. ioflag = "Z";
  1314. }
  1315. instcd = parent.parent.model.getValue("/root/user/instcd");
  1316. if (rdo_viewmode.value == "TV")
  1317. {
  1318. for (i=fv.PageTotal; i>= 1; i--)
  1319. {
  1320. if (workmode == "OLD")
  1321. {
  1322. if(fv.ThumbnailSelect(i) == true)
  1323. {
  1324. filename = fv.PageFilePath(i);
  1325. filehidden = fv.PageHiddenText(i);
  1326. page = i
  1327. copyfile(fv.PageFilePath(i), page, "S")
  1328. sSaveData += "d▦" + patno + "▦" + ioflag + "▦" + filehidden + "▦" + instcd + "▩";
  1329. sSaveDataDel += "d▦" + patno + "▦" + ioflag + "▦" + page + "▦" + instcd + "▩";
  1330. parent.parent.f_ltp.FileDelete(filehidden);
  1331. fv.PageRemove(i,i);
  1332. fv.ActionParamINT1 = i;
  1333. fv.ActionThumbnail = 10;
  1334. fv.PageCurrent = i;
  1335. delpage = delpage + 1;
  1336. }
  1337. }
  1338. else
  1339. {
  1340. if (comp == "COMP")
  1341. {
  1342. filename = fv.PageFilePath(i);
  1343. for (j=parent.dg_treat.rows - 1; j >= 1; j--)
  1344. {
  1345. gridpath = parent.dg_treat.valueMatrix(j, parent.dg_treat.colref("fileno"));
  1346. if (gridpath == filename)
  1347. {
  1348. filehidden = fv.PageHiddenText(i);
  1349. page = i
  1350. copyfile(fv.PageFilePath(i), page, "S")
  1351. sSaveData += "d▦" + patno + "▦" + ioflag + "▦" + filehidden + "▦" + instcd + "▩";
  1352. sSaveDataDel += "d▦" + patno + "▦" + ioflag + "▦" + page + "▦" + instcd + "▩";
  1353. parent.parent.f_ltp.FileDelete(filehidden);
  1354. fv.PageRemove(i,i);
  1355. parent.dg_treat.deleteitem(j);
  1356. fv.ActionParamINT1 = i-1;
  1357. fv.ActionThumbnail = 10;
  1358. fv.PageCurrent = i-1;
  1359. delpage = delpage + 1;
  1360. }
  1361. }
  1362. }
  1363. else
  1364. {
  1365. if(fv.ThumbnailSelect(i) == true)
  1366. {
  1367. filename = fv.PageFilePath(i);
  1368. filehidden = fv.PageHiddenText(i);
  1369. page = i
  1370. sSaveData += "d▦" + patno + "▦" + ioflag + "▦" + filehidden + "▦" + instcd + "▩";
  1371. sSaveDataDel += "d▦" + patno + "▦" + ioflag + "▦" + page + "▦" + instcd + "▩";
  1372. parent.parent.f_ltp.FileDelete(filehidden);
  1373. fv.PageRemove(i,i);
  1374. fv.ActionParamINT1 = f_View.PageTotal;
  1375. fv.ActionThumbnail = 10;
  1376. fv.PageCurrent = f_View.PageTotal;
  1377. delpage = delpage + 1;
  1378. copyfile(fv.PageFilePath(i), page, "S")
  1379. }
  1380. }
  1381. }
  1382. }
  1383. }
  1384. else
  1385. {
  1386. i = fv.PageCurrent;
  1387. filename = fv.PageFilePath(i);
  1388. filehidden = fv.PageHiddenText(i);
  1389. page = i
  1390. sSaveData += "d▦" + patno + "▦" + ioflag + "▦" + filehidden + "▦" + instcd + "▩";
  1391. sSaveDataDel += "d▦" + patno + "▦" + ioflag + "▦" + page + "▦" + instcd + "▩";
  1392. parent.parent.f_ltp.FileDelete(filehidden);
  1393. fv.PageRemove(i,i);
  1394. fv.ActionParamINT1 = i;
  1395. fv.ActionThumbnail = 10;
  1396. fv.PageCurrent = i;
  1397. copyfile(fv.PageFilePath(i), page, "S")
  1398. }
  1399. model.setValue("/root/send/delimage/updata", sSaveDataDel);
  1400. submit("TXMPL03329");
  1401. model.setValue("/root/send/delimage/fileno", sSaveData);
  1402. submit("TXMPL03318");
  1403. }
  1404. else if (delboolean == "blank")
  1405. {
  1406. patno = opener.parent.dg_treat.valueMatrix(opener.parent.dg_treat.row, opener.parent.dg_treat.colref("patid"));
  1407. ioflag = opener.parent.parent.model.getValue("/root/user/class");
  1408. instcd = opener.parent.parent.model.getValue("/root/user/instcd");
  1409. model.setValue("/root/send/delimage/patno", patno);
  1410. model.setValue("/root/send/delimage/instcd", ioflag);
  1411. model.setValue("/root/send/delimage/ioflag", instcd);
  1412. for (i=fv.PageTotal; i>= 1; i--)
  1413. {
  1414. if(fv.ThumbnailSelect(i) == false)
  1415. {
  1416. filename = opener.f_View.PageFilePath(fv.PageHiddenText(i));
  1417. filehidden = opener.f_View.PageHiddenText(fv.PageHiddenText(i));
  1418. model.setValue("/root/send/delimage/fileno", filehidden);
  1419. model.setValue("/root/send/delimage/page", fv.PageHiddenText(i));
  1420. sSaveData += "d▦" + patno + "▦" + ioflag + "▦" + filehidden + "▦" + instcd + "▩";
  1421. opener.f_View.PageRemove(fv.PageHiddenText(i), fv.PageHiddenText(i));
  1422. fv.PageRemove(i,i)
  1423. opener.optPageTotal.text = parseInt(opener.optPageTotal.text) - 1;
  1424. opener.parent.parent.f_ltp.FileDelete(filehidden);
  1425. opener.model.refresh();
  1426. submit("TXMPL03329");
  1427. delpage = delpage + 1;
  1428. copyfile(fv.PageFilePath(i), i, "S")
  1429. }
  1430. }
  1431. opener.optPageTotal.text = opener.optPageTotal.text - delpage;
  1432. model.setValue("/root/send/delimage/fileno", sSaveData);
  1433. submit("TXMPL03318");
  1434. }
  1435. for (i=1; i <= fv.PageTotal; i++)
  1436. {
  1437. fv.PageText(i, i);
  1438. }
  1439. fv.AutoRefresh = true;
  1440. }
  1441. function DelIndexImgFile(fv, delboolean)
  1442. {
  1443. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1444. var fileno;
  1445. var filename;
  1446. var filehidden;
  1447. var instcd;
  1448. var patno = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  1449. var ioflag;
  1450. var i;
  1451. var instcd;
  1452. var delpage;
  1453. // getUserInfo("dutplceinstcd")
  1454. TrashFolder();
  1455. delpage = 0;
  1456. fv.AutoRefresh = false;
  1457. if (delboolean == "del")
  1458. { if (rdo_viewmode.value == "TV")
  1459. {
  1460. for (i=fv.PageTotal; i>= 1; i--)
  1461. {
  1462. if(fv.ThumbnailSelect(i) == true)
  1463. {
  1464. filehidden = fv.PageHiddenText(i);
  1465. // 환자나 서식 이동을 위해 trashfolder에 임시 복사
  1466. filename = fv.PageFilePath(i);
  1467. copyfile(fv.PageFilePath(i), i, "Y")
  1468. parent.parent.f_ltp.FileDelete(filehidden);
  1469. fv.PageRemove(i,i);
  1470. fv.PageCurrent = i;
  1471. }
  1472. }
  1473. }
  1474. else
  1475. {
  1476. i = fv.PageCurrent;
  1477. filehidden = fv.PageHiddenText(i);
  1478. // 환자나 서식 이동을 위해 trashfolder에 임시 복사
  1479. filename = fv.PageFilePath(i);
  1480. copyfile(fv.PageFilePath(i), page, "Y")
  1481. parent.parent.f_ltp.FileDelete(filehidden);
  1482. fv.PageRemove(i, i);
  1483. delpage = 1;
  1484. fv.ActionParamINT1 = i;
  1485. fv.ActionThumbnail = 10;
  1486. fv.PageCurrent = i;
  1487. }
  1488. model.refresh();
  1489. parent.dg_index1.textmatrix(parent.dg_index1.row, 1) = fv.PageTotal;
  1490. for (i=1; i <= fv.PageTotal; i++)
  1491. {
  1492. fv.PageText(i, i);
  1493. }
  1494. }
  1495. fv.AutoRefresh = true;
  1496. }
  1497. function DelIndexImg(cutyn, delpage, trash)
  1498. {
  1499. var filename; // = model.getValue("root/send/delimage/imageno");
  1500. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1501. var pageno;
  1502. var selpage;
  1503. var i;
  1504. var cdate;
  1505. var ctime;
  1506. var delfoler = parent.parent.model.getValue("/root/main/ltpindexinfo/ltpindexpath") + "\\" + "delfolder";
  1507. var bDelData = "status▦pageno▦instcd▩";
  1508. var bUpdpageData = "status▦treatno▦formcode▦page▦instcd▩"
  1509. var bIntPageDelLogt = "status▦pageno▦patid▦indate▦clincode▦class▦doccode▦formcode▦page▦cdate▦ctime▦cuserid▦treatno▦ocrcode▦instcd▩";
  1510. var instcd = parent.parent.model.getValue("/root/user/instcd");
  1511. var cuserid = parent.parent.model.getValue("/root/user/scanuser");
  1512. var patid = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  1513. var ioflag = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("class"));
  1514. var formcode = parent.model.getValue("/root/send/paget/formcode");
  1515. var treatno = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("treatno"));
  1516. var clincode = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("clincode"));
  1517. var indate = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("indate"));
  1518. var doccode = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("doccode"));
  1519. var page;
  1520. var cdate;
  1521. var ctime;
  1522. var cutFilename = "";
  1523. parent.parent.f_ltp.FolderCreate(delfoler);
  1524. submit("TRMPL03311");
  1525. cdate = model.getValue("/root/main/now/sysdate").substr(0, 8);
  1526. ctime = model.getValue("/root/main/now/sysdate").substr(8, 6);
  1527. if (delpage == "")
  1528. {
  1529. if (rdo_viewmode.value == "TV")
  1530. {
  1531. for (i=1; i <= f_View.PageTotal; i++)
  1532. {
  1533. if(f_View.ThumbnailSelect(i) == true)
  1534. {
  1535. filename = f_View.PageFilePath(i);
  1536. filehidden = f_View.PageHiddenText(i);
  1537. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1538. selpage = i;
  1539. model.setValue("/root/cond/scanmode", "add");
  1540. page = i;
  1541. if (trash != "trash")
  1542. {
  1543. LTPFilePut(delfoler + "\\" + fso.GetFileName(filehidden), filename, "parentparent");
  1544. }
  1545. filehidden = fso.GetBaseName(filehidden);
  1546. bDelData += "d▦" + filehidden + "▦" + instcd + "▩";
  1547. bUpdpageData += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  1548. bIntPageDelLogt += "d▦" + filehidden + "▦" + patid + "▦" + indate + "▦" + clincode + "▦" + ioflag + "▦00000▦" + formcode + "▦" + page + "▦" + cdate + "▦" + ctime + "▦" + cuserid + "▦" + treatno + "▦" + "" + "▦" + instcd + "▩";
  1549. if(cutFilename == "")
  1550. {
  1551. cutFilename = filename;
  1552. }
  1553. else
  1554. {
  1555. cutFilename = cutFilename + "|";
  1556. cutFilename = cutFilename + filename;
  1557. }
  1558. if (cutyn == "cut")
  1559. {
  1560. parent.iviewer1.f_View.PageAppend(filename, 1, 1);
  1561. }
  1562. }
  1563. }
  1564. model.setValue("/root/send/delimage/updpage", bUpdpageData);
  1565. submit("TXMPL03320");
  1566. model.setValue("/root/send/delimage/pageno", bDelData);
  1567. submit("TXMPL03317");
  1568. if (trash != "trash")
  1569. {
  1570. if (cutyn != "cut")
  1571. {
  1572. model.setValue("/root/send/deletepagetinfo/intdellog", bIntPageDelLogt);
  1573. submit("TXMPL03333");
  1574. }
  1575. }
  1576. }
  1577. else
  1578. {
  1579. i = f_View.PageCurrent;
  1580. filename = f_View.PageFilePath(i);
  1581. filehidden = f_View.PageHiddenText(i);
  1582. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1583. selpage = i;
  1584. model.setValue("/root/cond/scanmode", "add");
  1585. page = i;
  1586. LTPFilePut(delfoler + "\\" + fso.GetFileName(filehidden), filename, "parentparent");
  1587. filehidden = fso.GetBaseName(filehidden);
  1588. bDelData += "d▦" + filehidden + "▦" + instcd + "▩";
  1589. bUpdpageData += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  1590. bIntPageDelLogt += "d▦" + filehidden + "▦" + patid + "▦" + indate + "▦" + clincode + "▦" + ioflag + "▦00000▦" + formcode + "▦" + page + "▦" + cdate + "▦" + ctime + "▦" + cuserid + "▦" + treatno + "▦" + "" + "▦" + instcd + "▩";
  1591. if(cutFilename == "")
  1592. {
  1593. cutFilename = filename;
  1594. }
  1595. else
  1596. {
  1597. cutFilename = cutFilename + "|";
  1598. cutFilename = cutFilename + filename;
  1599. }
  1600. if (cutyn == "cut")
  1601. {
  1602. parent.iviewer1.f_View.PageAppend(filename, 1, 1);
  1603. }
  1604. model.setValue("/root/send/delimage/updpage", bUpdpageData);
  1605. submit("TXMPL03320");
  1606. model.setValue("/root/send/delimage/pageno", bDelData);
  1607. submit("TXMPL03317");
  1608. if (trash != "trash")
  1609. {
  1610. model.setValue("/root/send/deletepagetinfo/intdellog", bIntPageDelLogt);
  1611. submit("TXMPL03333");
  1612. }
  1613. }
  1614. if (cutyn == "cut")
  1615. {
  1616. scanInsertBatch(cutFilename, "add", "parentparent");
  1617. }
  1618. }
  1619. else
  1620. {
  1621. filename = f_View.PageFilePath(delpage);
  1622. filehidden = f_View.PageHiddenText(delpage);
  1623. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1624. filehidden = fso.GetBaseName(filehidden);
  1625. sSaveData += "d▦" + filehidden + "▩";
  1626. f_View.PageRemove(delpage, delpage);
  1627. if (fso.FileExists(filehidden) == true)
  1628. {
  1629. fso.DeleteFile(filehidden);
  1630. }
  1631. selpage = delpage;
  1632. model.setValue("root/send/delimage/page", delpage)
  1633. model.setValue("root/send/delimage/pageno", sSaveData);
  1634. submit("TXMPL03317");
  1635. // submit("TXMPL03319");
  1636. submit("TXMPL03320");
  1637. }
  1638. }
  1639. function BlankPage()
  1640. {
  1641. var i;
  1642. var filename;
  1643. var filehidden;
  1644. var filesize;
  1645. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1646. for (i=1; i<= opener.f_View.PageTotal; i++)
  1647. {
  1648. filename = opener.f_View.PageFilePath(i);
  1649. filehidden = opener.f_View.PageHiddenText(i);
  1650. filesize = fso.GetFile(filename).size;
  1651. if(filesize < 5000)
  1652. {
  1653. f_View.PageAppend(filename, 1, 1);
  1654. f_View.ActionParamInt1 = i;
  1655. f_View.ViewMode = 2;
  1656. f_View.PageHiddenText(f_View.PageTotal) = i;
  1657. }
  1658. else
  1659. {
  1660. }
  1661. }
  1662. }
  1663. function IndexInsert(fv, fv_1, type)
  1664. {
  1665. var cdate;
  1666. var ctime;
  1667. var cdateyyyymm;
  1668. var cdatedd;
  1669. var filename;
  1670. var filehidden;
  1671. var remotepath;
  1672. var pageno;
  1673. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1674. var extension;
  1675. var ltppath = parent.model.getvalue("/root/main/ltpindexinfo/ltpindexpath");
  1676. var i;
  1677. var j;
  1678. var filesize;
  1679. var pagecount = 0;
  1680. var page = 0;
  1681. var pathid = parent.model.getvalue("/root/main/ltpindexinfo/pathid");
  1682. var cuserid = parent.model.getValue("/root/user/scanuser");
  1683. var treatno = dg_treat.valueMatrix(dg_treat.row, dg_treat.colref("treatno"));
  1684. var formcode = model.getvalue("/root/send/paget/formcode");
  1685. var instcd = parent.model.getValue("/root/user/instcd");
  1686. var sSaveData = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▩";
  1687. var sSaveDataUpPage = "status▦treatno▦formcode▦page▦instcd▩";
  1688. var sSaveDataPage = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▦page▩";
  1689. var addpage = 0;
  1690. var currentpage;
  1691. cdate = parent.model.getValue("/root/main/now/sysdate");
  1692. ctime = parent.model.getValue("/root/main/now/sysdate");
  1693. cdate = cdate.substr(0, 8);
  1694. ctime = ctime.substr(8, 6);
  1695. cdateyyyymm = cdate.substr(0, 6);
  1696. cdatedd = cdate.substr(6, 2);
  1697. fv.AutoRefresh = false;
  1698. fv_1.AutoRefresh = false;
  1699. if (type == "add")
  1700. {
  1701. if (iviewer1.rdo_viewmode.value == "TV")
  1702. {
  1703. for (i=1; i<=fv.PageTotal; i++)
  1704. {
  1705. if (fv.ThumbnailSelect(i) == true)
  1706. {
  1707. filesize = "";
  1708. filename = fv.PageFilePath(i);
  1709. extension = fso.GetExtensionName(filename);
  1710. filesize = fso.GetFile(filename).size;
  1711. sSaveData += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▩";
  1712. fv_1.PageAppend(filename, 1, 1);
  1713. fv_1.PageText(i) = (fv_1.PageTotal, fv_1.PageTotal);
  1714. addpage = addpage + 1;
  1715. }
  1716. }
  1717. model.setValue("/root/send/paget/pageno", sSaveData);
  1718. submit("TXMPL03301");
  1719. }
  1720. else
  1721. {
  1722. filesize = "";
  1723. filename = fv.PageFilePath(iviewer1.optPageCurrent.text);
  1724. extension = fso.GetExtensionName(filename);
  1725. filesize = fso.GetFile(filename).size;
  1726. sSaveData += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▩";
  1727. fv_1.PageAppend(filename, 1, 1);
  1728. fv_1.PageText(i) = (fv_1.PageTotal, fv_1.PageTotal);
  1729. model.setValue("/root/send/paget/pageno", sSaveData);
  1730. submit("TXMPL03301");
  1731. }
  1732. fv_1.PageCurrent = fv_1.PageTotal;
  1733. fv_1.ActionThumbnail = 5;
  1734. fv_1.actionsingle = 3;
  1735. }
  1736. else if(type == "ins")
  1737. {
  1738. page = iviewer2.optPageCurrent.text;
  1739. if (iviewer1.rdo_viewmode.value == "TV")
  1740. {
  1741. for (i=1; i<=fv.PageTotal; i++)
  1742. {
  1743. if (fv.ThumbnailSelect(i) == true)
  1744. {
  1745. filesize = "";
  1746. filename = fv.PageFilePath(i);
  1747. extension = fso.GetExtensionName(filename);
  1748. filesize = fso.GetFile(filename).size;
  1749. sSaveDataUpPage += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  1750. sSaveDataPage += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▦" + page + "▩";
  1751. fv_1.PageInsert(page, filename, 1, 1);
  1752. fv_1.ActionParamINT1 = page;
  1753. fv_1.ActionThumbnail = 10;
  1754. page = parseInt(page) + 1;
  1755. }
  1756. }
  1757. model.setValue("/root/send/paget/uppage", sSaveDataUpPage);
  1758. submit("TXMPL03321");
  1759. model.setValue("/root/send/paget/pageno", sSaveDataPage);
  1760. submit("TXMPL03302");
  1761. }
  1762. else
  1763. {
  1764. filesize = "";
  1765. filename = fv.PageFilePath(iviewer1.optPageCurrent.text);
  1766. extension = fso.GetExtensionName(filename);
  1767. filesize = fso.GetFile(filename).size;
  1768. sSaveDataUpPage += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  1769. sSaveDataPage += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▦" + page + "▩";
  1770. fv_1.PageInsert(page, filename, 1, 1);
  1771. model.setValue("/root/send/paget/uppage", sSaveDataUpPage);
  1772. submit("TXMPL03321");
  1773. model.setValue("/root/send/paget/pageno", sSaveDataPage);
  1774. submit("TXMPL03302");
  1775. }
  1776. fv_1.PageCurrent = page;
  1777. fv_1.actionsingle = 10;
  1778. }
  1779. else if(type == "rep")
  1780. {
  1781. page = iviewer2.optPageCurrent.text;
  1782. if (iviewer1.rdo_viewmode.value == "TV")
  1783. {
  1784. page = iviewer2.optPageCurrent.text;
  1785. for (i=1; i<=fv.PageTotal; i++)
  1786. {
  1787. if (fv.ThumbnailSelect(i) == true)
  1788. {
  1789. filesize = "";
  1790. filename = fv.PageFilePath(i);
  1791. extension = fso.GetExtensionName(filename);
  1792. filesize = fso.GetFile(filename).size;
  1793. sSaveDataUpPage += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  1794. sSaveDataPage += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▦" + page + "▩";
  1795. fv_1.PageInsert(page, filename, 1, 1);
  1796. page = parseInt(page) + 1;
  1797. }
  1798. }
  1799. model.setValue("/root/send/paget/uppage", sSaveDataUpPage);
  1800. submit("TXMPL03321");
  1801. model.setValue("/root/send/paget/pageno", sSaveDataPage);
  1802. submit("TXMPL03302");
  1803. }
  1804. else
  1805. {
  1806. filesize = "";
  1807. filename = fv.PageFilePath(iviewer1.optPageCurrent.text);
  1808. extension = fso.GetExtensionName(filename);
  1809. filesize = fso.GetFile(filename).size;
  1810. sSaveDataUpPage += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  1811. sSaveDataPage += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▦" + page + "▩";
  1812. fv_1.PageInsert(page, filename, 1, 1);
  1813. model.setValue("/root/send/paget/uppage", sSaveDataUpPage);
  1814. submit("TXMPL03321");
  1815. model.setValue("/root/send/paget/pageno", sSaveDataPage);
  1816. submit("TXMPL03302");
  1817. }
  1818. fv_1.PageCurrent = page;
  1819. fv_1.actionsingle = 10;
  1820. }
  1821. // iviewer2.optPageTotal.text = fv_1.PageTotal;
  1822. dg_index1.textmatrix(dg_index1.row, 1) = fv_1.PageTotal;
  1823. for (i=1; i<=fv_1.PageTotal; i++)
  1824. {
  1825. fv_1.PageText(i) = i;
  1826. }
  1827. fv.AutoRefresh = true;
  1828. fv_1.AutoRefresh = true;
  1829. // fv_1.ActionParamINT1 =
  1830. // fv_1.ActionThumbnail = 10;
  1831. model.refresh();
  1832. }
  1833. function IndexInsertbyocr(fv)
  1834. {
  1835. var cdate;
  1836. var ctime;
  1837. var cdateyyyymm;
  1838. var cdatedd;
  1839. var filename;
  1840. var filehidden;
  1841. var remotepath;
  1842. var pageno;
  1843. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1844. var extension;
  1845. var ltppath = parent.model.getvalue("/root/main/ltpindexinfo/ltpindexpath");
  1846. var i;
  1847. var j;
  1848. var filesize;
  1849. var pagecount = 0;
  1850. var page = 0;
  1851. var pathid = parent.model.getvalue("/root/main/ltpindexinfo/pathid");
  1852. var cuserid = parent.model.getValue("/root/user/scanuser");
  1853. var treatno;
  1854. var formcode;
  1855. var instcd = parent.model.getValue("/root/user/instcd");
  1856. var sSaveData = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▩";
  1857. var sSaveDataUpPage = "status▦treatno▦formcode▦page▦instcd▩";
  1858. var sSaveDataPage = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▦page▩";
  1859. var addpage = 0;
  1860. var currentpage;
  1861. var gridpath;
  1862. cdate = parent.model.getValue("/root/main/now/sysdate");
  1863. ctime = parent.model.getValue("/root/main/now/sysdate");
  1864. cdate = cdate.substr(0, 8);
  1865. ctime = ctime.substr(8, 6);
  1866. cdateyyyymm = cdate.substr(0, 6);
  1867. cdatedd = cdate.substr(6, 2);
  1868. fv.AutoRefresh = false;
  1869. for (i=1; i<= dg_treat.rows - 1; i++)
  1870. {
  1871. gridpath = dg_treat.valueMatrix(i, dg_treat.colref("fileno"));
  1872. for (j=1; j<=fv.PageTotal; j++)
  1873. {
  1874. filename = fv.PageFilePath(j);
  1875. if (gridpath == filename)
  1876. {
  1877. treatno = dg_treat.valueMatrix(i, dg_treat.colref("treatno"));
  1878. formcode = dg_treat.valueMatrix(i, dg_treat.colref("formcode"));
  1879. filesize = "";
  1880. extension = fso.GetExtensionName(filename);
  1881. filesize = fso.GetFile(filename).size;
  1882. sSaveData += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▩";
  1883. }
  1884. }
  1885. }
  1886. model.setValue("/root/send/paget/pageno", sSaveData);
  1887. submit("TXMPL03301");
  1888. }
  1889. function OcrIndexInsert(fv, type)
  1890. {
  1891. var cdate;
  1892. var ctime;
  1893. var cdateyyyymm = getYear() + "" + getMonth();
  1894. var cdatedd = getDay();
  1895. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1896. var sSaveData = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▩";
  1897. var sOcrData = "status▦ocrtag▦scanuser▦instcd▩";
  1898. var ioflag = model.getValue("/root/send/delimage/ioflag");
  1899. var pathid = parent.model.getvalue("/root/main/ltpindexinfo/pathid");
  1900. var cuserid = parent.model.getValue("/root/user/scanuser");
  1901. var treatno;
  1902. var formcode;
  1903. var instcd = parent.model.getValue("/root/user/instcd");
  1904. var pageno;
  1905. var i;
  1906. var ocrtag;
  1907. var count;
  1908. var gridpath;
  1909. var imgpath;
  1910. var j;
  1911. var ltppath = model.getvalue("/root/main/ltpindexinfo/ltpindexpath");
  1912. cdate = parent.model.getValue("/root/main/now/sysdate");
  1913. ctime = parent.model.getValue("/root/main/now/sysdate");
  1914. cdate = cdate.substr(0, 8);
  1915. ctime = ctime.substr(8, 6);
  1916. cdateyyyymm = cdate.substr(0, 6);
  1917. cdatedd = cdate.substr(6, 2);
  1918. model.setValue("/root/send/paget/cdate", cdate);
  1919. for (i=1; i<= dg_treat.rows - 1; i++)
  1920. {
  1921. gridpath = dg_treat.valueMatrix(i, dg_treat.colref("fileno"));
  1922. for (j=1; j<=fv.PageTotal; j++)
  1923. {
  1924. filename = fv.PageFilePath(j);
  1925. if (gridpath == filename)
  1926. {
  1927. treatno = dg_treat.valueMatrix(i, dg_treat.colref("treatno"));
  1928. formcode = dg_treat.valueMatrix(i, dg_treat.colref("formcode"));
  1929. filesize = "";
  1930. extension = fso.GetExtensionName(filename);
  1931. filesize = fso.GetFile(filename).size;
  1932. ocrtag = dg_treat.valueMatrix(i, dg_treat.colref("ocrtag"));
  1933. sSaveData += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▩";
  1934. sOcrData += "d▦" + ocrtag + "▦" + cuserid + "▦" + instcd + "▩";
  1935. }
  1936. }
  1937. }
  1938. model.setValue("/root/send/paget/pageno", sSaveData);
  1939. model.setValue("/root/send/ocrinfo/ocrtag", sOcrData);
  1940. submit("TXMPL03301")
  1941. var count = getNodesetCount("/root/main/paget/pageno");
  1942. if (count == dg_treat.rows - 1)
  1943. {
  1944. submit("TXMPL04301");
  1945. }
  1946. else
  1947. {
  1948. }
  1949. }
  1950. function Scan(type, file)
  1951. {
  1952. var status;
  1953. var cdateyyyymm = getYear() + "" + getMonth();
  1954. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1955. var scancolor = fso.GetExtensionName(file);
  1956. var scanfolder = fso.GetSpecialFolder(2) + "\\LCViewer";
  1957. var bPage = iviewer1.f_View.PageTotal;
  1958. if (type=="add")
  1959. {
  1960. file = scanfolder + "\\" + fso.GetBaseName(file) + "." + scancolor;
  1961. iviewer1.window.javascript.scanLoad(file);
  1962. scanInsertBatch(file, type, "parent", bPage);
  1963. // iviewer1.model.setValue("/root/main/chartinfo/pagetotal",
  1964. // iviewer1.window.javascript.f_View.PageTotal);
  1965. }
  1966. else if (type == "ins")
  1967. {
  1968. for (i = 1; i <= iviewer1.window.javascript.f_View.PageTotal; i++)
  1969. {
  1970. if (iviewer1.window.javascript.f_View.ThumbnailSelect(i) == true)
  1971. {
  1972. selpage = i;
  1973. scanmode = "ins"
  1974. break;
  1975. }
  1976. }
  1977. file = scanfolder + "\\" + fso.GetBaseName(file) + "0001." + scancolor;
  1978. iviewer1.window.javascript.scanInsLoad(file, selpage);
  1979. model.setValue("/root/send/scaninfo/page", selpage);
  1980. submit("TXMPL03316");
  1981. // var remotePath = model.getvalue("root/main/ltpscaninfo/ltpscanpath")
  1982. scanInsert(file, type);
  1983. }
  1984. else if (type == "rep")
  1985. {
  1986. for (i = 1; i <= iviewer1.window.javascript.f_View.PageTotal; i++)
  1987. {
  1988. if (iviewer1.window.javascript.f_View.ThumbnailSelect(i) == true)
  1989. {
  1990. selpage = i;
  1991. scanmode = "rep"
  1992. delfileno = iviewer1.window.f_View.PageHiddenText(i);
  1993. sSaveData += "d▦" + delfileno +"▩";
  1994. break;
  1995. }
  1996. }
  1997. file = scanfolder + "\\" + fso.GetBaseName(file) + "0001." + scancolor;
  1998. iviewer1.window.javascript.scanInsLoad(file, selpage);
  1999. model.setValue("/root/send/scaninfo/page", selpage);
  2000. model.setValue("root/send/delimage/fileno", sSaveData);
  2001. model.setValue("root/send/delimage/instcd", model.getValue("/root/user/instcd"));
  2002. submit("TXMPL03318");
  2003. // iviewer1.window.javascript.f_View.PageRemove(selpage, selpage);
  2004. iviewer1.window.javascript.scanview_resetPageRemove()
  2005. scanInsert(file, type);
  2006. }
  2007. }
  2008. function scanInsert(file, type, sub)
  2009. {
  2010. var l_file;
  2011. var i ;
  2012. var remotePath;
  2013. var remoteFileName;
  2014. var remoteFullPath;
  2015. var localPath;
  2016. var dirs = new Array();
  2017. var savefile;
  2018. var SaveIP;
  2019. var stryear = getYear();
  2020. var strmonth = getMonth();
  2021. var strday = getDay();
  2022. var strtime
  2023. var strmilliseconds
  2024. var i;
  2025. var extension;
  2026. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2027. if (sub == "trash")
  2028. {
  2029. remotePath = opener.model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2030. opener.f_ltp.FolderCreate(remotePath);
  2031. }
  2032. else if (sub == "parent")
  2033. {
  2034. remotePath = parent.model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2035. parent.f_ltp.FolderCreate(remotePath);
  2036. }
  2037. else if (sub == "parentparent")
  2038. {
  2039. remotePath = parent.parent.model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2040. parent.parent.f_ltp.FolderCreate(remotePath);
  2041. }
  2042. else
  2043. {
  2044. remotePath = model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2045. f_ltp.FolderCreate(remotePath);
  2046. }
  2047. l_file = file.split("|");
  2048. for(i=0; i <= l_file.length -1 ; i++)
  2049. {
  2050. strmilliseconds = getMilliseconds();
  2051. strtime = getTime();
  2052. localpath = l_file[i];
  2053. extension = fso.GetExtensionName(localpath);
  2054. remoteFileName = "\\" + stryear + "" + strmonth + "" + strday + "" + strtime + "" + strmilliseconds + "." + extension
  2055. remoteFullPath = remotePath + remoteFileName;
  2056. model.setvalue("/root/send/scaninfo/fileno", remoteFullPath);
  2057. if (type == "add")
  2058. {
  2059. submit("TXMPL03306");
  2060. }
  2061. else if(type == "ins")
  2062. {
  2063. submit("TXMPL03307");
  2064. }
  2065. else if(type == "rep")
  2066. {
  2067. submit("TXMPL03307");
  2068. }
  2069. if (sub == "trash")
  2070. {
  2071. LTPFilePut(remoteFullPath, localpath, "trash");
  2072. // opener.optPageTotal.text = pareseInt(opener.optPageTotal.text) +
  2073. // 1;
  2074. }
  2075. else if (sub == "parent")
  2076. {
  2077. LTPFilePut(remoteFullPath, localpath, "parent");
  2078. // optPageTotal.text = optPageTotal.text - delpage;
  2079. // iviewer1.optPageTotal.text = parseInt(iviewer1.optPageTotal.text)
  2080. // + 1;
  2081. }
  2082. else if (sub == "parentparent")
  2083. {
  2084. LTPFilePut(remoteFullPath, localpath, "parentparent");
  2085. }
  2086. else
  2087. {
  2088. LTPFilePut(remoteFullPath, localpath);
  2089. // parent.iviewer1.optPageTotal.text =
  2090. // parseInt(parent.iviewer1.optPageTotal.text) + 1;
  2091. }
  2092. }
  2093. }
  2094. function scanInsertBatch(file, type, sub, bPage)
  2095. {
  2096. var l_file;
  2097. var i ;
  2098. var remotePath;
  2099. var remoteFileName;
  2100. var remoteFullPath;
  2101. var localPath;
  2102. var dirs = new Array();
  2103. var savefile;
  2104. var SaveIP;
  2105. var stryear = getYear();
  2106. var strmonth = getMonth();
  2107. var strday = getDay();
  2108. var strtime
  2109. var strmilliseconds
  2110. var i;
  2111. var extension;
  2112. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2113. var sSaveData = "status▦patid▦ioflag▦pathid▦fileno▦scanuser▦instcd▩";
  2114. var pathid;
  2115. var scanuser;
  2116. var instcd;
  2117. var patid;
  2118. var ioflag;
  2119. var page;
  2120. var bPage;
  2121. if (parent.model.getValue("/root/cond/scantype") == "OCR")
  2122. {
  2123. patid = parent.model.getValue("/root/user/scanuser");
  2124. ioflag = "Z";
  2125. instcd = parent.model.getValue("/root/user/instcd");
  2126. scanuser = parent.model.getValue("/root/user/scanuser");
  2127. pathid = parent.model.getValue("/root/user/pathid");
  2128. }
  2129. else
  2130. {
  2131. if (sub == "parent")
  2132. {
  2133. patid = dg_treat.valueMatrix(dg_treat.row, dg_treat.colref("patid"));
  2134. ioflag = dg_treat.valueMatrix(dg_treat.row, dg_treat.colref("class"));
  2135. instcd = parent.model.getValue("/root/user/instcd");
  2136. scanuser = parent.model.getValue("/root/user/scanuser");
  2137. pathid = parent.model.getValue("/root/user/pathid");
  2138. }
  2139. else if (sub == "parentparent")
  2140. {
  2141. patid = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  2142. ioflag = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("class"));
  2143. instcd = parent.parent.model.getValue("/root/user/instcd");
  2144. scanuser = parent.parent.model.getValue("/root/user/scanuser");
  2145. pathid = parent.parent.model.getValue("/root/user/pathid");
  2146. }
  2147. else if (sub =="trash")
  2148. {
  2149. patid = opener.ipt_pid.currentText;
  2150. ioflag = dg_trash.valueMatrix(dg_trash.row, dg_trash.colref("class"));
  2151. instcd = opener.parent.model.getValue("/root/user/instcd");
  2152. scanuser = opener.parent.model.getValue("/root/user/scanuser");
  2153. pathid = opener.parent.model.getValue("/root/user/pathid");
  2154. }
  2155. }
  2156. if (sub == "parent")
  2157. {
  2158. remotePath = parent.model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2159. parent.f_ltp.FolderCreate(remotePath);
  2160. }
  2161. else if (sub == "parentparent")
  2162. {
  2163. remotePath = parent.parent.model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2164. parent.parent.f_ltp.FolderCreate(remotePath);
  2165. }
  2166. else if (sub == "trash")
  2167. {
  2168. remotePath = opener.parent.model.getvalue("root/main/ltpscaninfo/ltpscanpath");
  2169. opener.parent.f_ltp.FolderCreate(remotePath);
  2170. }
  2171. l_file = file.split("|");
  2172. for(i=0; i <= l_file.length -1 ; i++)
  2173. {
  2174. strmilliseconds = getMilliseconds();
  2175. strtime = getTime();
  2176. localpath = l_file[i];
  2177. extension = fso.GetExtensionName(localpath);
  2178. remoteFileName = "\\" + stryear + "" + strmonth + "" + strday + "" + strtime + "" + strmilliseconds + "." + extension
  2179. remoteFullPath = remotePath + remoteFileName;
  2180. if (sub == "parentparent")
  2181. {
  2182. // parent.iviewer1.f_View.PageHiddenText(i + bPage + 1) =
  2183. // remoteFullPath;
  2184. // parent.iviewer1.f_View.PageText(i + bPage + 1) = i + bPage + 1;
  2185. }
  2186. else if (sub == "trash")
  2187. {
  2188. opener.iviewer1.f_View.PageHiddenText(i + bPage + 1) = remoteFullPath;
  2189. opener.iviewer1.f_View.PageText(i + bPage + 1) = i + bPage + 1;
  2190. }
  2191. else
  2192. {
  2193. iviewer1.f_View.PageHiddenText(i + bPage + 1) = remoteFullPath;
  2194. iviewer1.f_View.PageText(i + bPage + 1) = i + bPage + 1;
  2195. }
  2196. sSaveData += "d▦" + patid + "▦" + ioflag + "▦" + pathid + "▦" + remoteFullPath + "▦" + scanuser + "▦" + instcd + "▩";
  2197. if (sub == "parent")
  2198. {
  2199. LTPFilePut(remoteFullPath, localpath, "parent");
  2200. }
  2201. else if (sub == "parentparent")
  2202. {
  2203. LTPFilePut(remoteFullPath, localpath, "parentparent");
  2204. }
  2205. else if (sub == "trash")
  2206. {
  2207. LTPFilePut(remoteFullPath, localpath, "trash");
  2208. }
  2209. else
  2210. {
  2211. LTPFilePut(remoteFullPath, localpath);
  2212. }
  2213. }
  2214. model.setvalue("/root/send/scaninfo/fileno", sSaveData);
  2215. if (type == "add")
  2216. {
  2217. submit("TXMPL03306");
  2218. }
  2219. else if(type == "ins")
  2220. {
  2221. submit("TXMPL03307");
  2222. }
  2223. else if(type == "rep")
  2224. {
  2225. submit("TXMPL03307");
  2226. }
  2227. }
  2228. function findIndex(data, type)
  2229. {
  2230. if (rdo_index.value == "clinname")
  2231. {
  2232. var col = 0;
  2233. }
  2234. else
  2235. {
  2236. var col = 2;
  2237. }
  2238. var startRow = model.getValue("/root/send/paget/findrow");
  2239. var findrow = dg_index1.findrow(data, parseInt(startRow), parseInt(col), false, false);
  2240. dg_index1.select(findrow, 0, findrow, 2) = true;
  2241. if (type == "OLD")
  2242. {
  2243. model.setValue("/root/send/paget/formcode", dg_index1.textmatrix(findrow, 2));
  2244. model.refresh();
  2245. submit("TRMPL03316")
  2246. var totpage = dg_index1.valueMatrix(findrow, dg_index1.colref("page"));
  2247. iviewer2.window.javascript.ClearChart();
  2248. iviewer2.window.javascript.downloadChart(totpage, "index");
  2249. iviewer2.window.javascript.appendchart(totpage);
  2250. model.setvalue("/root/send/beforeclick/index", dg_index1.row)
  2251. model.setValue("/root/send/paget/findrow", findrow + 1);
  2252. }
  2253. dg_index1.topRow = findrow;
  2254. return findrow;
  2255. }
  2256. function scanSetting(codekey)
  2257. {
  2258. var scantype;
  2259. var scancolor;
  2260. var scanfront;
  2261. var scanback;
  2262. var scansize;
  2263. var scandpi;
  2264. var scansetid;
  2265. var scanArry;
  2266. model.setValue("/root/cond/scanset/codekey", codekey);
  2267. model.setValue("/root/cond/scanset/modekey", "scan");
  2268. model.setValue("/root/cond/scanset/instcd", parent.model.getValue("/root/user/instcd"));
  2269. model.setValue("/root/cond/scanset/userid", parent.model.getValue("/root/user/scanuser"));
  2270. submit("TRMPL03310");
  2271. var scansetting = model.getValue("/root/main/scanset/scansetting");
  2272. if (scansetting == "")
  2273. {
  2274. alert("저장 된 설정이 없습니다.");
  2275. return;
  2276. }
  2277. scanArry = scansetting.split("|")
  2278. scantype = scanArry[0];
  2279. scancolor = scanArry[1];
  2280. scanfront = scanArry[2];
  2281. scanback = scanArry[3];
  2282. scansize = scanArry[4];
  2283. scandpi = scanArry[5];
  2284. scanfront.value = scanfront;
  2285. scanback.value = scanback;
  2286. scansize.value = scansize;
  2287. scandpi.value = scandpi;
  2288. switch(scanfront)
  2289. {
  2290. case "Front0":
  2291. model.setValue("/root/main/combofront", scanfront);
  2292. case "Front90":
  2293. model.setValue("/root/main/combofront", scanfront);
  2294. case "Front180":
  2295. model.setValue("/root/main/combofront", scanfront);
  2296. case "Front270":
  2297. model.setValue("/root/main/combofront", scanfront);
  2298. }
  2299. switch(scanback)
  2300. {
  2301. case "Back0":
  2302. model.setValue("/root/main/comboback", scanback);
  2303. case "Back90":
  2304. model.setValue("/root/main/comboback", scanback);
  2305. case "Back180":
  2306. model.setValue("/root/main/comboback", scanback);
  2307. case "Back270":
  2308. model.setValue("/root/main/comboback", scanback);
  2309. }
  2310. switch(scansize)
  2311. {
  2312. case "A4":
  2313. model.setValue("/root/main/combosize", scansize);
  2314. case "A3":
  2315. model.setValue("/root/main/combosize", scansize);
  2316. }
  2317. switch(scandpi)
  2318. {
  2319. case "200dpi":
  2320. model.setValue("/root/main/combodpi", scandpi);
  2321. case "300dpi":
  2322. model.setValue("/root/main/combodpi", scandpi);
  2323. }
  2324. switch(scantype)
  2325. {
  2326. case "단면":
  2327. btn_feed1.disabled = "true";
  2328. btn_feed2.disabled = "false";
  2329. btn_feed3.disabled = "false";
  2330. break;
  2331. case "양면":
  2332. btn_feed1.disabled = "false";
  2333. btn_feed2.disabled = "true";
  2334. btn_feed3.disabled = "false";
  2335. break;
  2336. case "평판":
  2337. btn_feed1.disabled = "false";
  2338. btn_feed2.disabled = "false";
  2339. btn_feed3.disabled = "true";
  2340. break;
  2341. default:
  2342. btn_feed1.disabled = "false";
  2343. btn_feed2.disabled = "false";
  2344. btn_feed3.disabled = "false";
  2345. break;
  2346. }
  2347. switch(scancolor)
  2348. {
  2349. case "BLK":
  2350. btn_color1.disabled = "true";
  2351. btn_color2.disabled = "false";
  2352. btn_color3.disabled = "false";
  2353. break;
  2354. case "PLT":
  2355. btn_color1.disabled ="false";
  2356. btn_color2.disabled = "true";
  2357. btn_color3.disabled = "false";
  2358. break;
  2359. case "RGB":
  2360. btn_color1.disabled = "false";
  2361. btn_color2.disabled = "false";
  2362. btn_color3.disabled = "true";
  2363. break;
  2364. default:
  2365. btn_color1.disabled = "false";
  2366. btn_color2.disabled = "false";
  2367. btn_color3.disabled = "false";
  2368. break;
  2369. }
  2370. model.refresh();
  2371. }
  2372. function saveImageFileDialogs(maxBytes) {
  2373. var savename;
  2374. var file;
  2375. savename = parent.model.getValue("/root/send/scaninfo/patid") + "_" + parent.model.getValue("/root/send/scaninfo/clincode");
  2376. file = window.fileDialog("save","","false",savename,"","All Files (*.*)|*.*|JPEG Files(*.jpg)|*.jpg|GIF Files(*.gif)|*.gif|BMP Files(*.bmp)|*.bmp");
  2377. if (file != "" && maxBytes != null) { // 파일 크기 확인
  2378. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2379. var f = fso.GetFile(file);
  2380. if (f.size > maxBytes) {
  2381. messageBox("파일 크기가 최대치("+(maxBytes/1024)+"K)를","E003");
  2382. return "";
  2383. }
  2384. }
  2385. return file;
  2386. }
  2387. function OcrImageLoad(ocrtag)
  2388. {
  2389. var rc;
  2390. var ResultBuffer;
  2391. var i;
  2392. var arrocrtag;
  2393. var ocrtag;
  2394. for (i = 1; i <= iviewer1.window.f_View.PageTotal; i++)
  2395. {
  2396. if (OCR.TypeAppend("E:\\HIS\\friendlyImaging\\2012-04-24\\friendlyWrapperOCR_Tester\\OCRTYPES.bmp", "#+0123456789") == false)
  2397. {
  2398. alert("활자 실패");
  2399. }
  2400. rc= OCR.Recognition(iviewer1.window.f_View.PageFilePath(i), 1, 1);
  2401. arrocrtag = OCR.LastRecogedText.split("RECOG_TEXT : ");
  2402. ocrtag = arrocrtag[1].substring(1, 13);
  2403. }
  2404. }
  2405. function RefreshPaperList()
  2406. {
  2407. var papers;
  2408. var i;
  2409. var scanArry;
  2410. var scantype;
  2411. // cmbPaper.Clear
  2412. // alert(f_Twain.FeaturePaper);
  2413. /*
  2414. * if(UBound(f_Twain.FeaturePaper) < 0) { }
  2415. *
  2416. * papers = f_Twain.FeaturePaper
  2417. *
  2418. * scanArry = papers.split("|")
  2419. *
  2420. * scantype = scanArry[0];
  2421. *
  2422. * //alert(papers);
  2423. *
  2424. * for (i = LBound(papers); i < UBound(papers); i++) { //cmbPaper.AddItem
  2425. * papers(i)
  2426. *
  2427. * if (f_Twain.ScannerPaper == papers(i)) { //cmbPaper.ListIndex = i } }
  2428. */
  2429. }
  2430. function scanersetting(scantype, scancolor, size, dpi, brightness, threshold, contrast)
  2431. {
  2432. // feeder , pixel type, size, dpi, 밝기, 임계값, 대비
  2433. // alert("2 " + scantype);
  2434. /*
  2435. *
  2436. * if (scantype == "단면") { scantype = "ADF(앞면)" } else if (scantype == "양면") {
  2437. * scantype = "ADF(양면)" }
  2438. */
  2439. //alert("scanersetting " + scantype);
  2440. // scantype = "ADF(앞면)"
  2441. parent.f_Twain.ScannerFeeder = scantype;
  2442. parent.f_Twain.ScannerAcquireUI = false;
  2443. parent.f_Twain.ScannerAcquireIndicator = false;
  2444. parent.f_Twain.ScannerPixelType = scancolor
  2445. parent.f_Twain.ScannerXResolution = dpi.substr(0, 3);
  2446. parent.f_Twain.ScannerYResolution = dpi.substr(0, 3);
  2447. parent.f_Twain.ScannerBrightness = brightness
  2448. parent.f_Twain.ScannerThreshold = threshold
  2449. parent.f_Twain.ScannerContrast = contrast
  2450. }
  2451. function DelLocalFolder()
  2452. {
  2453. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2454. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer") == true)
  2455. {
  2456. fso.DeleteFolder(fso.GetSpecialFolder(2) + "\\LCViewer");
  2457. }
  2458. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer") == false)
  2459. {
  2460. fso.CreateFolder(fso.GetSpecialFolder(2) + "\\LCViewer");
  2461. }
  2462. }
  2463. function TrashFolder()
  2464. {
  2465. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2466. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer\\trash") == true)
  2467. {
  2468. fso.DeleteFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\trash");
  2469. }
  2470. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer\\trash") == false)
  2471. {
  2472. fso.CreateFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\trash");
  2473. }
  2474. }
  2475. function copyfile(org_path, page, type)
  2476. {
  2477. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2478. var dfile;
  2479. var patno = "undo";
  2480. if (fso.FileExists(org_path) == true)
  2481. {
  2482. dfile = fso.GetFile(org_path);
  2483. dfile.Copy(fso.GetSpecialFolder(2) + "\\LCViewer\\trash\\" + patno + "-" + page + "-" + type + "-" + fso.GetFileName(org_path));
  2484. }
  2485. }
  2486. function Trash(fv)
  2487. {
  2488. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2489. var filename = fv.PageFilePath(optPageCurrent.text);
  2490. var RemotePath = fv.PageHiddenText(optPageCurrent.text);
  2491. var dfile;
  2492. if (fso.FileExists(fso.GetSpecialFolder(2) + "\\LCViewer\\" + "trash\\" + fso.GetFileName(filename)) == true)
  2493. {
  2494. dfile = fso.GetFile(fso.GetSpecialFolder(2) + "\\LCViewer\\" + "trash\\" + fso.GetFileName(filename));
  2495. }
  2496. if (fso.FileExists(filename) == true)
  2497. {
  2498. fso.DeleteFile(filename);
  2499. }
  2500. dfile.Move(fso.GetSpecialFolder(2) + "\\LCViewer\\" + fso.GetFileName(filename));
  2501. LocalPath = fv.PageFilePath(optPageCurrent.text);
  2502. RemotePath = fv.PageHiddenText(optPageCurrent.text);
  2503. LTPFilePut(RemotePath, LocalPath);
  2504. }
  2505. function openScanLoad(filename)
  2506. {
  2507. var file;
  2508. opener.iviewer1.f_View.AutoRefresh = false;
  2509. opener.iviewer1.f_View.pageappend(filename, 1, 1);
  2510. opener.iviewer1.f_View.PageHiddenText(i) = filename
  2511. opener.iviewer1.f_View.AutoRefresh = true;
  2512. }
  2513. function fileFut(fv, type, page, gubun)
  2514. {
  2515. var filename;
  2516. var ltppath = parent.model.getvalue("/root/main/ltpindexinfo/ltpindexpath");
  2517. var cdate;
  2518. var ctime;
  2519. var cdateyyyymm;
  2520. var cdatedd;
  2521. var pageno;
  2522. var j = 1;
  2523. var extension;
  2524. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2525. var gridpath;
  2526. var n;
  2527. cdate = parent.model.getValue("/root/main/now/sysdate");
  2528. cdate = cdate.substr(0, 8);
  2529. cdateyyyymm = cdate.substr(0, 6);
  2530. cdatedd = cdate.substr(6, 2);
  2531. if (iviewer1.rdo_viewmode.value == "TV")
  2532. {
  2533. for (i=1; i<=fv.PageTotal; i++)
  2534. {
  2535. if (type == "OLD")
  2536. {
  2537. if (fv.ThumbnailSelect(i) == true)
  2538. {
  2539. pageno = model.getValue("/root/main/paget[" + j + "]/pageno");
  2540. filename = fv.PageFilePath(i);
  2541. extension = fso.GetExtensionName(filename);
  2542. remotepath = ltppath + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + pageno.substr(pageno.length - 1, 1) + "\\" + pageno + "." + extension
  2543. iviewer2.f_View.PageHiddenText(parseInt(page) + parseInt(j)) = remotepath;
  2544. LTPFilePut(remotepath, filename, "parent");
  2545. j = j + 1;
  2546. }
  2547. }
  2548. else
  2549. {
  2550. filename = fv.PageFilePath(i);
  2551. for (n=1; n <= dg_treat.rows - 1; n++)
  2552. {
  2553. gridpath = dg_treat.valueMatrix(n, dg_treat.colref("fileno"));
  2554. if (gridpath == filename)
  2555. {
  2556. pageno = model.getValue("/root/main/paget[" + n + "]/pageno");
  2557. extension = fso.GetExtensionName(filename);
  2558. remotepath = ltppath + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + pageno.substr(pageno.length - 1, 1) + "\\" + pageno + "." + extension
  2559. LTPFilePut(remotepath, filename, "parent");
  2560. j = j + 1;
  2561. }
  2562. }
  2563. }
  2564. }
  2565. }
  2566. else if (iviewer1.rdo_viewmode.value == "PV")
  2567. {
  2568. pageno = model.getValue("/root/main/paget/pageno");
  2569. filename = fv.PageFilePath(fv.PageCurrent);
  2570. extension = fso.GetExtensionName(filename);
  2571. remotepath = ltppath + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + pageno.substr(pageno.length - 1, 1) + "\\" + pageno + "." + extension
  2572. LTPFilePut(remotepath, filename, "parent");
  2573. }
  2574. }
  2575. function repFile(fv, fv_1)
  2576. {
  2577. var localPath;
  2578. var remotePath;
  2579. var i;
  2580. var localpage = fv.model.getValue("/root/main/chartinfo/pagecurrent");
  2581. var remotepage = fv_1.model.getValue("/root/main/chartinfo/pagecurrent");
  2582. localPath = fv.f_View.PageFilePath(localpage);
  2583. remotePath = fv_1.f_View.PageHiddenText(remotepage);
  2584. /*
  2585. * alert(localpage); alert(remotepage); alert(localPath); alert(remotePath);
  2586. */
  2587. LTPFilePut(remotePath, localPath, "parent");
  2588. fv_1.f_View.PageInsert(remotepage, localPath, 1, 1);
  2589. // fv_1.f_View.PageCurrent = remotepage;
  2590. // fv_1.f_View.PageRemove(remotepage + 1, remotepage + 1);
  2591. // fv.PageHiddenText(remotepage) = fv_temp.PageHiddenText(i);
  2592. }
  2593. function Skew()
  2594. {
  2595. var i;
  2596. var movepath;
  2597. var LocalPath;
  2598. var RemotePath;
  2599. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2600. var dfile;
  2601. var patno = "undo";
  2602. TrashFolder()
  2603. f_View.AutoRefresh = false;
  2604. for (i=1; i <= f_View.PageTotal; i++)
  2605. {
  2606. if(f_View.ThumbnailSelect(i) == true)
  2607. {
  2608. f_View.PageCurrent= i
  2609. f_View.ActionParamINT1 = parent.rgb(255, 255, 255);
  2610. f_View.ActionSingle = 16;
  2611. copyfile(f_View.PageFilePath(i), i, "R")
  2612. f_View.FileSaveCreate(f_View.PageFilePath(i), -1);
  2613. f_View.ActionParamINT1 = i;
  2614. f_View.ActionThumbnail = 1;
  2615. LocalPath = f_View.PageFilePath(i);
  2616. RemotePath = f_View.PageHiddenText(i);
  2617. LTPFilePut(RemotePath, LocalPath);
  2618. }
  2619. }
  2620. f_View.AutoRefresh = true;
  2621. }
  2622. function PageCurrentChanged()
  2623. {
  2624. model.setValue("/root/main/chartinfo/pagecurrent", f_View.PageCurrent);
  2625. model.setValue("/root/main/chartinfo/pagetotal", f_View.PageTotal);
  2626. model.refresh();
  2627. }
  2628. function fvSaveCreate()
  2629. {
  2630. var i;
  2631. var localPath;
  2632. var remotePath;
  2633. if (rdo_viewmode.value == "TV")
  2634. {
  2635. for (i=1; i <= f_View.PageTotal; i++)
  2636. {
  2637. if(f_View.ThumbnailSelect(i) == true)
  2638. {
  2639. localPath = f_View.PageFilePath(i);
  2640. RemotePath = f_View.PageHiddenText(i);
  2641. LTPFilePut(RemotePath, localPath);
  2642. }
  2643. }
  2644. }
  2645. else
  2646. {
  2647. localPath = f_View.PageFilePath(f_View.PageCurrent);
  2648. RemotePath = f_View.PageHiddenText(f_View.PageCurrent);
  2649. LTPFilePut(RemotePath, localPath);
  2650. }
  2651. }
  2652. function shortkey(formcode)
  2653. {
  2654. parent.iviewer2.window.javascript.ClearChart();
  2655. parent.rdo_index.value == "clincode"
  2656. parent.model.setValue("/root/cond/rdo_index", "clincode");
  2657. parent.model.refresh();
  2658. parent.input1.currentText = formcode
  2659. var data;
  2660. var toprow
  2661. var startRow = 1;
  2662. var col = 2;
  2663. data = parent.input1.currentText;
  2664. if (parent.rdo_index.value == "clinname")
  2665. {
  2666. col = 0;
  2667. }
  2668. else if (parent.rdo_index.value == "clincode")
  2669. {
  2670. col = 2;
  2671. }
  2672. var findrow = parent.dg_index1.findrow(data, parseInt(startRow), parseInt(col), false, false);
  2673. parent.dg_index1.select(findrow, 0, findrow, 2) = true;
  2674. parent.dg_index1.topRow = findrow;
  2675. model.setvalue("/root/send/paget/treatno", parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("treatno")))
  2676. model.setvalue("/root/send/paget/formcode", parent.input1.currentText);
  2677. model.setvalue("/root/send/paget/instcd", parent.parent.model.getValue("/root/user/instcd"));
  2678. submit("TRMPL03316")
  2679. var totpage = getNodesetCount("/root/main/imgpath");
  2680. parent.iviewer2.window.javascript.downloadChart(totpage, "index", "", "shortkey");
  2681. parent.iviewer2.window.javascript.appendchart(totpage, "shortkey");
  2682. // parent.model.setvalue("/root/send/beforeclick/index",
  2683. // parent.dg_index1.row);
  2684. parent.dg_index1.textmatrix(parent.dg_index1.row, 1) = parent.iviewer2.f_View.PageTotal;
  2685. parent.btn_add.dispatch("onclick");
  2686. }
  2687. function selectshortkey()
  2688. {
  2689. var i;
  2690. var selflag;
  2691. parent.chk_indexlist.value = "Y"
  2692. parent.btn_indexsear.dispatch("onclick");
  2693. if (parent.chk_indexlist.value != "Y")
  2694. {
  2695. alert("전체 인덱스를 설정 후 진행 하세요");
  2696. return;
  2697. }
  2698. for (i=1; i <= f_View.PageTotal; i++)
  2699. {
  2700. if(f_View.ThumbnailSelect(i) == true)
  2701. {
  2702. selflag = "true";
  2703. }
  2704. }
  2705. if (selflag != "true")
  2706. {
  2707. alert("선택 된 이미지가 없습니다.");
  2708. return;
  2709. }
  2710. submit("TRMPL03324");
  2711. var count = getNodesetCount("/root/main/shortinfo/formcode");
  2712. if (count > 0)
  2713. {
  2714. parent.model.setValue("/root/send/paget/formcode", model.getValue("/root/main/shortinfo/formcode"));
  2715. shortkey(model.getValue("/root/main/shortinfo/formcode"));
  2716. }
  2717. else
  2718. {
  2719. alert("저장 된 단축키 설정이 없습니다.");
  2720. }
  2721. parent.chk_indexlist.value = ""
  2722. parent.btn_indexsear.dispatch("onclick");
  2723. }
  2724. function findshortkey(shortkey)
  2725. {
  2726. var i;
  2727. for (i=1; i <= dg_shortkey.rows - 1; i++)
  2728. {
  2729. if (dg_shortkey.textmatrix(i, 0) == shortkey)
  2730. {
  2731. alert("저장 된 단축 키 설정이 있습니다.");
  2732. return;
  2733. }
  2734. }
  2735. dg_shortkey.textmatrix(dg_shortkey.row, 0) = shortkey;
  2736. }
  2737. function findformcode(formcode)
  2738. {
  2739. var i;
  2740. for (i=1; i <= dg_shortkey.rows - 1; i++)
  2741. {
  2742. if (dg_shortkey.textmatrix(i, 1) == formcode)
  2743. {
  2744. alert(dg_shortkey.textmatrix(i, 0) + " 으로 지정 된 서식 입니다.");
  2745. return;
  2746. }
  2747. }
  2748. dg_shortkey.textmatrix(dg_shortkey.row, 1) = dg_index1.textmatrix(dg_index1.row, 1);
  2749. dg_shortkey.textmatrix(dg_shortkey.row, 2) = dg_index1.textmatrix(dg_index1.row, 0);
  2750. }
  2751. function trashbackup(type)
  2752. {
  2753. var fso, f, fc, s;
  2754. var workmode = model.getValue("/root/cond/workmode");
  2755. var pageno;
  2756. var patno;
  2757. var patid = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  2758. var pathid = parent.parent.model.getvalue("/root/main/ltpindexinfo/pathid");
  2759. var cuserid = parent.parent.model.getValue("/root/user/scanuser");
  2760. var treatno = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("treatno"));
  2761. var formcode = parent.model.getvalue("/root/send/paget/formcode");
  2762. var instcd = parent.parent.model.getValue("/root/user/instcd");
  2763. var sSaveData = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▩";
  2764. var sColorData = "status▦patid▦fileno▦gubun▦instcd▩";
  2765. var cdate = parent.parent.model.getValue("/root/main/now/sysdate");
  2766. var cdateyyyymm;
  2767. var cdatedd;
  2768. var localpath;
  2769. var ltppath = parent.parent.model.getvalue("/root/main/ltpindexinfo/ltpindexpath");
  2770. cdate = cdate.substr(0, 8);
  2771. cdateyyyymm = cdate.substr(0, 6);
  2772. cdatedd = cdate.substr(6, 2);
  2773. fso = new ActiveXObject("Scripting.FileSystemObject");
  2774. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer\\trash") == true)
  2775. {
  2776. // f =
  2777. // fso.GetFolder("C:\\Users\\Administrator\\AppData\\Local\\Temp\\LCViewer\\Trash");
  2778. f = fso.GetFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\trash");
  2779. fc = new Enumerator(f.files);
  2780. s = "";
  2781. for (; !fc.atEnd(); fc.moveNext())
  2782. {
  2783. var remotePath = fc.item();
  2784. var trashfilename = fso.GetFileName(fc.item());
  2785. var ltpPath;
  2786. // var localPath = fso.GetSpecialFolder(2) + "\\LCViewer\\" +
  2787. // trashfilename;
  2788. var localPath = fso.GetSpecialFolder(2) + "\\LCViewer\\";
  2789. var page;
  2790. var localfullpath;
  2791. filename = trashfilename.split("-");
  2792. trashType = filename[2];
  2793. page = filename[1];
  2794. localfilename = filename[3];
  2795. localfullpath = localPath + localfilename
  2796. // ltpPath =
  2797. // parent.parent.model.getValue("/root/main/ltpscaninfo/ltpscanpath")
  2798. // + "\\" + trashfilename;
  2799. ltpPath = parent.parent.model.getValue("/root/main/ltpscaninfo/ltpscanpath") + "\\" + localfilename;
  2800. switch(trashType)
  2801. {
  2802. case "I", "S":
  2803. // insert update 추가
  2804. if (workmode == "OCR")
  2805. {
  2806. model.setValue("/root/send/scaninfo/patid", parent.parent.model.getValue("/root/user/scanuser"));
  2807. model.setValue("/root/send/scaninfo/class", "Z");
  2808. }
  2809. else
  2810. {
  2811. model.setValue("/root/send/scaninfo/patid", parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid")));
  2812. model.setValue("/root/send/scaninfo/class", parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("class")));
  2813. }
  2814. model.setValue("/root/send/scaninfo/instcd", parent.parent.model.getValue("/root/user/instcd"));
  2815. model.setValue("/root/send/scaninfo/pathid", parent.parent.model.getValue("/root/user/pathid"));
  2816. model.setValue("/root/send/scaninfo/fileno", ltpPath);
  2817. model.setValue("/root/send/scaninfo/scanuser", parent.parent.model.getValue("/root/user/scanuser"));
  2818. model.setValue("/root/send/scaninfo/page", page);
  2819. submit("TXMPL03316");
  2820. submit("TXMPL03307");
  2821. dfile = fso.GetFile(remotePath);
  2822. dfile.Copy(localfullpath);
  2823. if (fso.FileExists(localPath) == true)
  2824. {
  2825. fso.DeleteFile(localPath);
  2826. }
  2827. LTPFilePut(ltpPath, localfullpath, "parentparent");
  2828. // f_View.PageAppend(localPath, 1, 1);
  2829. f_View.PageInsert(page, localfullpath, 1, 1);
  2830. f_View.PageCurrent = f_View.PageTotal
  2831. f_View.PageHiddenText(f_View.PageTotal) = ltpPath;
  2832. break;
  2833. // var bPage = f_View.PageTotal;
  2834. // scanInsertBatch(trashfilename, "add", "parentparent",
  2835. // bPage);
  2836. case "R":
  2837. dfile = fso.GetFile(remotePath);
  2838. dfile.Copy(localfullpath);
  2839. if (fso.FileExists(localPath) == true)
  2840. {
  2841. fso.DeleteFile(localPath);
  2842. }
  2843. // ltpPath = f_View.PageHiddenText(page);
  2844. LTPFilePut(ltpPath, localfullpath, "parentparent");
  2845. f_View.PageRemove(page, page);
  2846. f_View.PageInsert(page, localfullpath, 1, 1);
  2847. f_View.PageCurrent = page;
  2848. f_View.PageHiddenText(page) = ltpPath;
  2849. f_View.ActionParamINT1 = page;
  2850. f_View.ActionThumbnail = 1;
  2851. break;
  2852. case "Y":
  2853. dfile = fso.GetFile(remotePath);
  2854. dfile.Copy(localfullpath);
  2855. if (fso.FileExists(localPath) == true)
  2856. {
  2857. fso.DeleteFile(localPath);
  2858. }
  2859. filesize = "";
  2860. extension = fso.GetExtensionName(localfullpath);
  2861. filesize = fso.GetFile(localfullpath).size;
  2862. sSaveData += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▩";
  2863. f_View.PageAppend(localfullpath, 1, 1);
  2864. f_View.PageText(i) = (f_View.PageTotal, f_View.PageTotal);
  2865. parent.dg_index1.textmatrix(parent.dg_index1.row, 1) = f_View.PageTotal;
  2866. break;
  2867. case "B":
  2868. dfile = fso.GetFile(remotePath);
  2869. dfile.Copy(localfullpath);
  2870. if (fso.FileExists(localPath) == true)
  2871. {
  2872. fso.DeleteFile(localPath);
  2873. }
  2874. LTPFilePut(ltpPath, localfullpath, "parentparent");
  2875. f_View.PageRemove(page, page);
  2876. f_View.PageInsert(page, localfullpath, 1, 1);
  2877. f_View.PageCurrent = page;
  2878. f_View.PageHiddenText(page) = ltpPath;
  2879. f_View.ActionParamINT1 = page;
  2880. f_View.ActionThumbnail = 1;
  2881. ltpPath = ltpPath.replace("jpg", "tif")
  2882. sColorData += "d▦" + patid + "▦" + ltpPath + "▦" + "B" + "▦" + instcd + "▩";
  2883. break;
  2884. }
  2885. }
  2886. switch(type)
  2887. {
  2888. case "index":
  2889. model.setValue("/root/send/paget/pageno", sSaveData);
  2890. submit("TXMPL03301");
  2891. f = fso.GetFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\trash");
  2892. fc = new Enumerator(f.files);
  2893. s = "";
  2894. var i = 0;
  2895. for (; !fc.atEnd(); fc.moveNext())
  2896. {
  2897. i = i + 1;
  2898. pageno = model.getValue("/root/main/paget[" + i + "]/pageno");
  2899. localpath = fc.item();
  2900. extension = fso.GetExtensionName(fc.item());
  2901. remotepath = ltppath + "\\" + cdateyyyymm + "\\" + cdatedd + "\\" + pageno.substr(pageno.length - 1, 1) + "\\" + pageno + "." + extension
  2902. LTPFilePut(remotepath, localpath, "parentparent");
  2903. f_View.PageHiddenText(i) = remotepath;
  2904. }
  2905. break;
  2906. }
  2907. switch(trashType)
  2908. {
  2909. case "B":
  2910. model.setValue("/root/send/colortobw/fileno", sColorData);
  2911. submit("TXMPL03345");
  2912. break;
  2913. }
  2914. }
  2915. for (i=1; i<=f_View.PageTotal; i++)
  2916. {
  2917. f_View.PageText(i) = i;
  2918. }
  2919. }
  2920. function trashmove()
  2921. {
  2922. var filename; // = model.getValue("root/send/delimage/imageno");
  2923. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2924. var pageno;
  2925. var selpage;
  2926. var i;
  2927. var cdate;
  2928. var ctime;
  2929. var delfoler = parent.parent.model.getValue("/root/main/ltpindexinfo/ltpindexpath") + "\\" + "delfolder";
  2930. var bDelData = "status▦pageno▦instcd▩";
  2931. var bUpdpageData = "status▦treatno▦formcode▦page▦instcd▩"
  2932. var bIntPageDelLogt = "status▦pageno▦patid▦indate▦clincode▦class▦doccode▦formcode▦page▦cdate▦ctime▦cuserid▦treatno▦ocrcode▦instcd▩";
  2933. var instcd = parent.parent.model.getValue("/root/user/instcd");
  2934. var cuserid = parent.parent.model.getValue("/root/user/scanuser");
  2935. var patid = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  2936. var ioflag = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("class"));
  2937. var formcode = parent.model.getValue("/root/send/paget/formcode");
  2938. var treatno = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("treatno"));
  2939. var clincode = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("clincode"));
  2940. var indate = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("indate"));
  2941. var doccode = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("doccode"));
  2942. var page;
  2943. var cdate;
  2944. var ctime;
  2945. var cutFilename = "";
  2946. parent.parent.f_ltp.FolderCreate(delfoler);
  2947. submit("TRMPL03311");
  2948. cdate = model.getValue("/root/main/now/sysdate").substr(0, 8);
  2949. ctime = model.getValue("/root/main/now/sysdate").substr(8, 6);
  2950. if (delpage == "")
  2951. {
  2952. if (rdo_viewmode.value == "TV")
  2953. {
  2954. for (i=1; i <= f_View.PageTotal; i++)
  2955. {
  2956. if(f_View.ThumbnailSelect(i) == true)
  2957. {
  2958. filename = f_View.PageFilePath(i);
  2959. filehidden = f_View.PageHiddenText(i);
  2960. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2961. selpage = i;
  2962. model.setValue("/root/cond/scanmode", "add");
  2963. page = i;
  2964. if (trash != "trash")
  2965. {
  2966. LTPFilePut(delfoler + "\\" + fso.GetFileName(filehidden), filename, "parentparent");
  2967. }
  2968. filehidden = fso.GetBaseName(filehidden);
  2969. bDelData += "d▦" + filehidden + "▦" + instcd + "▩";
  2970. bUpdpageData += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  2971. bIntPageDelLogt += "d▦" + filehidden + "▦" + patid + "▦" + indate + "▦" + clincode + "▦" + ioflag + "▦00000▦" + formcode + "▦" + page + "▦" + cdate + "▦" + ctime + "▦" + cuserid + "▦" + treatno + "▦" + "" + "▦" + instcd + "▩";
  2972. if(cutFilename == "")
  2973. {
  2974. cutFilename = filename;
  2975. }
  2976. else
  2977. {
  2978. cutFilename = cutFilename + "|";
  2979. cutFilename = cutFilename + filename;
  2980. }
  2981. if (cutyn == "cut")
  2982. {
  2983. parent.iviewer1.f_View.PageAppend(filename, 1, 1);
  2984. }
  2985. }
  2986. }
  2987. model.setValue("/root/send/delimage/updpage", bUpdpageData);
  2988. submit("TXMPL03320");
  2989. model.setValue("/root/send/delimage/pageno", bDelData);
  2990. submit("TXMPL03317");
  2991. if (trash != "trash")
  2992. {
  2993. model.setValue("/root/send/deletepagetinfo/intdellog", bIntPageDelLogt);
  2994. submit("TXMPL03333");
  2995. }
  2996. }
  2997. else
  2998. {
  2999. i = f_View.PageCurrent;
  3000. filename = f_View.PageFilePath(i);
  3001. filehidden = f_View.PageHiddenText(i);
  3002. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3003. selpage = i;
  3004. model.setValue("/root/cond/scanmode", "add");
  3005. page = i;
  3006. LTPFilePut(delfoler + "\\" + fso.GetFileName(filehidden), filename, "parentparent");
  3007. filehidden = fso.GetBaseName(filehidden);
  3008. bDelData += "d▦" + filehidden + "▦" + instcd + "▩";
  3009. bUpdpageData += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  3010. bIntPageDelLogt += "d▦" + filehidden + "▦" + patid + "▦" + indate + "▦" + clincode + "▦" + ioflag + "▦00000▦" + formcode + "▦" + page + "▦" + cdate + "▦" + ctime + "▦" + cuserid + "▦" + treatno + "▦" + "" + "▦" + instcd + "▩";
  3011. if(cutFilename == "")
  3012. {
  3013. cutFilename = filename;
  3014. }
  3015. else
  3016. {
  3017. cutFilename = cutFilename + "|";
  3018. cutFilename = cutFilename + filename;
  3019. }
  3020. if (cutyn == "cut")
  3021. {
  3022. parent.iviewer1.f_View.PageAppend(filename, 1, 1);
  3023. }
  3024. model.setValue("/root/send/delimage/updpage", bUpdpageData);
  3025. submit("TXMPL03320");
  3026. model.setValue("/root/send/delimage/pageno", bDelData);
  3027. submit("TXMPL03317");
  3028. if (trash != "trash")
  3029. {
  3030. model.setValue("/root/send/deletepagetinfo/intdellog", bIntPageDelLogt);
  3031. submit("TXMPL03333");
  3032. }
  3033. }
  3034. if (cutyn == "cut")
  3035. {
  3036. scanInsertBatch(cutFilename, "add", "parentparent");
  3037. }
  3038. }
  3039. else
  3040. {
  3041. filename = f_View.PageFilePath(delpage);
  3042. filehidden = f_View.PageHiddenText(delpage);
  3043. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3044. filehidden = fso.GetBaseName(filehidden);
  3045. sSaveData += "d▦" + filehidden + "▩";
  3046. f_View.PageRemove(delpage, delpage);
  3047. if (fso.FileExists(filehidden) == true)
  3048. {
  3049. fso.DeleteFile(filehidden);
  3050. }
  3051. selpage = delpage;
  3052. model.setValue("root/send/delimage/page", delpage)
  3053. model.setValue("root/send/delimage/pageno", sSaveData);
  3054. submit("TXMPL03317");
  3055. // submit("TXMPL03319");
  3056. submit("TXMPL03320");
  3057. }
  3058. }
  3059. function selectprntcancle()
  3060. {
  3061. var i;
  3062. for (i=1; i<= dg_treat.rows - 1; i++)
  3063. {
  3064. //alert(i);
  3065. model.makeNode("/root/send/temp[" + i + "]/ocrtag");
  3066. ocrtag = dg_treat.valueMatrix(i, dg_treat.colref("ocrtag"))
  3067. model.setValue("/root/send/temp[" + i + "]/ocrtag", ocrtag);
  3068. // copyNodeset("/root/send/ocrreturn/ocrtag", "/root/send/temp[" + i +
  3069. // "]/ocrtag");
  3070. }
  3071. }
  3072. function blankcheck()
  3073. {
  3074. var i;
  3075. var filename;
  3076. var filesize;
  3077. var chkflag;
  3078. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3079. for (i=1; i <= iviewer1.f_View.PageTotal; i++)
  3080. {
  3081. filename = iviewer1.f_View.PageFilePath(i);
  3082. filesize = fso.GetFile(filename).size;
  3083. if(filesize < 5000)
  3084. {
  3085. chkflag = "true"
  3086. }
  3087. }
  3088. return chkflag;
  3089. }
  3090. function DelIndexImgByHit(patid, ioflag, indate, clincode, formcode, cuserid, instcd)
  3091. {
  3092. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3093. var pageno;
  3094. var treatno;
  3095. var formcode;
  3096. var page;
  3097. var patid;
  3098. var indate;
  3099. var clincode;
  3100. var doccode;
  3101. var cdate;
  3102. var ctime;
  3103. var extension;
  3104. var delfoler = model.getValue("/root/main/ltpindexinfo/ltpindexpath") + "\\" + "delfolder";
  3105. var filepath = model.getValue("/root/main/ltpindexinfo/ltpindexpath");
  3106. var bDelData = "status▦pageno▦instcd▩";
  3107. var bUpdpageData = "status▦treatno▦formcode▦page▦instcd▩"
  3108. var bIntPageDelLogt = "status▦pageno▦patid▦indate▦clincode▦class▦doccode▦formcode▦page▦cdate▦ctime▦cuserid▦treatno▦ocrcode▦instcd▩";
  3109. var page;
  3110. var count;
  3111. parent.parent.f_ltp.FolderCreate(delfoler);
  3112. submit("TRMPL03333");
  3113. count = getNodesetCount("/root/main/ocrinfobyocr/pid")
  3114. for (i=1; i <= count; i++)
  3115. {
  3116. pageno = model.getValue("/root/send/trashinfo[" + i + "]/pageno");
  3117. extension = model.getValue("/root/send/trashinfo[" + i + "]/extension");
  3118. treatno = model.getValue("/root/send/trashinfo[" + i + "]/treatno");
  3119. page = model.getValue("/root/send/trashinfo[" + i + "]/page");
  3120. doccode = model.getValue("/root/send/trashinfo[" + i + "]/doccode");
  3121. cdate = model.getValue("/root/send/trashinfo[" + i + "]/cdate");
  3122. ctime = model.getValue("/root/send/trashinfo[" + i + "]/ctime");
  3123. filepath = filepath + "\\" + cdate.substr(0,6) + "\\" + cdate.substr(6,2) + "\\" + pageno.substr(pageno.length - 1, 1) + "\\" + pageno + "." + extension;
  3124. LTPFilePut(delfoler + "\\" + fso.GetFileName(pageno), filepath, "parentparent");
  3125. bDelData += "d▦" + pageno + "▦" + instcd + "▩";
  3126. bUpdpageData += "d▦" + treatno + "▦" + formcode + "▦" + page + "▦" + instcd + "▩";
  3127. bIntPageDelLogt += "d▦" + pageno + "▦" + patid + "▦" + indate + "▦" + clincode + "▦" + ioflag + "▦" + doccode + "▦" + formcode + "▦" + page + "▦" + cdate + "▦" + ctime + "▦" + cuserid + "▦" + treatno + "▦" + "▦" + instcd + "▩";
  3128. }
  3129. model.setValue("/root/send/delimage/updpage", bUpdpageData);
  3130. submit("TXMPL03320");
  3131. model.setValue("/root/send/delimage/pageno", bDelData);
  3132. submit("TXMPL03317");
  3133. model.setValue("/root/send/deletepagetinfo/intdellog", bIntPageDelLogt);
  3134. submit("TXMPL03333");
  3135. }
  3136. function copyaaa()
  3137. {
  3138. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3139. var spath;
  3140. var dpath;
  3141. spath = "C:\\2012040913481450.tif"
  3142. dPath = "C:\\test\\2012040913481450.tif"
  3143. }
  3144. function ColorToBw()
  3145. {
  3146. var moveRootPath;
  3147. var movePath;
  3148. var patid = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  3149. var ioflag = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("class"));
  3150. var instcd = parent.parent.model.getValue("/root/user/instcd");
  3151. var tempfile;
  3152. var page;
  3153. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3154. var sSaveData = "status▦patid▦fileno▦gubun▦instcd▩";
  3155. var fileno;
  3156. TrashFolder()
  3157. f_View.AutoRefresh = false;
  3158. if (rdo_viewmode.value == "TV")
  3159. {
  3160. for (i = 1; i <=f_View.PageTotal; i++)
  3161. {
  3162. if(f_View.ThumbnailSelect(i) == true)
  3163. {
  3164. if (fso.GetExtensionName(f_View.PageFilePath(i)) == "tif")
  3165. {
  3166. }
  3167. else
  3168. {
  3169. f_View.PageCurrent = i
  3170. f_View.ActionSingle = 17;
  3171. copyfile(f_View.PageFilePath(i), i, "B")
  3172. fileno = f_View.PageFilePath(i).replace("jpg", "tif");
  3173. sSaveData += "d▦" + patid + "▦" + f_View.PageHiddenText(i) + "▦" + "C" + "▦" + instcd + "▩";
  3174. RemotePath = f_View.PageHiddenText(i).replace("jpg", "tif");
  3175. f_View.FileSaveCreate(fileno, -1);
  3176. f_View.ActionParamINT1 = i;
  3177. f_View.ActionThumbnail = 1;
  3178. f_View.PageRemove(i, i)
  3179. f_View.PageInsert(i, fileno, 1, 1)
  3180. LocalPath = f_View.PageFilePath(i);
  3181. LTPFilePut(RemotePath, fileno);
  3182. }
  3183. }
  3184. }
  3185. }
  3186. else
  3187. {
  3188. /*
  3189. * if (fso.GetExtensionName(f_View.PageFilePath(i)) == "TIF") { } else {
  3190. * i = f_View.PageCurrent
  3191. *
  3192. * f_View.ActionSingle = 17;
  3193. *
  3194. * copyfile(fv.PageFilePath(i), page, "B")
  3195. *
  3196. * fileno = f_View.PageHiddenText(i).replace("jpg", "tif");
  3197. *
  3198. * sSaveData += "d▦" + patid + "▦" + fileno + "▦" + instcd + "▩";
  3199. *
  3200. * f_View.FileSaveCreate(fileno, -1); f_View.ActionParamINT1 = i;
  3201. * f_View.ActionThumbnail = 1;
  3202. *
  3203. * f_View.PageRemove(i, i) f_View.PageInsert(i, fileno, 1, 1)
  3204. *
  3205. * LocalPath = f_View.PageFilePath(i); RemotePath =
  3206. * f_View.PageHiddenText(i).replace("jpg", "tif"); alert("RemotePath " +
  3207. * RemotePath); alert("fileno " + fileno); LTPFilePut(RemotePath,
  3208. * fileno); }
  3209. */
  3210. }
  3211. model.setValue("/root/send/colortobw/fileno", sSaveData);
  3212. submit("TXMPL03345");
  3213. f_View.AutoRefresh = true;
  3214. }
  3215. function printChart(docName, msg)
  3216. {
  3217. var strPage;
  3218. var strPrintLog;
  3219. var bFirstPage;
  3220. var selCount;
  3221. var start = getCurrentDateTime();
  3222. switch(rdo_viewmode.value)
  3223. {
  3224. case "PV":
  3225. var pageCurrent = parseInt(model.getValue("/root/main/chartinfo/pagecurrent"));
  3226. if(pageCurrent > 0)
  3227. {
  3228. strPath = g_path[pageCurrent];
  3229. strPage = g_page[pageCurrent];
  3230. f_print.DocumentBegin(docName);
  3231. f_print.PageBegin();
  3232. f_preview.pageremove(0,0);
  3233. f_preview.viewmode = 2;
  3234. f_preview.pageappend(f_View.PageFilePath(pageCurrent),f_View.PageFilePage(pageCurrent) + 1 ,f_View.PageFilePage(pageCurrent) + 1 );
  3235. f_preview.pagecurrent = i;
  3236. if(f_preview.pagewidth > f_preview.pageheight)
  3237. {
  3238. if(f_View.PageFilePath(i).substr(0,3) =! "utf")
  3239. {
  3240. f_preview.actionthumbnail = 2;
  3241. TvTurnSelect("left");
  3242. }
  3243. }
  3244. f_print.PrintImage(f_View.PageFilePath(pageCurrent),f_View.PageFilePage(pageCurrent) + 1, 0, 0, f_print.PrintableWidth, f_print.PrintableHeight, 2,1,1,12);
  3245. // 사본발급시
  3246. if (docName=="SMMRC03000")
  3247. {
  3248. f_print.FontFaceName = "HY울릉도M"
  3249. f_print.FontSize = 12
  3250. f_print.FontBold = true
  3251. f_print.PrintText(360, f_print.PrintableHeight - f_print.PrintTextHeight("이 서식은 사본입니다(원본 대조필)", 0),f_print.PrintableWidth,f_print.PrintableHeight,"이 서식은 사본입니다(원본 대조필)",2048,0xff0000,0xff0000);
  3252. // f_print.PrintText(0, 0
  3253. // ,f_print.PrintableWidth,f_print.PrintableHeight,"이 서식은
  3254. // 사본입니다(원본 대조필)",2048,0xff0000,0xff0000);
  3255. }
  3256. // 사본발급 출력서식의 하단에 사본발급용도(목적) 출력요청(2010-04-05 박종훈)
  3257. // [요청번호 : 11336, TaskNo : 43930, 우선순위 : SY]
  3258. // 사본발급시(발급용도)
  3259. if (msg != null || msg != "")
  3260. {
  3261. f_print.FontFaceName = "HY울릉도M"
  3262. f_print.FontSize = 12
  3263. f_print.FontBold = true
  3264. f_print.PrintText(25, f_print.PrintableHeight - 20,f_print.PrintableWidth,f_print.PrintableHeight,msg,2048,0xff0000,0xff0000);
  3265. // f_print.PrintText(0, 0
  3266. // ,f_print.PrintableWidth,f_print.PrintableHeight,msg,2048,0xff0000,0xff0000);
  3267. }
  3268. f_print.PageEnd();
  3269. model.setValue("/root/main/printcount", parseInt(model.getValue("/root/main/printcount")) + 1 );
  3270. if(f_preview.pagewidth > f_preview.pageheight)
  3271. {
  3272. if(f_View.PageFilePath(i).substr(0,3) =! "utf")
  3273. {
  3274. f_preview.actionthumbnail = 2;
  3275. TvTurnSelect("right");
  3276. }
  3277. }
  3278. f_print.DocumentEnd();
  3279. // 출력 통보
  3280. model.setAttribute("sCMR_Param", printLog(pageCurrent));
  3281. }
  3282. else
  3283. {
  3284. alert("출력할 페이지가 없습니다.");
  3285. return false;
  3286. }
  3287. break;
  3288. case "TV":
  3289. selCount = getSelectPageCount()
  3290. // alert("selCount " + selCount)
  3291. if(selCount == 0)
  3292. {
  3293. f_print.DocumentBegin(docName);
  3294. bFirstPage = true;
  3295. strPrintLog = "";
  3296. for(i = 1; i <= f_View.PageTotal; i++)
  3297. {
  3298. f_print.PageBegin();
  3299. f_preview.pageremove(0,0);
  3300. f_preview.viewmode = 2;
  3301. f_preview.pageappend(f_View.PageFilePath(i),f_View.PageFilePage(i) + 1,f_View.PageFilePage(i) + 1);
  3302. f_preview.pagecurrent = i;
  3303. if(f_preview.pagewidth > f_preview.pageheight)
  3304. {
  3305. if(f_View.PageFilePath(i).substr(0,3) =! "utf")
  3306. {
  3307. f_preview.actionthumbnail = 2;
  3308. TvTurnSelect("left");
  3309. }
  3310. }
  3311. f_print.PrintImage(f_View.PageFilePath(i),f_View.PageFilePage(i) + 1, 0, 0, f_print.PrintableWidth, f_print.PrintableHeight, 2,1,1,12);
  3312. // 사본발급시
  3313. if (docName=="SMMRC03000")
  3314. {
  3315. f_print.FontFaceName = "HY울릉도M"
  3316. f_print.FontSize = 12
  3317. f_print.FontBold = true
  3318. f_print.PrintText(360, f_print.PrintableHeight - f_print.PrintTextHeight("이 서식은 사본입니다(원본 대조필)", 0),f_print.PrintableWidth,f_print.PrintableHeight,"이 서식은 사본입니다(원본 대조필)",2048,0xff0000,0xff0000);
  3319. // f_print.PrintText(0, 0
  3320. // ,f_print.PrintableWidth,f_print.PrintableHeight,"이 서식은
  3321. // 사본입니다(원본 대조필)",2048,0xff0000,0xff0000);
  3322. }
  3323. // 사본발급 출력서식의 하단에 사본발급용도(목적) 출력요청(2010-04-05 박종훈)
  3324. // [요청번호 : 11336, TaskNo : 43930, 우선순위 : SY]
  3325. // 사본발급시(발급용도)
  3326. if (msg != null || msg != "")
  3327. {
  3328. f_print.FontFaceName = "HY울릉도M"
  3329. f_print.FontSize = 12
  3330. f_print.FontBold = true
  3331. f_print.PrintText(25, f_print.PrintableHeight - 10,f_print.PrintableWidth,f_print.PrintableHeight,msg,2048,0xff0000,0xff0000);
  3332. // f_print.PrintText(0, 0
  3333. // ,f_print.PrintableWidth,f_print.PrintableHeight,msg,2048,0xff0000,0xff0000);
  3334. }
  3335. f_print.PageEnd();
  3336. model.setValue("/root/main/printcount", parseInt(model.getValue("/root/main/printcount")) + 1 );
  3337. if(f_preview.pagewidth > f_preview.pageheight)
  3338. {
  3339. if(f_View.PageFilePath(i).substr(0,3) =! "utf")
  3340. {
  3341. f_preview.actionthumbnail = 2;
  3342. TvTurnSelect("right");
  3343. }
  3344. }
  3345. strPrintLog += printLog(i);
  3346. }
  3347. f_print.DocumentEnd();
  3348. // alert(model.getValue("/root/main/printcount") )
  3349. model.setAttribute("sCMR_Param", strPrintLog);
  3350. break;
  3351. }
  3352. else
  3353. {
  3354. f_print.DocumentBegin(docName);
  3355. bFirstPage = true;
  3356. strPrintLog = "";
  3357. for(i = 1; i <= f_View.PageTotal; i++)
  3358. {
  3359. if(f_View.ThumbnailSelect(i) == true)
  3360. {
  3361. f_print.PageBegin();
  3362. f_preview.pageremove(0,0);
  3363. f_preview.viewmode = 2;
  3364. f_preview.pageappend(f_View.PageFilePath(i),f_View.PageFilePage(i) + 1,f_View.PageFilePage(i) + 1);
  3365. f_preview.pagecurrent = i;
  3366. if(f_preview.pagewidth > f_preview.pageheight)
  3367. {
  3368. if(f_View.PageFilePath(i).substr(0,3) =! "utf")
  3369. {
  3370. f_preview.actionthumbnail = 2;
  3371. TvTurnSelect("left");
  3372. }
  3373. }
  3374. f_print.PrintImage(f_View.PageFilePath(i),f_View.PageFilePage(i) + 1, 0, 0, f_print.PrintableWidth, f_print.PrintableHeight, 2,1,1,12);
  3375. // model.setValue("/root/main/printcount",
  3376. // parseInt(model.getValue("/root/main/printcount")) + 1 );
  3377. // 사본발급시
  3378. if (docName=="SMMRC03000")
  3379. {
  3380. f_print.FontFaceName = "HY울릉도M"
  3381. f_print.FontSize = 12
  3382. f_print.FontBold = true
  3383. f_print.PrintText(360, f_print.PrintableHeight - f_print.PrintTextHeight("이 서식은 사본입니다(원본 대조필)", 0),f_print.PrintableWidth,f_print.PrintableHeight,"이 서식은 사본입니다(원본 대조필)",2048,0xff0000,0xff0000);
  3384. }
  3385. // 사본발급 출력서식의 하단에 사본발급용도(목적) 출력요청(2010-04-05 박종훈)
  3386. // [요청번호 : 11336, TaskNo : 43930, 우선순위 : SY]
  3387. // 사본발급시(발급용도)
  3388. if (msg != null || msg != "")
  3389. {
  3390. f_print.FontFaceName = "HY울릉도M"
  3391. f_print.FontSize = 12
  3392. f_print.FontBold = true
  3393. f_print.PrintText(25, f_print.PrintableHeight - f_print.PrintTextHeight("이 서식은 사본입니다(원본 대조필)", 0),f_print.PrintableWidth,f_print.PrintableHeight,msg,2048,0xff0000,0xff0000);
  3394. }
  3395. f_print.PageEnd();
  3396. // model.setValue("/root/main/printcount",
  3397. // parseInt(model.getValue("/root/main/printcount")) + 1 );
  3398. if(f_preview.pagewidth > f_preview.pageheight)
  3399. {
  3400. if(f_View.PageFilePath(i).substr(0,3) =! "utf")
  3401. {
  3402. f_preview.actionthumbnail = 2;
  3403. TvTurnSelect("right");
  3404. }
  3405. }
  3406. // strPrintLog += printLog(i);
  3407. }
  3408. }
  3409. f_print.DocumentEnd();
  3410. // model.setAttribute("sCMR_Param", strPrintLog);
  3411. break;
  3412. }
  3413. }
  3414. return true;
  3415. }
  3416. function getSelectPageCount()
  3417. {
  3418. var seletedpage;
  3419. seletedpage = 0;
  3420. for (count = 1; count <= f_View.PageTotal; count++)
  3421. {
  3422. if(f_View.ThumbnailSelect(count) == true)
  3423. {
  3424. seletedpage = seletedpage + 1
  3425. }
  3426. }
  3427. return seletedpage
  3428. }
  3429. function DrawGrid()
  3430. {
  3431. var usercount;
  3432. var datecount;
  3433. var cdate;
  3434. var cuserid;
  3435. var scancnt;
  3436. var i;
  3437. var j;
  3438. datecount = getNodesetCount("/root/hidden/scancnt/cdate");
  3439. usercount = getNodesetCount("/root/main/scancntuser/cuserid");
  3440. // dg_scancnt.rebuild();
  3441. for (i = dg_scancnt.cols-1; i >= 1; i--)
  3442. {
  3443. dg_scancnt.deleteColumn(i);
  3444. }
  3445. for (j = dg_scancnt.rows-1; j > 1; j--)
  3446. {
  3447. dg_scancnt.deleteRow(j);
  3448. }
  3449. var nodename = "a";
  3450. if ( datecount != "" )
  3451. fAddCol( datecount, "/root/main/grid1/grid", "/root/temp/grid", dg_scancnt, nodename, "input" );
  3452. if ( usercount != "" )
  3453. fAddRow(dg_scancnt, usercount);
  3454. dg_scancnt.refresh();
  3455. }
  3456. function fAddRow(gridObj, rows)
  3457. {
  3458. for(var i=1; i<rows-1; i++)
  3459. gridObj.addRow(false);
  3460. }
  3461. function fAddCol( colCnt, nodeset, copyNodeset, pGrid, nodename, coltype )
  3462. {
  3463. var oldColCnt = parseInt(pGrid.cols);
  3464. var beforecdate = "";
  3465. pGrid.caption = ""
  3466. for ( i=0; i<=colCnt; i++)
  3467. {
  3468. cdate = model.getValue("/root/hidden/scancnt[" + oldColCnt + "]/cdate");
  3469. oldColCnt++;
  3470. if (beforecdate != cdate && cdate != "")
  3471. {
  3472. if ( coltype == null || coltype=="" )
  3473. coltype = "output";
  3474. // 컬럼 생성
  3475. pGrid.addColumn("ref:"+(nodename + oldColCnt)+"; type:"+coltype+";");
  3476. // 캡션 수정
  3477. pGrid.caption = pGrid.caption +"^"+cdate;
  3478. // copynode할 원본 노드셋에도 생성된 자식 노드 추가
  3479. model.makeNode(copyNodeset+"/" +(nodename + oldColCnt));
  3480. }
  3481. beforecdate = cdate
  3482. }
  3483. }
  3484. function setGrid()
  3485. {
  3486. datecount = getNodesetCount("/root/hidden/scancnt/cdate");
  3487. usercount = getNodesetCount("/root/main/scancntuser/cuserid");
  3488. var count;
  3489. var cdate;
  3490. var cuserid;
  3491. var rownm;
  3492. var colnm;
  3493. var i;
  3494. var j;
  3495. var k;
  3496. for (i = 1; i < dg_scancnt.rows; i++)
  3497. {
  3498. rownm = model.getValue("/root/main/scancntuser[" + i + "]/cuserid");
  3499. dg_scancnt.textmatrix(i, 0) = rownm
  3500. for (k = 1; k <= dg_scancnt.cols; k++)
  3501. {
  3502. colnm = dg_scancnt.valueMatrix(0, k);
  3503. for (j = 1; j <= datecount; j++)
  3504. {
  3505. dg_scancnt.textmatrix(i, 0) = rownm
  3506. // dg_scancnt.textmatrix(i, 0) =
  3507. // model.getValue("/root/main/scancntuser[" + i + "]/cuserid");
  3508. cdate = model.getValue("/root/hidden/scancnt[" + j + "]/cdate");
  3509. cuserid = model.getValue("/root/hidden/scancnt[" + j + "]/cuserid");
  3510. count = model.getValue("/root/hidden/scancnt[" + j + "]/count");
  3511. // alert(rownm + " rownm " + cuserid + " ## " + colnm + " colnm
  3512. // " + cdate );
  3513. if (rownm == cuserid && colnm == cdate)
  3514. {
  3515. dg_scancnt.textmatrix(i, k) = count;
  3516. // exit for;
  3517. }
  3518. }
  3519. }
  3520. }
  3521. }
  3522. function getltpInfo1()
  3523. {
  3524. model.setValue("/root/send/ltp/activeA", "A");
  3525. submit("TRMPL03307");
  3526. }
  3527. function LTPInit1(server, port, user, sub)
  3528. {
  3529. if(f_ltp.IsOnline)
  3530. {
  3531. }
  3532. else
  3533. {
  3534. f_ltp.server = server;
  3535. f_ltp.port = 2500;
  3536. f_ltp.account = user;
  3537. if(f_ltp.Connect())
  3538. {
  3539. }
  3540. else
  3541. {
  3542. alert('LTP 데몬과의 접속이 실패하였습니다.');
  3543. }
  3544. }
  3545. }
  3546. function Scan1(type, file)
  3547. {
  3548. var status;
  3549. var cdateyyyymm = getYear() + "" + getMonth();
  3550. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3551. var extension = fso.GetExtensionName(file);
  3552. var scanfolder = fso.GetSpecialFolder(2) + "\\LCViewer";
  3553. var bPage = iviewer1.f_View.PageTotal;
  3554. file = scanfolder + "\\" + fso.GetBaseName(file) + "." + extension;
  3555. // iviewer1.window.javascript.SelectLoadChart1(file);
  3556. IndexInsert1(iviewer1.f_View, file);
  3557. }
  3558. function SelectLoadChart1(files)
  3559. {
  3560. var l_files;
  3561. var i = 0;
  3562. var filename;
  3563. var addpage;
  3564. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3565. var file;
  3566. var scancolor;
  3567. var scanfolder = fso.GetSpecialFolder(2) + "\\LCViewer";
  3568. var dfile;
  3569. var bPage;
  3570. if (fso.FolderExists(fso.GetSpecialFolder(2) + "\\LCViewer\\") == false)
  3571. {
  3572. fso.CreateFolder(fso.GetSpecialFolder(2) + "\\LCViewer\\");
  3573. }
  3574. if (files == "")
  3575. {
  3576. return false;
  3577. }
  3578. else
  3579. {
  3580. l_files = files.split("|");
  3581. for(i=0 ; i <= l_files.length -1 ; i++)
  3582. {
  3583. scancolor = fso.GetExtensionName(l_files[i]);
  3584. file = scanfolder + "\\" + getTime() + getMilliseconds() + "." + scancolor;
  3585. dfile = fso.GetFile(l_files[i]);
  3586. dfile.Copy(fso.GetSpecialFolder(2) + "\\LCViewer\\" + fso.GetFileName(file));
  3587. f_View.pageappend(file,1,1);
  3588. f_View.ActionParamINT1 = f_View.PageTotal;
  3589. f_View.ActionThumbnail = 10;
  3590. f_View.PageCurrent = f_View.PageTotal;
  3591. f_View.ActionSingle = 3;
  3592. }
  3593. }
  3594. }
  3595. function IndexInsert1(fv, file)
  3596. {
  3597. var cdate;
  3598. var ctime;
  3599. var cdateyyyymm;
  3600. var cdatedd;
  3601. var filename;
  3602. var extension;
  3603. var filehidden;
  3604. var remotepath;
  3605. var pageno;
  3606. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3607. var extension;
  3608. var ltppath = model.getvalue("/root/main/ltpindexinfo/ltpindexpath");
  3609. var i;
  3610. var j;
  3611. var filesize;
  3612. var pagecount = 0;
  3613. var page = 0;
  3614. var pathid = model.getvalue("/root/main/ltpindexinfo/pathid");
  3615. var treatno = model.getValue("/root/send/treatinfo/treatno");
  3616. var formcode = model.getvalue("/root/send/treatinfo/formcode");
  3617. var cuserid = model.getValue("/root/user/scanuser");
  3618. var instcd = model.getValue("/root/user/instcd");
  3619. var ordtype = model.getValue("/root/send/ocrtreat/class");
  3620. var orddeptcd = model.getValue("/root/send/ocrtreat/class");
  3621. var pid = model.getValue("/root/send/ocrtreat/patid");
  3622. var orddd = model.getValue("/root/send/ocrtreat/indate");
  3623. var ocrtag = model.getValue("/root/send/ocrtreat/ocrtag");
  3624. var cretno = model.getValue("/root/send/ocrtreat/cretno");
  3625. var sSaveData = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▦class▦cretno▦pid▦orddd▦orddeptcd▦ocrtag▩";
  3626. //var sSaveData = "status▦pageno▦pathid▦cdate▦cuserid▦filesize▦extension▦instcd▦treatno▦formcode▦pid▦orddd▦class▦ocrtag▦flag▦cretno▦orddeptcd▩";
  3627. //20130430 김동준 start
  3628. //var pageno;
  3629. var dir;
  3630. //20130430 김동준 end
  3631. cdate = parent.model.getValue("/root/main/now/sysdate");
  3632. ctime = parent.model.getValue("/root/main/now/sysdate");
  3633. cdate = cdate.substr(0, 8);
  3634. ctime = ctime.substr(8, 6);
  3635. cdateyyyymm = cdate.substr(0, 6);
  3636. cdatedd = cdate.substr(6, 2);
  3637. fv.AutoRefresh = false;
  3638. filesize = "";
  3639. filename = file;
  3640. extension = fso.GetExtensionName(filename);
  3641. filesize = fso.GetFile(filename).size;
  3642. extension = fso.GetExtensionName(filename);
  3643. sSaveData += "d▦" + pageno + "▦" + pathid + "▦" + cdate + "▦" + cuserid + "▦" + filesize + "▦" + extension + "▦" + instcd + "▦" + treatno + "▦" + formcode + "▦" + ordtype +"▦" + cretno +"▦" + pid +"▦" + orddd+ "▦" + orddeptcd +"▦" + ocrtag +"▩";
  3644. fv.PageAppend(filename, 1, 1);
  3645. fv.PageText(fv.PageTotal) = (fv.PageTotal, fv.PageTotal);
  3646. model.setValue("/root/send/paget/savedata", sSaveData);
  3647. submit("TXMPL03302");
  3648. pageno = model.getValue("/root/main/paget/pageno");
  3649. //20130430 김동준 start
  3650. dir = pageno.substr(pageno.length -4 , pageno.length );
  3651. //remotepath = ltppath + "\\" + pageno.substr(4, 8) + "\\" + pageno + "." + extension;
  3652. remotepath = ltppath + "\\" + dir + "\\" + pageno + "." + extension;
  3653. //20130430 김동준 end
  3654. fv.PageHiddenText(fv.PageTotal) = remotepath;
  3655. LTPFilePut1(remotepath, filename);
  3656. fv.PageCurrent = fv.PageTotal;
  3657. fv.ActionThumbnail = 5;
  3658. fv.actionsingle = 3;
  3659. // iviewer2.optPageTotal.text = fv_1.PageTotal;
  3660. for (i=1; i<=fv.PageTotal; i++)
  3661. {
  3662. fv.PageText(i) = i;
  3663. }
  3664. fv.AutoRefresh = true;
  3665. //model.refresh();
  3666. }
  3667. function downloadChart1(totpage)
  3668. {
  3669. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3670. var filename;
  3671. var fullfilename;
  3672. var remotepath;
  3673. var pathRemote;
  3674. var localpath;
  3675. var pathLocal;
  3676. var cdate;
  3677. var cdateyyyymm;
  3678. var cdatedd;
  3679. var path;
  3680. var trashpath = opener.parent.model.getValue("/root/main/ltpindexinfo/ltpindexpath") + "\\" + "delfolder\\";
  3681. var trashpageno;
  3682. var extension;
  3683. var ltppath;
  3684. for (i = 1; i <= totpage; i++)
  3685. {
  3686. filename = model.getValue("/root/main/imgpath[" + i + "] /pageno");
  3687. extension = model.getValue("/root/main/imgpath[" + i + "] /extension");
  3688. ltppath = model.getValue("/root/main/imgpath[" + i + "] /ltppath");
  3689. //remotepath = ltppath + "\\" + filename.substr(4, 8) + "\\" + filename + "." + extension;
  3690. //이윤주
  3691. var dir = filename.substr(filename.length -4 , filename.length );
  3692. remotepath = ltppath + "\\" + dir + "\\" + filename + "." + extension;
  3693. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + filename + "." + extension ;
  3694. pathRemote = pathRemote + "|";
  3695. pathLocal = pathLocal + "|";
  3696. pathRemote = pathRemote + remotepath;
  3697. pathLocal = pathLocal + localpath;
  3698. }
  3699. getFiles(model.getvalue("/root/main/ltpindexinfo/ltpindexserver"), model.getvalue("/root/main/ltpindexinfo/ltpindexport"), model.getvalue("/root/main/ltpindexinfo/ltpindexuser"), "", pathRemote, pathLocal);
  3700. }
  3701. function appendchart1(totpage, fv)
  3702. {
  3703. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3704. var filename;
  3705. var fullfilename;
  3706. var remotepath;
  3707. var localpath;
  3708. var cdate;
  3709. var cdateyyyymm;
  3710. var cdatedd;
  3711. var path = parent.parent.model.getValue("/root/main/ltpindexinfo/ltpindexpath");
  3712. var ltppath;
  3713. fv.AutoRefresh = false;
  3714. for (i = 1; i <= totpage; i++)
  3715. {
  3716. filename = model.getValue("/root/main/imgpath[" + i + "] /pageno");
  3717. extension = model.getValue("/root/main/imgpath[" + i + "] /extension");
  3718. ltppath = model.getValue("/root/main/imgpath[" + i + "] /ltppath");
  3719. //remotepath = ltppath + "\\" + filename.substr(4, 8) + "\\" + filename + "." + extension;
  3720. //이윤주
  3721. var dir = filename.substr(filename.length -4 , filename.length );
  3722. remotepath = ltppath + "\\" + dir + "\\" + filename + "." + extension;
  3723. localpath = fso.GetSpecialFolder(2) + "\\LCViewer\\" + filename + "." + extension ;
  3724. fv.PageAppend(localpath, 1, 1);
  3725. fv.PageHiddenText(i) = remotepath;
  3726. fv.PageText(i) = (fv.PageTotal, fv.PageTotal);
  3727. fv.ActionParamInt1 = i;
  3728. //model.setValue("/root/main/chartinfo/pagecurrent", 1);
  3729. }
  3730. fv.AutoRefresh = true;
  3731. fv.PageCurrent = fv.PageTotal;
  3732. fv.ActionThumbnail = 1;
  3733. fv.actionsingle = 2;
  3734. //model.setValue("/root/main/chartinfo/pagetotal", f_View.PageTotal);
  3735. //model.refresh();
  3736. }
  3737. function getFiles1(host, port, user, pass, pathRemote, pathLocal)
  3738. {
  3739. var result;
  3740. LTPInit(host, port, user);
  3741. result = LTPFilesGet(pathRemote, pathLocal);
  3742. // LTPClose();
  3743. return result;
  3744. }
  3745. function LTPFilePut1(remotePath, localPath)
  3746. {
  3747. LTPInit(model.getvalue("/root/main/ltpindexinfo/ltpindexserver"), model.getvalue("/root/main/ltpindexinfo/ltpindexport"), model.getvalue("/root/main/ltpindexinfo/ltpindexuser"));
  3748. var is_succeed = f_ltp.FilePut(remotePath, localPath);
  3749. if (is_succeed == false)
  3750. {
  3751. alert("파일업로드에 실패하였습니다.");
  3752. }
  3753. return is_succeed;
  3754. }
  3755. function DelIndexImgFile(fv)
  3756. {
  3757. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3758. var fileno;
  3759. var filename;
  3760. var filehidden;
  3761. var instcd;
  3762. var patno = parent.dg_treat.valueMatrix(parent.dg_treat.row, parent.dg_treat.colref("patid"));
  3763. var ioflag;
  3764. var i;
  3765. var instcd;
  3766. var delpage;
  3767. // getUserInfo("dutplceinstcd")
  3768. delpage = 0;
  3769. fv.AutoRefresh = false;
  3770. for (i=fv.PageTotal; i>= 1; i--)
  3771. {
  3772. if(fv.ThumbnailSelect(i) == true)
  3773. {
  3774. filehidden = fv.PageHiddenText(i);
  3775. // 환자나 서식 이동을 위해 trashfolder에 임시 복사
  3776. filename = fv.PageFilePath(i);
  3777. f_ltp.FileDelete(filehidden);
  3778. fv.PageRemove(i,i);
  3779. fv.PageCurrent = i;
  3780. }
  3781. }
  3782. model.refresh();
  3783. for (i=1; i <= fv.PageTotal; i++)
  3784. {
  3785. fv.PageText(i, i);
  3786. }
  3787. fv.AutoRefresh = true;
  3788. }
  3789. function DelIndexImg(fv)
  3790. {
  3791. var filename; // = model.getValue("root/send/delimage/imageno");
  3792. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3793. var pageno;
  3794. var i;
  3795. var bDelData = "status▦pageno▩";
  3796. var bUpdpageData = "status▦treatno▦formcode▦page▩"
  3797. var treatno = parent.model.getValue("/root/send/treatinfo/treatno");
  3798. var formcode = parent.model.getvalue("/root/send/treatinfo/formcode");
  3799. var page;
  3800. for (i=1; i <= fv.PageTotal; i++)
  3801. {
  3802. if(fv.ThumbnailSelect(i) == true)
  3803. {
  3804. filename = f_View.PageFilePath(i);
  3805. filehidden = f_View.PageHiddenText(i);
  3806. page = i;
  3807. filehidden = fso.GetBaseName(filehidden);
  3808. bDelData += "d▦" + filehidden + "▩";
  3809. bUpdpageData += "d▦" + treatno + "▦" + formcode + "▦" + page + "▩";
  3810. }
  3811. }
  3812. model.setValue("/root/send/delimage/updpage", bUpdpageData);
  3813. submit("TXMPL03320");
  3814. model.setValue("/root/send/delimage/pageno", bDelData);
  3815. submit("TXMPL03317");
  3816. }
  3817. function ThumbnailClick_event1(fv, page, shift, button, x, y, fv_temp, type, mode)
  3818. {
  3819. var LocalPath;
  3820. var RemotePath;
  3821. var fso = new ActiveXObject("Scripting.FileSystemObject");
  3822. var scanSaveData = "status▦fileno▦page▦instcd▩";
  3823. var indexSaveData = "status▦pageno▦page▦instcd▩";
  3824. var indexinfo;
  3825. var patno = "undo";
  3826. TrashFolder()
  3827. if (page == 0)
  3828. {
  3829. }
  3830. else
  3831. {
  3832. if(button == 1)
  3833. {
  3834. if(shift == 1)
  3835. {
  3836. var i = 0;
  3837. var first = 0;
  3838. var last = page;
  3839. var count = 0;
  3840. for(i=1; i <= fv.PageTotal; i++)
  3841. {
  3842. if(fv.ThumbnailSelect(i) == true)
  3843. {
  3844. if(first == 0)
  3845. {
  3846. first = i;
  3847. }
  3848. }
  3849. }
  3850. if(page >= first)
  3851. {
  3852. count = last - first;
  3853. for(i=1; i <= count; i++)
  3854. {
  3855. fv.ThumbnailSelect(first + i, true);
  3856. }
  3857. }
  3858. else
  3859. {
  3860. count = first - last;
  3861. for(i=0; i <= count; i++)
  3862. {
  3863. fv.ThumbnailSelect(last + i, true);
  3864. }
  3865. }
  3866. }
  3867. else if (shift == 0)
  3868. {
  3869. if(fv.ThumbnailSelect(page) == false)
  3870. {
  3871. fv.ThumbnailSelect(page, true);
  3872. // 현재 페이지 입력
  3873. model.setValue("/root/main/chartinfo/pagecurrent", page);
  3874. model.refresh();
  3875. }
  3876. else
  3877. {
  3878. fv.ThumbnailSelect(page,false);
  3879. }
  3880. }
  3881. }
  3882. }
  3883. }
  3884. function fvSaveCreate1()
  3885. {
  3886. var i;
  3887. var localPath;
  3888. var remotePath;
  3889. for (i=1; i <= f_View.PageTotal; i++)
  3890. {
  3891. if(f_View.ThumbnailSelect(i) == true)
  3892. {
  3893. localPath = f_View.PageFilePath(i);
  3894. RemotePath = f_View.PageHiddenText(i);
  3895. LTPFilePut(RemotePath, localPath, "parent");
  3896. }
  3897. }
  3898. }
  3899. /*
  3900. * -
  3901. * =======================================================================================
  3902. *
  3903. * Image EMR Viewer Program (SSMRC03300.js) - Version : 1) : Ver.1.00.00 -
  3904. * =======================================================================================
  3905. */