SMMRI04000.js 129 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 통합기록조회 ( SMMRI04000_통합기록조회.xrw - JScript )
  4. - Version : SMMRI03000 + SMMRI04000 혼합됨.
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. var arrbtn = new Array("btn_all", "btn_prog", "btn_op", "btn_test", "btn_prcp", "btn_nurc", "btn_etc", "btn_img");
  9. var grdObj = "";
  10. var ref = "/root/main/recsrch/reclist";
  11. var stRef = "/root/tmp/reclist";
  12. var paramdefault = "";
  13. var isFirst = "Y";
  14. var gImgFile = "";
  15. var oprnerId = "";
  16. var srchorgcnt = 0;
  17. var srchcnt = 0;
  18. var srchendyn = "N";
  19. var gtmptreatno = "";
  20. var gtmpiformcd = "";
  21. var gemrpath = "";
  22. var gemrorddate = "";
  23. var gemrformnm = "";
  24. var gemrformcd = "";
  25. var gemrdeptnm = "";
  26. var gemrdeptcd = "";
  27. var gemrpage = "";
  28. var gemrhiddenmsg = "";
  29. var multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  30. var nodeposcnt = 1;
  31. var prevflag = "N";
  32. /**
  33. * @desc : 화면초기화
  34. * @id :
  35. * @event : xforms-ready
  36. * @return : void
  37. * @authur : 박종훈(튜닝)
  38. */
  39. function fInitalize()
  40. {
  41. var chkPidRtn = "";
  42. iviewerIemr.window.javascript.setChartViewerSize(parseInt(iviewerIemr.attribute("width")), parseInt(iviewerIemr.attribute("height")));
  43. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/pidynhcd", 3801);
  44. //2009-10-27 오후 4:37:13 강지훈 추가 : 북마크 사용여부를 기관별로 관리한다.
  45. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/bmkuseyn", 9909);
  46. var bmkuseyn = model.getValue("/root/init/bmkuseyn/hardcd/hardcd");
  47. if (bmkuseyn == "Y")
  48. {
  49. btn_setbmk.visible = true;
  50. btn_mark.visible = true;
  51. }
  52. else{
  53. btn_setbmk.visible = false;
  54. btn_mark.visible = false;
  55. }
  56. var sUserDeptcd = getUserInfo("dutplcecd");
  57. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  58. if(sJobkind == "03" || sUserDeptcd == "3230000000")
  59. {
  60. btn_copyprt.visible = true;
  61. }
  62. if (isPopup())
  63. {
  64. var parampid = opener.window.javascript.getParameter("SMMRI00400_param_pid");
  65. var paramchosflag = opener.window.javascript.getParameter("SMMRI00400_param_chosflag");
  66. var authflag = opener.window.javascript.getParameter("SMMRI00400_param_authflag");
  67. if (authflag == "N")
  68. {
  69. ipt_pid.disabled = true;
  70. ipt_hngnm.disabled = true;
  71. btn_search.disabled = true;
  72. ipt_rrgstno1.disabled = true;
  73. ipt_rrgstno2.disabled = true;
  74. button14.disabled = true;
  75. button5.disabled = true;
  76. }
  77. else
  78. {
  79. ipt_pid.disabled = false;
  80. ipt_hngnm.disabled = false;
  81. btn_search.disabled = false;
  82. ipt_rrgstno1.disabled = false;
  83. ipt_rrgstno2.disabled = false;
  84. button14.disabled = false;
  85. button5.disabled = false;
  86. }
  87. }
  88. if(parampid == "")
  89. {
  90. var pamInfoCvs = getGlobalVariable("paminfo"); //상단정보가 있을 경우는 검색
  91. var pid = "";
  92. if(pamInfoCvs != null)
  93. { //cvs가 null이 아닌 경우에만 처리함.
  94. model.removeNodeSet ("/root/main/result/paminfo/list");
  95. setCSVToNode ("/root/main/result/paminfo", pamInfoCvs);
  96. pid = model.getValue ("/root/main/result/paminfo/list/pid");
  97. ordtype = model.getValue ("/root/main/result/paminfo/list/ioflag");
  98. if ( !isNull ( pid ) )
  99. {
  100. if(oprnerId == "SPMRC03200")
  101. {
  102. opener.window.javascript.fGetCopyCmpPid(pid);
  103. }
  104. ipt_pid.value = pid;
  105. chkPidRtn = fPidKeyPress(); //등록번호로 환자 정보조회
  106. }
  107. }
  108. }
  109. else
  110. {
  111. ipt_pid.value = parampid;
  112. chkPidRtn = fPidKeyPress(); //등록번호로 환자 정보조회
  113. }
  114. model.setValue("/root/init/ioflag", "ALL");
  115. model.removeNodeset("/root/send");
  116. model.makeValue("/root/send/trgtno", 1100);
  117. model.makeValue("/root/send/exno", 1110);
  118. submit("TRMRI04006");
  119. //2009-11-17 오후 5:48:29 강지훈 수정 : 휠스크롤 메세지박스 사용여부 개인별 환경설정으로 관리
  120. model.removeNode("/root/send/interqestcd");
  121. model.makeNode("/root/send/interqestcd");
  122. var AnswData = fGetIntefeAnsw("017");
  123. model.setValue("/root/tmp/wheelmsg", AnswData);
  124. //2009-10-20 오후 2:01:30 강지훈 수정
  125. btn_all.selected = true;
  126. model.toggle("grd");
  127. if (chkPidRtn)
  128. {
  129. fGetPatOrddept();
  130. btn_all.dispatch("DOMActivate");
  131. }
  132. }
  133. /**
  134. * @desc : 환자 수진부서 조회
  135. * @id :
  136. * @event : DOMActivate
  137. * @return : void
  138. * @authur : 박종훈
  139. */
  140. function fGetPatOrddept()
  141. {
  142. model.removeNodeset("/root/send");
  143. model.removeNodeset("/root/initinfo/lrgIndx");
  144. model.removeNodeset("/root/initinfo/dplist");
  145. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  146. if (submit("TRMRI04001"))
  147. {
  148. addComboInstance("/root/initinfo", "itemindxseq^indxnm", "ALL^전체", "lrgIndx");
  149. addComboInstance("/root/initinfo", "deptcd^deptnm", "ALL^전체", "dplist");
  150. model.setValue("/root/init/orddept", "ALL");
  151. model.setValue("/root/init/tabflag", "ALL");
  152. cmb_dept.refresh();
  153. rdo_lindx.refresh();
  154. }
  155. }
  156. /**
  157. * @desc : 환자 수진이력 조회
  158. * @id :
  159. * @event : DOMActivate
  160. * @return : void
  161. * @authur : 박종훈(튜닝)
  162. */
  163. function fGetPatOrdHist(ioflag)
  164. {
  165. model.toggle("grd");
  166. iviewerIemr.window.javascript.cleanViewer();
  167. var orddept = model.getValue("/root/init/orddept");
  168. var tmpioflag = "" ;
  169. if (ioflag == null || ioflag == "")
  170. {
  171. tmpioflag = model.getValue("/root/init/ioflag");
  172. }
  173. else
  174. {
  175. model.setValue("/root/init/ioflag", ioflag);
  176. tmpioflag = ioflag;
  177. }
  178. model.setValue("/root/init/totcnt", "");
  179. lbl_totcnt.refresh();
  180. model.removeNodeset("/root/send");
  181. model.removeNodeset("/root/main/pathist/patordhist");
  182. model.removeNodeset("/root/main/midindx/midindxlist");
  183. model.resetInstanceNode("/root/init/accresn");
  184. model.resetInstanceNode("/root/init/prtresn");
  185. model.resetInstanceNode("/root/init/itemindxseq");
  186. model.resetInstanceNode("/root/init/midreccnt");
  187. model.resetInstanceNode("/root/init/reccurpos");
  188. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  189. model.makeValue("/root/send/ioflag", tmpioflag);
  190. model.makeValue("/root/send/orddeptcd", model.getValue("/root/init/orddept"));
  191. //김양수추가-kys-20091207-의사지시조회관련 초기화=========
  192. grup_prcppaging.attribute("visibility") = "hidden";
  193. model.makeValue("/root/tmp/prcprec/srchInterval", "");
  194. model.makeValue("/root/tmp/prcprec/srchFromdd", "");
  195. model.makeValue("/root/tmp/prcprec/srchTodd", "");
  196. model.makeValue("/root/tmp/prcprec/srchYn", "");
  197. //======================================================
  198. submit("TRMRI04002");
  199. if (ioflag == "I" || ioflag == "E")
  200. {
  201. grd_pathist.colhidden(grd_pathist.colref("centcd")) = true; //센터 컬럼 안보이게
  202. grd_pathist.attribute("scroll") = "autovscroll";
  203. }
  204. else
  205. {
  206. grd_pathist.colhidden(grd_pathist.colref("centcd")) = false; //센터 컬럼 보이게
  207. grd_pathist.attribute("scroll") = "auto";
  208. }
  209. grd_pathist.rebuild();
  210. }
  211. /**
  212. * @desc : 환자 기록 중분류 조회
  213. * @id :
  214. * @event : ondblclick
  215. * @return : void
  216. * @authur : 박종훈
  217. */
  218. function fGetRecMidIndx( grow )
  219. {
  220. var row = grow;
  221. if ( grow == null )
  222. row = grd_pathist.row;
  223. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  224. nodeposcnt = 1;
  225. prevflag = "N";
  226. var pid = "";
  227. var orddd = "";
  228. var cretno = "";
  229. var orddeptcd = "";
  230. var tabflag = "";
  231. var bfopentest = ""; //2009-10-31 오후 2:39:16 강지훈 추가 : nU 오픈전 검사처방이 있는 수진여부
  232. var emrflag = grd_pathist.valueMatrix(row, grd_pathist.colref("emrflag"));
  233. model.resetInstanceNode("/root/init/itemindxseq");
  234. model.resetInstanceNode("/root/init/midreccnt");
  235. model.resetInstanceNode("/root/init/reccurpos");
  236. model.setValue("/root/init/emrflag", emrflag);
  237. if((grd_pathist.isCell(event.target) && grd_pathist.mouserow >= grd_pathist.fixedrows))
  238. {
  239. pid = grd_pathist.valueMatrix(row, grd_pathist.colref("formrecseq"));
  240. orddd = grd_pathist.valueMatrix(row, grd_pathist.colref("orddd"));
  241. cretno = grd_pathist.valueMatrix(row, grd_pathist.colref("cretno"));
  242. orddeptcd = grd_pathist.valueMatrix(row, grd_pathist.colref("orddeptcd"));
  243. bfopentest = grd_pathist.valueMatrix(row, grd_pathist.colref("bfopentest"));
  244. tabflag = model.getValue("/root/init/tabflag");
  245. }
  246. else
  247. {
  248. if (row > 0)
  249. {
  250. pid = grd_pathist.valueMatrix(row, grd_pathist.colref("formrecseq"));
  251. orddd = grd_pathist.valueMatrix(row, grd_pathist.colref("orddd"));
  252. cretno = grd_pathist.valueMatrix(row, grd_pathist.colref("cretno"));
  253. orddeptcd = grd_pathist.valueMatrix(row, grd_pathist.colref("orddeptcd"));
  254. bfopentest = grd_pathist.valueMatrix(row, grd_pathist.colref("bfopentest"));
  255. tabflag = model.getValue("/root/init/tabflag");
  256. }
  257. else
  258. {
  259. messageBox("환자의 수진이력을 ", "C002");
  260. return;
  261. }
  262. }
  263. var comporddd = model.getValue("/root/init/accresn/orddd");
  264. var compcretno = model.getValue("/root/init/accresn/cretno");
  265. if (compcretno == "")
  266. {
  267. compcretno = "-";
  268. }
  269. var itrgtNodeCnt = getNodesetCnt(model, "/root/hardcd/trgtdept[trgtcd = '" + orddeptcd + "']"); //사유대상부서
  270. if (itrgtNodeCnt > 0) //감염내과, 정신과, 산부인과, 비뇨기과
  271. {
  272. var sUserDeptcd = getUserInfo("dutplcecd");
  273. var iexNodeCnt = getNodesetCnt(model, "/root/hardcd/exdept[trgtcd = '" + sUserDeptcd + "']"); //사유제외부서
  274. if ((iexNodeCnt <= 0) && (sUserDeptcd != orddeptcd) && (comporddd != orddd && compcretno != cretno)) //사용자 근무부서와 환자 수진부서가 틀린경우 사유창 팝업, 근무부서가 의료정보팀일경우 제외
  275. {
  276. model.resetInstanceNode("/root/init/accresn");
  277. setParameter("SPMRI03100_param_nodepath", "/root/init/accresn");
  278. setParameter("SPMRI03100_param_rsnflag", 'R');
  279. modal("SPMRI03100");
  280. var valiyn = model.getValue("/root/init/accresn/valiyn");
  281. if (valiyn != "Y")
  282. {
  283. return;
  284. }
  285. else
  286. {
  287. }
  288. }
  289. model.makeValue("/root/init/accresn/orddd", orddd);
  290. model.makeValue("/root/init/accresn/cretno", cretno);
  291. }
  292. else
  293. {
  294. model.resetInstanceNode("/root/init/accresn/resncd");
  295. model.resetInstanceNode("/root/init/accresn/resnnm");
  296. model.resetInstanceNode("/root/init/accresn/etc");
  297. model.resetInstanceNode("/root/init/accresn/valiyn");
  298. model.resetInstanceNode("/root/init/accresn/orddd");
  299. model.resetInstanceNode("/root/init/accresn/cretno");
  300. }
  301. var ViewMode;
  302. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  303. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView")
  304. {
  305. iviewerIemr.window.javascript.setupChart("ChartView");
  306. }
  307. iviewerIemr.window.javascript.cleanViewer();
  308. var ioflag = model.getValue("/root/send/ioflag");
  309. var refdata = "";
  310. var sizedata = "";
  311. if (emrflag == "I")
  312. {
  313. grd_midindx.caption = "lisflag^reckind^emrflag^정렬순번^상위아이템코드^아이템코드^중분류명^페이지수";
  314. }
  315. else if (emrflag == "E")
  316. {
  317. grd_midindx.caption = "lisflag^reckind^emrflag^정렬순번^상위아이템코드^아이템코드^중분류명^기록수";
  318. }
  319. model.setValue("/root/init/totcnt", "");
  320. lbl_totcnt.refresh();
  321. model.removeNodeset("/root/send");
  322. model.removeNodeset("/root/main/midindx/midindxlist");
  323. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  324. model.makeValue("/root/send/orddd", orddd);
  325. model.makeValue("/root/send/cretno", cretno);
  326. model.makeValue("/root/send/orddeptcd", orddeptcd);
  327. model.makeValue("/root/send/tabflag", tabflag);
  328. model.makeValue("/root/send/emrflag", emrflag);
  329. model.makeValue("/root/send/chosflag", grd_pathist.valueMatrix(row, grd_pathist.colref("ordtype")));
  330. model.makeValue("/root/send/refusge", model.getValue("/root/init/accresn/resncd"));
  331. model.makeValue("/root/send/refremark", model.getValue("/root/init/accresn/etc"));
  332. model.makeValue("/root/send/readprtflag", 'R');
  333. //2009-10-31 오후 2:36:09 강지훈 수정 :
  334. model.makeValue("/root/send/bfopentest", bfopentest);
  335. //20091204-kys-추가 조회현재일 셋팅
  336. //model.makeValue("/root/tmp/currentDate", orddd);
  337. if(submit("TRMRI04003"))
  338. {
  339. var midindxNodelist = model.instances(0).selectNodes("/root/main/midindx/midindxlist");
  340. var itemindxseq = 0;
  341. var midreccnt = 0;
  342. if (midindxNodelist.length > 0)
  343. {
  344. grd_midindx.resizeCells();
  345. var subNode = midindxNodelist.item(0);
  346. itemindxseq = parseInt(subNode.selectSingleNode("itemindxseq").text);
  347. midreccnt = parseInt(subNode.selectSingleNode("cnt").text);
  348. model.setValue("/root/init/itemindxseq", itemindxseq);
  349. model.setValue("/root/init/midreccnt", midreccnt);
  350. model.setValue("/root/init/reccurpos", 1);
  351. model.setValue("/root/init/bfopentest", bfopentest);
  352. grd_midindx.row = 1;
  353. fGetDetlRec(1, row); //pjh
  354. }
  355. }
  356. }
  357. /**
  358. * @desc : 키 이벤트
  359. * @id :
  360. * @event : DOMActivate
  361. * @return : void
  362. * @authur : 박종훈
  363. */
  364. function fGetRec(val)
  365. {
  366. if(model.getValue("/root/tmp/chklittleindx") != "Y"){ //조건분기추가-kys-20091210(전체조회시)
  367. var selIndx = switch1.selectedIndex;
  368. var aaa = "";
  369. //북마크모드가 아닐때
  370. if(selIndx == 0){
  371. var midnodeList = instance1.selectNodes("/root/main/midindx/midindxlist");
  372. if (midnodeList.length < 1)
  373. {
  374. messageBox("서식분류를", "C002");
  375. iviewerIemr.window.javascript.setupChart("ChartView");
  376. return;
  377. }
  378. var ViewMode = "-";
  379. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  380. if (ViewMode == "ThumbView")
  381. {
  382. iviewerIemr.window.javascript.setupChart("ChartView");
  383. }
  384. var emrflag = model.getValue("/root/init/emrflag");
  385. //2009-11-02 오후 7:16:41 강지훈 수정
  386. var reckind = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("reckind"))
  387. var wheelMsgFlag = model.getValue("/root/tmp/wheelmsg");
  388. if (emrflag == "I" && reckind != "EMR")
  389. {
  390. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  391. nodeposcnt = 1;
  392. prevflag = "N";
  393. switch(val)
  394. {
  395. case "first" :
  396. if (grd_midindx.row == 1)
  397. {
  398. messageBox("처음", "I009");
  399. return;
  400. }
  401. else
  402. {
  403. grd_midindx.row = 1;
  404. break;
  405. }
  406. case "prev" :
  407. if (grd_midindx.row == 1)
  408. {
  409. //messageBox("처음", "I009");
  410. //return;
  411. if(wheelMsgFlag == "Y"){
  412. var rtnmsg = messageBox("처음 기록입니다. 이전 수진이력으로", "Q003");
  413. if (rtnmsg == 6)
  414. {
  415. fPrevRecHist();
  416. return;
  417. }
  418. else
  419. {
  420. return;
  421. }
  422. }
  423. else{
  424. fPrevRecHist();
  425. return;
  426. }
  427. }
  428. else
  429. {
  430. grd_midindx.row = grd_midindx.row - 1;
  431. break;
  432. }
  433. case "next" :
  434. if (grd_midindx.row + 1 == grd_midindx.rows)
  435. {
  436. if(wheelMsgFlag == "Y"){
  437. var rtnmsg = messageBox("마지막 기록입니다. 다음 수진이력으로", "Q003");
  438. if (rtnmsg == 6)
  439. {
  440. fNextRecHist();
  441. return;
  442. }
  443. else
  444. {
  445. return;
  446. }
  447. }
  448. else{
  449. fNextRecHist();
  450. return;
  451. }
  452. }
  453. else
  454. {
  455. grd_midindx.row = grd_midindx.row + 1;
  456. break;
  457. }
  458. case "end" :
  459. if (grd_midindx.row + 1 == grd_midindx.rows)
  460. {
  461. messageBox("마지막", "I009");
  462. return;
  463. }
  464. else
  465. {
  466. grd_midindx.row = grd_midindx.rows - 1;
  467. break;
  468. }
  469. case "all" :
  470. model.setValue("/root/init/recall", "Y");
  471. }
  472. }
  473. else
  474. {
  475. var reccurpos = parseInt(model.getValue("/root/init/reccurpos"));
  476. var midreccnt = parseInt(model.getValue("/root/init/midreccnt"));
  477. var certnodeList = instance1.selectNodes("/root/tmpinicert/iniinfo");
  478. switch(val)
  479. {
  480. case "first" :
  481. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  482. nodeposcnt = 1;
  483. prevflag = "N";
  484. if (grd_midindx.row == 1 && reccurpos == 1)
  485. {
  486. messageBox("처음", "I009");
  487. return;
  488. }
  489. else
  490. {
  491. model.setValue("/root/init/recall", "N");
  492. grd_midindx.row = 1;
  493. var curmidcnt = parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")));
  494. model.setValue("/root/init/midreccnt", curmidcnt);
  495. model.setValue("/root/init/reccurpos", 1);
  496. model.setValue("/root/init/itemindxseq", parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq"))));
  497. break;
  498. }
  499. case "prev" :
  500. prevflag = "Y";
  501. if (certnodeList.length > 1 && nodeposcnt > 1)
  502. {
  503. multirecyn = "Y";
  504. }
  505. else
  506. {
  507. multirecyn = "N";
  508. nodeposcnt = 1;
  509. }
  510. if (multirecyn == "N")
  511. {
  512. if (grd_midindx.row == 1 && reccurpos == 1)
  513. {
  514. if(wheelMsgFlag == "Y"){
  515. var rtnmsg = messageBox("처음 기록입니다. 이전 수진이력으로", "Q003");
  516. if (rtnmsg == 6)
  517. {
  518. fPrevRecHist();
  519. return;
  520. }
  521. else
  522. {
  523. return;
  524. }
  525. }
  526. else{
  527. fPrevRecHist();
  528. return;
  529. }
  530. }
  531. else
  532. {
  533. model.setValue("/root/init/recall", "N");
  534. if (reccurpos == 1) //해당중분류의 첫기록일 경우 전 중분류로 이동 후 해당 중분류의 정보를 셋팅한다.
  535. {
  536. grd_midindx.row = grd_midindx.row - 1;
  537. var curmidcnt = parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")));
  538. model.setValue("/root/init/midreccnt", curmidcnt);
  539. model.setValue("/root/init/reccurpos", curmidcnt);
  540. model.setValue("/root/init/itemindxseq", parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq"))));
  541. break;
  542. }
  543. else
  544. {
  545. model.setValue("/root/init/reccurpos", reccurpos - 1);
  546. break;
  547. }
  548. }
  549. }
  550. else //하나의 기록이나 이미지가 포함된경우
  551. {
  552. if (nodeposcnt <= 1)
  553. {
  554. if (grd_midindx.row == 1 && reccurpos == 1)
  555. {
  556. if(wheelMsgFlag == "Y"){
  557. var rtnmsg = messageBox("처음 기록입니다. 이전 수진이력으로", "Q003");
  558. if (rtnmsg == 6)
  559. {
  560. fPrevRecHist();
  561. return;
  562. }
  563. else
  564. {
  565. return;
  566. }
  567. }
  568. else{
  569. fPrevRecHist();
  570. return;
  571. }
  572. }
  573. else
  574. {
  575. model.setValue("/root/init/reccurpos", reccurpos - 1);
  576. break;
  577. }
  578. }
  579. else
  580. {
  581. nodeposcnt--;
  582. break;
  583. }
  584. }
  585. case "next" :
  586. prevflag = "N";
  587. if (certnodeList.length > 1 && certnodeList.length > nodeposcnt)
  588. {
  589. multirecyn = "Y";
  590. }
  591. else
  592. {
  593. multirecyn = "N";
  594. nodeposcnt = 1;
  595. }
  596. if (multirecyn == "N")
  597. {
  598. if (reccurpos == midreccnt && grd_midindx.row + 1 == grd_midindx.rows)
  599. {
  600. if(wheelMsgFlag == "Y"){
  601. var rtnmsg = messageBox("마지막 기록입니다. 다음 수진이력으로", "Q003");
  602. if (rtnmsg == 6)
  603. {
  604. fNextRecHist();
  605. return;
  606. }
  607. else
  608. {
  609. return;
  610. }
  611. }
  612. else{
  613. fNextRecHist();
  614. return;
  615. }
  616. }
  617. else
  618. {
  619. model.setValue("/root/init/recall", "N");
  620. if (reccurpos == midreccnt)
  621. {
  622. grd_midindx.row = grd_midindx.row + 1;
  623. var curmidcnt = parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")));
  624. model.setValue("/root/init/midreccnt", curmidcnt);
  625. model.setValue("/root/init/reccurpos", 1);
  626. model.setValue("/root/init/itemindxseq", parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq"))));
  627. break;
  628. }
  629. else
  630. {
  631. model.setValue("/root/init/reccurpos", reccurpos + 1);
  632. break;
  633. }
  634. }
  635. }
  636. else //하나의 기록이나 이미지가 포함된경우
  637. {
  638. if (nodeposcnt >= certnodeList.length)
  639. {
  640. if (reccurpos == midreccnt && grd_midindx.row + 1 == grd_midindx.rows)
  641. {
  642. if(wheelMsgFlag == "Y"){
  643. var rtnmsg = messageBox("마지막 기록입니다. 다음 수진이력으로", "Q003");
  644. if (rtnmsg == 6)
  645. {
  646. fNextRecHist();
  647. return;
  648. }
  649. else
  650. {
  651. model.setValue("/root/init/reccurpos", reccurpos + 1);
  652. break;
  653. }
  654. }
  655. else{
  656. fNextRecHist();
  657. return;
  658. }
  659. }
  660. }
  661. else
  662. {
  663. nodeposcnt++;
  664. break;
  665. }
  666. }
  667. case "end" :
  668. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  669. nodeposcnt = 1;
  670. prevflag = "N";
  671. if (reccurpos == midreccnt && grd_midindx.row + 1 == grd_midindx.rows)
  672. {
  673. messageBox("마지막", "I009");
  674. return;
  675. }
  676. else
  677. {
  678. model.setValue("/root/init/recall", "N");
  679. grd_midindx.row = grd_midindx.rows - 1;
  680. var curmidcnt = parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")));
  681. model.setValue("/root/init/midreccnt", curmidcnt);
  682. model.setValue("/root/init/reccurpos", curmidcnt);
  683. model.setValue("/root/init/itemindxseq", parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq"))));
  684. break;
  685. }
  686. case "midfirst" :
  687. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  688. nodeposcnt = 1;
  689. prevflag = "N";
  690. if (grd_midindx.row == 1 && reccurpos == 1)
  691. {
  692. messageBox("처음", "I009");
  693. return;
  694. }
  695. else
  696. {
  697. model.setValue("/root/init/recall", "N");
  698. model.setValue("/root/init/reccurpos", 1);
  699. break;
  700. }
  701. case "midend" :
  702. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  703. nodeposcnt = 1;
  704. prevflag = "N";
  705. if (reccurpos == midreccnt && grd_midindx.row + 1 == grd_midindx.rows)
  706. {
  707. messageBox("마지막", "I009");
  708. return;
  709. }
  710. else
  711. {
  712. model.setValue("/root/init/recall", "N");
  713. model.setValue("/root/init/reccurpos", midreccnt);
  714. break;
  715. }
  716. case "all" :
  717. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  718. nodeposcnt = 1;
  719. prevflag = "N";
  720. model.setValue("/root/init/recall", "Y");
  721. }
  722. model.refresh(); //pjh
  723. }
  724. }
  725. fGetDetlRec(); //pjh
  726. }else{ //kys-20091210-선택체크후 조회시(부분(간격,일자선택)조회)
  727. var wheelMsgFlag = model.getValue("/root/tmp/wheelmsg");
  728. var certnodeList = instance1.selectNodes("/root/tmpinicert/iniinfo");
  729. switch(val)
  730. {
  731. case "prev" : //Page Up클릭시
  732. prevflag = "Y";
  733. if(model.getValue("/root/tmp/prcprec/srchkind") != 1){ //서식별, 일자+서식별조회시
  734. if(grd_littleindx.row == 1){
  735. if(wheelMsgFlag == "Y"){
  736. if(nodeposcnt == 1){
  737. messageBox("처음", "I009");
  738. return;
  739. }else{
  740. nodeposcnt--;
  741. break;
  742. }
  743. }
  744. }else if(grd_littleindx.row != 1){
  745. if(wheelMsgFlag == "Y"){
  746. if (nodeposcnt == 1){
  747. grd_littleindx.row = grd_littleindx.row - 1;
  748. multirecyn = "N"; //다음행으로 넘어갈때는 조회를 하기위해 N으로 셋팅한다-20091210-kys
  749. break;
  750. }else{
  751. nodeposcnt--;
  752. break;
  753. }
  754. }
  755. }
  756. }else{ //일자별 조회시
  757. if(wheelMsgFlag == "Y"){
  758. if(nodeposcnt == 1){
  759. messageBox("처음", "I009");
  760. return;
  761. }else{
  762. nodeposcnt--;
  763. break;
  764. }
  765. }
  766. }
  767. case "next" : //Page Down클릭시
  768. prevflag = "N";
  769. if(model.getValue("/root/tmp/prcprec/srchkind") != 1){ //서식별, 일자+서식별조회시
  770. if(grd_littleindx.row + 1 != grd_littleindx.rows){
  771. if(wheelMsgFlag == "Y"){
  772. if (nodeposcnt == certnodeList.length){
  773. grd_littleindx.row = grd_littleindx.row + 1;
  774. multirecyn = "N"; //다음행으로 넘어갈때는 조회를 하기위해 N으로 셋팅한다-20091210-kys
  775. break;
  776. }else{
  777. nodeposcnt++;
  778. break;
  779. }
  780. }
  781. }else if(grd_littleindx.row + 1 == grd_littleindx.rows){
  782. if(wheelMsgFlag == "Y"){
  783. if (nodeposcnt == certnodeList.length){
  784. messageBox("마지막", "I009");
  785. return;
  786. }else{
  787. nodeposcnt++;
  788. break;
  789. }
  790. }
  791. }
  792. }else{ //일자별 조회시
  793. if (nodeposcnt == certnodeList.length){
  794. messageBox("마지막", "I009");
  795. return;
  796. }else{
  797. nodeposcnt++;
  798. break;
  799. }
  800. }
  801. case "all" : //여러페이지보기클릭시에도 사용됨-kys
  802. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  803. nodeposcnt = 1;
  804. prevflag = "N";
  805. model.setValue("/root/init/recall", "Y");
  806. }
  807. //model.refresh(); //pjh
  808. fGetDetlRec();
  809. }
  810. }
  811. /**
  812. * @desc : 다음 수진이력으로 자동 이동
  813. * @id :
  814. * @event : DOMActivate
  815. * @return : void
  816. * @authur : 박종훈
  817. */
  818. function fNextRecHist()
  819. {
  820. var histrow = grd_pathist.row + 1;
  821. if ( histrow == grd_pathist.rows )
  822. {
  823. messageBox("마지막 이력", "I009");
  824. return;
  825. }
  826. else
  827. {
  828. grd_pathist.row = histrow;
  829. fGetRecMidIndx();
  830. }
  831. var ctrl = document.controls("grd_midindx");
  832. if (ctrl != null)
  833. {
  834. model.setFocus(ctrl.attribute("id"));
  835. ctrl.dispatch("onkeyup");
  836. }
  837. }
  838. /**
  839. * @desc : 이전 수진이력으로 자동 이동
  840. * @id :
  841. * @event :
  842. * @return : void
  843. * @authur : 주희경
  844. */
  845. function fPrevRecHist()
  846. {
  847. var histrow = grd_pathist.row - 1;
  848. if (histrow <= 0)
  849. {
  850. messageBox("처음 이력", "I009");
  851. return;
  852. }
  853. else
  854. {
  855. grd_pathist.row = histrow;
  856. fGetRecMidIndx();
  857. }
  858. var ctrl = document.controls("grd_midindx");
  859. if (ctrl != null)
  860. {
  861. model.setFocus(ctrl.attribute("id"));
  862. ctrl.dispatch("onkeyup");
  863. }
  864. }
  865. /**
  866. * @desc : 중분류 더블클릭
  867. * @id :
  868. * @event : DOMActivate
  869. * @return : void
  870. * @authur : 박종훈
  871. */
  872. function fDbClickMidIndx()
  873. {
  874. //if((grd_midindx.isCell(event.target) && grd_midindx.mouserow >= grd_midindx.fixedrows)) 주석처리-kys-20091209
  875. //{
  876. multirecyn = "N"; //다수의 기록 여부(ex.기록+이미지)
  877. nodeposcnt = 1;
  878. prevflag = "N";
  879. iviewerIemr.window.javascript.cleanViewer();
  880. if (grd_midindx.row >= 1)
  881. {
  882. var curmidcnt = parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")));
  883. var itemindxseq = parseInt(grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq")));
  884. //김양수추가-kys-20091208
  885. var reckind = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("reckind"));
  886. model.setValue("/root/init/midreccnt", curmidcnt);
  887. model.setValue("/root/init/reccurpos", 1);
  888. model.setValue("/root/init/itemindxseq", itemindxseq);
  889. model.refresh(); //pjh
  890. if(reckind != "PRCP"){ //김양수조건추가-의사지치기록일경우 기간조회차띄우기-kys-20091204
  891. if(model.getValue("/root/tmp/chklittleindx") != "Y"){ //선택에 체크가 되어있지 않은경우-kys-20091209
  892. grup_prcppaging.attribute("visibility") = "hidden"; ////김양수조건추가-의사지치기록일경우 기간조회차띄우기-kys-20091204
  893. }
  894. grup_prcppaging2.attribute("visibility") = "hidden"; //의사지시 기록조회창 닫기-kys-20091215
  895. fGetDetlRec(grd_midindx.row); //pjh
  896. var ViewMode;
  897. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  898. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView")
  899. {
  900. iviewerIemr.window.javascript.setupChart("ChartView");
  901. }
  902. }else if(reckind == "PRCP"){
  903. //20091204-kys-추가 조회현재일 셋팅
  904. //한번조회했다면 초기화하지 않는다.-20091207
  905. if(model.getValue("/root/tmp/prcprec/srchYn") != "Y"){ //최초 조회시 셋팅
  906. var srchAddOrddd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd"));
  907. //model.makeValue("/root/tmp/prcprec/srchYn", "Y"); //조회유무
  908. model.makeValue("/root/tmp/sndprcprec/srchprcpinterval", "7");
  909. model.makeValue("/root/tmp/sndprcprec/srchprcpfromdd", srchAddOrddd);
  910. model.makeValue("/root/tmp/sndprcprec/srchprcptodd", srchAddOrddd.toDate().getAddDate(6, "D").getDateFormat());
  911. }
  912. grup_prcppaging.attribute("visibility") = "hidden";
  913. grup_prcppaging2.attribute("visibility") = "visible";
  914. model.setFocus("ipt_srchprcpinterval");
  915. rdo_srchprcpchoice.select(0);
  916. model.refresh();
  917. fGetDetlRec(grd_midindx.row); //pjh
  918. var ViewMode;
  919. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  920. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView")
  921. {
  922. iviewerIemr.window.javascript.setupChart("ChartView");
  923. }
  924. }
  925. }
  926. // }
  927. }
  928. /**
  929. * @desc : 기록조회
  930. * @id :
  931. * @event : DOMActivate
  932. * @return : void
  933. * @authur : 박종훈
  934. */
  935. function fGetDetlRec( row1, row2 )
  936. {
  937. var grd_midindxrow = row1;
  938. var grd_pathistrow = row2;
  939. if ( row1 == null )
  940. grd_midindxrow = grd_midindx.row;
  941. if ( row2 == null )
  942. grd_pathistrow = grd_pathist.row;
  943. var itemindxseq = parseInt(model.getValue("/root/init/itemindxseq")); //선택중분류 인덱스순번
  944. var reccurpos = parseInt(model.getValue("/root/init/reccurpos")); //현재선택된기록 순번
  945. var midreccnt = parseInt(model.getValue("/root/init/midreccnt")); //선택중분류 기록수
  946. var bfopentest = model.getValue("/root/init/bfopentest"); //오픈 이전 검사처방 수진이력
  947. var reckind = grd_midindx.valueMatrix(grd_midindxrow, grd_midindx.colref("reckind"));
  948. var rowfocus = "";
  949. var emrflag = model.getValue("/root/init/emrflag");
  950. var selIndx = switch1.selectedIndex; //2009-10-20 오후 10:00:57 강지훈 추가
  951. if(selIndx == 1){
  952. fGetBookmarkItem();
  953. }
  954. else if(selIndx == 0){
  955. //2009-11-18 오후 10:14:11 강지훈 추가
  956. if (emrflag == "I" && (reckind != "EMR" && reckind != "CDIS"))
  957. {
  958. var totcnt = "[ " + 1 + " / " + grd_midindx.valueMatrix(grd_midindxrow, grd_midindx.colref("cnt")) + " / " + model.getValue("/root/init/reccnt") + " ]";
  959. model.setValue("/root/init/totcnt", totcnt);
  960. lbl_totcnt.refresh();
  961. var treatno = grd_midindx.valueMatrix(grd_midindxrow, grd_midindx.colref("itemindxseq"));
  962. var formcd = grd_midindx.valueMatrix(grd_midindxrow, grd_midindx.colref("supitemindxseq"));
  963. iviewerIemr.window.javascript.cleanViewer();
  964. iviewerIemr.window.javascript.refreshFalse();
  965. model.makeValue("/root/imgrec/iemr/treatno", parseInt(treatno));
  966. model.makeValue("/root/imgrec/iemr/docucd", formcd);
  967. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  968. var chartinfo;
  969. chartinfo = "I";
  970. var hiddenmsg;
  971. hiddenmsg = "I";
  972. iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg);
  973. iviewerIemr.window.javascript.refreshTrue();
  974. }
  975. else
  976. {
  977. var calcReccurpos = parseInt(model.getValue("/root/init/reccurpos"));
  978. var itemindxseq = parseInt(model.getValue("/root/init/itemindxseq"));
  979. var isLis = "";
  980. // for (var j = 1; j < grd_midindx.row; j++)
  981. // {
  982. // isLis = grd_midindx.valueMatrix(j, grd_midindx.colref("reckind"));
  983. //
  984. // if (isLis == "LIS")
  985. // {
  986. // calcReccurpos -= 1;
  987. // }
  988. // }
  989. model.removeNodeset("/root/send");
  990. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  991. model.makeValue("/root/send/orddd", grd_pathist.valueMatrix(grd_pathistrow, grd_pathist.colref("orddd")));
  992. model.makeValue("/root/send/cretno", grd_pathist.valueMatrix(grd_pathistrow, grd_pathist.colref("cretno")));
  993. model.makeValue("/root/send/chosflag", grd_pathist.valueMatrix(grd_pathistrow, grd_pathist.colref("ordtype")));
  994. model.makeValue("/root/send/orddeptcd", grd_pathist.valueMatrix(grd_pathistrow, grd_pathist.colref("orddeptcd")));
  995. model.makeValue("/root/send/tabflag", model.getValue("/root/init/tabflag"));
  996. model.makeValue("/root/send/reccurpos", calcReccurpos);
  997. if(model.getValue("/root/tmp/chklittleindx") != "Y"){ //분기-kys-체크선택후 조회시 전체를 가지고 온다.-20091210
  998. model.makeValue("/root/send/recall", model.getValue("/root/init/recall"));
  999. }else{
  1000. model.makeValue("/root/send/recall", "Y");
  1001. }
  1002. model.makeValue("/root/send/reckind", reckind);
  1003. model.makeValue("/root/send/itemindxseq", itemindxseq);
  1004. model.makeValue("/root/send/lisflag", grd_midindx.valueMatrix(grd_midindxrow, grd_midindx.colref("lisflag")));
  1005. //김양수추가부분-20091204-kys
  1006. if(reckind == "PRCP" || model.getValue("/root/tmp/chklittleindx") == "Y"){
  1007. if(reckind == "PRCP"){ //의사지시기록조회일경우
  1008. model.makeValue("/root/send/fromdd", model.getValue("/root/tmp/sndprcprec/srchprcpfromdd"));
  1009. model.makeValue("/root/send/todd", model.getValue("/root/tmp/sndprcprec/srchprcptodd"));
  1010. }else if(model.getValue("/root/tmp/chklittleindx") == "Y"){ //서식창 조건조회시
  1011. if(model.getValue("/root/tmp/prcprec/srchkind") != 2){ //서식별 조회시 fromm,todd 불필요-20091216-kys
  1012. model.makeValue("/root/send/fromdd", model.getValue("/root/tmp/prcprec/srchFromdd"));
  1013. model.makeValue("/root/send/todd", model.getValue("/root/tmp/prcprec/srchTodd"));
  1014. }
  1015. if(model.getValue("/root/tmp/prcprec/srchkind") != 1){ //일자별 조회시 srcformcd 불필요-20091216-kys
  1016. model.makeValue("/root/send/srcformcd", grd_littleindx.valueMatrix(grd_littleindx.row, grd_littleindx.colref("srcformcd"))); //소분류조회시 사용한다.-kys
  1017. }
  1018. }
  1019. }
  1020. //2009-11-02 오후 2:18:45 강지훈 수정
  1021. model.makeValue("/root/send/bfopentest", bfopentest);
  1022. pathistEmrFlag = grd_pathist.valueMatrix(grd_pathistrow, grd_pathist.colref("emrflag"))
  1023. if(bfopentest == "Y" && emrflag != "E"){
  1024. model.makeValue("/root/send/midbftest", "Y");
  1025. }
  1026. else{
  1027. model.makeValue("/root/send/midbftest", "N");
  1028. }
  1029. if (multirecyn == "N")
  1030. {
  1031. if(submit("TRMRI04004"))
  1032. {
  1033. var certnodeList = instance1.selectNodes("/root/tmpinicert/iniinfo");
  1034. if (certnodeList.length > 1 && certnodeList.length >= nodeposcnt)
  1035. {
  1036. multirecyn = "Y";
  1037. if (prevflag == "Y")
  1038. nodeposcnt = certnodeList.length;
  1039. else
  1040. nodeposcnt = 1;
  1041. }
  1042. else
  1043. {
  1044. multirecyn = "N";
  1045. nodeposcnt = 1;
  1046. }
  1047. iviewerIemr.window.javascript.cleanViewer();
  1048. if (model.getValue("/root/init/recall") == "Y")
  1049. {
  1050. fGetNextEmrImgRec(); //중분류 전체는 기존대로
  1051. }
  1052. else
  1053. {
  1054. fGetNextEmrImgRecOne(); //기록조회 결과가 여러개인 경우 한개씩 조회
  1055. }
  1056. model.setValue("/root/init/recall", "N");
  1057. }
  1058. }
  1059. else
  1060. {
  1061. iviewerIemr.window.javascript.cleanViewer();
  1062. fGetNextEmrImgRecOne(); //기록조회 결과가 여러개인 경우 한개씩 조회
  1063. }
  1064. }
  1065. }
  1066. }
  1067. /**
  1068. * @desc : 환자번호 정보조회
  1069. * @id :
  1070. * @event : onkeypress
  1071. * @return : void
  1072. * @authur : 박종훈(튜닝)
  1073. */
  1074. function fPidKeyPress()
  1075. {
  1076. model.removeNodeSet("/root/main/result/inform");
  1077. model.setValue("/root/source/srchcond", "1");
  1078. model.setValue("/root/source/pid", ipt_pid.currentText);
  1079. model.setValue("/root/main/patinfo/patinfolist/pid", ipt_pid.currentText);
  1080. //inputEnterKey("btn_search", "DOMActivate");
  1081. //환자등록번호 체크
  1082. if(ipt_pid.currentText.length >= 1 )
  1083. {
  1084. model.resetInstanceNode("/root/main/result/patinfo");
  1085. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  1086. //model.makeNode("/root/main/result/patinfo");
  1087. if(submit("TRMRC00501"))
  1088. {
  1089. var sBindPid = model.getValue("/root/main/result/inform/item/bindpid");
  1090. if( sBindPid != '-' && sBindPid != '' && sBindPid != ' ' )
  1091. {
  1092. var sPid = model.getValue("/root/main/result/inform/item/pid");
  1093. var sHngnm = model.getValue("/root/main/result/inform/item/hngnm");
  1094. var retValue = messageBox(sPid + "(" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
  1095. if( retValue == '6' )
  1096. {
  1097. ipt_pid.currentText = sBindPid;
  1098. model.setValue("/root/source/srchcond", "1");
  1099. model.setValue("/root/source/pid", ipt_pid.currentText);
  1100. model.setValue("/root/main/patinfo/patinfolist/pid", ipt_pid.currentText);
  1101. if (submit("TRPMC02500"))
  1102. {
  1103. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  1104. if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 ){
  1105. model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
  1106. model.makeValue("/root/main/patinfo/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
  1107. model.setValue("/root/main/popupendflag", "ok");
  1108. model.refresh();
  1109. oprnerId = opener.window.javascript.getScreenID();
  1110. if(oprnerId == "SPMRC03200")
  1111. {
  1112. var keyparam = model.getValue("/root/main/patinfo/patinfolist/pid") + "▦" + model.getValue("/root/main/patinfo/patinfolist/hngnm") + "▦" + model.getValue("/root/main/patinfo/patinfolist/sex") + "▦" + model.getValue("/root/main/patinfo/patinfolist/age") + "▩";
  1113. opener.window.javascript.fEnterPatinfo(keyparam);
  1114. }
  1115. //2009-10-21 오전 11:40:01 강지훈 추가 : 환자의 기록이 북마크에 있을때 탭색 변경
  1116. fChkBookmark();
  1117. return true;
  1118. }
  1119. else
  1120. {
  1121. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  1122. messageBox("없는 등록번호 입니다.", "E999", "");
  1123. return false;
  1124. }
  1125. }
  1126. }
  1127. else
  1128. {
  1129. var pAge = getFullAge(model.getValue("/root/main/result/inform/item/rrgstno1")+model.getValue("/root/main/result/inform/item/rrgstno2"));
  1130. var pGender = getGender(model.getValue("/root/main/result/inform/item/rrgstno1")+model.getValue("/root/main/result/inform/item/rrgstno2"));
  1131. model.makeValue("/root/main/patinfo/patinfolist/pid", sPid);
  1132. model.makeValue("/root/main/patinfo/agesex", pGender + "/" + pAge);
  1133. model.makeValue("/root/main/patinfo/patinfolist/hngnm", sHngnm);
  1134. model.makeValue("/root/main/patinfo/patinfolist/rrgstno1", model.getValue("/root/main/result/inform/item/rrgstno1"));
  1135. model.makeValue("/root/main/patinfo/patinfolist/rrgstno2", model.getValue("/root/main/result/inform/item/rrgstno2"));
  1136. ipt_pid.refresh();
  1137. ipt_hngnm.refresh();
  1138. opt_age.refresh();
  1139. ipt_rrgstno1.refresh();
  1140. ipt_rrgstno2.refresh();
  1141. //화면 초기화!!
  1142. //btn_init.dispatch("DOMActivate");
  1143. return true;
  1144. }
  1145. }
  1146. else
  1147. {
  1148. if (submit("TRPMC02500"))
  1149. {
  1150. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  1151. if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 ){
  1152. model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
  1153. model.makeValue("/root/main/patinfo/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
  1154. model.setValue("/root/main/popupendflag", "ok");
  1155. model.refresh();
  1156. oprnerId = opener.window.javascript.getScreenID();
  1157. if(oprnerId == "SPMRC03200")
  1158. {
  1159. var keyparam = model.getValue("/root/main/patinfo/patinfolist/pid") + "▦" + model.getValue("/root/main/patinfo/patinfolist/hngnm") + "▦" + model.getValue("/root/main/patinfo/patinfolist/sex") + "▦" + model.getValue("/root/main/patinfo/patinfolist/age") + "▩";
  1160. opener.window.javascript.fEnterPatinfo(keyparam);
  1161. }
  1162. //2009-10-21 오전 11:40:01 강지훈 추가 : 환자의 기록이 북마크에 있을때 탭색 변경
  1163. fChkBookmark();
  1164. return true;
  1165. }
  1166. else
  1167. {
  1168. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  1169. messageBox("없는 등록번호 입니다.", "E999", "");
  1170. return false;
  1171. }
  1172. }
  1173. }
  1174. }
  1175. }
  1176. else
  1177. {
  1178. messageBox("등록번호를 정확히", "C001");
  1179. return false;
  1180. }
  1181. }
  1182. /**
  1183. * @desc : 환자이름 정보조회
  1184. * @id :
  1185. * @event : onkeypress
  1186. * @return : void
  1187. * @authur : 박종훈
  1188. */
  1189. function fPnmKeyPress()
  1190. {
  1191. model.setValue("/root/source/srchcond", "2");
  1192. model.setValue("/root/source/hngnm", ipt_hngnm.currentText);
  1193. inputEnterKey("btn_search", "DOMActivate");
  1194. }
  1195. /**
  1196. * @desc : 환자주민번호 정보조회
  1197. * @id :
  1198. * @event : onkeypress
  1199. * @return : void
  1200. * @authur : 박종훈
  1201. */
  1202. function fRgstnoKeyPress()
  1203. {
  1204. model.setValue("/root/source/srchcond", "3");
  1205. model.setValue("/root/source/rrgstno1", ipt_rrgstno1.currentText);
  1206. model.setValue("/root/source/rrgstno2", ipt_rrgstno2.value);
  1207. model.makeValue("/root/source/autoflag", "Y");
  1208. inputEnterKey("btn_search", "DOMActivate");
  1209. }
  1210. /**
  1211. * @desc : 환자주민번호 뒷자리 정보조회
  1212. * @id :
  1213. * @event : onkeypress
  1214. * @return : void
  1215. * @authur : 강지훈
  1216. */
  1217. function fRgstno2KeyPress(){
  1218. if(event.keyCode == "13") {
  1219. model.setValue("/root/source/srchcond", "3");
  1220. model.setValue("/root/source/rrgstno1", ipt_rrgstno1.currentText);
  1221. model.setValue("/root/source/rrgstno2", ipt_rrgstno2.formattedText);
  1222. model.makeValue("/root/source/autoflag", "Y");
  1223. fPopPtinfo();
  1224. }
  1225. }
  1226. /**
  1227. * @desc : 환자정보조회 팝업
  1228. * @id :
  1229. * @event : DOMActivate
  1230. * @return : void
  1231. * @authur : 박종훈
  1232. */
  1233. function fPopPtinfo()
  1234. {
  1235. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/source", "/root/send");
  1236. model.resetInstanceNode("/root/source");
  1237. //2009-11-14 오전 11:57:20 강지훈 추가
  1238. model.makeValue("/root/main/patinfo/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
  1239. opt_age.refresh();
  1240. }
  1241. /**
  1242. * @desc : 화면닫기(처방에서 사용)
  1243. * @id :
  1244. * @event : xforms-select
  1245. * @return : void
  1246. * @authur : 박종훈
  1247. */
  1248. function fClose()
  1249. {
  1250. window.close();
  1251. }
  1252. /* @group : 폴더 존재여부 파악
  1253. * @ver : 2007.01.06
  1254. * @by : 박종훈
  1255. * @-----------------------------------
  1256. * @type : function
  1257. * @access : public
  1258. * @desc :
  1259. */
  1260. function fExistFolder(foldernm)
  1261. {
  1262. var fso, folder, s;
  1263. fso = new ActiveXObject("Scripting.FileSystemObject");
  1264. try
  1265. {
  1266. folder = fso.GetFolder(foldernm);
  1267. s = folder.DateCreated;
  1268. if (s != "")
  1269. {
  1270. fDelFolder(foldernm);
  1271. fMakeFolder(foldernm);
  1272. }
  1273. }
  1274. catch (e)
  1275. {
  1276. fMakeFolder(foldernm);
  1277. }
  1278. }
  1279. /* @group : 폴더 생성
  1280. * @ver : 2007.01.06
  1281. * @by : 박종훈
  1282. * @-----------------------------------
  1283. * @type : function
  1284. * @access : public
  1285. * @desc :
  1286. */
  1287. function fMakeFolder(foldernm)
  1288. {
  1289. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1290. var a = fso.CreateFolder(foldernm);
  1291. }
  1292. /* @group : 폴더 삭제
  1293. * @ver : 2007.01.06
  1294. * @by : 박종훈
  1295. * @-----------------------------------
  1296. * @type : function
  1297. * @access : public
  1298. * @desc :
  1299. */
  1300. function fDelFolder(foldernm)
  1301. {
  1302. var fso;
  1303. fso = new ActiveXObject("Scripting.FileSystemObject");
  1304. fso.DeleteFolder(foldernm);
  1305. }
  1306. /* @group : BIT모듈로부터 키값 받아옴
  1307. * @ver : 2008.01.17
  1308. * @by : 박종훈
  1309. * @-----------------------------------
  1310. * @type : function
  1311. * @access : public
  1312. * @desc :
  1313. */
  1314. function fSetCertRecKey(key)
  1315. {
  1316. setParameter("SPMRI02400_certinfo", key);
  1317. modal("SPMRI02400");
  1318. }
  1319. /**
  1320. * @desc : 사본발행 신청
  1321. * @id :
  1322. * @event : xforms-ready
  1323. * @return : void
  1324. * @authur : 박종훈
  1325. */
  1326. function fAppcopy()
  1327. {
  1328. setParameter("SMMRC03000_pid", ipt_pid.value);
  1329. open("SMMRC03000");
  1330. }
  1331. /**
  1332. * @desc : 질병 및 수술 인덱스 화면 연결
  1333. * @id :
  1334. * @event : DOMActivate
  1335. * @return : void
  1336. * @authur : 박종훈
  1337. */
  1338. function fDiagOprIndxLnk()
  1339. {
  1340. setParameter("SMMRD00400_pid", ipt_pid.value);
  1341. open("SMMRD00700");
  1342. }
  1343. /**
  1344. * @desc : 기록 조회영역 최대 최소화
  1345. * @id :
  1346. * @event : DOMActivate
  1347. * @return : void
  1348. * @authur : 박종훈
  1349. */
  1350. function fMaxMin()
  1351. {
  1352. var leftwidth = grup_left.attribute("width");
  1353. if (leftwidth == 0)
  1354. {
  1355. btn_minmax.attribute("class") = "icon_left";
  1356. grup_right.attribute("width") = 906;
  1357. grup_right.attribute("left") = 345;
  1358. grup_left.attribute("width") = 340;
  1359. iviewerIemr.attribute("width") = 902;
  1360. iviewerIemr.window.javascript.setChartViewerSize(parseInt(iviewerIemr.attribute("width")), parseInt(iviewerIemr.attribute("height")));
  1361. btn_minmax.hint = "최대화";
  1362. }
  1363. else
  1364. {
  1365. btn_minmax.attribute("class") = "icon_right";
  1366. grup_left.attribute("width") = 0;
  1367. grup_right.attribute("left") = 0;
  1368. grup_right.attribute("width") = 1251;
  1369. iviewerIemr.attribute("width") = 1247;
  1370. iviewerIemr.window.javascript.setChartViewerSize(parseInt(iviewerIemr.attribute("width")), parseInt(iviewerIemr.attribute("height")));
  1371. btn_minmax.hint = "이전크기로";
  1372. }
  1373. }
  1374. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1375. /**
  1376. * @desc : 화면표시 대상이 EMR + IMG 기록인경우 처리
  1377. * @id :
  1378. * @event : onclick
  1379. * @return : void
  1380. * @authur : 박종훈
  1381. */
  1382. function fGetNextEmrImgRec()
  1383. {
  1384. var certnodeList = instance1.selectNodes("/root/tmpinicert/iniinfo");
  1385. var foldernm = "C:\\Certrec";
  1386. var recall = model.getValue("/root/init/recall");
  1387. if (certnodeList.length <= 0)
  1388. {
  1389. return;
  1390. }
  1391. else if(certnodeList.length > 1)
  1392. {
  1393. model.setValue("/root/init/recall", "N");
  1394. }
  1395. var emrpath = "";
  1396. var emrorddate = "";
  1397. var emrformnm = "";
  1398. var emrformcd = "";
  1399. var emrdeptnm = "";
  1400. var emrdeptcd = "";
  1401. var emrpage = "";
  1402. var emrhiddenmsg = "";
  1403. var recrowno = "";
  1404. var k = "";
  1405. var pid = "";
  1406. var ptnm = "";
  1407. var depthngnm = "";
  1408. var deptengabbr = "";
  1409. var rgstno = "";
  1410. var sa = "";
  1411. var disporddd = "";
  1412. var orddd = "";
  1413. var drid = "";
  1414. var roomcd = "";
  1415. var ordtype = "";
  1416. var chosflag = "";
  1417. var orddeptcd = "";
  1418. var signflag = "";
  1419. var imgflag = "";
  1420. var langflag = "";
  1421. var tmptreatno = "";
  1422. var tmpiformcd = "";
  1423. var signno = 0;
  1424. var formcd = "";
  1425. var srcformcd = "";
  1426. var formnm = "";
  1427. var formprogflag = "";
  1428. var recdt = "";
  1429. var recdd = "";
  1430. var wardheader = "";
  1431. var dateheader = "";
  1432. var doctorheader = "";
  1433. var printheader = "";
  1434. var pageheader = "";
  1435. var imgepath = "";
  1436. var formrecdt = "";
  1437. var fstrgstdt = "";
  1438. var lastupdtdt = "";
  1439. var staffconfirmdt = "";
  1440. var fstrgstrusrnm = "";
  1441. var lastupdtrusrnm = "";
  1442. var erdt = "";
  1443. var ervisittm = "";
  1444. var staffnmheader = "";
  1445. var staffnm = "";
  1446. var emrrecusrnmheader = "";
  1447. var emrrecusrnm = "";
  1448. var indd = "";
  1449. var dschdd = "";
  1450. var inorddepthngnm = "";
  1451. var dschorddepthngnm = "";
  1452. var incnt = "";
  1453. var mainyn = "";
  1454. var rowno = "";
  1455. var prtnunm = getUserInfo("usernm");
  1456. var prtndeptnm = "";
  1457. //var getuseren = getUserInfo("userengnm");
  1458. var getdate = getCurrentDate();
  1459. var gettime = getCurrentTime();
  1460. var dateprnt = getdate.substr(0, 4) + "/" + getdate.substr(4, 2) + "/" + getdate.substr(6, 2);
  1461. var timeprnt = gettime.substr(0, 2) + ":" + gettime.substr(2, 2) + ":" + gettime.substr(4, 2);
  1462. var prtdt = dateprnt + " " + timeprnt;
  1463. fExistFolder(foldernm);
  1464. iviewerIemr.window.javascript.refreshFalse();
  1465. for(var i = 1; i <= certnodeList.length; i++)
  1466. {
  1467. signno = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/signno");
  1468. formcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formcd");
  1469. srcformcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/srcformcd");
  1470. formnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formnm");
  1471. formprogflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formprogflag");
  1472. recdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/recdt");
  1473. recdd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/recdd");
  1474. trans = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/trans");
  1475. pid = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/pid");
  1476. ptnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/ptnm");
  1477. depthngnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/depthngnm");
  1478. deptengabbr = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/deptengabbr");
  1479. rgstno = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/rgstno");
  1480. sa = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/sa");
  1481. disporddd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/disporddd");
  1482. orddd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/orddd");
  1483. drid = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/drid");
  1484. roomcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/roomcd");
  1485. ordtype = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/ordtype");
  1486. chosflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/chosflag");
  1487. orddeptcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/orddeptcd");
  1488. signflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/signflag");
  1489. imgflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/imgflag");
  1490. langflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/langflag");
  1491. formrecdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formrecdt");
  1492. formrecdt = formrecdt.toDate().getDateFormat("YYYY/MM/DD");
  1493. fstrgstdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/fstrgstdt");
  1494. lastupdtdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/lastupdtdt");
  1495. staffconfirmdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/staffconfirmdt");
  1496. fstrgstrusrnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/fstrgstrusrnm");
  1497. if(fstrgstrusrnm != "")
  1498. fstrgstrusrnm = fstrgstrusrnm + " (" + fstrgstdt + ")";
  1499. lastupdtrusrnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/lastupdtrusrnm");
  1500. if(lastupdtrusrnm != "")
  1501. lastupdtrusrnm = lastupdtrusrnm + " (" + lastupdtdt + ")";
  1502. erdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/erdt");
  1503. ervisittm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/ervisittm");
  1504. staffnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/staffnm");
  1505. emrrecusrnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/emrrecusrnm");
  1506. indd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/indd");
  1507. dschdd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/dschdd");
  1508. inorddepthngnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/inorddepthngnm");
  1509. dschorddepthngnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/dschorddepthngnm");
  1510. mainyn = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/mainyn");
  1511. rowno = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/rowno");
  1512. incnt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/incnt");
  1513. if(incnt != "")
  1514. incnt += " 회차";
  1515. var ininfo = indd + " / " + inorddepthngnm;
  1516. if(erdt != "")
  1517. ininfo += " (응급실 내원일 : " + erdt + ")";
  1518. var dschinfo = dschdd + " / " + dschorddepthngnm;
  1519. var formnmarr = formnm.split("\n");
  1520. var topformnm = "";
  1521. var botformnm = "";
  1522. if (formnmarr.length == 1)
  1523. {
  1524. topformnm = formnmarr[0];
  1525. }
  1526. else if (formnmarr.length == 2)
  1527. {
  1528. topformnm = formnmarr[0];
  1529. botformnm = formnmarr[1];
  1530. }
  1531. else
  1532. {
  1533. topformnm = formnm;
  1534. }
  1535. //2009-06-02 등록번호 "-" 병원별 제거
  1536. var pidynhcd = model.getValue("/root/init/pidynhcd/hardcd/hardcd");
  1537. if (pidynhcd == "Y")
  1538. {
  1539. for(var k = pid.length; k <= 8; k++)
  1540. {
  1541. if(k < 8){
  1542. pid = "0"+pid;
  1543. }
  1544. }
  1545. var str1 = pid.substr(0, 3);
  1546. var str2 = pid.substr(3, 2);
  1547. var str3 = pid.substr(5, 2);
  1548. var str4 = pid.substr(7, 1);
  1549. var tmppid = str1 + " " + str2 + " " + str3 + "-" + str4;
  1550. }
  1551. else
  1552. {
  1553. tmppid = pid;
  1554. }
  1555. if (chosflag == "O" || chosflag == "S")
  1556. {
  1557. wardheader = "진료과 : ";
  1558. }
  1559. else
  1560. {
  1561. wardheader = "병실 : ";
  1562. }
  1563. if (langflag == "KO")
  1564. {
  1565. if (chosflag == "O" || chosflag == "S")
  1566. {
  1567. wardheader = "진료과 : ";
  1568. }
  1569. else
  1570. {
  1571. wardheader = "병실 : ";
  1572. }
  1573. dateheader = "진료기간 : ";
  1574. doctorheader = "주치의 : ";
  1575. printheader = "출력 : ";
  1576. prtndeptnm = getUserInfo("dutplcenm");
  1577. imgepath = "com/commonweb/images/biglogo" + getUserInfo("dutplceinstcd") + ".jpg"
  1578. pageheader = "페이지 : ";
  1579. }
  1580. else
  1581. {
  1582. if (chosflag == "O" || chosflag == "S")
  1583. {
  1584. wardheader = "Dept : ";
  1585. }
  1586. else
  1587. {
  1588. wardheader = "Room : ";
  1589. }
  1590. dateheader = "Date : ";
  1591. doctorheader = "Doctor : ";
  1592. printheader = "Print date : ";
  1593. prtndeptnm = getUserInfo("deptengnm");
  1594. imgepath = "com/commonweb/images/biglogo" + getUserInfo("dutplceinstcd") + "e.jpg"
  1595. if (prtndeptnm == "" || prtndeptnm == null)
  1596. {
  1597. prtndeptnm = getUserInfo("dutplcenm");
  1598. }
  1599. pageheader = "Page : ";
  1600. }
  1601. if (imgflag == "N")
  1602. {
  1603. if(trans == "")
  1604. trans = "<html><head><title>출력화면 구현중입니다.</title></head><body>출력화면 구현중입니다.</body></html>";
  1605. var ininm = "cmc";
  1606. switch(srcformcd)
  1607. {
  1608. case "0000000001"://외래초진
  1609. case "0000000002"://외래재진
  1610. case "0000000004"://입원경과
  1611. case "0000003325"://DSC기록
  1612. ininm += "_0000000001.ini";
  1613. break;
  1614. case "0000000003"://입원초진
  1615. ininm += "_0000000003.ini";
  1616. break;
  1617. case "0000000676"://수술기록
  1618. staffnmheader = "◈ Surgeon :";
  1619. if(staffnm != "")
  1620. staffnm += "(" + staffconfirmdt + ")";
  1621. emrrecusrnmheader = "";
  1622. ininm += "_0000000676.ini";
  1623. break;
  1624. case "0000003169"://Brief OP Note
  1625. ininm += "_0000000676.ini";
  1626. break;
  1627. case "0000000680"://입퇴원요약
  1628. staffnmheader = "◈ Staff작성 및 확인 :";
  1629. if(staffnm != "")
  1630. staffnm += "(" + staffconfirmdt + ")";
  1631. emrrecusrnmheader = "◈ 의무기록사 :";
  1632. ininm += "_0000000680.ini";
  1633. break;
  1634. case "0000000679"://응급실기록
  1635. ininm += "_0000000679.ini";
  1636. break;
  1637. default:
  1638. //ininm += "_0000000001.ini";
  1639. if(formprogflag == "-" || formprogflag == "MAIN" || mainyn == "Y")
  1640. ininm += "_0000000001.ini";
  1641. else
  1642. ininm += ".ini";
  1643. break;
  1644. }
  1645. trans = "<!--% \n %BASE " + getDomain() + "/himed/webapps/ \n %INCLUDE emr/recmngtweb/xrw/" + ininm + " \n VAR_PAT_NUM = " + tmppid + " \n VAR_CLASS = " + ordtype + " \n VAR_CHART_NAME_TOP = " + topformnm + " \n VAR_CHART_NAME_BOTTOM = " + botformnm + " \n VAR_CHART_NAME_LINE = " + formnm + " \n VAR_PAT_AGE_SEX = " + sa + " \n VAR_TREAT_DEPT = " + deptengabbr + " \n VAR_PAT_JUMIN_NO = " + rgstno + " \n VAR_PAT_NAME = " + ptnm + " \n VAR_PRINT_NAME = " + prtnunm + " \n VAR_PRINT_DEPT = " + prtndeptnm + " \n VAR_WARD_HEAD = " + wardheader + roomcd + " \n VAR_DATE_HEADER = " + dateheader + disporddd + " \n VAR_DOCTOR_HEADER = " + doctorheader + drid + " \n VAR_PRINT_HEADER = " + printheader + prtdt + " \n SYS_PAGE_HEADER = " + pageheader + " \n VAR_HOSP_IMG = " + imgepath + " \n VAR_ORDDATE = " + formrecdt + " \n VAR_ORDDEPT = " + depthngnm + " \n VAR_FSTRGSTRUSRNM = " + fstrgstrusrnm + " \n VAR_LASTUPDTRUSRNM = " + lastupdtrusrnm + " \n VAR_ERDT = " + erdt + " \n VAR_ERVISITTM = " + ervisittm + " \n VAR_STAFFNM_HEADER = " + staffnmheader + " \n VAR_STAFFNM = " + staffnm + " \n VAR_EMRRECUSRNM_HEADER = " + emrrecusrnmheader + " \n VAR_EMRRECUSRNM = " + emrrecusrnm + " \n VAR_ININFO = " + ininfo + " \n VAR_DSCHINFO = " + dschinfo + " \n VAR_INCNT = " + incnt + " \n VAR_INORDDEPTHNGNM = " + inorddepthngnm + "\n %-->\n" + trans;
  1646. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1647. var a = fso.CreateTextFile(foldernm + "\\" + signno + "_" + formcd + ".HTML", true, true);
  1648. a.WriteLine(trans);
  1649. //a.Write(trans);
  1650. a.Close();
  1651. emrpath = foldernm + "\\" + signno + "_" + formcd + ".HTML|";
  1652. //emrorddate += orddd + "|";
  1653. emrorddate = recdd + "|"; //기록일을 보여달라는 의료정보팀 요청
  1654. emrformnm = formnm + "|";
  1655. emrformcd = formcd + "|";
  1656. emrdeptnm = deptengabbr + "|";
  1657. emrdeptcd = orddeptcd + "|";
  1658. emrpage = "1|";
  1659. emrhiddenmsg = formcd + "▦" + signno + "▦" + formnm + "▦" + chosflag + "▦" +pid + "▦" + ptnm + "▦" + deptengabbr
  1660. + "▦" + sa + "▦" + rgstno + "▦" + disporddd + "▦" + drid + "▦" + roomcd + "▦" + disporddd + "▦" + ordtype + "▦" + "E|";
  1661. recrowno = rowno;
  1662. //영상-EMR구분|파일경로|입원일|서식지코드|서식지이름|진료과코드|진료과이름
  1663. var chartinfo = "";
  1664. chartinfo = "E|" + emrpath + emrorddate + emrformcd + emrformnm + emrdeptcd + emrdeptnm;
  1665. model.makeValue("/root/send/iemr/treatno", "");
  1666. model.makeValue("/root/send/iemr/docucd", "");
  1667. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  1668. iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, emrhiddenmsg, recrowno);
  1669. //iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, emrhiddenmsg);
  1670. }
  1671. else
  1672. {
  1673. tmptreatno = signno + ",";
  1674. tmpiformcd = formcd + ",";
  1675. emrpath = "*|";
  1676. emrorddate = "*|";
  1677. emrformnm = "*|";
  1678. emrformcd = "*|";
  1679. emrdeptnm = "*|";
  1680. emrdeptcd = "*|";
  1681. emrpage = "*|";
  1682. emrhiddenmsg = "*|";
  1683. recrowno = rowno;
  1684. model.makeValue("/root/imgrec/iemr/treatno", signno);
  1685. model.makeValue("/root/imgrec/iemr/docucd", formcd);
  1686. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  1687. var chartinfo;
  1688. chartinfo = "I";
  1689. var hiddenmsg;
  1690. hiddenmsg = "I";
  1691. iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg, recrowno);
  1692. //iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg);
  1693. }
  1694. }
  1695. iviewerIemr.window.javascript.refreshTrue();
  1696. }
  1697. /**
  1698. * @desc : 미비확인 화면 오픈
  1699. * @id :
  1700. * @event : DOMActivate
  1701. * @return : void
  1702. * @authur : 박종훈
  1703. */
  1704. function fOpenUnprep()
  1705. {
  1706. var pid = model.getValue("/root/main/patinfo/patinfolist/pid");
  1707. var orddd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd"));
  1708. var cretno = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("cretno"));
  1709. setParameter("SPMRI03000_pid", pid);
  1710. setParameter("SPMRI03000_indd", orddd);
  1711. setParameter("SPMRI03000_cretno", cretno);
  1712. var wndobj = getOpenWindow("SPMRI03000");
  1713. if(wndobj != null)
  1714. {
  1715. wndobj.window.javascript.fInitialize_SPMRI03000();
  1716. activateChild("SPMRI03000");
  1717. }
  1718. else
  1719. {
  1720. open("SPMRI03000");
  1721. }
  1722. }
  1723. /**
  1724. * @desc : 출력버튼 클릭
  1725. * @id :
  1726. * @event : DOMActivate
  1727. * @return : void
  1728. * @authur : 박종훈
  1729. */
  1730. function fClickPrint()
  1731. {
  1732. var orddd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd"));
  1733. var cretno = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("cretno"));
  1734. var orddeptcd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddeptcd"));
  1735. var comporddd = model.getValue("/root/init/prtresn/orddd");
  1736. var compcretno = model.getValue("/root/init/prtresn/cretno");
  1737. var itrgtNodeCnt = getNodesetCnt(model, "/root/hardcd/trgtdept[trgtcd = '" + orddeptcd + "']"); //사유대상부서
  1738. if (itrgtNodeCnt > 0) //감염내과, 정신과, 산부인과, 비뇨기과
  1739. {
  1740. var sUserDeptcd = getUserInfo("dutplcecd");
  1741. var iexNodeCnt = getNodesetCnt(model, "/root/hardcd/exdept[trgtcd = '" + sUserDeptcd + "']"); //사유제외부서
  1742. if ((iexNodeCnt <= 0) && (sUserDeptcd != orddeptcd) && (comporddd != orddd && compcretno != cretno)) //사용자 근무부서와 환자 수진부서가 틀린경우 사유창 팝업, 근무부서가 의료정보팀일경우 제외
  1743. {
  1744. model.resetInstanceNode("/root/init/prtresn");
  1745. setParameter("SPMRI03100_param_nodepath", "/root/init/prtresn");
  1746. setParameter("SPMRI03100_param_rsnflag", 'P');
  1747. modal("SPMRI03100");
  1748. var valiyn = model.getValue("/root/init/prtresn/valiyn");
  1749. if (valiyn != "Y")
  1750. {
  1751. return;
  1752. }
  1753. else
  1754. {
  1755. }
  1756. }
  1757. model.makeValue("/root/init/prtresn/orddd", orddd);
  1758. model.makeValue("/root/init/prtresn/cretno", cretno);
  1759. }
  1760. else
  1761. {
  1762. model.resetInstanceNode("/root/init/prtresn");
  1763. }
  1764. var appcopykey = iviewerIemr.window.javascript.setCopy(true); //영상뷰어에서의 리턴값
  1765. if (appcopykey != "")
  1766. {
  1767. var copykey = appcopykey.split("|");
  1768. var appkeyArr = copykey[0].split("▦");
  1769. var reckind = ""; //기록, 영상구분(E/I)
  1770. var tmpval = "";
  1771. var tmpformcd = "";
  1772. var tmptotpage = "";
  1773. appkeyArr = "";
  1774. var copyparam = "";
  1775. var compsignno = "";
  1776. var compformcd = "";
  1777. var tmpreckind = "";
  1778. var tmpdeptcd = getUserInfo("dutplcecd");
  1779. var tmppid = model.getValue("/root/main/patinfo/patinfolist/pid")
  1780. var tmporddd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd"));
  1781. var tmpcretno = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("cretno"));
  1782. var tmpchosflag = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("ordtype"));
  1783. model.removeNodeSet("/root/prthist");
  1784. model.makeNode("/root/prthist");
  1785. var leng = 1;
  1786. for(var i = 0; i < copykey.length; i = i + 2)
  1787. {
  1788. appkeyArr = copykey[i].split("▦");
  1789. reckind = appkeyArr[0];
  1790. if (reckind == "I")
  1791. {
  1792. tmpval = appkeyArr[1];
  1793. tmpformcd = appkeyArr[2];
  1794. tmpreckind = "02";
  1795. if (compsignno != tmpval || compformcd != tmpformcd)
  1796. {
  1797. compsignno = tmpval;
  1798. compformcd = tmpformcd;
  1799. }
  1800. else
  1801. {
  1802. continue;
  1803. }
  1804. }
  1805. else
  1806. {
  1807. tmpval = appkeyArr[1];
  1808. tmpformcd = appkeyArr[0];
  1809. tmpreckind = "01";
  1810. if (compsignno != tmpval)
  1811. {
  1812. compsignno = tmpval;
  1813. }
  1814. else
  1815. {
  1816. continue;
  1817. }
  1818. }
  1819. if (tmpcretno == "")
  1820. tmpcretno = 0;
  1821. model.makeValue("/root/prthist[" + leng + "]/pid", tmppid);
  1822. model.makeValue("/root/prthist[" + leng + "]/orddd", tmporddd);
  1823. model.makeValue("/root/prthist[" + leng + "]/cretno", tmpcretno);
  1824. model.makeValue("/root/prthist[" + leng + "]/chosflag", tmpchosflag);
  1825. model.makeValue("/root/prthist[" + leng + "]/signno", tmpval);
  1826. model.makeValue("/root/prthist[" + leng + "]/formcd", tmpformcd);
  1827. model.makeValue("/root/prthist[" + leng + "]/reckind", tmpreckind);
  1828. model.makeValue("/root/prthist[" + leng + "]/userdeptcd", tmpdeptcd);
  1829. model.makeValue("/root/prthist[" + leng + "]/readprtflag", "P");
  1830. model.makeValue("/root/prthist[" + leng + "]/refusge", model.getValue("/root/init/prtresn/resncd"));
  1831. model.makeValue("/root/prthist[" + leng + "]/refremark", model.getValue("/root/init/prtresn/etc"));
  1832. leng++;
  1833. }
  1834. datagrid1.rebuild();
  1835. for(var j = 1; j < datagrid1.rows; j++)
  1836. {
  1837. datagrid1.rowstatus(j) = 1;
  1838. }
  1839. model.removeNodeset("/root/send");
  1840. model.makeValue("/root/send/prtlist", datagrid1.getUpdateData());
  1841. submit("TXMRI04001");
  1842. if(iviewerIemr.window.javaScript.printChart("SMMRC03000"))
  1843. {
  1844. messageBox("출력", "I001");
  1845. }
  1846. else
  1847. {
  1848. messageBox("출력에", "E009");
  1849. }
  1850. model.removeNodeSet("/root/prthist");
  1851. model.makeNode("/root/prthist");
  1852. datagrid1.refresh();
  1853. }
  1854. }
  1855. /**
  1856. * @desc : 중분류 그리드 메뉴
  1857. * @id :
  1858. * @event : DOMActivate
  1859. * @return : void
  1860. * @authur : 박종훈
  1861. */
  1862. function fMidindxMouseRight()
  1863. {
  1864. if(grd_midindx.isCell(event.target) && (grd_midindx.mouserow >= grd_midindx.fixedrows))
  1865. {
  1866. setPopupMenu("grd_midindx", false, "/root/midmsrght/mouserght", "label", "func");
  1867. }
  1868. }
  1869. /**
  1870. * @desc : 분류출력 클릭
  1871. * @id :
  1872. * @event : DOMActivate
  1873. * @return : void
  1874. * @authur : 박종훈
  1875. */
  1876. function fMidPrint()
  1877. {
  1878. model.setValue("/root/init/recall", "Y");
  1879. iviewerIemrprt.window.javascript.setupChart("ThumbView");
  1880. fGetDetlRecForPrt();
  1881. var appcopykey = iviewerIemrprt.window.javascript.setCopy(true); //영상뷰어에서의 리턴값
  1882. if (appcopykey != "")
  1883. {
  1884. var copykey = appcopykey.split("|");
  1885. var appkeyArr = copykey[0].split("▦");
  1886. var reckind = ""; //기록, 영상구분(E/I)
  1887. var tmpval = "";
  1888. var tmpformcd = "";
  1889. var tmptotpage = "";
  1890. appkeyArr = "";
  1891. var copyparam = "";
  1892. var compsignno = "";
  1893. var compformcd = "";
  1894. var tmpreckind = "";
  1895. var tmpdeptcd = getUserInfo("dutplcecd");
  1896. var tmppid = model.getValue("/root/main/patinfo/patinfolist/pid")
  1897. var tmporddd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd"));
  1898. var tmpcretno = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("cretno"));
  1899. var tmpchosflag = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("ordtype"));
  1900. model.removeNodeSet("/root/prthist");
  1901. model.makeNode("/root/prthist");
  1902. var leng = 1;
  1903. for(var i = 0; i < copykey.length; i = i + 2)
  1904. {
  1905. appkeyArr = copykey[i].split("▦");
  1906. reckind = appkeyArr[0];
  1907. if (reckind == "I")
  1908. {
  1909. tmpval = appkeyArr[1];
  1910. tmpformcd = appkeyArr[2];
  1911. tmpreckind = "02";
  1912. if (compsignno != tmpval || compformcd != tmpformcd)
  1913. {
  1914. compsignno = tmpval;
  1915. compformcd = tmpformcd;
  1916. }
  1917. else
  1918. {
  1919. continue;
  1920. }
  1921. }
  1922. else
  1923. {
  1924. tmpval = appkeyArr[1];
  1925. tmpformcd = appkeyArr[0];
  1926. tmpreckind = "01";
  1927. if (compsignno != tmpval)
  1928. {
  1929. compsignno = tmpval;
  1930. }
  1931. else
  1932. {
  1933. continue;
  1934. }
  1935. }
  1936. if (tmpcretno == "")
  1937. tmpcretno = 0;
  1938. model.makeValue("/root/prthist[" + leng+ "]/pid", tmppid);
  1939. model.makeValue("/root/prthist[" + leng + "]/orddd", tmporddd);
  1940. model.makeValue("/root/prthist[" + leng + "]/cretno", tmpcretno);
  1941. model.makeValue("/root/prthist[" + leng + "]/chosflag", tmpchosflag);
  1942. model.makeValue("/root/prthist[" + leng + "]/signno", tmpval);
  1943. model.makeValue("/root/prthist[" + leng + "]/formcd", tmpformcd);
  1944. model.makeValue("/root/prthist[" + leng + "]/reckind", tmpreckind);
  1945. model.makeValue("/root/prthist[" + leng + "]/userdeptcd", tmpdeptcd);
  1946. model.makeValue("/root/prthist[" + leng + "]/readprtflag", "P");
  1947. model.makeValue("/root/prthist[" + leng + "]/refusge", "");
  1948. model.makeValue("/root/prthist[" + leng + "]/refremark", "");
  1949. leng++;
  1950. }
  1951. datagrid1.rebuild();
  1952. for(var j = 1; j < datagrid1.rows; j++)
  1953. {
  1954. datagrid1.rowstatus(j) = 1;
  1955. }
  1956. model.removeNodeset("/root/send");
  1957. model.makeValue("/root/send/prtlist", datagrid1.getUpdateData());
  1958. submit("TXMRI04001");
  1959. if(iviewerIemr.window.javaScript.printChart("SMMRC03000"))
  1960. {
  1961. messageBox("출력", "I001");
  1962. }
  1963. else
  1964. {
  1965. messageBox("출력에", "E009");
  1966. }
  1967. model.removeNodeSet("/root/prthist");
  1968. model.makeNode("/root/prthist");
  1969. datagrid1.refresh();
  1970. }
  1971. }
  1972. /**
  1973. * @desc : 기록조회
  1974. * @id :
  1975. * @event : DOMActivate
  1976. * @return : void
  1977. * @authur : 박종훈
  1978. */
  1979. function fGetDetlRecForPrt()
  1980. {
  1981. var reccurpos = parseInt(model.getValue("/root/init/reccurpos"));
  1982. var rowfocus = "";
  1983. var midreccurpos = 1;
  1984. var midpos = 0; //중분류중 몇번째 기록계산
  1985. var emrflag = model.getValue("/root/init/emrflag");
  1986. //2009-11-02 오후 4:44:56 강지훈 수정
  1987. var reckind = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("reckind"));
  1988. if (emrflag == "I" && (reckind != "EMR" && reckind != "CDIS"))
  1989. {
  1990. var totcnt = "[ " + 1 + " / " + grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")) + " / " + model.getValue("/root/init/reccnt") + " ]";
  1991. model.setValue("/root/init/totcnt", totcnt);
  1992. lbl_totcnt.refresh();
  1993. var treatno = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq"));
  1994. var formcd = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("supitemindxseq"));
  1995. iviewerIemrprt.window.javascript.cleanViewer();
  1996. iviewerIemrprt.window.javascript.refreshFalse();
  1997. model.makeValue("/root/imgrec/iemr/treatno", parseInt(treatno));
  1998. model.makeValue("/root/imgrec/iemr/docucd", formcd);
  1999. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  2000. var chartinfo;
  2001. chartinfo = "I";
  2002. var hiddenmsg;
  2003. hiddenmsg = "I";
  2004. iviewerIemrprt.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg);
  2005. iviewerIemrprt.window.javascript.refreshTrue();
  2006. }
  2007. else
  2008. {
  2009. for (var i = 1; i <= grd_midindx.rows; i++)
  2010. {
  2011. midcnt = grd_midindx.valueMatrix(i, grd_midindx.colref("cnt"));
  2012. midreccurpos += parseInt(midcnt);
  2013. if (midreccurpos > reccurpos)
  2014. {
  2015. //grd_midindx.row = i;
  2016. break;
  2017. }
  2018. }
  2019. var reckind = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("reckind"));
  2020. var calcReccurpos = parseInt(model.getValue("/root/init/reccurpos"));
  2021. var bfopentest = model.getValue("/root/init/bfopentest");
  2022. var isLis = "";
  2023. for (var j = 1; j < grd_midindx.row; j++)
  2024. {
  2025. isLis = grd_midindx.valueMatrix(j, grd_midindx.colref("reckind"));
  2026. if (isLis == "LIS")
  2027. {
  2028. calcReccurpos -= 1;
  2029. }
  2030. }
  2031. model.removeNodeset("/root/send");
  2032. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  2033. model.makeValue("/root/send/orddd", grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd")));
  2034. model.makeValue("/root/send/cretno", grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("cretno")));
  2035. model.makeValue("/root/send/chosflag", grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("ordtype")));
  2036. model.makeValue("/root/send/orddeptcd", grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddeptcd")));
  2037. model.makeValue("/root/send/tabflag", model.getValue("/root/init/tabflag"));
  2038. model.makeValue("/root/send/reccurpos", calcReccurpos);
  2039. model.makeValue("/root/send/recall", model.getValue("/root/init/recall"));
  2040. model.makeValue("/root/send/reckind", reckind);
  2041. model.makeValue("/root/send/itemindxseq", grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq")));
  2042. model.makeValue("/root/send/lisflag", grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("lisflag")));
  2043. //2009-11-02 오후 2:18:45 강지훈 수정
  2044. model.makeValue("/root/send/bfopentest", bfopentest);
  2045. grd_pathistrow = grd_pathist.row;
  2046. pathistEmrFlag = grd_pathist.valueMatrix(grd_pathistrow, grd_pathist.colref("emrflag"))
  2047. if(bfopentest == "Y" && emrflag != "E"){
  2048. model.makeValue("/root/send/midbftest", "Y");
  2049. }
  2050. else{
  2051. model.makeValue("/root/send/midbftest", "N");
  2052. }
  2053. if(submit("TRMRI04004"))
  2054. {
  2055. iviewerIemrprt.window.javascript.cleanViewer();
  2056. fGetNextEmrImgRecPrt();
  2057. }
  2058. if (grd_midindx.row > 1)
  2059. {
  2060. var prevmidcnt = grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt"));
  2061. midpos = reccurpos - midreccurpos + parseInt(prevmidcnt) + 1;
  2062. }
  2063. else
  2064. {
  2065. midpos = reccurpos;
  2066. }
  2067. var totcnt = "[ " + midpos + " / " + grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("cnt")) + " / " + model.getValue("/root/init/reccnt") + " ]";
  2068. model.setValue("/root/init/totcnt", totcnt);
  2069. lbl_totcnt.refresh();
  2070. }
  2071. }
  2072. function fGetNextEmrImgRecPrt()
  2073. {
  2074. var certnodeList = instance1.selectNodes("/root/tmpinicert/iniinfo");
  2075. var foldernm = "C:\\Certrec";
  2076. if (certnodeList.length <= 0)
  2077. return;
  2078. var emrpath = "";
  2079. var emrorddate = "";
  2080. var emrformnm = "";
  2081. var emrformcd = "";
  2082. var emrdeptnm = "";
  2083. var emrdeptcd = "";
  2084. var emrpage = "";
  2085. var emrhiddenmsg = "";
  2086. var k = "";
  2087. var pid = "";
  2088. var ptnm = "";
  2089. var depthngnm = "";
  2090. var deptengabbr = "";
  2091. var rgstno = "";
  2092. var sa = "";
  2093. var disporddd = "";
  2094. var orddd = "";
  2095. var drid = "";
  2096. var roomcd = "";
  2097. var ordtype = "";
  2098. var chosflag = "";
  2099. var orddeptcd = "";
  2100. var signflag = "";
  2101. var imgflag = "";
  2102. var langflag = "";
  2103. var tmptreatno = "";
  2104. var tmpiformcd = "";
  2105. var signno = 0;
  2106. var formcd = "";
  2107. var srcformcd = "";
  2108. var formnm = "";
  2109. var formprogflag = "";
  2110. var recdt = "";
  2111. var recdd = "";
  2112. var wardheader = "";
  2113. var dateheader = "";
  2114. var doctorheader = "";
  2115. var printheader = "";
  2116. var pageheader = "";
  2117. var imgepath = "";
  2118. var formrecdt = "";
  2119. var fstrgstdt = "";
  2120. var lastupdtdt = "";
  2121. var staffconfirmdt = "";
  2122. var fstrgstrusrnm = "";
  2123. var lastupdtrusrnm = "";
  2124. var erdt = "";
  2125. var ervisittm = "";
  2126. var staffnmheader = "";
  2127. var staffnm = "";
  2128. var emrrecusrnmheader = "";
  2129. var emrrecusrnm = "";
  2130. var indd = "";
  2131. var dschdd = "";
  2132. var inorddepthngnm = "";
  2133. var dschorddepthngnm = "";
  2134. var incnt = "";
  2135. var mainyn = "";
  2136. var prtnunm = getUserInfo("usernm");
  2137. var prtndeptnm = "";
  2138. //var getuseren = getUserInfo("userengnm");
  2139. var getdate = getCurrentDate();
  2140. var gettime = getCurrentTime();
  2141. var dateprnt = getdate.substr(0, 4) + "/" + getdate.substr(4, 2) + "/" + getdate.substr(6, 2);
  2142. var timeprnt = gettime.substr(0, 2) + ":" + gettime.substr(2, 2) + ":" + gettime.substr(4, 2);
  2143. var prtdt = dateprnt + " " + timeprnt;
  2144. fExistFolder(foldernm);
  2145. iviewerIemrprt.window.javascript.refreshFalse();
  2146. for(var i = 1; i <= certnodeList.length; i++)
  2147. {
  2148. signno = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/signno");
  2149. formcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formcd");
  2150. srcformcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/srcformcd");
  2151. formnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formnm");
  2152. formprogflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formprogflag");
  2153. recdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/recdt");
  2154. recdd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/recdd");
  2155. trans = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/trans");
  2156. pid = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/pid");
  2157. ptnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/ptnm");
  2158. depthngnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/depthngnm");
  2159. deptengabbr = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/deptengabbr");
  2160. rgstno = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/rgstno");
  2161. sa = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/sa");
  2162. disporddd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/disporddd");
  2163. orddd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/orddd");
  2164. drid = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/drid");
  2165. roomcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/roomcd");
  2166. ordtype = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/ordtype");
  2167. chosflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/chosflag");
  2168. orddeptcd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/orddeptcd");
  2169. signflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/signflag");
  2170. imgflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/imgflag");
  2171. langflag = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/langflag");
  2172. formrecdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/formrecdt");
  2173. formrecdt = formrecdt.toDate().getDateFormat("YYYY/MM/DD");
  2174. fstrgstdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/fstrgstdt");
  2175. lastupdtdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/lastupdtdt");
  2176. staffconfirmdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/staffconfirmdt");
  2177. fstrgstrusrnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/fstrgstrusrnm");
  2178. if(fstrgstrusrnm != "")
  2179. fstrgstrusrnm = fstrgstrusrnm + " (" + fstrgstdt + ")";
  2180. lastupdtrusrnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/lastupdtrusrnm");
  2181. if(lastupdtrusrnm != "")
  2182. lastupdtrusrnm = lastupdtrusrnm + " (" + lastupdtdt + ")";
  2183. erdt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/erdt");
  2184. ervisittm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/ervisittm");
  2185. staffnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/staffnm");
  2186. emrrecusrnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/emrrecusrnm");
  2187. indd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/indd");
  2188. dschdd = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/dschdd");
  2189. inorddepthngnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/inorddepthngnm");
  2190. dschorddepthngnm = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/dschorddepthngnm");
  2191. mainyn = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/mainyn");
  2192. incnt = model.getValue("/root/tmpinicert/iniinfo[" + i + "]/incnt");
  2193. if(incnt != "")
  2194. incnt += " 회차";
  2195. var ininfo = indd + " / " + inorddepthngnm;
  2196. if(erdt != "")
  2197. ininfo += " (응급실 내원일 : " + erdt + ")";
  2198. var dschinfo = dschdd + " / " + dschorddepthngnm;
  2199. var formnmarr = formnm.split("\n");
  2200. var topformnm = "";
  2201. var botformnm = "";
  2202. if (formnmarr.length == 1)
  2203. {
  2204. topformnm = formnmarr[0];
  2205. }
  2206. else if (formnmarr.length == 2)
  2207. {
  2208. topformnm = formnmarr[0];
  2209. botformnm = formnmarr[1];
  2210. }
  2211. else
  2212. {
  2213. topformnm = formnm;
  2214. }
  2215. //2009-06-02 등록번호 "-" 병원별 제거
  2216. var pidynhcd = model.getValue("/root/init/pidynhcd/hardcd/hardcd");
  2217. if (pidynhcd == "Y")
  2218. {
  2219. for(var k = pid.length; k <= 8; k++)
  2220. {
  2221. if(k < 8){
  2222. pid = "0"+pid;
  2223. }
  2224. }
  2225. var str1 = pid.substr(0, 3);
  2226. var str2 = pid.substr(3, 2);
  2227. var str3 = pid.substr(5, 2);
  2228. var str4 = pid.substr(7, 1);
  2229. var tmppid = str1 + " " + str2 + " " + str3 + "-" + str4;
  2230. }
  2231. else
  2232. {
  2233. tmppid = pid;
  2234. }
  2235. if (chosflag == "O" || chosflag == "S")
  2236. {
  2237. wardheader = "진료과 : ";
  2238. }
  2239. else
  2240. {
  2241. wardheader = "병실 : ";
  2242. }
  2243. if (langflag == "KO")
  2244. {
  2245. if (chosflag == "O" || chosflag == "S")
  2246. {
  2247. wardheader = "진료과 : ";
  2248. }
  2249. else
  2250. {
  2251. wardheader = "병실 : ";
  2252. }
  2253. dateheader = "진료기간 : ";
  2254. doctorheader = "주치의 : ";
  2255. printheader = "출력 : ";
  2256. prtndeptnm = getUserInfo("dutplcenm");
  2257. imgepath = "com/commonweb/images/biglogo" + getUserInfo("dutplceinstcd") + ".jpg"
  2258. pageheader = "페이지 : ";
  2259. }
  2260. else
  2261. {
  2262. if (chosflag == "O" || chosflag == "S")
  2263. {
  2264. wardheader = "Dept : ";
  2265. }
  2266. else
  2267. {
  2268. wardheader = "Room : ";
  2269. }
  2270. dateheader = "Date : ";
  2271. doctorheader = "Doctor : ";
  2272. printheader = "Print date : ";
  2273. prtndeptnm = getUserInfo("deptengnm");
  2274. imgepath = "com/commonweb/images/biglogo" + getUserInfo("dutplceinstcd") + "e.jpg"
  2275. if (prtndeptnm == "" || prtndeptnm == null)
  2276. {
  2277. prtndeptnm = getUserInfo("dutplcenm");
  2278. }
  2279. pageheader = "Page : ";
  2280. }
  2281. if (imgflag == "N")
  2282. {
  2283. if(trans == "")
  2284. trans = "<html><head><title>출력화면 구현중입니다.</title></head><body>출력화면 구현중입니다.</body></html>";
  2285. var ininm = "cmc";
  2286. switch(srcformcd)
  2287. {
  2288. case "0000000001"://외래초진
  2289. case "0000000002"://외래재진
  2290. case "0000000004"://입원경과
  2291. case "0000003325"://DSC기록
  2292. ininm += "_0000000001.ini";
  2293. break;
  2294. case "0000000003"://입원초진
  2295. ininm += "_0000000003.ini";
  2296. break;
  2297. case "0000000676"://수술기록
  2298. staffnmheader = "◈ Surgeon :";
  2299. if(staffnm != "")
  2300. staffnm += "(" + staffconfirmdt + ")";
  2301. emrrecusrnmheader = "";
  2302. ininm += "_0000000676.ini";
  2303. break;
  2304. case "0000003169"://Brief OP Note
  2305. ininm += "_0000000676.ini";
  2306. break;
  2307. case "0000000680"://입퇴원요약
  2308. staffnmheader = "◈ Staff작성 및 확인 :";
  2309. if(staffnm != "")
  2310. staffnm += "(" + staffconfirmdt + ")";
  2311. emrrecusrnmheader = "◈ 의무기록사 :";
  2312. ininm += "_0000000680.ini";
  2313. break;
  2314. case "0000000679"://응급실기록
  2315. ininm += "_0000000679.ini";
  2316. break;
  2317. default:
  2318. //ininm += "_0000000001.ini";
  2319. if(formprogflag == "-" || formprogflag == "MAIN" || mainyn == "Y")
  2320. ininm += "_0000000001.ini";
  2321. else
  2322. ininm += ".ini";
  2323. break;
  2324. }
  2325. trans = "<!--% \n %BASE " + getDomain() + "/himed/webapps/ \n %INCLUDE emr/recmngtweb/xrw/" + ininm + " \n VAR_PAT_NUM = " + tmppid + " \n VAR_CLASS = " + ordtype + " \n VAR_CHART_NAME_TOP = " + topformnm + " \n VAR_CHART_NAME_BOTTOM = " + botformnm + " \n VAR_CHART_NAME_LINE = " + formnm + " \n VAR_PAT_AGE_SEX = " + sa + " \n VAR_TREAT_DEPT = " + deptengabbr + " \n VAR_PAT_JUMIN_NO = " + rgstno + " \n VAR_PAT_NAME = " + ptnm + " \n VAR_PRINT_NAME = " + prtnunm + " \n VAR_PRINT_DEPT = " + prtndeptnm + " \n VAR_WARD_HEAD = " + wardheader + roomcd + " \n VAR_DATE_HEADER = " + dateheader + disporddd + " \n VAR_DOCTOR_HEADER = " + doctorheader + drid + " \n VAR_PRINT_HEADER = " + printheader + prtdt + " \n SYS_PAGE_HEADER = " + pageheader + " \n VAR_HOSP_IMG = " + imgepath + " \n VAR_ORDDATE = " + formrecdt + " \n VAR_ORDDEPT = " + depthngnm + " \n VAR_FSTRGSTRUSRNM = " + fstrgstrusrnm + " \n VAR_LASTUPDTRUSRNM = " + lastupdtrusrnm + " \n VAR_ERDT = " + erdt + " \n VAR_ERVISITTM = " + ervisittm + " \n VAR_STAFFNM_HEADER = " + staffnmheader + " \n VAR_STAFFNM = " + staffnm + " \n VAR_EMRRECUSRNM_HEADER = " + emrrecusrnmheader + " \n VAR_EMRRECUSRNM = " + emrrecusrnm + " \n VAR_ININFO = " + ininfo + " \n VAR_DSCHINFO = " + dschinfo + " \n VAR_INCNT = " + incnt + " \n VAR_INORDDEPTHNGNM = " + inorddepthngnm + "\n %-->\n" + trans;
  2326. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2327. var a = fso.CreateTextFile(foldernm + "\\" + signno + "_" + formcd + ".HTML", true, true);
  2328. a.WriteLine(trans);
  2329. //a.Write(trans);
  2330. a.Close();
  2331. emrpath += foldernm + "\\" + signno + "_" + formcd + ".HTML|";
  2332. //emrorddate += orddd + "|";
  2333. emrorddate += recdd + "|"; //기록일을 보여달라는 의료정보팀 요청
  2334. emrformnm += formnm + "|";
  2335. emrformcd += formcd + "|";
  2336. emrdeptnm += deptengabbr + "|";
  2337. emrdeptcd += orddeptcd + "|";
  2338. emrpage += "1|";
  2339. emrhiddenmsg += formcd + "▦" + signno + "▦" + formnm + "▦" + chosflag + "▦" +pid + "▦" + ptnm + "▦" + deptengabbr
  2340. + "▦" + sa + "▦" + rgstno + "▦" + disporddd + "▦" + drid + "▦" + roomcd + "▦" + disporddd + "▦" + ordtype + "▦" + "E|";
  2341. //영상-EMR구분|파일경로|입원일|서식지코드|서식지이름|진료과코드|진료과이름
  2342. var chartinfo = "E|" + emrpath + emrorddate + emrformcd + emrformnm + emrdeptcd + emrdeptnm;
  2343. model.makeValue("/root/send/iemr/treatno", "");
  2344. model.makeValue("/root/send/iemr/docucd", "");
  2345. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  2346. iviewerIemrprt.window.javascript.appendChart(iemrNode, chartinfo, emrhiddenmsg);
  2347. }
  2348. else
  2349. {
  2350. tmptreatno += signno + ",";
  2351. tmpiformcd += formcd + ",";
  2352. emrpath += "*|";
  2353. emrorddate += "*|";
  2354. emrformnm += "*|";
  2355. emrformcd += "*|";
  2356. emrdeptnm += "*|";
  2357. emrdeptcd += "*|";
  2358. emrpage += "*|";
  2359. emrhiddenmsg += "*|";
  2360. model.makeValue("/root/imgrec/iemr/treatno", signno);
  2361. model.makeValue("/root/imgrec/iemr/docucd", formcd);
  2362. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  2363. var chartinfo;
  2364. chartinfo = "I";
  2365. var hiddenmsg;
  2366. hiddenmsg = "I";
  2367. iviewerIemrprt.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg);
  2368. }
  2369. }
  2370. iviewerIemrprt.window.javascript.refreshTrue();
  2371. }
  2372. /**
  2373. * @desc : 연속보기 더블클릭시 기록 rowno 리턴 인터페이스
  2374. * @id :
  2375. * @event : DOMActivate
  2376. * @return : void
  2377. * @authur : 박종훈
  2378. */
  2379. function fReturnRecRowno(rowno)
  2380. {
  2381. if (rowno != null && rowno != "" && rowno > 0)
  2382. {
  2383. model.setValue("/root/init/reccurpos", parseInt(rowno));
  2384. }
  2385. model.refresh(); //pjh
  2386. }
  2387. /**
  2388. * @desc : 화면표시 대상이 EMR + IMG 기록인경우 처리
  2389. * @id :
  2390. * @event : onclick
  2391. * @return : void
  2392. * @authur : 박종훈
  2393. */
  2394. function fGetNextEmrImgRecOne()
  2395. {
  2396. var certnodeList = instance1.selectNodes("/root/tmpinicert/iniinfo");
  2397. var foldernm = "C:\\Certrec";
  2398. var recall = model.getValue("/root/init/recall");
  2399. if (certnodeList.length <= 0)
  2400. {
  2401. return;
  2402. }
  2403. else if(certnodeList.length > 1)
  2404. {
  2405. model.setValue("/root/init/recall", "N");
  2406. }
  2407. var emrpath = "";
  2408. var emrorddate = "";
  2409. var emrformnm = "";
  2410. var emrformcd = "";
  2411. var emrdeptnm = "";
  2412. var emrdeptcd = "";
  2413. var emrpage = "";
  2414. var emrhiddenmsg = "";
  2415. var recrowno = "";
  2416. var k = "";
  2417. var pid = "";
  2418. var ptnm = "";
  2419. var depthngnm = "";
  2420. var deptengabbr = "";
  2421. var rgstno = "";
  2422. var sa = "";
  2423. var disporddd = "";
  2424. var orddd = "";
  2425. var drid = "";
  2426. var roomcd = "";
  2427. var ordtype = "";
  2428. var chosflag = "";
  2429. var orddeptcd = "";
  2430. var signflag = "";
  2431. var imgflag = "";
  2432. var langflag = "";
  2433. var tmptreatno = "";
  2434. var tmpiformcd = "";
  2435. var signno = 0;
  2436. var formcd = "";
  2437. var srcformcd = "";
  2438. var formnm = "";
  2439. var formprogflag = "";
  2440. var recdt = "";
  2441. var recdd = "";
  2442. var wardheader = "";
  2443. var dateheader = "";
  2444. var doctorheader = "";
  2445. var printheader = "";
  2446. var pageheader = "";
  2447. var imgepath = "";
  2448. var formrecdt = "";
  2449. var fstrgstdt = "";
  2450. var lastupdtdt = "";
  2451. var staffconfirmdt = "";
  2452. var fstrgstrusrnm = "";
  2453. var lastupdtrusrnm = "";
  2454. var erdt = "";
  2455. var ervisittm = "";
  2456. var staffnmheader = "";
  2457. var staffnm = "";
  2458. var emrrecusrnmheader = "";
  2459. var emrrecusrnm = "";
  2460. var indd = "";
  2461. var dschdd = "";
  2462. var inorddepthngnm = "";
  2463. var dschorddepthngnm = "";
  2464. var incnt = "";
  2465. var mainyn = "";
  2466. var rowno = "";
  2467. var prtnunm = getUserInfo("usernm");
  2468. var prtndeptnm = "";
  2469. //var getuseren = getUserInfo("userengnm");
  2470. var getdate = getCurrentDate();
  2471. var gettime = getCurrentTime();
  2472. var dateprnt = getdate.substr(0, 4) + "/" + getdate.substr(4, 2) + "/" + getdate.substr(6, 2);
  2473. var timeprnt = gettime.substr(0, 2) + ":" + gettime.substr(2, 2) + ":" + gettime.substr(4, 2);
  2474. var prtdt = dateprnt + " " + timeprnt;
  2475. fExistFolder(foldernm);
  2476. iviewerIemr.window.javascript.refreshFalse();
  2477. //for(var i = 1; i <= certnodeList.length; i++)
  2478. //{
  2479. signno = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/signno");
  2480. formcd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/formcd");
  2481. srcformcd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/srcformcd");
  2482. formnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/formnm");
  2483. formprogflag = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/formprogflag");
  2484. recdt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/recdt");
  2485. recdd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/recdd");
  2486. trans = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/trans");
  2487. pid = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/pid");
  2488. ptnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/ptnm");
  2489. depthngnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/depthngnm");
  2490. deptengabbr = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/deptengabbr");
  2491. rgstno = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/rgstno");
  2492. sa = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/sa");
  2493. disporddd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/disporddd");
  2494. orddd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/orddd");
  2495. drid = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/drid");
  2496. roomcd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/roomcd");
  2497. ordtype = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/ordtype");
  2498. chosflag = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/chosflag");
  2499. orddeptcd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/orddeptcd");
  2500. signflag = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/signflag");
  2501. imgflag = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/imgflag");
  2502. langflag = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/langflag");
  2503. formrecdt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/formrecdt");
  2504. formrecdt = formrecdt.toDate().getDateFormat("YYYY/MM/DD");
  2505. fstrgstdt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/fstrgstdt");
  2506. lastupdtdt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/lastupdtdt");
  2507. staffconfirmdt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/staffconfirmdt");
  2508. fstrgstrusrnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/fstrgstrusrnm");
  2509. if(fstrgstrusrnm != "")
  2510. fstrgstrusrnm = fstrgstrusrnm + " (" + fstrgstdt + ")";
  2511. lastupdtrusrnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/lastupdtrusrnm");
  2512. if(lastupdtrusrnm != "")
  2513. lastupdtrusrnm = lastupdtrusrnm + " (" + lastupdtdt + ")";
  2514. erdt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/erdt");
  2515. ervisittm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/ervisittm");
  2516. staffnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/staffnm");
  2517. emrrecusrnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/emrrecusrnm");
  2518. indd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/indd");
  2519. dschdd = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/dschdd");
  2520. inorddepthngnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/inorddepthngnm");
  2521. dschorddepthngnm = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/dschorddepthngnm");
  2522. mainyn = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/mainyn");
  2523. rowno = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/rowno");
  2524. incnt = model.getValue("/root/tmpinicert/iniinfo[" + nodeposcnt + "]/incnt");
  2525. if(incnt != "")
  2526. incnt += " 회차";
  2527. var ininfo = indd + " / " + inorddepthngnm;
  2528. if(erdt != "")
  2529. ininfo += " (응급실 내원일 : " + erdt + ")";
  2530. var dschinfo = dschdd + " / " + dschorddepthngnm;
  2531. var formnmarr = formnm.split("\n");
  2532. var topformnm = "";
  2533. var botformnm = "";
  2534. if (formnmarr.length == 1)
  2535. {
  2536. topformnm = formnmarr[0];
  2537. }
  2538. else if (formnmarr.length == 2)
  2539. {
  2540. topformnm = formnmarr[0];
  2541. botformnm = formnmarr[1];
  2542. }
  2543. else
  2544. {
  2545. topformnm = formnm;
  2546. }
  2547. //2009-06-02 등록번호 "-" 병원별 제거
  2548. var pidynhcd = model.getValue("/root/init/pidynhcd/hardcd/hardcd");
  2549. if (pidynhcd == "Y")
  2550. {
  2551. for(var k = pid.length; k <= 8; k++)
  2552. {
  2553. if(k < 8){
  2554. pid = "0"+pid;
  2555. }
  2556. }
  2557. var str1 = pid.substr(0, 3);
  2558. var str2 = pid.substr(3, 2);
  2559. var str3 = pid.substr(5, 2);
  2560. var str4 = pid.substr(7, 1);
  2561. var tmppid = str1 + " " + str2 + " " + str3 + "-" + str4;
  2562. }
  2563. else
  2564. {
  2565. tmppid = pid;
  2566. }
  2567. if (chosflag == "O" || chosflag == "S")
  2568. {
  2569. wardheader = "진료과 : ";
  2570. }
  2571. else
  2572. {
  2573. wardheader = "병실 : ";
  2574. }
  2575. if (langflag == "KO")
  2576. {
  2577. if (chosflag == "O" || chosflag == "S")
  2578. {
  2579. wardheader = "진료과 : ";
  2580. }
  2581. else
  2582. {
  2583. wardheader = "병실 : ";
  2584. }
  2585. dateheader = "진료기간 : ";
  2586. doctorheader = "주치의 : ";
  2587. printheader = "출력 : ";
  2588. prtndeptnm = getUserInfo("dutplcenm");
  2589. imgepath = "com/commonweb/images/biglogo" + getUserInfo("dutplceinstcd") + ".jpg"
  2590. pageheader = "페이지 : ";
  2591. }
  2592. else
  2593. {
  2594. if (chosflag == "O" || chosflag == "S")
  2595. {
  2596. wardheader = "Dept : ";
  2597. }
  2598. else
  2599. {
  2600. wardheader = "Room : ";
  2601. }
  2602. dateheader = "Date : ";
  2603. doctorheader = "Doctor : ";
  2604. printheader = "Print date : ";
  2605. prtndeptnm = getUserInfo("deptengnm");
  2606. imgepath = "com/commonweb/images/biglogo" + getUserInfo("dutplceinstcd") + "e.jpg"
  2607. if (prtndeptnm == "" || prtndeptnm == null)
  2608. {
  2609. prtndeptnm = getUserInfo("dutplcenm");
  2610. }
  2611. pageheader = "Page : ";
  2612. }
  2613. if (imgflag == "N")
  2614. {
  2615. if(trans == "")
  2616. trans = "<html><head><title>출력화면 구현중입니다.</title></head><body>출력화면 구현중입니다.</body></html>";
  2617. var ininm = "cmc";
  2618. switch(srcformcd)
  2619. {
  2620. case "0000000001"://외래초진
  2621. case "0000000002"://외래재진
  2622. case "0000000004"://입원경과
  2623. case "0000003325"://DSC기록
  2624. ininm += "_0000000001.ini";
  2625. break;
  2626. case "0000000003"://입원초진
  2627. ininm += "_0000000003.ini";
  2628. break;
  2629. case "0000000676"://수술기록
  2630. staffnmheader = "◈ Surgeon :";
  2631. if(staffnm != "")
  2632. staffnm += "(" + staffconfirmdt + ")";
  2633. emrrecusrnmheader = "";
  2634. ininm += "_0000000676.ini";
  2635. break;
  2636. case "0000003169"://Brief OP Note
  2637. ininm += "_0000000676.ini";
  2638. break;
  2639. case "0000000680"://입퇴원요약
  2640. staffnmheader = "◈ Staff작성 및 확인 :";
  2641. if(staffnm != "")
  2642. staffnm += "(" + staffconfirmdt + ")";
  2643. emrrecusrnmheader = "◈ 의무기록사 :";
  2644. ininm += "_0000000680.ini";
  2645. break;
  2646. case "0000000679"://응급실기록
  2647. ininm += "_0000000679.ini";
  2648. break;
  2649. default:
  2650. //ininm += "_0000000001.ini";
  2651. if(formprogflag == "-" || formprogflag == "MAIN" || mainyn == "Y")
  2652. ininm += "_0000000001.ini";
  2653. else
  2654. ininm += ".ini";
  2655. break;
  2656. }
  2657. trans = "<!--% \n %BASE " + getDomain() + "/himed/webapps/ \n %INCLUDE emr/recmngtweb/xrw/" + ininm + " \n VAR_PAT_NUM = " + tmppid + " \n VAR_CLASS = " + ordtype + " \n VAR_CHART_NAME_TOP = " + topformnm + " \n VAR_CHART_NAME_BOTTOM = " + botformnm + " \n VAR_CHART_NAME_LINE = " + formnm + " \n VAR_PAT_AGE_SEX = " + sa + " \n VAR_TREAT_DEPT = " + deptengabbr + " \n VAR_PAT_JUMIN_NO = " + rgstno + " \n VAR_PAT_NAME = " + ptnm + " \n VAR_PRINT_NAME = " + prtnunm + " \n VAR_PRINT_DEPT = " + prtndeptnm + " \n VAR_WARD_HEAD = " + wardheader + roomcd + " \n VAR_DATE_HEADER = " + dateheader + disporddd + " \n VAR_DOCTOR_HEADER = " + doctorheader + drid + " \n VAR_PRINT_HEADER = " + printheader + prtdt + " \n SYS_PAGE_HEADER = " + pageheader + " \n VAR_HOSP_IMG = " + imgepath + " \n VAR_ORDDATE = " + formrecdt + " \n VAR_ORDDEPT = " + depthngnm + " \n VAR_FSTRGSTRUSRNM = " + fstrgstrusrnm + " \n VAR_LASTUPDTRUSRNM = " + lastupdtrusrnm + " \n VAR_ERDT = " + erdt + " \n VAR_ERVISITTM = " + ervisittm + " \n VAR_STAFFNM_HEADER = " + staffnmheader + " \n VAR_STAFFNM = " + staffnm + " \n VAR_EMRRECUSRNM_HEADER = " + emrrecusrnmheader + " \n VAR_EMRRECUSRNM = " + emrrecusrnm + " \n VAR_ININFO = " + ininfo + " \n VAR_DSCHINFO = " + dschinfo + " \n VAR_INCNT = " + incnt + " \n VAR_INORDDEPTHNGNM = " + inorddepthngnm + "\n %-->\n" + trans;
  2658. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2659. var a = fso.CreateTextFile(foldernm + "\\" + signno + "_" + formcd + ".HTML", true, true);
  2660. a.WriteLine(trans);
  2661. //a.Write(trans);
  2662. a.Close();
  2663. emrpath = foldernm + "\\" + signno + "_" + formcd + ".HTML|";
  2664. //emrorddate += orddd + "|";
  2665. emrorddate = recdd + "|"; //기록일을 보여달라는 의료정보팀 요청
  2666. emrformnm = formnm + "|";
  2667. emrformcd = formcd + "|";
  2668. emrdeptnm = deptengabbr + "|";
  2669. emrdeptcd = orddeptcd + "|";
  2670. emrpage = "1|";
  2671. emrhiddenmsg = formcd + "▦" + signno + "▦" + formnm + "▦" + chosflag + "▦" +pid + "▦" + ptnm + "▦" + deptengabbr
  2672. + "▦" + sa + "▦" + rgstno + "▦" + disporddd + "▦" + drid + "▦" + roomcd + "▦" + disporddd + "▦" + ordtype + "▦" + "E|";
  2673. recrowno = rowno;
  2674. //영상-EMR구분|파일경로|입원일|서식지코드|서식지이름|진료과코드|진료과이름
  2675. var chartinfo = "";
  2676. chartinfo = "E|" + emrpath + emrorddate + emrformcd + emrformnm + emrdeptcd + emrdeptnm;
  2677. model.makeValue("/root/send/iemr/treatno", "");
  2678. model.makeValue("/root/send/iemr/docucd", "");
  2679. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  2680. iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, emrhiddenmsg, recrowno);
  2681. //iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, emrhiddenmsg);
  2682. }
  2683. else
  2684. {
  2685. tmptreatno = signno + ",";
  2686. tmpiformcd = formcd + ",";
  2687. emrpath = "*|";
  2688. emrorddate = "*|";
  2689. emrformnm = "*|";
  2690. emrformcd = "*|";
  2691. emrdeptnm = "*|";
  2692. emrdeptcd = "*|";
  2693. emrpage = "*|";
  2694. emrhiddenmsg = "*|";
  2695. recrowno = rowno;
  2696. model.makeValue("/root/imgrec/iemr/treatno", signno);
  2697. model.makeValue("/root/imgrec/iemr/docucd", formcd);
  2698. var iemrNode = instance1.selectSingleNode("/root/imgrec/iemr");
  2699. var chartinfo;
  2700. chartinfo = "I";
  2701. var hiddenmsg;
  2702. hiddenmsg = "I";
  2703. iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg, recrowno);
  2704. //iviewerIemr.window.javascript.appendChart(iemrNode, chartinfo, hiddenmsg);
  2705. }
  2706. /*
  2707. if (certnodeList.length > 1 && certnodeList.length > nodeposcnt)
  2708. {
  2709. multirecyn = "Y";
  2710. }
  2711. else
  2712. {
  2713. multirecyn = "N";
  2714. nodeposcnt = 1;
  2715. }*/
  2716. //}
  2717. iviewerIemr.window.javascript.refreshTrue();
  2718. }
  2719. /**
  2720. * @desc : 북마크 등록 클릭시 모달창 호출
  2721. * @id :
  2722. * @event : DOMActivate
  2723. * @return : void
  2724. * @authur : 강지훈
  2725. */
  2726. function fSetBookmark()
  2727. {
  2728. var ViewMode;
  2729. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  2730. var appcopykey = iviewerIemr.window.javascript.SetMarkPage(ViewMode); //영상뷰어에서의 리턴값
  2731. var selPid = model.getValue("/root/main/patinfo/patinfolist/pid");
  2732. if(selPid != ""){
  2733. if(appcopykey != null && appcopykey != "" ){
  2734. appcopykey = appcopykey.getTrim();
  2735. var copykey = appcopykey.split("|");
  2736. var appkeyArr = "";
  2737. var imageCnt = 0;
  2738. //1차적으로 영상EMR만 등록가능. 선택된 영상EMR의 갯수를 파악한다.
  2739. for(var i = 0; i < copykey.length; i++){
  2740. appkeyArr = copykey[i].split("▦");
  2741. reckind = appkeyArr[0];
  2742. if (reckind == "I"){
  2743. imageCnt++;
  2744. }
  2745. }
  2746. if(imageCnt > 0){ //선택된 이미지중에 영상EMR이 있을경우
  2747. setParameter("SPMRI01500_reckey", appcopykey);
  2748. setParameter("SPMRI01500_setflag", "A");
  2749. modal("SPMRI01500");
  2750. //북마크 treeview 재조회
  2751. fGetTreeView();
  2752. }
  2753. else{
  2754. messageBox("현재 영상EMR만 등록 ","I006");
  2755. return;
  2756. }
  2757. }
  2758. else{
  2759. var ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  2760. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView")
  2761. {
  2762. messageBox("선택된 기록이","I004");
  2763. return;
  2764. }
  2765. }
  2766. }
  2767. else{
  2768. messageBox("선택된 환자가","I004");
  2769. model.toggle("grd");
  2770. btn_all.selected = true;
  2771. model.setFocus("ipt_pid");
  2772. return;
  2773. }
  2774. }
  2775. /**
  2776. * @group :
  2777. * @ver :
  2778. * @by : 2009-10-16 오전 10:13:04 강지훈
  2779. * @---------------------------------------------------
  2780. * @type : function
  2781. * @access : public
  2782. * @desc : 트리뷰 조회
  2783. * @param :
  2784. * @return :
  2785. * @---------------------------------------------------
  2786. */
  2787. function fGetTreeView(){
  2788. //북마크 트리뷰는 환자가 조회되어있어야만 조회된다. 환자가없을경우 전체창 모드
  2789. var selPid = model.getValue("/root/main/patinfo/patinfolist/pid");
  2790. if(selPid == ""){
  2791. messageBox("선택된 환자가","I004");
  2792. model.toggle("grd");
  2793. btn_all.selected = true;
  2794. model.setFocus("ipt_pid");
  2795. return;
  2796. }
  2797. else{
  2798. //북마크가 선택되어야만 조회를 한다.
  2799. var selIndx = switch1.selectedIndex;
  2800. var bmkAll = chk_allbmk.value;
  2801. if(selIndx == 1){
  2802. //Instance초기화
  2803. model.removenode("/root/main/treeview");
  2804. model.makeNode("/root/main/treeview");
  2805. //send Node 설정
  2806. model.removenode("/root/send/bmkpara");
  2807. model.makeValue("/root/send/bmkpara/pid", selPid);
  2808. model.makeValue("/root/send/bmkpara/bmkall", bmkAll);
  2809. if(submit("TRMRI01500")){
  2810. trv_bookmark.rebuild();
  2811. }
  2812. }
  2813. }
  2814. }
  2815. /**
  2816. * @group :
  2817. * @ver :
  2818. * @by : 2009-10-16 오전 10:13:04 강지훈
  2819. * @---------------------------------------------------
  2820. * @type : function
  2821. * @access : public
  2822. * @desc : 북마크 항목을 더블클릭한다.
  2823. * @param :
  2824. * @return :
  2825. * @---------------------------------------------------
  2826. */
  2827. function fGetBookmarkItem(){
  2828. var selFolder = new SELFOLDER();
  2829. itemno = selFolder.itemno;
  2830. linkflag = selFolder.linkflag;
  2831. if(linkflag == "Y"){
  2832. model.removeNode("/root/send/bookmark");
  2833. model.makeValue("/root/send/bookmark/itemno", itemno);
  2834. submit("TRMRI00408");
  2835. var recinfos = instance1.selectNodes("/root/tmp/recinfos/recinfo");
  2836. if(recinfos.length > 0){
  2837. //초기화
  2838. iviewerIemr.window.javascript.cleanViewer();
  2839. iviewerIemr.window.javascript.refreshFalse();
  2840. model.removenode("/root/tmp/imgrec");
  2841. //통합기록조회 환자정보 셋팅
  2842. var selPid = "";
  2843. //북마크에 등록된 정보를 가져온다.
  2844. for(var i = 0 ; i < recinfos.length; i++){
  2845. var recinfo = recinfos.item(i);
  2846. var emrflag = recinfo.selectSingleNode("emrflag").text;
  2847. //영상일때
  2848. if(emrflag == "I"){
  2849. var nodePos = i+1;
  2850. var treatno = recinfo.selectSingleNode("recno").text;
  2851. var docucd = recinfo.selectSingleNode("formcd").text;
  2852. var pageno = recinfo.selectSingleNode("pageno").text;
  2853. var pid = recinfo.selectSingleNode("pid").text;
  2854. selPid = pid;
  2855. model.makeValue("/root/tmp/imgrec/iemr[" + nodePos + "]/treatno", parseInt(treatno));
  2856. model.makeValue("/root/tmp/imgrec/iemr[" + nodePos + "]/pid", pid);
  2857. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/orddeptcd");
  2858. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/indd");
  2859. model.makeValue("/root/tmp/imgrec/iemr[" + nodePos + "]/docucd", docucd);
  2860. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/ioflag");
  2861. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/cmc_cretno");
  2862. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/cmc_spcid");
  2863. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/cmc_orddate");
  2864. model.makeNode("/root/tmp/imgrec/iemr[" + nodePos + "]/cmc_orderseqno");
  2865. model.makeValue("/root/tmp/imgrec/iemr[" + nodePos + "]/pageno", parseInt(pageno));
  2866. }
  2867. }
  2868. //통합기록조회 환자정보입력란 Setting
  2869. if(chk_allbmk.value == "A"){
  2870. ipt_pid.value = selPid;
  2871. chkPidRtn = fPidKeyPress();
  2872. }
  2873. var iemrNode = instance1.selectSingleNode("/root/tmp/imgrec");
  2874. //chart추가
  2875. var chartinfo;
  2876. chartinfo = "I";
  2877. var hiddenmsg;
  2878. hiddenmsg = "I";
  2879. iviewerIemr.window.javascript.append_BmarkChart(iemrNode, chartinfo, hiddenmsg);
  2880. iviewerIemr.window.javascript.refreshTrue();
  2881. //ViewMode를 여러페이지 보기로 Setting
  2882. var ViewMode;
  2883. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  2884. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView")
  2885. {
  2886. iviewerIemr.window.javascript.setupChart("ChartView");
  2887. }
  2888. }
  2889. else{
  2890. messageBox("등록된 기록이 ", "I004");
  2891. return;
  2892. }
  2893. }
  2894. }
  2895. /**
  2896. * @group :
  2897. * @ver :
  2898. * @by : 2009-10-16 오전 10:13:04 강지훈
  2899. * @---------------------------------------------------
  2900. * @type : function
  2901. * @access : public
  2902. * @desc : 선택한 폴더의 정보
  2903. * @param :
  2904. * @return :
  2905. * @---------------------------------------------------
  2906. */
  2907. function SELFOLDER(){
  2908. var item = trv_bookmark.item(trv_bookmark.selectedIndex);
  2909. if(item == null) return;
  2910. var currow = item.index + 1;
  2911. this.level = model.getValue("/root/main/treeview/item["+currow+"]/level");
  2912. this.itemno = model.getValue("/root/main/treeview/item["+currow+"]/itemno");
  2913. this.supitemno = model.getValue("/root/main/treeview/item["+currow+"]/supitemno");
  2914. this.itemnm = model.getValue("/root/main/treeview/item["+currow+"]/itemnm");
  2915. this.linkflag = model.getValue("/root/main/treeview/item["+currow+"]/linkflag");
  2916. this.pid = model.getValue("/root/main/treeview/item["+currow+"]/pid");
  2917. }
  2918. /**
  2919. * @group :
  2920. * @ver :
  2921. * @by : 2009-10-16 오전 10:13:04 강지훈
  2922. * @---------------------------------------------------
  2923. * @type : function
  2924. * @access : public
  2925. * @desc : 폴더를 수정함
  2926. * @param :
  2927. * @return :
  2928. * @---------------------------------------------------
  2929. */
  2930. function fModiFolder(){
  2931. setParameter("SPMRI01500_setflag", "M");
  2932. open("SPMRI01500");
  2933. fGetTreeView();
  2934. }
  2935. /**
  2936. * @group :
  2937. * @ver :
  2938. * @by : 2009-10-16 오전 10:13:04 강지훈
  2939. * @---------------------------------------------------
  2940. * @type : function
  2941. * @access : public
  2942. * @desc : 북마크에 해당환자 기록이 있으면 북마크 탭 색을 변경.
  2943. * @param :
  2944. * @return :
  2945. * @---------------------------------------------------
  2946. */
  2947. function fChkBookmark(){
  2948. var selPid = model.getValue("/root/main/patinfo/patinfolist/pid");
  2949. model.removeNode("/root/send/selpid");
  2950. model.makeValue("/root/send/selpid", selPid);
  2951. if(submit("TRMRI00409")){
  2952. var itemNodes = instance1.selectNodes("/root/tmp/chkitem/itemno");
  2953. if(0 < itemNodes.length){
  2954. btn_mark.attribute("color") = "#ff0000";
  2955. }
  2956. else{
  2957. btn_mark.attribute("color") = "";
  2958. }
  2959. }
  2960. }
  2961. function fUpKeyBtn()
  2962. {
  2963. if ( (grd_pathist.row-1) >= grd_pathist.fixedRows )
  2964. {
  2965. fGetRecMidIndx(grd_pathist.row-1);
  2966. grd_pathist.row = grd_pathist.row - 1;
  2967. }
  2968. }
  2969. function fDownKeyBtn()
  2970. {
  2971. if ( (grd_pathist.row+1) != grd_pathist.rows )
  2972. {
  2973. fGetRecMidIndx(grd_pathist.row+1);
  2974. grd_pathist.row = grd_pathist.row + 1;
  2975. }
  2976. }
  2977. /**
  2978. * @group :
  2979. * @ver :
  2980. * @by : 2009-10-30 주희경
  2981. * @---------------------------------------------------
  2982. * @type : function
  2983. * @access : public
  2984. * @desc : xrw화면내에서 방향키(↑ , ↓) 이벤트 발생 시 다음/이전의 수진이력 조회
  2985. * @param :
  2986. * @return :
  2987. * @---------------------------------------------------
  2988. */
  2989. function onkeydown()
  2990. {
  2991. /*
  2992. if (event.keyCode == 38) //↑
  2993. {
  2994. if ( (grd_pathist.row-1) >= grd_pathist.fixedRows )
  2995. {
  2996. fGetRecMidIndx(grd_pathist.row-1);
  2997. grd_pathist.row = grd_pathist.row - 1;
  2998. }
  2999. }
  3000. else if ( event.keyCode == 40 ) //↓
  3001. {
  3002. if ( (grd_pathist.row+1) != grd_pathist.rows )
  3003. {
  3004. fGetRecMidIndx(grd_pathist.row+1);
  3005. grd_pathist.row = grd_pathist.row + 1;
  3006. }
  3007. }
  3008. else {
  3009. event.preventDefault();
  3010. }
  3011. event.stopPropagation();*/
  3012. }
  3013. /**
  3014. * @group :
  3015. * @ver :
  3016. * @by : 2009-12-04 김양수
  3017. * @---------------------------------------------------
  3018. * @type : function
  3019. * @access : public
  3020. * @desc : 조회일자 생성 및 조회
  3021. * @param :
  3022. * @return :
  3023. * @---------------------------------------------------
  3024. */
  3025. function fSrchMakeDd(preflag, callflag)
  3026. {
  3027. if(callflag == "Y"){ //서식창조회인경우
  3028. var currentSchrFromDay = model.getValue("/root/tmp/prcprec/srchFromdd"); //조회시작일자
  3029. var currentSchrToDay = model.getValue("/root/tmp/prcprec/srchTodd"); //조회종료일자
  3030. var srchInterval = model.getValue("/root/tmp/prcprec/srchInterval"); //조회구간
  3031. //var srchYn = model.getValue("/root/tmp/prcprec/srchYn"); //최초조회여부
  3032. }else if(callflag == "P"){ //의사지시 기록조회일경우
  3033. var currentSchrFromDay = model.getValue("/root/tmp/sndprcprec/srchprcpfromdd"); //조회시작일자
  3034. var currentSchrToDay = model.getValue("/root/tmp/sndprcprec/srchprcptodd"); //조회종료일자
  3035. var srchInterval = model.getValue("/root/tmp/sndprcprec/srchprcpinterval"); //조회구간
  3036. }
  3037. if(srchInterval == ""){
  3038. messageBox("조회구간을 입력하셔야 합니다.","I");
  3039. return;
  3040. }
  3041. if(preflag == 1){ //이전인경우
  3042. var fromDay = currentSchrFromDay.toDate().getAddDate(parseInt(srchInterval) * -1, "D").getDateFormat();
  3043. if(callflag == "Y"){ //서식창조회인경우
  3044. model.makeValue("/root/tmp/prcprec/srchFromdd", fromDay);
  3045. model.makeValue("/root/tmp/prcprec/srchTodd", currentSchrFromDay.toDate().getAddDate(-1, "D").getDateFormat());
  3046. }else if(callflag == "P"){ //의사지시 기록조회일경우
  3047. model.makeValue("/root/tmp/sndprcprec/srchprcpfromdd", fromDay);
  3048. model.makeValue("/root/tmp/sndprcprec/srchprcptodd", currentSchrFromDay.toDate().getAddDate(-1, "D").getDateFormat());
  3049. }
  3050. //model.makeValue("/root/tmp/prcprec/srchYn", "Y");
  3051. }else if(preflag == 2){ //다음인경우
  3052. var toDay = currentSchrToDay.toDate().getAddDate(parseInt(srchInterval)).getDateFormat();
  3053. if(callflag == "Y"){ //서식창조회인경우
  3054. model.makeValue("/root/tmp/prcprec/srchFromdd", currentSchrToDay.toDate().getAddDate(1, "D").getDateFormat());
  3055. model.makeValue("/root/tmp/prcprec/srchTodd", toDay);
  3056. }else if(callflag == "P"){ //의사지시 기록조회일경우
  3057. model.makeValue("/root/tmp/sndprcprec/srchprcpfromdd", currentSchrToDay.toDate().getAddDate(1, "D").getDateFormat());
  3058. model.makeValue("/root/tmp/sndprcprec/srchprcptodd", toDay);
  3059. }
  3060. //model.makeValue("/root/tmp/prcprec/srchYn", "Y");
  3061. }
  3062. model.refresh();
  3063. if(callflag == "P"){ //의사지시 기록조회일경우
  3064. //grd_littleindx.attribute("visibility") = "hidden";
  3065. fGetDetlRec(grd_midindx.row);
  3066. var ViewMode;
  3067. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  3068. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView"){
  3069. iviewerIemr.window.javascript.setupChart("ChartView");
  3070. }
  3071. }else if(callflag == "Y"){ //서식창조회인경우
  3072. fReqLittleIndx();
  3073. fDbClickMidIndx();
  3074. }
  3075. }
  3076. function fSrchChoice(callflag)
  3077. {
  3078. if(callflag == "C"){ //서식창조회시
  3079. var srchChoice = model.getValue("/root/tmp/prcprec/srchchoice");
  3080. if(srchChoice == "1"){ //기간(간격)조회
  3081. ipt_srchinterval.disabled = "false";
  3082. ipt_fromdd.disabled = "true";
  3083. ipt_todd.disabled = "true";
  3084. btn_prcpsrch.attribute("visibility") = "hidden";
  3085. btn_intervalpre.disabled = "false";
  3086. btn_intervalnext.disabled = "false";
  3087. }else if(srchChoice == "2"){ //일자조회
  3088. ipt_srchinterval.disabled = "true";
  3089. ipt_fromdd.disabled = "false";
  3090. ipt_todd.disabled = "false";
  3091. btn_prcpsrch.attribute("visibility") = "visible";
  3092. btn_intervalpre.disabled = "true";
  3093. btn_intervalnext.disabled = "true";
  3094. }
  3095. }else if(callflag == "P"){ //의사지시기록조회시
  3096. var srchChoice = model.getValue("/root/tmp/sndprcprec/srchprcpchoice");
  3097. if(srchChoice == "1"){ //기간(간격)조회
  3098. ipt_srchprcpinterval.disabled = "false";
  3099. ipt_srchprcpfromdd.disabled = "true";
  3100. ipt_srchprcptodd.disabled = "true";
  3101. btn_srchprcp.attribute("visibility") = "hidden";
  3102. btn_prcppre.disabled = "false";
  3103. btn_prcpnext.disabled = "false";
  3104. }else if(srchChoice == "2"){ //일자조회
  3105. ipt_srchprcpinterval.disabled = "true";
  3106. ipt_srchprcpfromdd.disabled = "false";
  3107. ipt_srchprcptodd.disabled = "false";
  3108. btn_srchprcp.attribute("visibility") = "visible";
  3109. btn_prcppre.disabled = "true";
  3110. btn_prcpnext.disabled = "true";
  3111. }
  3112. }
  3113. }
  3114. /**
  3115. * @group :
  3116. * @ver :
  3117. * @by : 2009-12-04 김양수
  3118. * @---------------------------------------------------
  3119. * @type : function
  3120. * @access : public
  3121. * @desc : 의시지시기간조회창에서의 조회버튼(의사지시 기간검색)
  3122. * @param :
  3123. * @return :
  3124. * @---------------------------------------------------
  3125. */
  3126. function fPrcpSrchDd()
  3127. {
  3128. fGetDetlRec(grd_midindx.row);
  3129. var ViewMode;
  3130. ViewMode = iviewerIemr.model.getValue("/root/hidden/currentViewMode");
  3131. if (ViewMode == null || ViewMode == "" || ViewMode != "ChartView"){
  3132. iviewerIemr.window.javascript.setupChart("ChartView");
  3133. }
  3134. }
  3135. /**
  3136. * @group :
  3137. * @ver :
  3138. * @by : 2009-12-04 김양수
  3139. * @---------------------------------------------------
  3140. * @type : function
  3141. * @access : public
  3142. * @desc : 소분류조회
  3143. * @param :
  3144. * @return :
  3145. * @---------------------------------------------------
  3146. */
  3147. function fReqLittleIndx(reqflag)
  3148. {
  3149. if(reqflag == 1){
  3150. grup_prcppaging.attribute("visibility") = "hidden";
  3151. }
  3152. grup_prcppaging2.attribute("visibility") = "hidden"; //의사지시기록 조회창이 visible이면 숨김-20091215
  3153. model.removeNodeset("/root/send");
  3154. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  3155. model.makeValue("/root/send/orddd", grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd")));
  3156. model.makeValue("/root/send/cretno", grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("cretno")));
  3157. model.makeValue("/root/send/itemindxseq", grd_midindx.valueMatrix(grd_midindx.row, grd_midindx.colref("itemindxseq")));
  3158. if(reqflag == 1){
  3159. var srchAddOrddd = grd_pathist.valueMatrix(grd_pathist.row, grd_pathist.colref("orddd"));
  3160. model.makeValue("/root/tmp/prcprec/srchInterval", "10");
  3161. model.makeValue("/root/tmp/prcprec/srchFromdd", srchAddOrddd);
  3162. model.makeValue("/root/tmp/prcprec/srchTodd", srchAddOrddd.toDate().getAddDate(9, "D").getDateFormat());
  3163. grup_prcppaging.attribute("visibility") = "visible";
  3164. model.setFocus("ipt_srchinterval");
  3165. rdo_srchchoice.select(0);
  3166. //rdo_srchkind.select(0);
  3167. //grup_srchchrt.disabled = true; //일자별일경우 서식별그룹비활성화-kys-20091215
  3168. model.refresh();
  3169. }
  3170. if(model.getValue("/root/tmp/prcprec/srchkind") != 2){ //서식별 조회시 fromm todd 불필요-20091216-kys
  3171. model.makeValue("/root/send/fromdd", model.getValue("/root/tmp/prcprec/srchFromdd"));
  3172. model.makeValue("/root/send/todd", model.getValue("/root/tmp/prcprec/srchTodd"));
  3173. }
  3174. if(model.getValue("/root/tmp/prcprec/srchkind") == 1){ //일자별일경우
  3175. model.removeNodeset("root/tmp/littleindx");
  3176. fDbClickMidIndx();
  3177. }else if(model.getValue("/root/tmp/prcprec/srchkind") == ""){
  3178. }else{ //서식별, 일자+서식별일 경우
  3179. if(submit("TRMRI04007")){
  3180. var littleIndxNodeCnt = getNodesetCnt(model, "/root/tmp/littleindx/littleindxlist");
  3181. if(littleIndxNodeCnt > 0){
  3182. //grd_littleindx.attribute("visibility") = "visible";
  3183. grd_littleindx.row = 1;
  3184. fDbClickMidIndx();
  3185. }else{
  3186. //grd_littleindx.attribute("visibility") = "hidden";
  3187. }
  3188. }else{
  3189. messageBox("소분류 가져오기를 실패하였습니다.", "E", "");
  3190. return;
  3191. }
  3192. }
  3193. }
  3194. /**
  3195. * @group :
  3196. * @ver :
  3197. * @by : 2009-12-15 김양수
  3198. * @---------------------------------------------------
  3199. * @type : function
  3200. * @access : public
  3201. * @desc : 조회종류 setting
  3202. * @param :
  3203. * @return :
  3204. * @---------------------------------------------------
  3205. */
  3206. function fChngkind(){
  3207. var srchkind = model.getValue("/root/tmp/prcprec/srchkind");
  3208. if(srchkind == 1){ //일자별
  3209. grup_srchchrt.disabled = true; //서식별 조회
  3210. grup_srchday.disabled = false; //일자별 조회
  3211. }else if(srchkind == 2){ //서식별
  3212. grup_srchchrt.disabled = false; //서식별 조회
  3213. grup_srchday.disabled = true; //일자별 조회
  3214. //fReqLittleIndx();
  3215. }else if(srchkind == 3){ //일자+서식
  3216. grup_srchchrt.disabled = false; //서식별 조회
  3217. grup_srchday.disabled = false; //일자별 조회
  3218. }
  3219. fReqLittleIndx();
  3220. }