SMMRE00100.js 126 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 치과기록 ( SMMRE00100_치과기록.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - Author : 최원돈 (2010.10.25~
  7. - ref : C:\KNUProject\application\webapps\emr\medirecweb\js\MMR00100.js
  8. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  9. */
  10. var sSELINFO_PATH = "/root/main/selinfo"
  11. var sSELRECINFO_PATH = "/root/main/selinfo/recinfo"
  12. var sSELRECLIST_PATH = "/root/main/selinfo/recinfo/reclist"
  13. var sSELREFINFO_PATH = "/root/main/selinfo/refinfo"
  14. var sSELREFLIST_PATH = "/root/main/selinfo/refinfo/reflist"
  15. var sSELFOLDINFO_PATH = "/root/main/selinfo/foldinfo"
  16. var sSELFOLDLIST_PATH = "/root/main/selinfo/foldinfo/foldlist"
  17. var sSELWORDINFO_PATH = "/root/main/selinfo/wordinfo"
  18. var sSELWORDLIST_PATH = "/root/main/selinfo/wordinfo/wordlist"
  19. var sSELRECINFO_ORG_PATH = "/root/data/selinfo/recinfo"
  20. var sSELRECLIST_ORG_PATH = "/root/data/selinfo/recinfo/reclist"
  21. var sMODINFO_PATH = "/root/data/modinfo"
  22. var sMODRECINFO_PATH = "/root/data/modinfo/recinfo"
  23. var sDELINFO_PATH = "/root/data/delinfo"
  24. var sDELRECINFO_PATH = "/root/data/delinfo/recinfo"
  25. var sRECBASELIST_PATH = "/root/hidden/recbaseinfo/recbaselist";
  26. var aSKIPCOL = new Array("etcimgheight");
  27. var sLISTTMP = " ";
  28. // MAINLIST COLUMNS
  29. var aRECCOL = {"F1":[1 ]
  30. ,"F2":[1 ]
  31. ,"F3":[1 ]
  32. ,"F4":[1 ]
  33. ,"I" :[1,2 ]
  34. ,"T" :[1,2 ]
  35. ,"D" :[1,2,3]
  36. ,"W" :[1,2 ]
  37. ,"IM":[1,2 ]
  38. ,"FT":[1,2 ]
  39. }
  40. // PK COLUMNS
  41. var aPKCOLID_MASTLIST = new Array( "instcd"
  42. , "pid"
  43. , "orddd"
  44. , "cretno"
  45. , "orddeptcd"
  46. , "formrecdeptcd"
  47. , "wrdflag"
  48. , "wmid"
  49. , "recoseq" );
  50. var aWRDFLAG = { "CC" : [true, true]
  51. , "PI" : [true, true]
  52. , "PDH" : [true, true]
  53. , "PMH" : [true, true]
  54. , "진단" : [true, true]
  55. , "진료" : [true, true]
  56. , "계획" : [true, true]
  57. , "NEXT" : [true, true]
  58. , "템플릿" : [false, true]}
  59. // 서식 코드 값
  60. var aRECFLAGCD = { "CC" : "A1"
  61. , "PI" : "A2"
  62. , "PDH" : "A8"
  63. , "PMH" : "A3"
  64. , "진단" : "A5"
  65. , "진료" : "A4"
  66. , "계획" : "A9"
  67. , "주의사항" : "A11"
  68. , "NEXT" : "A30"}
  69. var sIMAGEFOLD1 = "C:\\Program Files\\himed\\webapps";
  70. var sIMAGEFOLD2 = sIMAGEFOLD1 + "\\emr";
  71. var sIMAGEFOLD3 = sIMAGEFOLD2 + "\\dentirecweb";
  72. var sIMAGEFOLD4 = sIMAGEFOLD3 + "\\" + ((getSystemCd()=="")?"LOCAL":getSystemCd());
  73. var sIMAGEFOLD = sIMAGEFOLD4 + "\\" + ((getGlobalVariable("logindt")=="")?"LOCAL":getGlobalVariable("logindt"));
  74. var sFTPFOLD4 = sIMAGEFOLD3 + "\\" + ((getSystemCd()=="")?"FTP_LOCAL":("FTP_" + getSystemCd()));
  75. var sFTPFOLD = sFTPFOLD4 + "\\" + ((getGlobalVariable("logindt")=="")?"FTP_LOCAL":getGlobalVariable("logindt"));
  76. var iFocusIndx = 0;
  77. var sFORMCD = '1000009251';
  78. // input popup의 object 위치 초기값을 저장한다.
  79. var iopt_checktext1width = 0;
  80. var iopt_checktext2width = 0;
  81. var iopt_checktext3width = 0;
  82. var iopt_checktext4width = 0;
  83. var iopt_checktext5width = 0;
  84. var iinpt_inptedit1width = 0;
  85. var iinpt_inptedit2width = 0;
  86. var iinpt_inptedit3width = 0;
  87. var iinpt_inptedit4width = 0;
  88. var iinpt_inptedit5width = 0;
  89. var iinpt_inptedit1left = 0;
  90. var iinpt_inptedit2left = 0;
  91. var iinpt_inptedit3left = 0;
  92. var iinpt_inptedit4left = 0;
  93. var iinpt_inptedit5left = 0;
  94. var icmb_inptdddl1width = 0;
  95. var icmb_inptdddl2width = 0;
  96. var icmb_inptdddl3width = 0;
  97. var icmb_inptdddl4width = 0;
  98. var icmb_inptdddl5width = 0;
  99. var icmb_inptdddl1left = 0;
  100. var icmb_inptdddl2left = 0;
  101. var icmb_inptdddl3left = 0;
  102. var icmb_inptdddl4left = 0;
  103. var icmb_inptdddl5left = 0;
  104. /**
  105. * @---------------------------------------------------
  106. * @creat : 20110101
  107. * @author : 최원돈
  108. * @desc : 기록블라인드 처리에 따른 초기화
  109. * @---------------------------------------------------
  110. */
  111. function fRecMainReady()
  112. {
  113. model.setValue("/root/main/cond/foldinfo/bizflag", (mmbfGetUserEnvQuestValue("030")=="002")?"B":"A"); // 업무구분 환경설정값 셋팅
  114. creatMainListImgFold(true); // 메인 이미지를 위한 폴더를 생성한다.
  115. setMainlistImageRatio50(true); // 메인 이미지 30 비율로 설정한다.
  116. // treeview 초기화
  117. grp_foldtree.attribute ("left" ) = parseInt(grp_foldtree.attribute ("left" )) + 300;
  118. grp_foldtree.attribute ("width" ) = parseInt(grp_foldtree.attribute ("width" )) + 300;
  119. grp_foldtree.attribute ("height") = parseInt(grp_foldtree.attribute ("height")) + 300;
  120. tr_fold.attribute ("width" ) = parseInt(tr_fold.attribute ("width" )) + 300;
  121. tr_fold.attribute ("height") = parseInt(tr_fold.attribute ("height")) + 300;
  122. btn_drugprint.attribute("left" ) = parseInt(btn_drugprint.attribute("left" )) + 300;
  123. // input popup의 object 위치 초기값을 저장한다.
  124. iopt_checktext1width = parseInt(opt_checktext1.attribute("width"));
  125. iopt_checktext2width = parseInt(opt_checktext2.attribute("width"));
  126. iopt_checktext3width = parseInt(opt_checktext3.attribute("width"));
  127. iopt_checktext4width = parseInt(opt_checktext4.attribute("width"));
  128. iopt_checktext5width = parseInt(opt_checktext5.attribute("width"));
  129. iinpt_inptedit1width = parseInt(inpt_inptedit1.attribute("width"));
  130. iinpt_inptedit2width = parseInt(inpt_inptedit2.attribute("width"));
  131. iinpt_inptedit3width = parseInt(inpt_inptedit3.attribute("width"));
  132. iinpt_inptedit4width = parseInt(inpt_inptedit4.attribute("width"));
  133. iinpt_inptedit5width = parseInt(inpt_inptedit5.attribute("width"));
  134. iinpt_inptedit1left = parseInt(inpt_inptedit1.attribute("left" ));
  135. iinpt_inptedit2left = parseInt(inpt_inptedit2.attribute("left" ));
  136. iinpt_inptedit3left = parseInt(inpt_inptedit3.attribute("left" ));
  137. iinpt_inptedit4left = parseInt(inpt_inptedit4.attribute("left" ));
  138. iinpt_inptedit5left = parseInt(inpt_inptedit5.attribute("left" ));
  139. icmb_inptdddl1width = parseInt(cmb_inptdddl1.attribute ("width"));
  140. icmb_inptdddl2width = parseInt(cmb_inptdddl2.attribute ("width"));
  141. icmb_inptdddl3width = parseInt(cmb_inptdddl3.attribute ("width"));
  142. icmb_inptdddl4width = parseInt(cmb_inptdddl4.attribute ("width"));
  143. icmb_inptdddl5width = parseInt(cmb_inptdddl5.attribute ("width"));
  144. icmb_inptdddl1left = parseInt(cmb_inptdddl1.attribute ("left" ));
  145. icmb_inptdddl2left = parseInt(cmb_inptdddl2.attribute ("left" ));
  146. icmb_inptdddl3left = parseInt(cmb_inptdddl3.attribute ("left" ));
  147. icmb_inptdddl4left = parseInt(cmb_inptdddl4.attribute ("left" ));
  148. icmb_inptdddl5left = parseInt(cmb_inptdddl5.attribute ("left" ));
  149. fInitRecPamInfo();
  150. fReadyFormInitData();
  151. model.refresh();
  152. // setFoldReset(); // 폴더를 초기화(선택취소)한다.
  153. //
  154. // fGetRecWordinfo(); //기록용 술식어및폴더별술식어를 조회한다.
  155. fGetrecinfo(); // 치과진료메인을 조회한다. -- 임시
  156. fGetrefinfo(); // 술식어 참조를 조회한다.
  157. }
  158. /**
  159. * @---------------------------------------------------
  160. * @creat : 20110101
  161. * @author : 최원돈
  162. * @desc : 조회기간 설정 초기화
  163. * @---------------------------------------------------
  164. */
  165. function fReadyFormInitData()
  166. {
  167. model.removenode("/root/init/wrddeptlist");
  168. model.makeNode("/root/init/wrddeptlist");
  169. fGetHardCDList("N", 242, 0 , "/root/init/wrddeptlist"); // 치과 부서(하드코드 리스트)를 조회한다. cf) mmbfGetHardCodeInfoNm(ref, rsltref, hardcd)
  170. var ls_btwrdflag1 = "bt_wrdflag1";
  171. // 술식구분을 사용자정의코드로 선택
  172. switch (mmbfGetUserEnvQuestValue("031"))
  173. {
  174. case "001" :
  175. ls_btwrdflag1 = "bt_wrdflag1";
  176. break;
  177. case "002" :
  178. ls_btwrdflag1 = "bt_wrdflag2";
  179. break;
  180. case "003" :
  181. ls_btwrdflag1 = "bt_wrdflag3";
  182. break;
  183. case "004" :
  184. ls_btwrdflag1 = "bt_wrdflag4";
  185. break;
  186. case "005" :
  187. ls_btwrdflag1 = "bt_wrdflag5";
  188. break;
  189. case "006" :
  190. ls_btwrdflag1 = "bt_wrdflag6";
  191. break;
  192. case "007" :
  193. ls_btwrdflag1 = "bt_wrdflag7";
  194. break;
  195. case "008" :
  196. ls_btwrdflag1 = "bt_wrdflag8";
  197. break;
  198. case "009" :
  199. ls_btwrdflag1 = "bt_wrdflag9";
  200. break;
  201. default :
  202. ls_btwrdflag1 = "bt_wrdflag1";
  203. break;
  204. }
  205. opener.ivw_dentifmla.window.document.controls.item(ls_btwrdflag1).dispatch("onclick");
  206. ipt_student.value = "";
  207. ipt_tutor.value = "";
  208. }
  209. /**
  210. * @---------------------------------------------------
  211. * @creat : 20110101
  212. * @author : 최원돈
  213. * @desc : 환자 원무 정보 셋팅
  214. * @---------------------------------------------------
  215. */
  216. function fInitRecPamInfo()
  217. {
  218. try
  219. {
  220. var node = getGlobalVariable("paminfo");
  221. model.removeNodeset("/root/main/paminfo");
  222. setCSVToNode("/root/main", node, "paminfo");
  223. model.setValue("/root/main/cond/recinfo/pid" , model.getValue("/root/main/paminfo/pid" ));
  224. model.setValue("/root/main/cond/recinfo/orddd" , (model.getValue("/root/main/paminfo/orddd")==null) ? model.getValue("/root/main/paminfo/indd") : model.getValue("/root/main/paminfo/orddd"));
  225. model.setValue("/root/main/cond/recinfo/cretno" , model.getValue("/root/main/paminfo/cretno" ));
  226. model.setValue("/root/main/cond/recinfo/orddeptcd", model.getValue("/root/main/paminfo/orddeptcd"));
  227. model.setValue("/root/main/cond/inptioflag" , model.getValue("/root/main/paminfo/ioflag" ));
  228. model.setValue("/root/main/cond/recinfo/ioflag" , model.getValue("/root/main/paminfo/ioflag" ));
  229. }
  230. catch (e)
  231. {
  232. //alert("fInitRecPamInfo");
  233. throw e;
  234. }
  235. }
  236. /**
  237. * @---------------------------------------------------
  238. * @creat : 20110101
  239. * @author : 최원돈
  240. * @desc : 치과진료메인 조회
  241. * @---------------------------------------------------
  242. */
  243. function fGetrecinfo()
  244. {
  245. model.setValue("/root/main/cond/recinfo/recfromdt" , opener.model.getValue("/root/init/reqmedireclist/recfromdt" ));
  246. model.setValue("/root/main/cond/recinfo/rectodt" , opener.model.getValue("/root/init/reqmedireclist/rectodt" ));
  247. model.setValue("/root/main/cond/recinfo/reqformrecdeptcd", opener.model.getValue("/root/send/reqmedireclist/formrecdeptcd"));
  248. // 초기화 START
  249. //mainlist 초기화
  250. model.removenode(sSELRECINFO_PATH);
  251. model.makeNode(sSELRECINFO_PATH);
  252. //send parameter 초기화
  253. model.removeNodeset("/root/send/savedata/recinfo");
  254. model.makeNode("/root/send/savedata/recinfo");
  255. model.removenode("/root/send/reqcond");
  256. model.makeNode("/root/send/reqcond");
  257. model.copyNode("/root/send/reqcond", "/root/main/cond/recinfo");
  258. // 초기화 END
  259. grd_mainlist.rebuildStyle();
  260. //submit 호출
  261. if(!submit("TRMRE00101")){
  262. messageBox("조회를 실패하였습니다.", "E999");
  263. setMainlistAll(true); // Main Grid 전체 Style 설정
  264. return;
  265. }
  266. // 조회시간을 설정한다.
  267. var ls_searchdt = "";
  268. var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and skipyn!='Y' and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
  269. var lx_timenode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
  270. if (lx_timenode.length > 0)
  271. {
  272. ls_searchdt = lx_timenode.item(0).selectSingleNode("searchdt").NodeValue;
  273. }
  274. model.setValue("/root/main/cond/recinfo/reqsearchdt", ls_searchdt);
  275. // 메인 이미지를 위한 폴더를 생성한다.
  276. var fso = new ActiveXObject('Scripting.FileSystemObject');
  277. if (!fso.FolderExists(sIMAGEFOLD))
  278. {
  279. creatMainListImgFold(false);
  280. }
  281. insertInptFlag1Rec(); // Title을 무조건 발생시킨다.
  282. setRecImgColInstance(); // IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 로컬에 저장한다.
  283. setActiveInit(false); // 초기화 (조회, 저장 후)
  284. //치과기록PMH조회화면 재로딩
  285. var mainObj = getMainViewer();
  286. curPmhSrchObj = mainObj.javascript.getOpenWindow("SMMRE00800"); // 활성화된 PMH 검색
  287. if(curPmhSrchObj != null) {curPmhSrchObj.javascript.fRecMainReady(); } // 활성화된 PMH 화면이 있는 경우 조회
  288. }
  289. /**
  290. * @---------------------------------------------------
  291. * @creat : 20110101
  292. * @author : 최원돈
  293. * @desc : 초기화 (조회, 저장 후)
  294. * @---------------------------------------------------
  295. */
  296. function setActiveInit(pb_refresh)
  297. {
  298. createTempNode(); // Temp 노드를 생성한다.
  299. setMainlistAll(pb_refresh); // Main Grid 전체 Style 설정
  300. model.removeNodeset(sMODRECINFO_PATH);
  301. model.makeNode(sMODRECINFO_PATH);
  302. model.removeNodeset(sDELRECINFO_PATH);
  303. model.makeNode(sDELRECINFO_PATH);
  304. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(false); // 인증저장버튼 색을 초기화한다.
  305. }
  306. /**
  307. * @---------------------------------------------------
  308. * @creat : 20110101
  309. * @author : 최원돈
  310. * @desc : 치과진료메인 저장
  311. * @---------------------------------------------------
  312. */
  313. function fClkBtnrecSave(ps_prcpsignflag)
  314. {
  315. if (ps_prcpsignflag == "0") // 임시저장(0) 일 경우 인증저장 자료가 있다면 에러메세지
  316. {
  317. var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and formrecdeptcd='" + getUserInfo("dutplcecd") + "' and prcpsignflag='2'" ;
  318. var lx_signnode = instance1.selectNodes(sSELRECLIST_ORG_PATH + "[" + ls_cond + "]");
  319. if (lx_signnode.length > 0)
  320. {
  321. messageBox("인증저장 자료가 존재해서 임시저장을 할 수 없습니다. 인증(확정)저장을 하세요!", "E999");
  322. return;
  323. }
  324. }
  325. else if (ps_prcpsignflag == "2") // 인증저장(2) 일 경우 임시저장(0)을 인증저장(2)으로 갱신
  326. {
  327. var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and (skipyn!='Y' or inptflag='F4') and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
  328. var lx_signnode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
  329. if (lx_signnode.length > 0)
  330. {
  331. var ls_currentdt = getCurrentDate() + getCurrentTime();
  332. for (var j=0; j <lx_signnode.length; j++)
  333. {
  334. var lx_node = lx_signnode.item(j);
  335. lx_node.selectSingleNode("prcpsignflag").NodeValue = ps_prcpsignflag;
  336. lx_node.selectSingleNode("signrecoseq").NodeValue = lx_node.selectSingleNode("recoseq").NodeValue;
  337. lx_node.selectSingleNode("inptseq").NodeValue = (j+1);
  338. if (lx_node.selectSingleNode("status").NodeValue=="")
  339. {
  340. lx_node.selectSingleNode("status").NodeValue = "m";
  341. lx_node.selectSingleNode("rgstdt").NodeValue = ls_currentdt;
  342. }
  343. }
  344. }
  345. }
  346. if (model.getValue("/root/main/condEtc/imgratio") == 0) // 'Y'일 경우에만 RESET 진행
  347. {
  348. var ls_cond = "inptflag = 'IM'";
  349. var lx_recImagenode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
  350. if (lx_recImagenode.length > 0)
  351. {
  352. for (var j=0; j <lx_recImagenode.length; j++)
  353. {
  354. var lx_node = lx_recImagenode.item(j);
  355. for (var i=2; i<=3; i++) // COL2~COL12까지 type을 설정한다.
  356. {
  357. lx_node.selectSingleNode("col" + i).NodeValue = "";
  358. }
  359. }
  360. }
  361. }
  362. if(chkMsetIdenNode(aPKCOLID_MASTLIST, sSELRECLIST_ORG_PATH, sSELRECINFO_PATH, sDELRECINFO_PATH, sMODRECINFO_PATH, true, "insertseq", aSKIPCOL, "m", "i")) // 동일여부체크
  363. {
  364. messageBox("저장할 데이터가", "I004");
  365. return;
  366. }
  367. model.removeNodeset("/root/send/savedata/recinfo");
  368. model.makeNode("/root/send/savedata/recinfo");
  369. var modrecinfo = instance1.selectSingleNode(sMODRECINFO_PATH);
  370. var modreclist = modrecinfo.childNodes;
  371. var delrecinfo = instance1.selectSingleNode(sDELRECINFO_PATH);
  372. var delreclist = delrecinfo.childNodes;
  373. var saverecinfo = instance1.selectSingleNode("/root/send/savedata/recinfo");
  374. if (modreclist.length > 0) // 추가 또는 수정정보를 save에 등록한다.
  375. {
  376. while(modrecchild1 = modreclist.nextNode())
  377. {
  378. saverecinfo.appendChild(modrecchild1);
  379. }
  380. }
  381. if (delreclist.length > 0) // 삭제정보를 save에 등록한다.
  382. {
  383. while(delrecchild1 = delreclist.nextNode())
  384. {
  385. saverecinfo.appendChild(delrecchild1);
  386. }
  387. }
  388. if ( ps_prcpsignflag == "2" // 인증저장(2) 일 경우 인증을 실행 및 성공해야 진행함.
  389. && !fSignSave(modreclist.length))
  390. {
  391. return;
  392. }
  393. model.refresh();
  394. //send parameter 설정
  395. model.setValue("/root/main/cond/recinfo/prcpsignflag", ps_prcpsignflag);
  396. model.makeNode("/root/send/savedata/recinfo/reqcond");
  397. model.copyNode("/root/send/savedata/recinfo/reqcond", "/root/main/cond/recinfo");
  398. grd_mainlist.rebuildStyle();
  399. if(!submit("TXMRE00101")){
  400. messageBox("저장을 실패하였습니다.", "E999");
  401. setMainlistAll(true); // Main Grid 전체 Style 설정
  402. return;
  403. }
  404. // 조회시간을 설정한다.
  405. var ls_searchdt = "";
  406. var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and skipyn!='Y' and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
  407. var lx_timenode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
  408. if (lx_timenode.length > 0)
  409. {
  410. ls_searchdt = lx_timenode.item(0).selectSingleNode("searchdt").NodeValue;
  411. }
  412. model.setValue("/root/main/cond/recinfo/reqsearchdt", ls_searchdt);
  413. // 메인 이미지를 위한 폴더를 생성한다.
  414. var fso = new ActiveXObject('Scripting.FileSystemObject');
  415. if (!fso.FolderExists(sIMAGEFOLD))
  416. {
  417. creatMainListImgFold(false);
  418. }
  419. insertInptFlag1Rec(); // Title을 무조건 발생시킨다.
  420. setRecImgColInstance(); // IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 col2~col12에 입력해준다.
  421. setActiveInit(true); // 초기화 (조회, 저장 후)
  422. }
  423. /**
  424. * @---------------------------------------------------
  425. * @creat : 20110101
  426. * @author : 최원돈
  427. * @desc : 기록용 술식어및폴더별술식어를 조회한다.
  428. * @---------------------------------------------------
  429. */
  430. function fGetRecWordinfo(){
  431. initWordSelectValue(); // 술식어 선택 공통변수 초기화
  432. model.setValue("/root/main/cond/wordinfo/bizflag", model.getValue("/root/main/cond/foldinfo/bizflag"));
  433. model.setValue("/root/main/cond/wordinfo/deptcd", model.getValue("/root/main/cond/foldinfo/deptcd"));
  434. model.setValue("/root/main/cond/wordinfo/wrdflag", model.getValue("/root/main/cond/recinfo/wrdflag"));
  435. // 초기화 START
  436. //mainlist 초기화
  437. model.removenode(sSELWORDINFO_PATH);
  438. model.makeNode(sSELWORDINFO_PATH);
  439. //send parameter 초기화
  440. model.removeNodeset("/root/send/wordinfo/reqcond");
  441. model.makeNode("/root/send/wordinfo/reqcond");
  442. model.copyNode("/root/send/wordinfo/reqcond", "/root/main/cond/wordinfo");
  443. // 초기화 END
  444. //submit 호출
  445. if(!submit("TRMRE00103")){
  446. messageBox("조회를 실패하였습니다.", "E999");
  447. return;
  448. }
  449. }
  450. /**
  451. * @---------------------------------------------------
  452. * @creat : 20110101
  453. * @author : 최원돈
  454. * @desc : 술식어 참조를 조회
  455. * @---------------------------------------------------
  456. */
  457. function fGetrefinfo()
  458. {
  459. // 초기화 START
  460. //mainlist 초기화
  461. model.removenode(sSELREFINFO_PATH);
  462. model.makeNode(sSELREFINFO_PATH);
  463. //send parameter 초기화
  464. model.removeNodeset("/root/send/refinfo/reqcond");
  465. model.makeNode("/root/send/refinfo/reqcond");
  466. model.copyNode("/root/send/refinfo/reqcond", "/root/main/cond/refinfo");
  467. // 초기화 END
  468. //submit 호출
  469. if(!submit("TRMRE00301")){
  470. messageBox("조회를 실패하였습니다.", "E999");
  471. return;
  472. }
  473. }
  474. /**
  475. * @---------------------------------------------------
  476. * @creat : 20110101
  477. * @author : 최원돈
  478. * @desc : 폴더를 조회
  479. * @---------------------------------------------------
  480. */
  481. function fGetfoldinfo()
  482. {
  483. model.setValue("/root/main/cond/foldinfo/wrdflag", model.getValue("/root/main/cond/recinfo/wrdflag"));
  484. // 초기화 START
  485. //mainlist 초기화
  486. model.removenode(sSELFOLDINFO_PATH);
  487. model.makeNode(sSELFOLDINFO_PATH);
  488. //send parameter 초기화
  489. model.removeNodeset("/root/send/foldinfo/reqcond");
  490. model.makeNode("/root/send/foldinfo/reqcond");
  491. model.copyNode("/root/send/foldinfo/reqcond", "/root/main/cond/foldinfo");
  492. // 초기화 END
  493. //submit 호출
  494. if(!submit("TRMRE00501")){
  495. messageBox("조회를 실패하였습니다.", "E999");
  496. return;
  497. }
  498. }
  499. /**
  500. * @---------------------------------------------------
  501. * @creat : 20110101
  502. * @author : 최원돈
  503. * @desc : Temp 노드를 생성한다.
  504. * @---------------------------------------------------
  505. */
  506. function createTempNode()
  507. {
  508. model.removeNodeset(sSELRECINFO_ORG_PATH);
  509. model.makeNode(sSELRECINFO_ORG_PATH);
  510. model.copyNode(sSELRECINFO_ORG_PATH, sSELRECINFO_PATH);
  511. // temp 노드에 image col2~12 정보 삭제
  512. var ls_cond = "inptflag = 'IM'";
  513. // 삭제 내역 중 IMAGE 의 COL1~COL2값을 STRING으로 재설정
  514. // IMAGE 정보를 모두 찾는다.
  515. var lx_recImagenode = instance1.selectNodes(sSELRECLIST_ORG_PATH + "[" + ls_cond + "]");
  516. for (var j=0; j <lx_recImagenode.length; j++)
  517. {
  518. for (var i=2; i<=3; i++) // COL2~COL12까지 type을 설정한다.
  519. {
  520. lx_recImagenode.item(j).selectSingleNode("col" + i).NodeValue = "";
  521. }
  522. }
  523. }
  524. // 선택 Column Disalbed 가져오기
  525. function getColDisabled(ps_inptflag, pi_colid)
  526. {
  527. if (!chkValidationModifyMainlist(grd_mainlist.row, false)) // Main List 수정 가능여부 확인
  528. {
  529. return true;
  530. }
  531. var ls_col2id = grd_mainlist.colRef("col2");
  532. var ls_col3id = grd_mainlist.colRef("col3");
  533. switch(ps_inptflag)
  534. {
  535. case 'I' : // INPUT
  536. case 'T' :
  537. if (pi_colid == ls_col2id)
  538. {
  539. return false;
  540. }
  541. break;
  542. case 'D' : // DENTAL OUTPUT
  543. if (pi_colid == ls_col3id)
  544. {
  545. return false;
  546. }
  547. break;
  548. case 'W' : // WORD
  549. if (pi_colid == ls_col2id
  550. && grd_mainlist.valueMatrix(grd_mainlist.row, grd_mainlist.colRef("popinptyn")) == "N")
  551. {
  552. return false;
  553. }
  554. break;
  555. default:
  556. break;
  557. }
  558. return true;
  559. }
  560. /**
  561. * @---------------------------------------------------
  562. * @creat : 20110101
  563. * @author : 최원돈
  564. * @desc : 오른쪽 버튼 메뉴 파일 다운로드
  565. * @---------------------------------------------------
  566. */
  567. function downloadFile()
  568. {
  569. var li_row = grd_mainlist.row;
  570. if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("inptflag")) == "FT")
  571. {
  572. if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rgstdrid")) == "")
  573. {
  574. messageBox("파일 다운로드는 저장 후 가능합니다.", "E999");
  575. }
  576. else
  577. {
  578. var filepath = grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("filepath"));
  579. var filenm = grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("filenm"));
  580. var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
  581. if (localfile != "") {
  582. model.download(getActionURL("TRMRE00102")+"&filepath="+filepath,localfile, false, false);
  583. var rtn = messageBox("파일을", "Q004");
  584. if( rtn == 6 ) {
  585. window.exec(localfile);
  586. }
  587. }
  588. }
  589. }
  590. else
  591. {
  592. messageBox("첨부파일만 다운로드가 가능합니다.", "E999");
  593. }
  594. initPopupMenu(); // Reset Right Popupmenu
  595. }
  596. /**
  597. * @---------------------------------------------------
  598. * @creat : 20110101
  599. * @author : 최원돈
  600. * @desc : 오른쪽 버튼 메뉴 삭제 함수
  601. * @---------------------------------------------------
  602. */
  603. function delMainlistRow()
  604. {
  605. var delnode = instance1.selectSingleNode(sDELRECINFO_PATH);
  606. var la_recsel = new Array();
  607. // 삭제 ros Desc 임시 저장
  608. var j = 0;
  609. var li_getrow = 0;
  610. for(var i=(grd_mainlist.selectedRows-1); i>=0; i--)
  611. {
  612. li_getrow = grd_mainlist.selectedRow(i);
  613. if (chkValidationModifyMainlist(li_getrow, false)) // Main List 수정 가능여부 확인
  614. {
  615. la_recsel[j++] = li_getrow;
  616. }
  617. }
  618. // 삭제 노드를 '삭제노드'에 임시 저장을 하고, 삭제함(=> 저장 시 삭제정보 활용)
  619. for(i=0; i<la_recsel.length; i++)
  620. {
  621. li_row = la_recsel[i];
  622. var ls_pkcond = "";
  623. var lb_skipyn = (grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("skipyn")) == "Y") ? true : false;
  624. if (!lb_skipyn) // 비교 및 저장 대상일 경우
  625. {
  626. // 비교하기 위해서 PK 를 추출
  627. for (j=0; j<aPKCOLID_MASTLIST.length; j++)
  628. {
  629. if (ls_pkcond != "")
  630. {
  631. ls_pkcond += " and ";
  632. }
  633. var ls_pkvalue = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef(aPKCOLID_MASTLIST[j]));
  634. if (ls_pkvalue == "")
  635. {
  636. ls_pkcond = "";
  637. break;
  638. }
  639. ls_pkcond += aPKCOLID_MASTLIST[j] + "='" + ls_pkvalue + "'";
  640. }
  641. if (ls_pkcond == "") // PK가 존재하지 않을 경우 [추가일 경우]
  642. {
  643. grd_mainlist.deleteRow(li_row, false);
  644. }
  645. else
  646. {
  647. var ls_cond = sSELRECLIST_PATH + "[" + ls_pkcond + "]";
  648. delnode.appendChild(instance1.selectSingleNode(ls_cond));
  649. delnode.lastChild.selectSingleNode("delyn").NodeValue = "Y";
  650. delnode.lastChild.selectSingleNode("status").NodeValue = "d";
  651. grd_mainlist.deleteRow(li_row, false);
  652. }
  653. }
  654. }
  655. var ls_orddd = model.getValue("/root/main/cond/recinfo/orddd");
  656. var ls_dutplcecd = getUserInfo("dutplcecd");
  657. // F4 삭제
  658. for(i=grd_mainlist.rows-1; i>0; i--)
  659. {
  660. if( grd_mainlist.valueMatrix(i, grd_mainlist.colRef("orddd")) == ls_orddd
  661. && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
  662. && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "F4")
  663. {
  664. if ( i == grd_mainlist.rows-1
  665. || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("skipyn")) == "Y"
  666. || grd_mainlist.valueMatrix(i, grd_mainlist.colRef("wmid")) != grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("wmid")))
  667. {
  668. ls_pkcond = "";
  669. // 비교하기 위해서 PK 를 추출
  670. for (j=0; j<aPKCOLID_MASTLIST.length; j++)
  671. {
  672. if (ls_pkcond != "")
  673. {
  674. ls_pkcond += " and ";
  675. }
  676. var ls_pkvalue = grd_mainlist.valueMatrix(i, grd_mainlist.colRef(aPKCOLID_MASTLIST[j]));
  677. if (ls_pkvalue == "")
  678. {
  679. ls_pkcond = "";
  680. break;
  681. }
  682. ls_pkcond += aPKCOLID_MASTLIST[j] + "='" + ls_pkvalue + "'";
  683. }
  684. if (ls_pkcond == "") // PK가 존재하지 않을 경우 [추가일 경우]
  685. {
  686. grd_mainlist.deleteRow(i, false);
  687. }
  688. else
  689. {
  690. var ls_cond = sSELRECLIST_PATH + "[" + ls_pkcond + "]";
  691. delnode.appendChild(instance1.selectSingleNode(ls_cond));
  692. delnode.lastChild.selectSingleNode("delyn").NodeValue = "Y";
  693. delnode.lastChild.selectSingleNode("status").NodeValue = "d";
  694. grd_mainlist.deleteRow(i, false);
  695. }
  696. }
  697. }
  698. }
  699. // F3 삭제
  700. for(i=grd_mainlist.rows-1; i>0; i--)
  701. {
  702. if( grd_mainlist.valueMatrix(i, grd_mainlist.colRef("orddd")) == ls_orddd
  703. && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
  704. && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "F3")
  705. {
  706. if ( i == grd_mainlist.rows-1
  707. || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("inptflag")) == "F2"
  708. || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("inptflag")) == "F3")
  709. {
  710. grd_mainlist.deleteRow(i, false);
  711. }
  712. }
  713. }
  714. // F2 삭제
  715. for(i=grd_mainlist.rows-1; i>0; i--)
  716. {
  717. if( grd_mainlist.valueMatrix(i, grd_mainlist.colRef("orddd")) == ls_orddd
  718. && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
  719. && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "F2")
  720. {
  721. if ( i == grd_mainlist.rows-1
  722. || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("inptflag")) == "F2")
  723. {
  724. grd_mainlist.deleteRow(i, false);
  725. }
  726. }
  727. }
  728. model.refresh();
  729. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  730. initPopupMenu(); // Reset Right Popupmenu
  731. }
  732. /**
  733. * @---------------------------------------------------
  734. * @creat : 20110101
  735. * @author : 최원돈
  736. * @desc : Main List 수정 가능여부 확인
  737. * @---------------------------------------------------
  738. */
  739. function chkValidationModifyMainlist(pi_row, pb_chkinptflag)
  740. {
  741. // 진료(처방)일자와 기록 일자가 동일해야 수정가능
  742. if (model.getValue("/root/main/cond/recinfo/orddd") != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("orddd")))
  743. {
  744. return false;
  745. }
  746. // 사용자부서와 진료과가 동일해야 수정가능
  747. if (getUserInfo("dutplcecd") != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("formrecdeptcd")))
  748. {
  749. return false;
  750. }
  751. var ls_inptflag = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("inptflag"))
  752. if (pb_chkinptflag) // row 전체 설정 시 필요한 체크 ex) Font
  753. {
  754. if ( ls_inptflag != "I"
  755. && ls_inptflag != "T"
  756. && ls_inptflag != "D"
  757. && ls_inptflag != "W")
  758. {
  759. return false; // INPUT, 치식, 술식 일 경우만 수정 가능
  760. }
  761. }
  762. return true;
  763. }
  764. /**
  765. * @---------------------------------------------------
  766. * @creat : 20110101
  767. * @author : 최원돈
  768. * @desc : 술식 팝업메뉴 '입력' 클릭 시 메인에 삽입
  769. * @---------------------------------------------------
  770. */
  771. function insertWordPopupMenu()
  772. {
  773. var lb_startyn = true;
  774. var lb_endyn = false;
  775. grd_wrdlist.isselected(0) = false;
  776. var li_selectedRows = grd_wrdlist.selectedRows;
  777. // for(var i=li_selectedRows; i>=0; i--)
  778. for(var i=0; i<=li_selectedRows; i++)
  779. {
  780. if (grd_wrdlist.selectedRow(i) > 0)
  781. {
  782. if (i == 0) // 마지막에 refresh
  783. {
  784. lb_endyn = true;
  785. }
  786. insertDatagridRec(grd_wrdlist, grd_wrdlist.selectedRow(i), lb_startyn, lb_endyn);
  787. lb_startyn = false;
  788. }
  789. }
  790. initWordSelect(); // 술식어 선택 초기화
  791. initPopupMenu(); // Reset Right Popupmenu
  792. }
  793. /**
  794. * @---------------------------------------------------
  795. * @creat : 20110307
  796. * @author : 최원돈
  797. * @desc : 술식어 선택 초기화
  798. * @---------------------------------------------------
  799. */
  800. function initWordSelect()
  801. {
  802. var li_selectedRows = grd_wrdlist.selectedRows;
  803. for(i=li_selectedRows; i>=0; i--)
  804. {
  805. grd_wrdlist.isselected(grd_wrdlist.selectedRow(i)) = false;
  806. }
  807. initWordSelectValue() // 술식어 선택 공통변수 초기화
  808. }
  809. /**
  810. * @---------------------------------------------------
  811. * @creat : 20110307
  812. * @author : 최원돈
  813. * @desc : 술식어 선택 공통변수 초기화
  814. * @---------------------------------------------------
  815. */
  816. function initWordSelectValue()
  817. {
  818. if (wordSelectedIdx > 0)
  819. {
  820. wordSelectedRow = new Array();
  821. wordSelectedIdx = 0;
  822. }
  823. }
  824. /**
  825. * @---------------------------------------------------
  826. * @creat : 20110307
  827. * @author : 최원돈
  828. * @desc : 술식어 선택 DESC
  829. * @---------------------------------------------------
  830. */
  831. function sortNumber(a, b)
  832. {
  833. return b - a;
  834. }
  835. /**
  836. * @---------------------------------------------------
  837. * @creat : 20110307
  838. * @author : 최원돈
  839. * @desc : 술식어 선택 값 저장
  840. * @---------------------------------------------------
  841. */
  842. function initWordSelectedSave()
  843. {
  844. var isSelected = false;
  845. if (wordSelectedRow.length == 0)
  846. {
  847. wordSelectedRow[wordSelectedIdx] = grd_wrdlist.row;
  848. grd_wrdlist.AddListSelect(wordSelectedRow[i]);
  849. wordSelectedIdx++;
  850. }
  851. else
  852. {
  853. for (var j=wordSelectedRow.length-1; j>=0; j--) // 재선택 확인
  854. {
  855. if (wordSelectedRow[j]== grd_wrdlist.row)
  856. {
  857. isSelected = true;
  858. grd_wrdlist.isselected(grd_wrdlist.row) = false;
  859. break;
  860. }
  861. }
  862. var li_selectedRows = grd_wrdlist.selectedRows;
  863. for(i=li_selectedRows; i>=0; i--) // 선택 초기화
  864. {
  865. grd_wrdlist.isselected(grd_wrdlist.selectedRow(i)) = false;
  866. }
  867. grd_wrdlist.isselected(grd_wrdlist.row) = false;
  868. if(isSelected) // 재선택 시 삭제
  869. {
  870. if (j==wordSelectedRow.length-1)
  871. {
  872. wordSelectedRow.pop();
  873. }
  874. else
  875. {
  876. wordSelectedRow.splice(j,2,wordSelectedRow[j+1]);
  877. }
  878. }
  879. else
  880. {
  881. wordSelectedRow[wordSelectedIdx] = grd_wrdlist.row;
  882. }
  883. wordSelectedRow.sort(sortNumber);
  884. for(var i=wordSelectedRow.length-1; i>=0; i--)
  885. {
  886. grd_wrdlist.AddListSelect(wordSelectedRow[i]);
  887. }
  888. if(isSelected)
  889. {
  890. wordSelectedIdx--;
  891. }
  892. else
  893. {
  894. wordSelectedIdx++;
  895. }
  896. }
  897. }
  898. /**
  899. * @---------------------------------------------------
  900. * @creat : 20110101
  901. * @author : 최원돈
  902. * @desc : input popup의 object 를 설정한다.
  903. * @---------------------------------------------------
  904. */
  905. function setinptPopup(pi_row)
  906. {
  907. opt_currentrow.value = pi_row;
  908. ls_bigostyle1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle" ));
  909. ls_bigogubun1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun" ));
  910. ls_checktext1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext" ));
  911. ls_bigotext1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext" ));
  912. ls_bigostyle2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle2"));
  913. ls_bigogubun2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun2"));
  914. ls_checktext2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext2"));
  915. ls_bigotext2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext2" ));
  916. ls_bigostyle3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle3"));
  917. ls_bigogubun3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun3"));
  918. ls_checktext3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext3"));
  919. ls_bigotext3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext3" ));
  920. ls_bigostyle4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle4"));
  921. ls_bigogubun4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun4"));
  922. ls_checktext4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext4"));
  923. ls_bigotext4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext4" ));
  924. ls_bigostyle5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle5"));
  925. ls_bigogubun5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun5"));
  926. ls_checktext5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext5"));
  927. ls_bigotext5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext5" ));
  928. // Visible을 설정한다.
  929. bool_checktext1.visible = (ls_bigostyle1 == "CHECKBOX")? true : false;
  930. bool_checktext2.visible = (ls_bigostyle2 == "CHECKBOX")? true : false;
  931. bool_checktext3.visible = (ls_bigostyle3 == "CHECKBOX")? true : false;
  932. bool_checktext4.visible = (ls_bigostyle4 == "CHECKBOX")? true : false;
  933. bool_checktext5.visible = (ls_bigostyle5 == "CHECKBOX")? true : false;
  934. opt_checktext1.visible = (ls_bigostyle1 == "CHECKBOX")? true : false;
  935. opt_checktext2.visible = (ls_bigostyle2 == "CHECKBOX")? true : false;
  936. opt_checktext3.visible = (ls_bigostyle3 == "CHECKBOX")? true : false;
  937. opt_checktext4.visible = (ls_bigostyle4 == "CHECKBOX")? true : false;
  938. opt_checktext5.visible = (ls_bigostyle5 == "CHECKBOX")? true : false;
  939. inpt_inptedit1.visible = (ls_bigostyle1 == "EDIT" )? true : false;
  940. inpt_inptedit2.visible = (ls_bigostyle2 == "EDIT" )? true : false;
  941. inpt_inptedit3.visible = (ls_bigostyle3 == "EDIT" )? true : false;
  942. inpt_inptedit4.visible = (ls_bigostyle4 == "EDIT" )? true : false;
  943. inpt_inptedit5.visible = (ls_bigostyle5 == "EDIT" )? true : false;
  944. cmb_inptdddl1.visible = (ls_bigostyle1 == "DDDL" )? true : false;
  945. cmb_inptdddl2.visible = (ls_bigostyle2 == "DDDL" )? true : false;
  946. cmb_inptdddl3.visible = (ls_bigostyle3 == "DDDL" )? true : false;
  947. cmb_inptdddl4.visible = (ls_bigostyle4 == "DDDL" )? true : false;
  948. cmb_inptdddl5.visible = (ls_bigostyle5 == "DDDL" )? true : false;
  949. // Position을 설정한다.
  950. opt_checktext1.attribute("width") = (opt_checktext1.visible) ? iopt_checktext1width + 250 : iopt_checktext1width;
  951. opt_checktext2.attribute("width") = (opt_checktext2.visible) ? iopt_checktext2width + 250 : iopt_checktext2width;
  952. opt_checktext3.attribute("width") = (opt_checktext3.visible) ? iopt_checktext3width + 250 : iopt_checktext3width;
  953. opt_checktext4.attribute("width") = (opt_checktext4.visible) ? iopt_checktext4width + 250 : iopt_checktext4width;
  954. opt_checktext5.attribute("width") = (opt_checktext5.visible) ? iopt_checktext5width + 250 : iopt_checktext5width;
  955. inpt_inptedit1.attribute("width") = (inpt_inptedit1.visible) ? iinpt_inptedit1width + 280 : iinpt_inptedit1width;
  956. inpt_inptedit2.attribute("width") = (inpt_inptedit2.visible) ? iinpt_inptedit2width + 280 : iinpt_inptedit2width;
  957. inpt_inptedit3.attribute("width") = (inpt_inptedit3.visible) ? iinpt_inptedit3width + 280 : iinpt_inptedit3width;
  958. inpt_inptedit4.attribute("width") = (inpt_inptedit4.visible) ? iinpt_inptedit4width + 280 : iinpt_inptedit4width;
  959. inpt_inptedit5.attribute("width") = (inpt_inptedit5.visible) ? iinpt_inptedit5width + 280 : iinpt_inptedit5width;
  960. inpt_inptedit1.attribute("left" ) = (inpt_inptedit1.visible) ? iinpt_inptedit1left - 150 : iinpt_inptedit1left ;
  961. inpt_inptedit2.attribute("left" ) = (inpt_inptedit2.visible) ? iinpt_inptedit2left - 150 : iinpt_inptedit2left ;
  962. inpt_inptedit3.attribute("left" ) = (inpt_inptedit3.visible) ? iinpt_inptedit3left - 150 : iinpt_inptedit3left ;
  963. inpt_inptedit4.attribute("left" ) = (inpt_inptedit4.visible) ? iinpt_inptedit4left - 150 : iinpt_inptedit4left ;
  964. inpt_inptedit5.attribute("left" ) = (inpt_inptedit5.visible) ? iinpt_inptedit5left - 150 : iinpt_inptedit5left ;
  965. cmb_inptdddl1.attribute ("width") = (cmb_inptdddl1.visible ) ? icmb_inptdddl1width + 280 : icmb_inptdddl1width ;
  966. cmb_inptdddl2.attribute ("width") = (cmb_inptdddl2.visible ) ? icmb_inptdddl2width + 280 : icmb_inptdddl2width ;
  967. cmb_inptdddl3.attribute ("width") = (cmb_inptdddl3.visible ) ? icmb_inptdddl3width + 280 : icmb_inptdddl3width ;
  968. cmb_inptdddl4.attribute ("width") = (cmb_inptdddl4.visible ) ? icmb_inptdddl4width + 280 : icmb_inptdddl4width ;
  969. cmb_inptdddl5.attribute ("width") = (cmb_inptdddl5.visible ) ? icmb_inptdddl5width + 280 : icmb_inptdddl5width ;
  970. cmb_inptdddl1.attribute ("left" ) = (cmb_inptdddl1.visible ) ? icmb_inptdddl1left - 280 : icmb_inptdddl1left ;
  971. cmb_inptdddl2.attribute ("left" ) = (cmb_inptdddl2.visible ) ? icmb_inptdddl2left - 280 : icmb_inptdddl2left ;
  972. cmb_inptdddl3.attribute ("left" ) = (cmb_inptdddl3.visible ) ? icmb_inptdddl3left - 280 : icmb_inptdddl3left ;
  973. cmb_inptdddl4.attribute ("left" ) = (cmb_inptdddl4.visible ) ? icmb_inptdddl4left - 280 : icmb_inptdddl4left ;
  974. cmb_inptdddl5.attribute ("left" ) = (cmb_inptdddl5.visible ) ? icmb_inptdddl5left - 280 : icmb_inptdddl5left ;
  975. // MainList의 값을 설정한다.
  976. //selectNodelist
  977. model.setValue("/root/main/inptinfo/dddl1" , (cmb_inptdddl1.visible ) ? ls_bigotext1 : "");
  978. model.setValue("/root/main/inptinfo/dddl2" , (cmb_inptdddl2.visible ) ? ls_bigotext2 : "");
  979. model.setValue("/root/main/inptinfo/dddl3" , (cmb_inptdddl3.visible ) ? ls_bigotext3 : "");
  980. model.setValue("/root/main/inptinfo/dddl4" , (cmb_inptdddl4.visible ) ? ls_bigotext4 : "");
  981. model.setValue("/root/main/inptinfo/dddl5" , (cmb_inptdddl5.visible ) ? ls_bigotext5 : "");
  982. model.setValue("/root/main/inptinfo/edit1" , (inpt_inptedit1.visible ) ? ls_bigotext1 : "");
  983. model.setValue("/root/main/inptinfo/edit2" , (inpt_inptedit2.visible ) ? ls_bigotext2 : "");
  984. model.setValue("/root/main/inptinfo/edit3" , (inpt_inptedit3.visible ) ? ls_bigotext3 : "");
  985. model.setValue("/root/main/inptinfo/edit4" , (inpt_inptedit4.visible ) ? ls_bigotext4 : "");
  986. model.setValue("/root/main/inptinfo/edit5" , (inpt_inptedit5.visible ) ? ls_bigotext5 : "");
  987. model.setValue("/root/main/inptinfo/checktext1" , (opt_checktext1.visible ) ? ls_checktext1 : "");
  988. model.setValue("/root/main/inptinfo/checktext2" , (opt_checktext2.visible ) ? ls_checktext2 : "");
  989. model.setValue("/root/main/inptinfo/checktext3" , (opt_checktext3.visible ) ? ls_checktext3 : "");
  990. model.setValue("/root/main/inptinfo/checktext4" , (opt_checktext4.visible ) ? ls_checktext4 : "");
  991. model.setValue("/root/main/inptinfo/checktext5" , (opt_checktext5.visible ) ? ls_checktext5 : "");
  992. model.setValue("/root/main/inptinfo/checkvalue1", (bool_checktext1.visible) ? ls_bigotext1 : "");
  993. model.setValue("/root/main/inptinfo/checkvalue2", (bool_checktext2.visible) ? ls_bigotext2 : "");
  994. model.setValue("/root/main/inptinfo/checkvalue3", (bool_checktext3.visible) ? ls_bigotext3 : "");
  995. model.setValue("/root/main/inptinfo/checkvalue4", (bool_checktext4.visible) ? ls_bigotext4 : "");
  996. model.setValue("/root/main/inptinfo/checkvalue5", (bool_checktext5.visible) ? ls_bigotext5 : "");
  997. // input popup의 DDDL LIST 를 설정한다.
  998. model.removenode("/root/main/inptinfo/dddlinfo1");
  999. model.makeNode ("/root/main/inptinfo/dddlinfo1");
  1000. model.removenode("/root/main/inptinfo/dddlinfo2");
  1001. model.makeNode ("/root/main/inptinfo/dddlinfo2");
  1002. model.removenode("/root/main/inptinfo/dddlinfo3");
  1003. model.makeNode ("/root/main/inptinfo/dddlinfo3");
  1004. model.removenode("/root/main/inptinfo/dddlinfo4");
  1005. model.makeNode ("/root/main/inptinfo/dddlinfo4");
  1006. model.removenode("/root/main/inptinfo/dddlinfo5");
  1007. model.makeNode ("/root/main/inptinfo/dddlinfo5");
  1008. if (cmb_inptdddl1.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo1", ls_bigogubun1, ls_bigotext1, "/root/main/inptinfo/dddl1"); }
  1009. if (cmb_inptdddl2.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo2", ls_bigogubun2, ls_bigotext2, "/root/main/inptinfo/dddl2"); }
  1010. if (cmb_inptdddl3.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo3", ls_bigogubun3, ls_bigotext3, "/root/main/inptinfo/dddl3"); }
  1011. if (cmb_inptdddl4.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo4", ls_bigogubun4, ls_bigotext4, "/root/main/inptinfo/dddl4"); }
  1012. if (cmb_inptdddl5.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo5", ls_bigogubun5, ls_bigotext5, "/root/main/inptinfo/dddl5"); }
  1013. model.refresh();
  1014. return;
  1015. }
  1016. // input popup의 DDDL 정보를 설정한다.
  1017. function setdddlinfo(ps_path, ps_bigogubun, ps_bigotext, ps_dddlpath)
  1018. {
  1019. var lx_dddlinfo = instance1.selectSingleNode(ps_path);
  1020. var lx_refnode = instance1.selectNodes(sSELREFLIST_PATH + "[gubun='" + ps_bigogubun + "']");
  1021. while(lx_node = lx_refnode.nextNode())
  1022. {
  1023. lx_dddlinfo.appendChild(lx_node);
  1024. if ( ps_bigotext != ""
  1025. && ps_bigotext == lx_node.selectSingleNode("codename").text)
  1026. {
  1027. model.setValue(ps_dddlpath, lx_node.selectSingleNode("code").text);
  1028. }
  1029. }
  1030. }
  1031. /**
  1032. * @---------------------------------------------------
  1033. * @creat : 20110101
  1034. * @author : 최원돈
  1035. * @desc : 치과기록 메인기록 onmousedown Event
  1036. * @---------------------------------------------------
  1037. */
  1038. function fMainlistOnmousedown()
  1039. {
  1040. grup_inptrec.attribute("visibility") = "hidden";
  1041. if ( grd_mainlist.isCell(event.target)
  1042. && grd_mainlist.mouserow >= grd_mainlist.fixedrows)
  1043. {
  1044. if (event.button == "3") // 오른쪽 마우스 버튼 => popup menu
  1045. {
  1046. setPopupMenu("grd_mainlist", false, "/root/popupmenu/recmenuinfo/menulist/item", "name", "func");
  1047. }
  1048. else if (event.button == "1") // 왼쪽 마우스 버튼
  1049. {
  1050. if (grd_mainlist.mouseCol == grd_mainlist.colRef("col1"))
  1051. {
  1052. var ls_inptflag = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("inptflag"));
  1053. switch (ls_inptflag)
  1054. {
  1055. case "FT" : // FTP 일 경우 다운로드
  1056. if (grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("rgstdrid")) == "")
  1057. {
  1058. messageBox("파일보기는 저장 후 가능합니다.", "E999");
  1059. return;
  1060. }
  1061. var filepath = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("filepath"));
  1062. var filenm = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("filenm"));
  1063. creatMainListFtpFold(false);
  1064. var localfile = sFTPFOLD+"\\"+filenm;
  1065. model.download(getActionURL("TRMRE00102")+"&filepath="+filepath, localfile, false, false);
  1066. window.exec(localfile);
  1067. break;
  1068. case "IM" : // IMAGE 일 경우 IMAGE POPUP을 이용하여 수정
  1069. var li_row = grd_mainlist.mouseRow;
  1070. if (!chkValidationModifyMainlist(li_row, false)) // Main List 수정 가능여부 확인
  1071. {
  1072. return true;
  1073. }
  1074. // 현재 담고있는 이미지가 있다면 삭제
  1075. model.removenode("/root/temp/imgerec");
  1076. model.makeNode("/root/temp/imgerec");
  1077. // TEMP Node를 생성한다.
  1078. model.copynode("/root/temp/imgerec", "/root/temp/imgerecbackup")
  1079. model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemno" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemno")));
  1080. model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemcd" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemcd")));
  1081. model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemkind" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemkind")));
  1082. model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemlevlno", grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemlevlno")));
  1083. model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemnm" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemnm")));
  1084. model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemlevlcd", grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemlevlcd")));
  1085. model.setvalue("/root/temp/imgerec/recinfo/recitem/reccnts" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("reccnts")));
  1086. model.setvalue("/root/temp/imgerec/recinfo/recitem/recimge" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("recimge")));
  1087. model.setvalue("/root/temp/imgerec/recinfo/recitem/rowno" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rowno")));
  1088. model.setvalue("/root/temp/imgerec/recinfo/recitem/colno" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("colno")));
  1089. // 그림챠트 popup Call
  1090. setParameter("openmode", "DentiRec");
  1091. modalUrl("../../../emr/medirecweb/xrw/SMMMR03600_이미지편집.xrw",1,100,100,"이미지편집");
  1092. // 그림챠트에서 입력한 정보를 가져온다.
  1093. var lx_recitemnode = instance1.selectSingleNode("/root/temp/imgerec/recinfo").childNodes;
  1094. var li_recitemcnt = lx_recitemnode.length;
  1095. var lb_refresh = false;
  1096. var i = lx_recitemnode.length - 1; // 수정은 무조건 마지막 한 건
  1097. var lx_node = lx_recitemnode.item(i);
  1098. setMainlistOneRow(li_row, "IM", "col1", "그림챠트", false, false);
  1099. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemno" )) = lx_node.selectSingleNode("degnitemno").text;
  1100. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemcd" )) = lx_node.selectSingleNode("degnitemcd").text;
  1101. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemkind" )) = lx_node.selectSingleNode("degnitemkind").text;
  1102. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemlevlno" )) = parseInt(lx_node.selectSingleNode("degnitemlevlno").text);
  1103. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemnm" )) = lx_node.selectSingleNode("degnitemnm").text;
  1104. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemlevlcd" )) = lx_node.selectSingleNode("degnitemlevlcd").text;
  1105. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("reccnts" )) = lx_node.selectSingleNode("reccnts").text;
  1106. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("recimge" )) = lx_node.selectSingleNode("recimge").text.replace(/\r\n/g, "");
  1107. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("rowno" )) = lx_node.selectSingleNode("rowno").text;
  1108. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("colno" )) = lx_node.selectSingleNode("colno").text;
  1109. if (model.getValue("/root/main/condEtc/imgratio") > 0)
  1110. {
  1111. var la_value = getMainlistImg(lx_recitemnode.item(i).selectSingleNode("recimge").text, li_row); // Grid에 맞는 이미지와 이미지 높이를 반환한다.
  1112. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("etcimgheight")) = la_value[0]; // 이미지 높이를 저장한다.
  1113. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("etcimgfilepath")) = la_value[1]; // 이미지 파일 경로를 저장한다.
  1114. setMainlistOneRow(li_row, "IM", "col2", "", false, false);
  1115. }
  1116. else
  1117. {
  1118. setMainlistOneRow(li_row, "IM", "col2", grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemnm")), false, false);
  1119. }
  1120. setMainlistAutoResize(true, true, true); // 메인의 column 높이를 자동으로 설정한다.
  1121. break;
  1122. default :
  1123. break;
  1124. }
  1125. }
  1126. else if (grd_mainlist.mouseCol == grd_mainlist.colRef("col2"))
  1127. {
  1128. var ls_inptflag = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("inptflag"));
  1129. switch (ls_inptflag)
  1130. {
  1131. case "W" : // 술식일 경우 POPUP OBJECT 를 사용하여 입력
  1132. var li_row = grd_mainlist.mouseRow;
  1133. if (!chkValidationModifyMainlist(li_row, false) // Main List 수정 가능여부 확인 : 진료(처방)일자와 기록 일자가 동일해야 수정가능
  1134. || grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("popinptyn")) != "Y")
  1135. {
  1136. return;
  1137. }
  1138. grup_inptrec.attribute("top") = (event.clientY < 520) ? event.clientY : event.clientY - 160;
  1139. setinptPopup(li_row); // input popup의 object 를 설정한다.
  1140. grup_inptrec.attribute("visibility") = "visible";
  1141. break;
  1142. default :
  1143. break;
  1144. }
  1145. }
  1146. }
  1147. }
  1148. }
  1149. /**
  1150. * @---------------------------------------------------
  1151. * @creat : 20110101
  1152. * @author : 최원돈
  1153. * @desc : 메인 첨부파일을 위한 폴더를 생성한다.
  1154. * @---------------------------------------------------
  1155. */
  1156. function creatMainListFtpFold(pb_recreate)
  1157. {
  1158. // 이미지를 저장할 로컬 폴더 생성
  1159. fExistFolder(sIMAGEFOLD1, false);
  1160. fExistFolder(sIMAGEFOLD2, false);
  1161. fExistFolder(sIMAGEFOLD3, false);
  1162. fExistFolder(sFTPFOLD4 , false);
  1163. fExistFolder(sFTPFOLD , false);
  1164. }
  1165. // Flag 별 화면 설정
  1166. function setwrdflag()
  1167. {
  1168. ls_flagtxt = document.controls.item(event.target).text;
  1169. out_wrdflag.value = aRECFLAGCD[ls_flagtxt];
  1170. out_wrdflagnm.value = ls_flagtxt;
  1171. switch (ls_flagtxt)
  1172. {
  1173. case "진단" :
  1174. btn_diagcopy.disabled = false;
  1175. btn_prcp.disabled = true;
  1176. break;
  1177. case "계획" :
  1178. btn_diagcopy.disabled = true;
  1179. btn_prcp.disabled = false;
  1180. break;
  1181. case "진료" :
  1182. btn_diagcopy.disabled = true;
  1183. btn_prcp.disabled = false;
  1184. break;
  1185. default :
  1186. btn_diagcopy.disabled = true;
  1187. btn_prcp.disabled = true;
  1188. break;
  1189. }
  1190. setFoldReset(); // 폴더를 초기화(선택취소)한다.
  1191. if (model.getValue("/root/main/cond/foldinfo/bizflag") == "A")
  1192. {
  1193. cmb_wrddept.visible = true;
  1194. if (model.getValue("/root/main/cond/foldinfo/deptcd") == "") {
  1195. model.setValue("/root/main/cond/foldinfo/deptcd", getUserInfo("dutplcecd"));
  1196. }
  1197. }
  1198. else
  1199. {
  1200. cmb_wrddept.visible = false;
  1201. }
  1202. fGetfoldinfo(); //술식어폴더를 조회한다.
  1203. fGetRecWordinfo(); //기록용 술식어및폴더별술식어를 조회한다.
  1204. ipt_student.value = "";
  1205. ipt_tutor.value = "";
  1206. if (rdo_inputflag.value != "M") // S
  1207. {
  1208. model.setFocus("ipt_recnm");
  1209. }
  1210. else // M(멀티)
  1211. {
  1212. model.setFocus("txt_recnm");
  1213. }
  1214. return;
  1215. }
  1216. /**
  1217. * @---------------------------------------------------
  1218. * @creat : 20110101
  1219. * @author : 최원돈
  1220. * @desc : 폴더를 초기화(선택취소)한다.
  1221. * @---------------------------------------------------
  1222. */
  1223. function setFoldReset()
  1224. {
  1225. model.setValue("/root/main/cond/selectIndxcd", "");
  1226. model.setValue("/root/main/cond/wordinfo/wmid", "0");
  1227. btn_wmid.attribute("class")="btn2_letter4";
  1228. grp_foldtree.visible = false;
  1229. }
  1230. /////////////////////////////////////////////////////////////////////////////////////
  1231. // 유형별 입력 Start
  1232. /////////////////////////////////////////////////////////////////////////////////////
  1233. /**
  1234. * @---------------------------------------------------
  1235. * @creat : 20110101
  1236. * @author : 최원돈
  1237. * @desc : 메인에 직접입력
  1238. * @---------------------------------------------------
  1239. */
  1240. function inputRecinfo()
  1241. {
  1242. var li_row = grd_mainlist.row;
  1243. var ls_inptflag = grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag"));
  1244. var ls_rectxt = ls_inptflag=="T" ? grd_mainlist.valueMatrix(li_row, grd_mainlist.col) : trim(grd_mainlist.valueMatrix(li_row, grd_mainlist.col));
  1245. if (ls_inptflag == 'W') // 술식어 이면 술식어기록도 수정해야 함.
  1246. {
  1247. grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("wrdrec")) = ls_rectxt;
  1248. }
  1249. setMainlistOneRow(li_row, ls_inptflag, "col" + (grd_mainlist.col - (grd_mainlist.colref("col1") - 1)), ls_rectxt, false, true);
  1250. if (grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("rgstdt")) != "")
  1251. {
  1252. grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("status")) = "m";
  1253. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  1254. }
  1255. return;
  1256. }
  1257. /**
  1258. * @---------------------------------------------------
  1259. * @creat : 20110101
  1260. * @author : 최원돈
  1261. * @desc : Main Grid 전체 Style 설정
  1262. * @---------------------------------------------------
  1263. */
  1264. function setMainlistAll(pb_refresh) //pi_rowcnt, ps_inptflag, ps_colid, ps_value, pb_refreshyn
  1265. {
  1266. var li_rows = grd_mainlist.rows;
  1267. if (li_rows < 1)
  1268. {
  1269. return;
  1270. }
  1271. //Rec 정보 설정
  1272. setRecinfo(0, li_rows-1, "", true, false);
  1273. setMainlistAutoResize(false, pb_refresh, true); // 메인의 column 높이를 자동으로 설정한다.
  1274. }
  1275. /**
  1276. * @---------------------------------------------------
  1277. * @creat : 20110101
  1278. * @author : 최원돈
  1279. * @desc : 메인에 InptFlag1 기록정보 설정
  1280. * @---------------------------------------------------
  1281. */
  1282. function insertInptFlag1Rec()
  1283. {
  1284. var li_row = grd_mainlist.row; // Title은 Top에 위치
  1285. setMainlistOneRow(li_row, "F1", "col1", "<<치과기록>>", true, true);
  1286. }
  1287. /**
  1288. * @---------------------------------------------------
  1289. * @creat : 20110101
  1290. * @author : 최원돈
  1291. * @desc : 메인에 InptFlag2 기록정보 설정
  1292. * @---------------------------------------------------
  1293. */
  1294. function insertInptFlag2Rec(pb_refreshyn)
  1295. {
  1296. var li_row = grd_mainlist.row;
  1297. setMainlistOneRow(li_row, "F2", "col1", model.getValue("/root/main/cond/recinfo/orddd").toDate().getDateFormat("YYYY.MM.DD ") + getUserInfo("dutplcenm"), true, pb_refreshyn);
  1298. }
  1299. /**
  1300. * @---------------------------------------------------
  1301. * @creat : 20110101
  1302. * @author : 최원돈
  1303. * @desc : 메인에 InptFlag3 기록정보 설정
  1304. * @---------------------------------------------------
  1305. */
  1306. function insertInptFlag3Rec(pb_refreshyn)
  1307. {
  1308. var li_row = grd_mainlist.row;
  1309. setMainlistOneRow(li_row, "F3", "col1", out_wrdflagnm.value, true, pb_refreshyn);
  1310. }
  1311. /**
  1312. * @---------------------------------------------------
  1313. * @creat : 20110101
  1314. * @author : 최원돈
  1315. * @desc : 메인에 InptFlag4 기록정보 설정
  1316. * @---------------------------------------------------
  1317. */
  1318. function insertInptFlag4Rec(pb_refreshyn)
  1319. {
  1320. var li_row = grd_mainlist.row;
  1321. var ls_value = model.getValue(sSELFOLDLIST_PATH+"[" + (parseInt(iFocusIndx) + 1) + "]/titlepath");
  1322. setMainlistOneRow(li_row, "F4", "col1", ls_value, true, pb_refreshyn);
  1323. }
  1324. /**
  1325. * @---------------------------------------------------
  1326. * @creat : 20110101
  1327. * @author : 최원돈
  1328. * @desc : 메인에 INPUT 기록정보 설정
  1329. * @---------------------------------------------------
  1330. */
  1331. function insertInputRec()
  1332. {
  1333. if(trim(ipt_recnm.currentText) == "")
  1334. {
  1335. return;
  1336. }
  1337. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  1338. var li_row = grd_mainlist.row;
  1339. setMainlistOneRow(li_row, "I", "col2", trim(ipt_recnm.currentText), true, true);
  1340. ipt_recnm.value = "";
  1341. }
  1342. /**
  1343. * @---------------------------------------------------
  1344. * @creat : 20110101
  1345. * @author : 최원돈
  1346. * @desc : 메인에 INPUT (TEXT) 기록정보 설정
  1347. * @---------------------------------------------------
  1348. */
  1349. function insertTextInputRec()
  1350. {
  1351. if( trim(ipt_recnm.currentText) == ""
  1352. && trim(txt_recnm.currentText) == "")
  1353. {
  1354. return;
  1355. }
  1356. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  1357. var li_row = grd_mainlist.row;
  1358. var ls_ipttxt = "";
  1359. if (rdo_inputflag.value == "S") // 싱글일 경우
  1360. {
  1361. ls_ipttxt = trim(ipt_recnm.currentText);
  1362. ipt_recnm.value = "";
  1363. }
  1364. else
  1365. {
  1366. ls_ipttxt = trim(txt_recnm.currentText);
  1367. txt_recnm.value = "";
  1368. }
  1369. setMainlistOneRow(li_row, "I", "col2", ls_ipttxt, true, true);
  1370. }
  1371. /**
  1372. * @---------------------------------------------------
  1373. * @creat : 20110101
  1374. * @author : 최원돈
  1375. * @desc : 치과기록 메인기록의 콤보박스 팝업내용을 메인기록에 적용하기
  1376. * @---------------------------------------------------
  1377. */
  1378. function fInputRecPop()
  1379. {
  1380. grup_inptrec.attribute("visibility") = "hidden";
  1381. var li_row = grd_mainlist.row;
  1382. ls_content = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("content" ));
  1383. ls_bigostyle1 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle" ));
  1384. ls_bigogubun1 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun" ));
  1385. ls_checktext1 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext" ));
  1386. ls_bigostyle2 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle2"));
  1387. ls_bigogubun2 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun2"));
  1388. ls_checktext2 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext2"));
  1389. ls_bigostyle3 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle3"));
  1390. ls_bigogubun3 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun3"));
  1391. ls_checktext3 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext3"));
  1392. ls_bigostyle4 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle4"));
  1393. ls_bigogubun4 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun4"));
  1394. ls_checktext4 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext4"));
  1395. ls_bigostyle5 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle5"));
  1396. ls_bigogubun5 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun5"));
  1397. ls_checktext5 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext5"));
  1398. // MainList의 값을 설정한다.
  1399. if (cmb_inptdddl1.visible ) { ls_bigotext1 = model.getValue("/root/main/inptinfo/dddlnm1" ); }
  1400. if (cmb_inptdddl2.visible ) { ls_bigotext2 = model.getValue("/root/main/inptinfo/dddlnm2" ); }
  1401. if (cmb_inptdddl3.visible ) { ls_bigotext3 = model.getValue("/root/main/inptinfo/dddlnm3" ); }
  1402. if (cmb_inptdddl4.visible ) { ls_bigotext4 = model.getValue("/root/main/inptinfo/dddlnm4" ); }
  1403. if (cmb_inptdddl5.visible ) { ls_bigotext5 = model.getValue("/root/main/inptinfo/dddlnm5" ); }
  1404. if (inpt_inptedit1.visible ) { ls_bigotext1 = model.getValue("/root/main/inptinfo/edit1" ); }
  1405. if (inpt_inptedit2.visible ) { ls_bigotext2 = model.getValue("/root/main/inptinfo/edit2" ); }
  1406. if (inpt_inptedit3.visible ) { ls_bigotext3 = model.getValue("/root/main/inptinfo/edit3" ); }
  1407. if (inpt_inptedit4.visible ) { ls_bigotext4 = model.getValue("/root/main/inptinfo/edit4" ); }
  1408. if (inpt_inptedit5.visible ) { ls_bigotext5 = model.getValue("/root/main/inptinfo/edit5" ); }
  1409. if (bool_checktext1.visible) { ls_bigotext1 = model.getValue("/root/main/inptinfo/checkvalue1"); }
  1410. if (bool_checktext2.visible) { ls_bigotext2 = model.getValue("/root/main/inptinfo/checkvalue2"); }
  1411. if (bool_checktext3.visible) { ls_bigotext3 = model.getValue("/root/main/inptinfo/checkvalue3"); }
  1412. if (bool_checktext4.visible) { ls_bigotext4 = model.getValue("/root/main/inptinfo/checkvalue4"); }
  1413. if (bool_checktext5.visible) { ls_bigotext5 = model.getValue("/root/main/inptinfo/checkvalue5"); }
  1414. // 1. 출력내용에 항목 추가
  1415. var ls_txt = ls_content;
  1416. // 2. 내용에 공백 추가
  1417. if ( ls_checktext1 != ""
  1418. || ls_bigostyle1 != "")
  1419. {
  1420. ls_txt += sLISTTMP;
  1421. }
  1422. // 기록내용 작성
  1423. var ls_rectxt = ls_txt;
  1424. // 3. 내용에 텍스트 추가
  1425. if (ls_checktext1 != "")
  1426. {
  1427. ls_txt += ls_checktext1;
  1428. }
  1429. // 4. 내용에 언드라인 또는 대괄호 추가
  1430. if (ls_bigostyle1 == "DDDL")
  1431. {
  1432. ls_txt += "【" + ls_bigotext1 + " ▼】";
  1433. }
  1434. else if (ls_bigostyle1 == "EDIT")
  1435. {
  1436. ls_txt += "【" + ((ls_bigotext1=="")?"_":ls_bigotext1) + "】";
  1437. }
  1438. else if (ls_bigostyle1 == "CHECKBOX")
  1439. {
  1440. ls_txt += "【" + ((ls_bigotext1==""||ls_bigotext1=="N")?" ":"√") + "】";
  1441. }
  1442. // 기록내용 추가
  1443. if (ls_bigostyle1 == "TEXT")
  1444. {
  1445. ls_rectxt += ((ls_checktext1=="")?"":ls_checktext1 + " ");
  1446. }
  1447. else if (ls_bigotext1 != "")
  1448. {
  1449. if (ls_bigostyle1 == "CHECKBOX")
  1450. {
  1451. ls_rectxt += (ls_bigotext1=="Y" && ls_checktext1!="" )?ls_checktext1 + " ":"";
  1452. }
  1453. else
  1454. {
  1455. ls_rectxt += ((ls_checktext1=="")?"":ls_checktext1 + " ") + ls_bigotext1 + " ";
  1456. }
  1457. }
  1458. // 내용에 텍스트 추가
  1459. if (ls_checktext2 != "")
  1460. {
  1461. ls_txt += ls_checktext2;
  1462. }
  1463. // 내용에 언드라인 또는 대괄호 추가
  1464. if (ls_bigostyle2 == "DDDL")
  1465. {
  1466. ls_txt += "【" + ls_bigotext2 + " ▼】";
  1467. }
  1468. else if (ls_bigostyle2 == "EDIT")
  1469. {
  1470. ls_txt += "【" + ((ls_bigotext2=="")?"_":ls_bigotext2) + "】";
  1471. }
  1472. else if (ls_bigostyle2 == "CHECKBOX")
  1473. {
  1474. ls_txt += "【" + ((ls_bigotext2==""||ls_bigotext2=="N")?" ":"√") + "】";
  1475. }
  1476. // 기록내용 추가
  1477. if (ls_bigostyle2 == "TEXT")
  1478. {
  1479. ls_rectxt += ((ls_checktext2=="")?"":ls_checktext2 + " ");
  1480. }
  1481. else if (ls_bigotext2 != "")
  1482. {
  1483. if (ls_bigostyle2 == "CHECKBOX")
  1484. {
  1485. ls_rectxt += (ls_bigotext2=="Y" && ls_checktext2!="" )?ls_checktext2 + " ":"";
  1486. }
  1487. else
  1488. {
  1489. ls_rectxt += ((ls_checktext2=="")?"":ls_checktext2 + " ") + ls_bigotext2 + " ";
  1490. }
  1491. }
  1492. // 내용에 텍스트 추가
  1493. if (ls_checktext3 != "")
  1494. {
  1495. ls_txt += ls_checktext3;
  1496. }
  1497. // 내용에 언드라인 또는 대괄호 추가
  1498. if (ls_bigostyle3 == "DDDL")
  1499. {
  1500. ls_txt += "【" + ls_bigotext3 + " ▼】";
  1501. }
  1502. else if (ls_bigostyle3 == "EDIT")
  1503. {
  1504. ls_txt += "【" + ((ls_bigotext3=="")?"_":ls_bigotext3) + "】";
  1505. }
  1506. else if (ls_bigostyle3 == "CHECKBOX")
  1507. {
  1508. ls_txt += "【" + ((ls_bigotext3==""||ls_bigotext3=="N")?" ":"√") + "】";
  1509. }
  1510. // 기록내용 추가
  1511. if (ls_bigostyle3 == "TEXT")
  1512. {
  1513. ls_rectxt += ((ls_checktext3=="")?"":ls_checktext3 + " ");
  1514. }
  1515. else if (ls_bigotext3 != "")
  1516. {
  1517. if (ls_bigostyle3 == "CHECKBOX")
  1518. {
  1519. ls_rectxt += (ls_bigotext3=="Y" && ls_checktext3!="" )?ls_checktext3 + " ":"";
  1520. }
  1521. else
  1522. {
  1523. ls_rectxt += ((ls_checktext3=="")?"":ls_checktext3 + " ") + ls_bigotext3 + " ";
  1524. }
  1525. }
  1526. // 내용에 텍스트 추가
  1527. if (ls_checktext4 != "")
  1528. {
  1529. ls_txt += ls_checktext4;
  1530. }
  1531. // 내용에 언드라인 또는 대괄호 추가
  1532. if (ls_bigostyle4 == "DDDL")
  1533. {
  1534. ls_txt += "【" + ls_bigotext4 + " ▼】";
  1535. }
  1536. else if (ls_bigostyle4 == "EDIT")
  1537. {
  1538. ls_txt += "【" + ((ls_bigotext4=="")?"_":ls_bigotext4) + "】";
  1539. }
  1540. else if (ls_bigostyle4 == "CHECKBOX")
  1541. {
  1542. ls_txt += "【" + ((ls_bigotext4==""||ls_bigotext4=="N")?" ":"√") + "】";
  1543. }
  1544. // 기록내용 추가
  1545. if (ls_bigostyle4 == "TEXT")
  1546. {
  1547. ls_rectxt += ((ls_checktext4=="")?"":ls_checktext4 + " ");
  1548. }
  1549. else if (ls_bigotext4 != "")
  1550. {
  1551. if (ls_bigostyle4 == "CHECKBOX")
  1552. {
  1553. ls_rectxt += (ls_bigotext4=="Y" && ls_checktext4!="" )?ls_checktext4 + " ":"";
  1554. }
  1555. else
  1556. {
  1557. ls_rectxt += ((ls_checktext4=="")?"":ls_checktext4 + " ") + ls_bigotext4 + " ";
  1558. }
  1559. }
  1560. // 내용에 텍스트 추가
  1561. if (ls_checktext5 != "")
  1562. {
  1563. ls_txt += ls_checktext5;
  1564. }
  1565. // 내용에 언드라인 또는 대괄호 추가
  1566. if (ls_bigostyle5 == "DDDL")
  1567. {
  1568. ls_txt += "【" + ls_bigotext5 + " ▼】";
  1569. }
  1570. else if (ls_bigostyle5 == "EDIT")
  1571. {
  1572. ls_txt += "【" + ((ls_bigotext5=="")?"_":ls_bigotext5) + "】";
  1573. }
  1574. else if (ls_bigostyle5 == "CHECKBOX")
  1575. {
  1576. ls_txt += "【" + ((ls_bigotext5==""||ls_bigotext5=="N")?" ":"√") + "】";
  1577. }
  1578. // 기록내용 추가
  1579. if (ls_bigostyle5 == "TEXT")
  1580. {
  1581. ls_rectxt += ((ls_checktext5=="")?"":ls_checktext5 + " ");
  1582. }
  1583. else if (ls_bigotext5 != "")
  1584. {
  1585. if (ls_bigostyle5 == "CHECKBOX")
  1586. {
  1587. ls_rectxt += (ls_bigotext5=="Y" && ls_checktext5!="" )?ls_checktext5 + " ":"";
  1588. }
  1589. else
  1590. {
  1591. ls_rectxt += ((ls_checktext5=="")?"":ls_checktext5 + " ") + ls_bigotext5 + " ";
  1592. }
  1593. }
  1594. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext" )) = ls_bigotext1;
  1595. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext2")) = ls_bigotext2;
  1596. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext3")) = ls_bigotext3;
  1597. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext4")) = ls_bigotext4;
  1598. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext5")) = ls_bigotext5;
  1599. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wrdrec" )) = trim(ls_rectxt);
  1600. setMainlistOneRow(li_row, "W", "col2", ls_txt, false, true);
  1601. if (grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("rgstdt")) != "")
  1602. {
  1603. grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("status")) = "m";
  1604. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  1605. }
  1606. }
  1607. /**
  1608. * @---------------------------------------------------
  1609. * @creat : 20110101
  1610. * @author : 최원돈
  1611. * @desc : 메인에 치식 기록정보 추가설정 [DENTAL]
  1612. * @---------------------------------------------------
  1613. */
  1614. function insertDentalOutputRec()
  1615. {
  1616. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  1617. var ls_detlt = opener.ivw_dentifmla.window.javascript.getdetlt(); // 좌상 치식
  1618. var ls_detrt = opener.ivw_dentifmla.window.javascript.getdetrt(); // 우상 치식
  1619. var ls_detlb = opener.ivw_dentifmla.window.javascript.getdetlb(); // 좌하 치식
  1620. var ls_detrb = opener.ivw_dentifmla.window.javascript.getdetrb(); // 우하 치식
  1621. if (rdo_inputflag.value == "S") // 싱글일 경우
  1622. {
  1623. var ls_ipttxt = trim(ipt_recnm.currentText);
  1624. ipt_recnm.value = "";
  1625. }
  1626. else
  1627. {
  1628. var ls_ipttxt = trim(txt_recnm.currentText);
  1629. txt_recnm.value = "";
  1630. }
  1631. if (ls_ipttxt == "")
  1632. {
  1633. var lb_existsTxt = false;
  1634. }
  1635. else
  1636. {
  1637. var lb_existsTxt = true;
  1638. }
  1639. setMainlistOneRow(grd_mainlist.row, "D", "col2", ls_detlt + "│" + ls_detrt + "\n────────┼────────\n" + ls_detlb + "│" + ls_detrb, true, !lb_existsTxt);
  1640. opener.ivw_dentifmla.window.javascript.selectBtnTab(0); // 치식탭1 선택
  1641. if (lb_existsTxt)
  1642. {
  1643. setMainlistOneRow(grd_mainlist.row, "D", "col3", ls_ipttxt, false, true);
  1644. }
  1645. insertWordPopupMenu(); //'입력' 클릭 시 메인에 삽입
  1646. }
  1647. /**
  1648. * @---------------------------------------------------
  1649. * @creat : 20110101
  1650. * @author : 최원돈
  1651. * @desc : 메인에 Ftp 기록정보 설정
  1652. * @---------------------------------------------------
  1653. */
  1654. function insertFtpRec()
  1655. {
  1656. var maxcount = uploadchk.attribute("filecount");
  1657. var maxsize = uploadchk.attribute("filesize");
  1658. var ls_files = window.fileDialog("open","|",true); //,"","*", "모든 파일, (*.*)|*.*"); // ("open","|","true","","pdf","Adobe PDF 파일(*.pdf)|*.pdf");
  1659. var ls_filelist = ls_files.split("|");
  1660. var ls_fileNM = "";
  1661. var ls_filenm = "";
  1662. var ls_filepath = "";
  1663. if (ls_filelist[0] == "") // 선택 정보가 없으면 return
  1664. {
  1665. return;
  1666. }
  1667. for(i = 0 ; i < ls_filelist.length ; i++ )
  1668. {
  1669. ls_fileNM = ls_filelist[i].split("\\"); //파일 경로에서 이름을 자른다.
  1670. ls_filenm = ls_fileNM[ls_fileNM.length-1];
  1671. ls_filepath = ls_filelist[i];
  1672. var li_newrow = grd_mainlist.row;
  1673. model.setValue("/root/main/filepath", ls_filepath);
  1674. var fileSize = uploadchk.getFileSize(0);
  1675. if (fileSize==0) {
  1676. messageBox("파일용량이 0 이거나 또는 지정된 경로에 없는 파일입니다.\n"+ ls_filepath, "E999");
  1677. return;
  1678. }
  1679. if (!checkFileSize(uploadchk)){
  1680. messageBox("파일 크기가 최대치("+ (maxsize / 1048576) +"MB)를", "E003");
  1681. return;
  1682. }
  1683. }
  1684. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  1685. var li_row = grd_mainlist.row;
  1686. var lb_refresh = false;
  1687. for(i = 0 ; i < ls_filelist.length ; i++ )
  1688. {
  1689. ls_fileNM = ls_filelist[i].split("\\"); //파일 경로에서 이름을 자른다.
  1690. ls_filenm = ls_fileNM[ls_fileNM.length-1];
  1691. ls_filepath = ls_filelist[i];
  1692. setMainlistOneRow(li_row + i, "FT", "col2", ls_filenm, true, false);
  1693. var li_newrow = grd_mainlist.row;
  1694. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("filenm")) = ls_filenm;
  1695. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("filepath")) = ls_filepath;
  1696. if (i == (ls_filelist.length - 1)) // 마지막에 refresh()
  1697. {
  1698. lb_refresh = true;
  1699. }
  1700. setMainlistOneRow(li_newrow, "FT", "col1", "첨부파일", false, lb_refresh);
  1701. }
  1702. }
  1703. /**
  1704. * @---------------------------------------------------
  1705. * @creat : 20110101
  1706. * @author : 최원돈
  1707. * @desc : 치과기록PMH조회화면 CALL
  1708. * @---------------------------------------------------
  1709. */
  1710. function callPMH()
  1711. {
  1712. // // 그림챠트 popup Call
  1713. // setParameter("openmode", "DentiRec");
  1714. open("SMMRE00800");
  1715. }
  1716. /**
  1717. * @---------------------------------------------------
  1718. * @creat : 20110101
  1719. * @author : 최원돈
  1720. * @desc : 메인에 Image 기록정보 설정
  1721. * @---------------------------------------------------
  1722. */
  1723. function insertImageRec()
  1724. {
  1725. // 현재 담고있는 이미지가 있다면 삭제
  1726. model.removenode("/root/temp/imgerec/recinfo");
  1727. model.makeNode("/root/temp/imgerec/recinfo");
  1728. // 그림챠트 popup Call
  1729. setParameter("openmode", "DentiRec");
  1730. modalUrl("../../../emr/medirecweb/xrw/SMMMR03600_이미지편집.xrw",1,100,100,"이미지편집");
  1731. // 그림챠트에서 입력한 정보를 가져온다.
  1732. var lx_recitemnode = instance1.selectSingleNode("/root/temp/imgerec/recinfo").childNodes;
  1733. var li_recitemcnt = lx_recitemnode.length;
  1734. var lb_refresh = false;
  1735. for (var i=0; i <li_recitemcnt; i++)
  1736. {
  1737. var lx_node = lx_recitemnode.item(i);
  1738. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  1739. var li_row = grd_mainlist.row;
  1740. setMainlistOneRow(li_row, "IM", "col1", "그림챠트", true, false);
  1741. var li_newrow = grd_mainlist.row;
  1742. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemno" )) = lx_node.selectSingleNode("degnitemno").text;
  1743. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemcd" )) = lx_node.selectSingleNode("degnitemcd").text;
  1744. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemkind" )) = lx_node.selectSingleNode("degnitemkind").text;
  1745. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemlevlno")) = parseInt(lx_node.selectSingleNode("degnitemlevlno").text);
  1746. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemnm" )) = lx_node.selectSingleNode("degnitemnm").text;
  1747. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemlevlcd")) = lx_node.selectSingleNode("degnitemlevlcd").text;
  1748. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("reccnts" )) = lx_node.selectSingleNode("reccnts").text;
  1749. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("recimge" )) = lx_node.selectSingleNode("recimge").text;
  1750. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("rowno" )) = lx_node.selectSingleNode("rowno").text;
  1751. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("colno" )) = lx_node.selectSingleNode("colno").text;
  1752. if (model.getValue("/root/main/condEtc/imgratio") > 0)
  1753. {
  1754. var la_value = getMainlistImg(lx_recitemnode.item(i).selectSingleNode("recimge").text, li_newrow); //// Grid에 맞는 이미지와 이미지 높이를 반환한다.
  1755. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("etcimgheight")) = la_value[0]; // 이미지 높이 경로를 저장한다.
  1756. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("etcimgfilepath")) = la_value[1]; // 이미지 파일 경로를 저장한다.
  1757. setMainlistOneRow(li_newrow, "IM", "col2", "", false, false);
  1758. }
  1759. else
  1760. {
  1761. setMainlistOneRow(li_newrow, "IM", "col2", grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemnm")), false, false);
  1762. }
  1763. if (i == li_recitemcnt - 1) // 마지막 row 이면 refresh한다.
  1764. {
  1765. lb_refresh = true;
  1766. }
  1767. if (lb_refresh) // 마지막 row 이면 refresh한다.
  1768. {
  1769. setMainlistAutoResize(true, true, true); // 메인의 column 높이를 자동으로 설정한다.
  1770. }
  1771. }
  1772. }
  1773. // Grid에 맞는 축소이미지와 이미지 높이를 반환한다.(이미지와 column의 넓이로 비율을 구해서 이미지의 높이를 조정한다.)
  1774. function getMainlistImg(ps_recimge, pi_row)
  1775. {
  1776. var li_widthcol = getWidthColSum(2, 3); // 현재 col2~12의 넓이를 구한다.
  1777. obj_thumnail2.Clear();
  1778. obj_thumnail2.LoadImageBase64(ps_recimge); // Base64로 인코딩된 이미지를 로드한다.
  1779. obj_thumnail2.SetViewMode(0);
  1780. var strBase64 = obj_thumnail2.SaveImageBase64();
  1781. var sz = obj_thumnail2.GetImageSizeEx(false); // 원이미지=>GetImageSize(), 현재 이미지 => GetImageSizeEx(true:원 이미지/false:편집 이미지)
  1782. var la_arrSz = sz.split("|");
  1783. var li_widthimg = la_arrSz[0] * model.getValue("/root/main/condEtc/imgratio");
  1784. var li_heightimg = la_arrSz[1] * model.getValue("/root/main/condEtc/imgratio");
  1785. var ll_ratiowidth = li_widthimg;
  1786. var ll_ratioheight = li_heightimg;
  1787. if (li_widthimg > li_widthcol)
  1788. {
  1789. ll_ratiowidth = li_widthcol;
  1790. ll_ratioheight = Math.floor(li_heightimg * (li_widthcol / li_widthimg));
  1791. }
  1792. obj_thumnail.Clear();
  1793. obj_thumnail.SetViewMode(1);
  1794. obj_thumnail.SetControlSize(ll_ratiowidth, ll_ratioheight);
  1795. obj_thumnail.LoadImageBase64(strBase64);
  1796. var la_return = new Array();
  1797. la_return[0] = ll_ratioheight;
  1798. la_return[1] = sIMAGEFOLD + "\\SMMRE00100_grd_mainlist_" + pi_row + getCurrentDateTime() + ".jpg";
  1799. obj_thumnail.SaveImage(1, la_return[1]);
  1800. obj_thumnail.Clear();
  1801. obj_thumnail2.Clear();
  1802. return la_return;
  1803. }
  1804. // column들의 총 width 을 구한다.
  1805. function getWidthColSum(pi_colfrom, pi_colto)
  1806. {
  1807. var li_width = 0;
  1808. for (var i=pi_colfrom; i<=pi_colto; i++)
  1809. {
  1810. li_width += grd_mainlist.colwidth(grd_mainlist.colRef("col" + i));
  1811. }
  1812. return li_width;
  1813. }
  1814. /**
  1815. * @---------------------------------------------------
  1816. * @creat : 20110101
  1817. * @author : 최원돈
  1818. * @desc : 메인의 column 높이를 자동으로 설정한다.
  1819. * @---------------------------------------------------
  1820. */
  1821. function setMainlistAutoResize(pb_bottomyn, pb_refresh, pb_autoresize)
  1822. {
  1823. if (pb_refresh)
  1824. {
  1825. model.refresh();
  1826. }
  1827. if (pb_autoresize)
  1828. {
  1829. grd_mainlist.autoresize = true;
  1830. }
  1831. if (model.getValue("/root/main/condEtc/imgratio") > 0)
  1832. {
  1833. // IMAGE 를 모두 찾아서 Row 높이 설정을 현재 IMAGE 높이에 맞춰서 강제 조정해준다.
  1834. for (var li_row = 0; li_row < grd_mainlist.rows; li_row++)
  1835. {
  1836. if ( grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "IM"
  1837. && grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("etcimgheight")) != "")
  1838. {
  1839. grd_mainlist.rowheight(li_row) = grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("etcimgheight"));
  1840. }
  1841. }
  1842. }
  1843. if (pb_bottomyn)
  1844. {
  1845. grd_mainlist.bottomrow = grd_mainlist.row
  1846. }
  1847. }
  1848. /**
  1849. * @---------------------------------------------------
  1850. * @creat : 20110101
  1851. * @author : 최원돈
  1852. * @desc : 메인에 술식 기록정보 설정
  1853. * @---------------------------------------------------
  1854. */
  1855. function insertDatagridRec(pd_dragGrid, pi_dragRow, pb_startYn, pb_endYn)
  1856. {
  1857. grup_inptrec.attribute("visibility") = "hidden";
  1858. if (pb_startYn)
  1859. {
  1860. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  1861. }
  1862. var li_row = (grd_mainlist.row < 0) ? grd_mainlist.rows - 1 : grd_mainlist.row;
  1863. var li_newrow = li_row + 1;
  1864. setMainlistOneRow(li_row , "W", "col1" , "", true, false);
  1865. var li_wrpid = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("wrpid"));
  1866. var ls_content = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("content" ));
  1867. var ls_bigostyle1 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle" ));
  1868. var ls_bigogubun1 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun" ));
  1869. var ls_checktext1 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext" ));
  1870. var ls_bigostyle2 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle2"));
  1871. var ls_bigogubun2 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun2"));
  1872. var ls_checktext2 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext2"));
  1873. var ls_bigostyle3 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle3"));
  1874. var ls_bigogubun3 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun3"));
  1875. var ls_checktext3 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext3"));
  1876. var ls_bigostyle4 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle4"));
  1877. var ls_bigogubun4 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun4"));
  1878. var ls_checktext4 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext4"));
  1879. var ls_bigostyle5 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle5"));
  1880. var ls_bigogubun5 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun5"));
  1881. var ls_checktext5 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext5"));
  1882. // 1. 출력내용에 항목 추가
  1883. var ls_txt = ls_content;
  1884. // 2. 내용에 공백 추가
  1885. if ( ls_checktext1 != ""
  1886. || ls_bigostyle1 != "")
  1887. {
  1888. ls_txt += sLISTTMP;
  1889. }
  1890. // 3. 내용에 텍스트 추가
  1891. if (ls_checktext1 != "")
  1892. {
  1893. ls_txt += ls_checktext1;
  1894. }
  1895. // 4. 내용에 언드라인 또는 대괄호 추가
  1896. if (ls_bigostyle1 == "DDDL")
  1897. {
  1898. ls_txt += "【 ▼】";
  1899. }
  1900. else if (ls_bigostyle1 == "EDIT")
  1901. {
  1902. ls_txt += "【_】";
  1903. }
  1904. else if (ls_bigostyle1 == "CHECKBOX")
  1905. {
  1906. ls_txt += "【 】";
  1907. }
  1908. // 내용에 텍스트 추가
  1909. if (ls_checktext2 != "")
  1910. {
  1911. ls_txt += ls_checktext2;
  1912. }
  1913. // 내용에 언드라인 또는 대괄호 추가
  1914. if (ls_bigostyle2 == "DDDL")
  1915. {
  1916. ls_txt += "【 ▼】";
  1917. }
  1918. else if (ls_bigostyle2 == "EDIT")
  1919. {
  1920. ls_txt += "【_】";
  1921. }
  1922. else if (ls_bigostyle2 == "CHECKBOX")
  1923. {
  1924. ls_txt += "【 】";
  1925. }
  1926. // 내용에 텍스트 추가
  1927. if (ls_checktext3 != "")
  1928. {
  1929. ls_txt += ls_checktext3;
  1930. }
  1931. // 내용에 언드라인 또는 대괄호 추가
  1932. if (ls_bigostyle3 == "DDDL")
  1933. {
  1934. ls_txt += "【 ▼】";
  1935. }
  1936. else if (ls_bigostyle3 == "EDIT")
  1937. {
  1938. ls_txt += "【_】";
  1939. }
  1940. else if (ls_bigostyle3 == "CHECKBOX")
  1941. {
  1942. ls_txt += "【 】";
  1943. }
  1944. // 내용에 텍스트 추가
  1945. if (ls_checktext4 != "")
  1946. {
  1947. ls_txt += ls_checktext4;
  1948. }
  1949. // 내용에 언드라인 또는 대괄호 추가
  1950. if (ls_bigostyle4 == "DDDL")
  1951. {
  1952. ls_txt += "【 ▼】";
  1953. }
  1954. else if (ls_bigostyle4 == "EDIT")
  1955. {
  1956. ls_txt += "【_】";
  1957. }
  1958. else if (ls_bigostyle4 == "CHECKBOX")
  1959. {
  1960. ls_txt += "【 】";
  1961. }
  1962. // 내용에 텍스트 추가
  1963. if (ls_checktext5 != "")
  1964. {
  1965. ls_txt += ls_checktext5;
  1966. }
  1967. // 내용에 언드라인 또는 대괄호 추가
  1968. if (ls_bigostyle5 == "DDDL")
  1969. {
  1970. ls_txt += "【 ▼】";
  1971. }
  1972. else if (ls_bigostyle5 == "EDIT")
  1973. {
  1974. ls_txt += "【_】";
  1975. }
  1976. else if (ls_bigostyle5 == "CHECKBOX")
  1977. {
  1978. ls_txt += "【 】";
  1979. }
  1980. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("content" )) = ls_content;
  1981. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle" )) = ls_bigostyle1;
  1982. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun" )) = ls_bigogubun1;
  1983. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext" )) = ls_checktext1;
  1984. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle2")) = ls_bigostyle2;
  1985. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun2")) = ls_bigogubun2;
  1986. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext2")) = ls_checktext2;
  1987. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle3")) = ls_bigostyle3;
  1988. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun3")) = ls_bigogubun3;
  1989. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext3")) = ls_checktext3;
  1990. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle4")) = ls_bigostyle4;
  1991. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun4")) = ls_bigogubun4;
  1992. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext4")) = ls_checktext4;
  1993. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle5")) = ls_bigostyle5;
  1994. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun5")) = ls_bigogubun5;
  1995. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext5")) = ls_checktext5;
  1996. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("popinptyn")) = (ls_txt.lastIndexOf("【")==-1) ? "N":"Y";
  1997. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("wrdrec")) = ls_content;
  1998. grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("wrpid")) = li_wrpid;
  1999. setMainlistOneRow(li_newrow, "W", "col2" , ls_txt, false, pb_endYn);
  2000. }
  2001. /**
  2002. * @---------------------------------------------------
  2003. * @creat : 20110101
  2004. * @author : 최원돈
  2005. * @desc : Main Grid에 1 Row 정보 설정
  2006. * @---------------------------------------------------
  2007. */
  2008. function setMainlistOneRow(pl_row, ps_inptflag, ps_colid, ps_value, pb_stlyesetYn, pb_refreshyn)
  2009. {
  2010. var li_row = pl_row;
  2011. if (pb_stlyesetYn)
  2012. {
  2013. var ls_insertType = "below";
  2014. if ( ps_inptflag == "F1"
  2015. && grd_mainlist.rows > 0 ) // Title은 Top에
  2016. {
  2017. ls_insertType = "above";
  2018. li_row = 0;
  2019. }
  2020. li_row = insertLeftRow(1, li_row, ls_insertType); // 메인에 빈 Row 추가
  2021. //Rec 기본정보 설정
  2022. grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag" )) = ps_inptflag;
  2023. if (ps_inptflag != "F1")
  2024. {
  2025. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("instcd" )) = getUserInfo("dutplceinstcd");
  2026. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("pid" )) = model.getValue("/root/main/cond/recinfo/pid");
  2027. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("orddd" )) = model.getValue("/root/main/cond/recinfo/orddd");
  2028. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("cretno" )) = model.getValue("/root/main/cond/recinfo/cretno");
  2029. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("orddeptcd" )) = model.getValue("/root/main/cond/recinfo/orddeptcd");
  2030. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("formrecdeptcd")) = getUserInfo("dutplcecd");
  2031. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("ioflag" )) = model.getValue("/root/main/cond/inptioflag");
  2032. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("recoseq" )) = "imsi" + pl_row;
  2033. if (ps_inptflag != "F2")
  2034. {
  2035. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wrdflag")) = out_wrdflag.value;
  2036. }
  2037. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wmid" )) = model.getValue("/root/main/cond/wordinfo/wmid");
  2038. }
  2039. if ( ps_inptflag == "F1"
  2040. || ps_inptflag == "F2"
  2041. || ps_inptflag == "F3"
  2042. || ps_inptflag == "F4")
  2043. {
  2044. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("skipyn")) = "Y";
  2045. if (ps_inptflag == "F4")
  2046. {
  2047. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("status")) = "i";
  2048. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  2049. }
  2050. }
  2051. else
  2052. {
  2053. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("student" )) = ipt_student.value;
  2054. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("tutor" )) = ipt_tutor.value;
  2055. grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("status")) = "i";
  2056. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  2057. }
  2058. }
  2059. //Rec 정보 설정
  2060. grd_mainlist.valueMatrix(li_row, grd_mainlist.colref(ps_colid)) = ps_value;
  2061. //Rec 정보 설정
  2062. setRecinfo(li_row, li_row, ps_colid, pb_stlyesetYn, true);
  2063. if (pb_refreshyn)
  2064. {
  2065. if ( ps_inptflag == "F1"
  2066. || ps_inptflag == "F2"
  2067. || ps_inptflag == "F3"
  2068. || ps_inptflag == "F4")
  2069. {
  2070. setMainlistAutoResize(false, true, false); // 메인의 column 높이를 자동으로 설정한다. (refresh만 진행)
  2071. }
  2072. else
  2073. {
  2074. setMainlistAutoResize(true, true, true); // 메인의 column 높이를 자동으로 설정한다.
  2075. }
  2076. }
  2077. }
  2078. /**
  2079. * @---------------------------------------------------
  2080. * @creat : 20110101
  2081. * @author : 최원돈
  2082. * @desc : Rec정보에 설정
  2083. * @---------------------------------------------------
  2084. */
  2085. function setRecinfo(pi_minrow, pi_maxrow, ps_colid, pb_stlyesetYn, pb_colspanYn)
  2086. {
  2087. var ls_reccond = "";
  2088. var ls_colcond = "";
  2089. for (li_row = pi_minrow; li_row <= pi_maxrow; li_row++)
  2090. {
  2091. ls_inptflag = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("inptflag"));
  2092. ls_reccond = "[inptflag='" + ls_inptflag + "']";
  2093. if (pb_stlyesetYn)
  2094. {
  2095. // row style setting
  2096. setRowstyle(li_row, ls_reccond);
  2097. // column style setting
  2098. for(li_array = 0; li_array < aRECCOL[ls_inptflag].length; li_array++)
  2099. {
  2100. setColstyle("col" + aRECCOL[ls_inptflag][li_array], li_row, ls_reccond);
  2101. }
  2102. }
  2103. if (pb_colspanYn) // column colspan setting
  2104. {
  2105. setColspan(ps_colid, li_row, ls_reccond);
  2106. }
  2107. if (ps_colid == "") // 전체 설정일 경우
  2108. {
  2109. setReversalStyleRec(li_row, ls_inptflag); // 반전 정보에 맞춰서 Style 변경
  2110. }
  2111. if ( ls_inptflag == "IM" // 이미지 일 경우 배경을 강제로 설정한다.
  2112. && ( ps_colid == "col2"
  2113. || ps_colid == "")
  2114. && model.getValue("/root/main/condEtc/imgratio") > 0)
  2115. {
  2116. grd_mainlist.cellstyle("background-image", li_row, grd_mainlist.colRef("col2"), li_row, grd_mainlist.colRef("col3")) = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("etcimgfilepath"));
  2117. }
  2118. }
  2119. return;
  2120. }
  2121. /**
  2122. * @---------------------------------------------------
  2123. * @creat : 20110101
  2124. * @author : 최원돈
  2125. * @desc : row style setting
  2126. * @---------------------------------------------------
  2127. */
  2128. function setRowstyle(pi_row, ps_reccond)
  2129. {
  2130. var ls_rowcond = ps_reccond + "/rowstyleinfo";
  2131. var lnl_style = instance1.selectSingleNode(sRECBASELIST_PATH + ls_rowcond); // Rec 기준정보에서 inptflag 에 해당하는 nodelist를 가져온다.
  2132. if(lnl_style.length > 0)
  2133. {
  2134. var lnl_stylechild = lnl_style.childNodes;
  2135. while(lnlc_stylechild = lnl_stylechild.nextNode())
  2136. {
  2137. var lnl_styleGchild = lnlc_stylechild.childNodes;
  2138. var ls_stylename = "";
  2139. var ls_stylevalue = "";
  2140. while(lnlc_styleGchild = lnl_styleGchild.nextNode())
  2141. {
  2142. switch(lnlc_styleGchild.nodeName)
  2143. {
  2144. case 'stylename':
  2145. ls_stylename = lnlc_styleGchild.NodeValue;
  2146. break;
  2147. case 'stylevalue':
  2148. ls_stylevalue = lnlc_styleGchild.NodeValue;
  2149. break;
  2150. default:
  2151. break;
  2152. }
  2153. }
  2154. grd_mainlist.rowstyle(pi_row, "data", ls_stylename) = ls_stylevalue;
  2155. }
  2156. }
  2157. return;
  2158. }
  2159. /**
  2160. * @---------------------------------------------------
  2161. * @creat : 20110101
  2162. * @author : 최원돈
  2163. * @desc : column colspan setting 수행
  2164. * @---------------------------------------------------
  2165. */
  2166. function setColspan(ps_colid, pi_row, ps_reccond)
  2167. {
  2168. var ls_colcond = ps_reccond + "/colmapinfo/colmaplist[colid='" + ps_colid + "']";
  2169. var lnl_col = instance1.selectSingleNode(sRECBASELIST_PATH + ls_colcond); // Rec 기준정보에서 inptflag & colid 에 해당하는 nodelist를 가져온다.
  2170. if(lnl_col.length > 0)
  2171. {
  2172. var lnl_colchild = lnl_col.childNodes;
  2173. }
  2174. else // 1 Row 일 경우
  2175. {
  2176. lnl_col = instance1.selectNodes(sRECBASELIST_PATH + ls_colcond);
  2177. var lnl_colchild = lnl_col.item(0).childNodes;
  2178. }
  2179. if(lnl_col.length > 0)
  2180. {
  2181. var ls_value = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref(ps_colid));
  2182. var ls_starttemp = "";
  2183. var li_mincol = 0;
  2184. var li_maxcol = 0;
  2185. while(lnlc_colchild = lnl_colchild.nextNode())
  2186. {
  2187. switch(lnlc_colchild.nodeName)
  2188. {
  2189. case 'starttemp':
  2190. ls_starttemp = lnlc_colchild.NodeValue;
  2191. break;
  2192. case 'mincol':
  2193. li_mincol = parseInt(lnlc_colchild.NodeValue);
  2194. break;
  2195. case 'maxcol':
  2196. li_maxcol = parseInt(lnlc_colchild.NodeValue);
  2197. break;
  2198. default:
  2199. break;
  2200. }
  2201. }
  2202. for (var li_col = li_mincol; li_col <= li_maxcol; li_col++)
  2203. {
  2204. grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("col" + li_col)) = ls_starttemp + ls_value;
  2205. }
  2206. }
  2207. return;
  2208. }
  2209. /**
  2210. * @---------------------------------------------------
  2211. * @creat : 20110101
  2212. * @author : 최원돈
  2213. * @desc : column style setting
  2214. * @---------------------------------------------------
  2215. */
  2216. function setColstyle(ps_colid, pi_row, ps_reccond)
  2217. {
  2218. var ls_colcond = ps_reccond + "/colmapinfo/colmaplist[colid='" + ps_colid + "']";
  2219. var lnl_col = instance1.selectSingleNode(sRECBASELIST_PATH + ls_colcond); // Rec 기준정보에서 inptflag & colid 에 해당하는 nodelist를 가져온다.
  2220. if(lnl_col.length > 0)
  2221. {
  2222. var lnl_colchild = lnl_col.childNodes;
  2223. }
  2224. else // 1 Row 일 경우
  2225. {
  2226. lnl_col = instance1.selectNodes(sRECBASELIST_PATH + ls_colcond);
  2227. var lnl_colchild = lnl_col.item(0).childNodes;
  2228. }
  2229. if(lnl_col.length > 0)
  2230. {
  2231. var li_mincol = 0;
  2232. var li_maxcol = 0;
  2233. while(lnlc_colchild = lnl_colchild.nextNode())
  2234. {
  2235. switch(lnlc_colchild.nodeName)
  2236. {
  2237. case 'mincol':
  2238. li_mincol = lnlc_colchild.NodeValue;
  2239. break;
  2240. case 'maxcol':
  2241. li_maxcol = lnlc_colchild.NodeValue;
  2242. break;
  2243. case 'styledefaultyn':
  2244. ls_styledefaultyn = lnlc_colchild.NodeValue;
  2245. break;
  2246. case 'styleinfo':
  2247. if(ls_styledefaultyn == "N")
  2248. {
  2249. var lnl_stylechild = lnlc_colchild.childNodes;
  2250. while(lnlc_stylechild = lnl_stylechild.nextNode())
  2251. {
  2252. var lnl_styleGchild = lnlc_stylechild.childNodes;
  2253. var ls_stylename = "";
  2254. var ls_stylevalue = "";
  2255. while(lnlc_styleGchild = lnl_styleGchild.nextNode())
  2256. {
  2257. switch(lnlc_styleGchild.nodeName)
  2258. {
  2259. case 'stylename':
  2260. ls_stylename = lnlc_styleGchild.NodeValue;
  2261. break;
  2262. case 'stylevalue':
  2263. ls_stylevalue = lnlc_styleGchild.NodeValue;
  2264. break;
  2265. default:
  2266. break;
  2267. }
  2268. }
  2269. grd_mainlist.cellstyle(ls_stylename, pi_row, grd_mainlist.colref("col" + li_mincol), pi_row, grd_mainlist.colref("col" + li_maxcol)) = ls_stylevalue;
  2270. }
  2271. }
  2272. break;
  2273. default:
  2274. break;
  2275. }
  2276. }
  2277. }
  2278. return;
  2279. }
  2280. /**
  2281. * @---------------------------------------------------
  2282. * @creat : 20110101
  2283. * @author : 최원돈
  2284. * @desc : 반전 정보에 맞춰서 Style 변경
  2285. * @---------------------------------------------------
  2286. */
  2287. function setReversalStyleRec(pi_row, ps_inptflag)
  2288. {
  2289. var li_colid = "";
  2290. if (ps_inptflag == "D")
  2291. {
  2292. li_colid = grd_mainlist.colref("col3");
  2293. }
  2294. else
  2295. {
  2296. li_colid = grd_mainlist.colref("col2");
  2297. }
  2298. // 글자색반전
  2299. var ls_color = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("color"));
  2300. if (ls_color != "")
  2301. {
  2302. grd_mainlist.cellstyle("color", pi_row, li_colid, pi_row, li_colid) = ls_color;
  2303. }
  2304. // 이탤릭체반전
  2305. if (grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("italicyn")) == "Y")
  2306. {
  2307. grd_mainlist.cellstyle("font-style", pi_row, li_colid, pi_row, li_colid) = "italic";
  2308. }
  2309. }
  2310. /**
  2311. * @---------------------------------------------------
  2312. * @creat : 20110101
  2313. * @author : 최원돈
  2314. * @desc : 메인에 빈 Row 추가
  2315. * @---------------------------------------------------
  2316. */
  2317. function insertLeftRow(Rows, pl_currentrow, ls_insertType)
  2318. {
  2319. for(var i=0; i<Rows; i++)
  2320. {
  2321. if (pl_currentrow < 0)
  2322. {
  2323. grd_mainlist.addRow(true);
  2324. }
  2325. else
  2326. {
  2327. grd_mainlist.insertRow(pl_currentrow, ls_insertType, false, true);
  2328. }
  2329. }
  2330. return grd_mainlist.row;
  2331. }
  2332. /**
  2333. * @---------------------------------------------------
  2334. * @creat : 20110101
  2335. * @author : 최원돈
  2336. * @desc : 구분 Rows를 체크하여 없으면 삽입한다.
  2337. * @---------------------------------------------------
  2338. */
  2339. function insertDefaultRow()
  2340. {
  2341. var ls_wmid = model.getValue("/root/main/cond/wordinfo/wmid"); //업무구분정보
  2342. var ls_addflag = setFlagInsertRow(); // 삽입할 Flag 유형 Row를 찾아서 row focus를 설정한다.
  2343. var lb_insertFlag3 = false;
  2344. // return "24"; 메인에 InptFlag2 ~ 4 기록정보 설정
  2345. // return "34"; 메인에 InptFlag3 ~ 4 기록정보 설정
  2346. // return "44"; 메인에 InptFlag4 기록정보 설정
  2347. // return "" ; 메인에 InptFlag 기록정보 설정 없음
  2348. if (ls_addflag == "24")
  2349. {
  2350. insertInptFlag2Rec(false); // 메인에 InptFlag2 기록정보 설정
  2351. }
  2352. if ( ls_addflag == "24"
  2353. || ls_addflag == "34")
  2354. {
  2355. insertInptFlag3Rec(false); // 메인에 InptFlag2 기록정보 설정
  2356. lb_insertFlag3 = true;
  2357. }
  2358. if ( ls_addflag != ""
  2359. && ls_wmid != "0")
  2360. {
  2361. if (!lb_insertFlag3) // 기존에 FLAG3이 있고, FLAG4를 추가해야하면 마지막 FLAG4의 마지막 입력 정보를 찾는다.
  2362. {
  2363. }
  2364. insertInptFlag4Rec(false); // 메인에 InptFlag4 기록정보 설정
  2365. }
  2366. }
  2367. // 삽입할 Flag 유형 Row를 찾아서 row focus를 설정한다.
  2368. function setFlagInsertRow()
  2369. {
  2370. var ls_currentdd = model.getValue("/root/main/cond/recinfo/orddd");
  2371. var ls_wrdflag = out_wrdflag.value;
  2372. var ls_wmid = model.getValue("/root/main/cond/wordinfo/wmid"); //업무구분정보
  2373. // 금일 날짜정보 찾기
  2374. var li_daterow = grd_mainlist.findRow(ls_currentdd, 0, grd_mainlist.colref("orddd"), false, true);
  2375. // 작성부서 찾기
  2376. var ls_dutplcecd = getUserInfo("dutplcecd");
  2377. var li_deptrow = grd_mainlist.findRow(ls_dutplcecd, li_daterow, grd_mainlist.colref("formrecdeptcd"), false, true);
  2378. if ( li_daterow < 0
  2379. || li_deptrow < 0) // 금일 날짜정보 없거나 기록작성 부서가 없을 경우
  2380. {
  2381. grd_mainlist.row = 0;
  2382. return "24";
  2383. }
  2384. else // 금일 날짜정보가 있을 경우
  2385. {
  2386. if (li_daterow != grd_mainlist.rows - 1) // 마지막 Row가 아닐 경우
  2387. {
  2388. // 진료일자의 술식구분을 찾는다.
  2389. var li_wrdflagrow = grd_mainlist.findRow(ls_wrdflag, li_deptrow, grd_mainlist.colref("wrdflag"), false, true);
  2390. // 진료일자에 술식구분이 있다면,
  2391. if ( li_wrdflagrow > 0
  2392. && grd_mainlist.valueMatrix(li_wrdflagrow, grd_mainlist.colRef("orddd")) == ls_currentdd
  2393. && grd_mainlist.valueMatrix(li_wrdflagrow, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd)
  2394. {
  2395. if (li_wrdflagrow != grd_mainlist.rows - 1) // 마지막 Row가 아닐 경우
  2396. {
  2397. var li_wmidrow = grd_mainlist.findRow(ls_wmid, li_wrdflagrow+1, grd_mainlist.colref("wmid"), false, true);
  2398. // 진료일자의 술식구분에 폴더가 있을 경우
  2399. if ( li_wmidrow > 0
  2400. && grd_mainlist.valueMatrix(li_wmidrow, grd_mainlist.colRef("orddd")) == ls_currentdd
  2401. && grd_mainlist.valueMatrix(li_wmidrow, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
  2402. && grd_mainlist.valueMatrix(li_wmidrow, grd_mainlist.colRef("wrdflag")) == ls_wrdflag)
  2403. {
  2404. if (li_wmidrow != grd_mainlist.rows - 1)
  2405. {
  2406. setRowLastWrdflagInsert(li_wmidrow); // 금일 술식구분의 폴더의 마지막 row를 찾아서 row focus를 설정한다.
  2407. }
  2408. else
  2409. {
  2410. grd_mainlist.row = li_wmidrow;
  2411. }
  2412. return "";
  2413. }
  2414. else // 진료일자의 술식구분에 폴더가 없을 경우
  2415. {
  2416. grd_mainlist.row = li_wrdflagrow;
  2417. setRowLastFoldInsert(li_wrdflagrow); // 진료일자의 술식구분의 마지막 row를 찾아서 설정한다.
  2418. return "44";
  2419. }
  2420. }
  2421. else
  2422. {
  2423. grd_mainlist.row = li_wrdflagrow;
  2424. return "44";
  2425. }
  2426. }
  2427. else // 진료일자 술식구분이 없을 경우
  2428. {
  2429. grd_mainlist.row = li_daterow;
  2430. setRowLastDayInsert(li_daterow); // 진료일자의 마지막 row를 찾아서 설정한다.
  2431. return "34";
  2432. }
  2433. }
  2434. else // 마지막 Row 일 경우
  2435. {
  2436. grd_mainlist.row = li_daterow;
  2437. return "34";
  2438. }
  2439. }
  2440. }
  2441. //tt
  2442. // 진료일자 술식구분의 마지막 row를 찾아서 설정한다.
  2443. function setRowLastFoldInsert(pi_row)
  2444. {
  2445. var ls_orddd = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ));
  2446. var ls_wrdflag = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag"));
  2447. var ls_dutplcecd = getUserInfo("dutplcecd");
  2448. if ( pi_row == grd_mainlist.rows - 1
  2449. || ls_orddd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("orddd" ))
  2450. || ls_dutplcecd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("formrecdeptcd" ))
  2451. || ls_wrdflag != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wrdflag")))
  2452. {
  2453. grd_mainlist.row = pi_row;
  2454. return;
  2455. }
  2456. else
  2457. {
  2458. setRowLastFoldInsert(pi_row + 1);
  2459. return;
  2460. }
  2461. }
  2462. // 진료일자 술식구분의 폴더의 마지막 row를 찾아서 설정한다.
  2463. function setRowLastWrdflagInsert(pi_row)
  2464. {
  2465. var ls_orddd = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ));
  2466. var ls_wrdflag = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag"));
  2467. var ls_wmid = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid"));
  2468. var ls_dutplcecd = getUserInfo("dutplcecd");
  2469. if ( pi_row == grd_mainlist.rows - 1
  2470. || ls_orddd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("orddd" ))
  2471. || ls_dutplcecd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("formrecdeptcd" ))
  2472. || ls_wrdflag != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wrdflag"))
  2473. || ls_wmid != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wmid")))
  2474. {
  2475. grd_mainlist.row = pi_row;
  2476. return;
  2477. }
  2478. else
  2479. {
  2480. setRowLastWrdflagInsert(pi_row + 1);
  2481. return;
  2482. }
  2483. }
  2484. // 진료일자의 마지막 row를 찾아서 설정한다.
  2485. function setRowLastDayInsert(pi_row)
  2486. {
  2487. var ls_orddd = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd"));
  2488. var ls_dutplcecd = getUserInfo("dutplcecd");
  2489. if ( pi_row == grd_mainlist.rows - 1
  2490. || ls_orddd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("orddd"))
  2491. || ls_dutplcecd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("formrecdeptcd")))
  2492. {
  2493. grd_mainlist.row = pi_row;
  2494. return;
  2495. }
  2496. else
  2497. {
  2498. setRowLastDayInsert(pi_row + 1);
  2499. return;
  2500. }
  2501. }
  2502. /////////////////////////////////////////////////////////////////////////////////////
  2503. // 유형별 입력 End
  2504. /////////////////////////////////////////////////////////////////////////////////////
  2505. /////////////////////////////////////////////////////////////////////////////////////
  2506. // 반전 Start
  2507. /////////////////////////////////////////////////////////////////////////////////////
  2508. /**
  2509. * @---------------------------------------------------
  2510. * @creat : 20110101
  2511. * @author : 최원돈
  2512. * @desc : 글자 검정색 설정
  2513. * @---------------------------------------------------
  2514. */
  2515. function setColorBlack()
  2516. {
  2517. setColor("#000000"); // 글자색 설정
  2518. initPopupMenu(); // Reset Right Popupmenu
  2519. }
  2520. /**
  2521. * @---------------------------------------------------
  2522. * @creat : 20110101
  2523. * @author : 최원돈
  2524. * @desc : 글자 빨간색 설정
  2525. * @---------------------------------------------------
  2526. */
  2527. function setColorRed()
  2528. {
  2529. setColor("#FF0000"); // 글자색 설정
  2530. initPopupMenu(); // Reset Right Popupmenu
  2531. }
  2532. /**
  2533. * @---------------------------------------------------
  2534. * @creat : 20110101
  2535. * @author : 최원돈
  2536. * @desc : 글자 초록색 설정
  2537. * @---------------------------------------------------
  2538. */
  2539. function setColorGreen()
  2540. {
  2541. setColor("#4AB34A"); // 글자색 설정
  2542. initPopupMenu(); // Reset Right Popupmenu
  2543. }
  2544. /**
  2545. * @---------------------------------------------------
  2546. * @creat : 20110101
  2547. * @author : 최원돈
  2548. * @desc : 글자 파란색 설정
  2549. * @---------------------------------------------------
  2550. */
  2551. function setColorBlue()
  2552. {
  2553. setColor("#0000FF"); // 글자색 설정
  2554. initPopupMenu(); // Reset Right Popupmenu
  2555. }
  2556. /**
  2557. * @---------------------------------------------------
  2558. * @creat : 20110101
  2559. * @author : 최원돈
  2560. * @desc : 글자색 설정
  2561. * @---------------------------------------------------
  2562. */
  2563. function setColor(ps_color)
  2564. {
  2565. var li_row = 0;
  2566. var li_colid = "";
  2567. var ls_color = "";
  2568. var ls_coloryn = "";
  2569. for(var i=0; i<grd_mainlist.selectedRows; i++)
  2570. {
  2571. li_row = grd_mainlist.selectedRow(i);
  2572. if (chkValidationModifyMainlist(li_row, true)) // Main List 수정 가능여부 확인
  2573. {
  2574. if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("inptflag")) == "D")
  2575. {
  2576. li_colid = grd_mainlist.colref("col3");
  2577. }
  2578. else
  2579. {
  2580. li_colid = grd_mainlist.colref("col2");
  2581. }
  2582. grd_mainlist.cellstyle("color", li_row, li_colid, li_row, li_colid) = ps_color;
  2583. grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("color")) = ps_color;
  2584. if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rgstdt")) != "")
  2585. {
  2586. grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("status")) = "m";
  2587. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  2588. }
  2589. }
  2590. }
  2591. }
  2592. /**
  2593. * @---------------------------------------------------
  2594. * @creat : 20110101
  2595. * @author : 최원돈
  2596. * @desc : 이탤릭체 반전
  2597. * @---------------------------------------------------
  2598. */
  2599. function updateItalicReversalRec()
  2600. {
  2601. var li_row = grd_mainlist.row;
  2602. var li_colid = "";
  2603. var ls_fontstyle = "";
  2604. var ls_italicyn = "";
  2605. for(var i=0; i<grd_mainlist.selectedRows; i++)
  2606. {
  2607. li_row = grd_mainlist.selectedRow(i);
  2608. if (chkValidationModifyMainlist(li_row, true)) // Main List 수정 가능여부 확인
  2609. {
  2610. if(grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("italicyn")) == "Y")
  2611. {
  2612. ls_fontstyle = "";
  2613. ls_italicyn = "N";
  2614. }
  2615. else
  2616. {
  2617. ls_fontstyle = "italic";
  2618. ls_italicyn = "Y";
  2619. }
  2620. if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("inptflag")) == "D")
  2621. {
  2622. li_colid = grd_mainlist.colref("col3");
  2623. }
  2624. else
  2625. {
  2626. li_colid = grd_mainlist.colref("col2");
  2627. }
  2628. grd_mainlist.cellstyle("font-style", li_row, li_colid, li_row, li_colid) = ls_fontstyle;
  2629. grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("italicyn")) = ls_italicyn;
  2630. if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rgstdt")) != "")
  2631. {
  2632. grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("status")) = "m";
  2633. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  2634. }
  2635. }
  2636. }
  2637. initPopupMenu(); // Reset Right Popupmenu
  2638. }
  2639. /////////////////////////////////////////////////////////////////////////////////////
  2640. // 반전 End
  2641. /////////////////////////////////////////////////////////////////////////////////////
  2642. /////////////////////////////////////////////////////////////////////////////////////
  2643. // Client File Access Start
  2644. /////////////////////////////////////////////////////////////////////////////////////
  2645. /* @group : 폴더 존재여부 파악
  2646. * @ref : C:\KNUProject\application\webapps\emr\recmngtweb\js\SPMRI02400.js
  2647. * @by : 최원돈
  2648. */
  2649. function fExistFolder(foldernm, pb_recreate)
  2650. {
  2651. var fso, folder, s;
  2652. fso = new ActiveXObject("Scripting.FileSystemObject");
  2653. try
  2654. {
  2655. folder = fso.GetFolder(foldernm);
  2656. if (pb_recreate)
  2657. {
  2658. s = folder.DateCreated;
  2659. if (s != "")
  2660. {
  2661. fDelFolder(foldernm);
  2662. fMakeFolder(foldernm);
  2663. }
  2664. }
  2665. }
  2666. catch (e)
  2667. {
  2668. fMakeFolder(foldernm);
  2669. }
  2670. }
  2671. /* @group : 폴더 생성
  2672. * @ref : C:\KNUProject\application\webapps\emr\recmngtweb\js\SPMRI02400.js
  2673. * @by : 최원돈
  2674. */
  2675. function fMakeFolder(foldernm)
  2676. {
  2677. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2678. var a = fso.CreateFolder(foldernm);
  2679. }
  2680. /* @group : 폴더 삭제
  2681. * @ref : C:\KNUProject\application\webapps\emr\recmngtweb\js\SPMRI02400.js
  2682. * @by : 최원돈
  2683. */
  2684. function fDelFolder(foldernm)
  2685. {
  2686. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2687. fso.DeleteFolder(foldernm);
  2688. }
  2689. /////////////////////////////////////////////////////////////////////////////////////
  2690. // Client File Access End
  2691. /////////////////////////////////////////////////////////////////////////////////////
  2692. /////////////////////////////////////////////////////////////////////////////////////
  2693. // 이미지 제어 Start
  2694. /////////////////////////////////////////////////////////////////////////////////////
  2695. /**
  2696. * @---------------------------------------------------
  2697. * @creat : 20110101
  2698. * @author : 최원돈
  2699. * @desc : 메인 이미지 100 비율로 설정한다.
  2700. * @---------------------------------------------------
  2701. */
  2702. function setMainlistImageRatio100(pb_return)
  2703. {
  2704. setMainlistImageRatio("100", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
  2705. if (pb_return)
  2706. {
  2707. return;
  2708. }
  2709. initPopupMenu();
  2710. }
  2711. /**
  2712. * @---------------------------------------------------
  2713. * @creat : 20110101
  2714. * @author : 최원돈
  2715. * @desc : 메인 이미지 50 비율로 설정한다.
  2716. * @---------------------------------------------------
  2717. */
  2718. function setMainlistImageRatio50(pb_return)
  2719. {
  2720. setMainlistImageRatio("50", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
  2721. if (pb_return)
  2722. {
  2723. return;
  2724. }
  2725. initPopupMenu();
  2726. }
  2727. /**
  2728. * @---------------------------------------------------
  2729. * @creat : 20110101
  2730. * @author : 최원돈
  2731. * @desc : 메인 이미지 30 비율로 설정한다.
  2732. * @---------------------------------------------------
  2733. */
  2734. function setMainlistImageRatio30(pb_return)
  2735. {
  2736. setMainlistImageRatio("30", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
  2737. if (pb_return)
  2738. {
  2739. return;
  2740. }
  2741. initPopupMenu();
  2742. }
  2743. /**
  2744. * @---------------------------------------------------
  2745. * @creat : 20110101
  2746. * @author : 최원돈
  2747. * @desc : 메인 이미지 0 비율로 설정한다.
  2748. * @---------------------------------------------------
  2749. */
  2750. function setMainlistImageRatio0(pb_return)
  2751. {
  2752. setMainlistImageRatio("0", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
  2753. if (pb_return)
  2754. {
  2755. return;
  2756. }
  2757. initPopupMenu();
  2758. }
  2759. /**
  2760. * @---------------------------------------------------
  2761. * @creat : 20110101
  2762. * @author : 최원돈
  2763. * @desc : 이미지 비율에 따른 SIZE를 설정한다.
  2764. * @---------------------------------------------------
  2765. */
  2766. function setMainlistImageRatio(ps_value, pb_return)
  2767. {
  2768. var ls_cond = "/root/popupmenu/recmenuinfo/menulist/item[func='setMainlistImageRatio" + ps_value + "' and checkyn='N']";
  2769. var lx_nodemod = instance1.selectNodes(ls_cond);
  2770. if (lx_nodemod.length > 0)
  2771. {
  2772. resetMainlistImageRatio(); // RESET CHECK
  2773. for (var i=0; i <lx_nodemod.length; i++) // INPUT CHECK
  2774. {
  2775. var lx_node = lx_nodemod.item(i);
  2776. var ls_value = lx_node.selectSingleNode("name").NodeValue;
  2777. lx_node.selectSingleNode("name").NodeValue = "[√" + ls_value.substring(2, ls_value.length);
  2778. lx_node.selectSingleNode("checkyn").NodeValue = "Y";
  2779. model.setValue("/root/main/condEtc/imgratio", lx_node.selectSingleNode("value").NodeValue)
  2780. }
  2781. }
  2782. if (pb_return)
  2783. {
  2784. return;
  2785. }
  2786. grd_mainlist.rebuildStyle();
  2787. setRecImgColInstance(); // IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 col2~col12에 입력해준다.
  2788. setMainlistAll(true); // Main Grid 전체 Style 설정
  2789. }
  2790. /**
  2791. * @---------------------------------------------------
  2792. * @creat : 20110101
  2793. * @author : 최원돈
  2794. * @desc : 이미지 설정정보를 RESET
  2795. * @---------------------------------------------------
  2796. */
  2797. function resetMainlistImageRatio()
  2798. {
  2799. var ls_cond = "/root/popupmenu/recmenuinfo/menulist/item[checkyn='Y']";
  2800. var lx_nodemod = instance1.selectNodes(ls_cond);
  2801. for (var i=0; i <lx_nodemod.length; i++)
  2802. {
  2803. var lx_node = lx_nodemod.item(i);
  2804. var ls_value = lx_node.selectSingleNode("name").NodeValue;
  2805. lx_node.selectSingleNode("name").NodeValue = "[ " + ls_value.substring(2, ls_value.length);
  2806. lx_node.selectSingleNode("checkyn").NodeValue = "N";
  2807. }
  2808. }
  2809. /**
  2810. * @---------------------------------------------------
  2811. * @creat : 20110101
  2812. * @author : 최원돈
  2813. * @desc : 메인 이미지를 위한 폴더를 생성한다.
  2814. * @---------------------------------------------------
  2815. */
  2816. function creatMainListImgFold(pb_recreate)
  2817. {
  2818. // 이미지를 저장할 로컬 폴더 생성
  2819. fExistFolder(sIMAGEFOLD1, false);
  2820. fExistFolder(sIMAGEFOLD2, false);
  2821. fExistFolder(sIMAGEFOLD3, false);
  2822. fExistFolder(sIMAGEFOLD4, pb_recreate);
  2823. fExistFolder(sIMAGEFOLD , false);
  2824. }
  2825. /**
  2826. * @---------------------------------------------------
  2827. * @creat : 20110101
  2828. * @author : 최원돈
  2829. * @desc : IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 col2~col12에 입력해준다.
  2830. * @---------------------------------------------------
  2831. */
  2832. function setRecImgColInstance()
  2833. {
  2834. var ls_cond = "inptflag = 'IM'";
  2835. for (var i=0; i<grd_mainlist.rows; i++)
  2836. {
  2837. if (grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "IM")
  2838. {
  2839. if (model.getValue("/root/main/condEtc/imgratio") > 0)
  2840. {
  2841. var la_value = getMainlistImg(grd_mainlist.valueMatrix(i, grd_mainlist.colRef("recimge")), i); // Grid에 맞는 이미지와 이미지 높이를 반환한다.
  2842. grd_mainlist.valueMatrix(i, grd_mainlist.colRef("etcimgheight")) = la_value[0]; // 이미지 높이를 저장한다.
  2843. grd_mainlist.valueMatrix(i, grd_mainlist.colRef("etcimgfilepath")) = la_value[1]; // 이미지 파일 경로를 저장한다.
  2844. for (var j=2; j<=3; j++) // COL2~COL12까지 type을 설정한다.
  2845. {
  2846. grd_mainlist.valueMatrix(i, grd_mainlist.colRef("col" + j)) = "";
  2847. }
  2848. }
  2849. else
  2850. {
  2851. for (var j=2; j<=3; j++) // COL2~COL12까지 type을 설정한다.
  2852. {
  2853. grd_mainlist.valueMatrix(i, grd_mainlist.colRef("col" + j)) = grd_mainlist.valueMatrix(i, grd_mainlist.colRef("degnitemnm"));
  2854. }
  2855. }
  2856. }
  2857. }
  2858. }
  2859. /////////////////////////////////////////////////////////////////////////////////////
  2860. // 이미지 제어 End
  2861. /////////////////////////////////////////////////////////////////////////////////////
  2862. /**
  2863. * @---------------------------------------------------
  2864. * @copy& : 20100000
  2865. * @ref : C:\KNUProject\application\webapps\emr\medirecweb\js\MMRCommon.js#GetPatDiagNm(itemCd)
  2866. * @author : 최원돈
  2867. * @desc : 환자진단정보 가져오기
  2868. * @---------------------------------------------------
  2869. */
  2870. function GetPatDiagNm()
  2871. {
  2872. model.removeNodeset("/root/main/diaginfo");
  2873. model.makeValue("/root/send/cond1", model.getValue("/root/main/cond/recinfo/pid" ));
  2874. model.makeValue("/root/send/cond2", model.getValue("/root/main/cond/recinfo/orddd" ));
  2875. model.makeValue("/root/send/cond3", model.getValue("/root/main/cond/recinfo/cretno" ));
  2876. model.makeValue("/root/send/cond4", model.getValue("/root/main/cond/recinfo/orddeptcd"));
  2877. model.makeValue("/root/send/cond5", model.getValue("/root/main/cond/inptioflag" ));
  2878. if (submit("TRMMO00105", false))
  2879. {
  2880. var nodelistDiaginfo = model.instances(0).selectNodes("/root/main/diaginfo/diagcdlist");
  2881. var ro = "";
  2882. var ms = "";
  2883. var diaglist = "";
  2884. if(nodelistDiaginfo.length >= 1)
  2885. {
  2886. for(var i = 1; i <= nodelistDiaginfo.length; i++)
  2887. {
  2888. sDiagkindcd = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagkindcd");
  2889. sDiagkindcdflag = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagkindcdflag");
  2890. sTmpdiagcd = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/icd10cd");
  2891. sTmpdiagengnm = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagengnm");
  2892. ro = (sDiagkindcd == "R") ? "R/O" : " - ";
  2893. ms = (sDiagkindcdflag == "M") ? "주" : "부";
  2894. //diaglist += ro + " " + ms + " " + sTmpdiagengnm + ((i==nodelistDiaginfo.length)?"":"\n");
  2895. diaglist += ro + " " + ms + " " + sTmpdiagcd + " " + sTmpdiagengnm + ((i==nodelistDiaginfo.length)?"":"\n"); // 20151123 변진석 교수 코드 추가 요청 (최원돈)
  2896. }
  2897. }
  2898. }
  2899. if(diaglist == "")
  2900. {
  2901. messageBox("환자진단정보가 없습니다.", "E999");
  2902. return;
  2903. }
  2904. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  2905. var li_row = grd_mainlist.row;
  2906. setMainlistOneRow(li_row, "I", "col2", diaglist, true, true);
  2907. }
  2908. /**
  2909. * @---------------------------------------------------
  2910. * @copy& : 20100000
  2911. * @ref : C:\KNUProject\application\webapps\emr\medirecweb\js\MMRCommon.js#GetPatDiagNm(itemCd)
  2912. * @author : 최원돈
  2913. * @desc : 환자처방정보 가져오기
  2914. * @ MMO001.js#fBfPrcpSrchCom에서 opener 때문에 사용할 수 없어서 1월 초 본원 오픈 후 김영학(진료-처방담당)씨가 지원해주기로함. (2010-12-15 최원돈)
  2915. * @---------------------------------------------------
  2916. */
  2917. function GetPatDrugPrcpList()
  2918. {
  2919. var prcpdd = "";
  2920. var bfflag = "bfprcp";
  2921. var flag = "";
  2922. var todd = "";
  2923. var pid = model.getValue("/root/main/paminfo/pid");
  2924. var orddd = model.getValue("/root/main/cond/recinfo/orddd");
  2925. var cretno = model.getValue("/root/main/paminfo/cretno");
  2926. var orddrid = model.getValue("/root/main/paminfo/orddrid");
  2927. var orddeptcd = model.getValue("/root/main/paminfo/orddeptcd");
  2928. var prcpgenrflag = model.getValue("/root/main/paminfo/ioflag");
  2929. if (prcpgenrflag == "I" || prcpgenrflag == "E" || prcpgenrflag == "D")
  2930. {
  2931. prcpdd = model.getValue("/root/main/paminfo/formrecdd");
  2932. }
  2933. else
  2934. {
  2935. prcpdd = orddd;
  2936. }
  2937. //처방정보 가져오기(퇴원처방 prcpkindcd = 60)
  2938. if(fBfPrcpSrchCom(pid, orddd, prcpdd, bfflag, flag, orddrid, todd, prcpgenrflag, orddeptcd, cretno, "TRMMO00100", true))
  2939. {
  2940. //투약
  2941. var nodelistDrugPrcpinfo = model.instances(0).selectNodes("/root/prcpsrch/prcplist[(prcpkindcd != '' and prcphistcd != 'C' and prcphistcd != 'L' and prcphistcd != 'E') and (prcpclscd = 'A2' or prcpclscd = 'A4' or prcpclscd = 'A6')]");
  2942. //처치
  2943. var nodelistPrcpinfo = model.instances(0).selectNodes("/root/prcpsrch/prcplist[(prcpkindcd != '' and prcphistcd != 'C' and prcphistcd != 'L' and prcphistcd != 'E') and (prcpclscd = 'H2' or prcpclscd = 'H4')]");
  2944. }
  2945. var prcpkind = ""; //처방종류
  2946. var orgprcpnm = ""; //처방명
  2947. var drugmthdspccdnm = ""; //용법
  2948. var prcpdelivefact = ""; //전달사항
  2949. var prcplist = "";
  2950. var prcphistcd = ""; //임시,인증구분
  2951. var prcpclscd = "";
  2952. var tmpdrugmthdspccdnm = "";
  2953. if(nodelistDrugPrcpinfo.length >= 1)
  2954. {
  2955. for(var i = 1; i <= nodelistDrugPrcpinfo.length; i++)
  2956. {
  2957. var subNode = nodelistDrugPrcpinfo.item(i - 1);
  2958. //orgprcpnm = subNode.selectSingleNode("orgprcpnm").text;
  2959. tmpdrugmthdspccdnm = subNode.selectSingleNode("drugmthdspccdnm").text;
  2960. prcpkind = subNode.selectSingleNode("tempcol13").text;
  2961. orgprcpnm = subNode.selectSingleNode("tempcol6").text;
  2962. drugmthdspccdnm = subNode.selectSingleNode("tempcol7").text;
  2963. prcpclscd = subNode.selectSingleNode("prcpclscd").text;
  2964. drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
  2965. drugmthdspccdnm = drugmthdspccdnm.replace("[급]", "");
  2966. drugmthdspccdnm = drugmthdspccdnm.replace("[일]", "");
  2967. drugmthdspccdnm = drugmthdspccdnm.replace("[본]", "");
  2968. drugmthdspccdnm = drugmthdspccdnm.replace("(집)", "");
  2969. drugmthdspccdnm = drugmthdspccdnm.replace("[home]", "");
  2970. drugmthdspccdnm = drugmthdspccdnm.replace("[임상]", "");
  2971. drugmthdspccdnm = drugmthdspccdnm.replace("[prn]", "");
  2972. prcpdelivefact = subNode.selectSingleNode("prcpdelivefact").text;
  2973. prcphistcd = subNode.selectSingleNode("prcphistcd").text;
  2974. var ls_enter = (i==nodelistDrugPrcpinfo.length)?"":"\n";
  2975. if(prcphistcd == "T")
  2976. {
  2977. if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
  2978. {
  2979. prcplist += "[임] " + orgprcpnm + " " + drugmthdspccdnm + ls_enter;
  2980. }
  2981. else
  2982. {
  2983. prcplist += "[임] " + orgprcpnm + ls_enter;
  2984. }
  2985. }
  2986. else
  2987. {
  2988. if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
  2989. {
  2990. prcplist += orgprcpnm + " " + drugmthdspccdnm + ls_enter
  2991. }
  2992. else
  2993. {
  2994. prcplist += orgprcpnm + ls_enter
  2995. }
  2996. }
  2997. }
  2998. }
  2999. var prerec = (prcplist=="") ? "" : prcplist;
  3000. var prcpkind = ""; //처방종류
  3001. var orgprcpnm = ""; //처방명
  3002. var drugmthdspccdnm = ""; //용법
  3003. var prcpdelivefact = ""; //전달사항
  3004. var prcplist = "";
  3005. var prcphistcd = ""; //임시,인증구분
  3006. var prcpclscd = "";
  3007. var tmpdrugmthdspccdnm = "";
  3008. if(nodelistPrcpinfo.length >= 1)
  3009. {
  3010. for(var i = 1; i <= nodelistPrcpinfo.length; i++)
  3011. {
  3012. var subNode = nodelistPrcpinfo.item(i - 1);
  3013. prcpkind = subNode.selectSingleNode("tempcol13").text;
  3014. orgprcpnm = subNode.selectSingleNode("tempcol6").text;
  3015. tmpdrugmthdspccdnm = subNode.selectSingleNode("drugmthdspccdnm").text;
  3016. drugmthdspccdnm = subNode.selectSingleNode("tempcol7").text;
  3017. prcpclscd = subNode.selectSingleNode("prcpclscd").text;
  3018. drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
  3019. drugmthdspccdnm = drugmthdspccdnm.replace("[급]", "");
  3020. drugmthdspccdnm = drugmthdspccdnm.replace("[일]", "");
  3021. drugmthdspccdnm = drugmthdspccdnm.replace("[본]", "");
  3022. drugmthdspccdnm = drugmthdspccdnm.replace("(집)", "");
  3023. drugmthdspccdnm = drugmthdspccdnm.replace("[home]", "");
  3024. drugmthdspccdnm = drugmthdspccdnm.replace("[임상]", "");
  3025. drugmthdspccdnm = drugmthdspccdnm.replace("[prn]", "");
  3026. prcpdelivefact = subNode.selectSingleNode("prcpdelivefact").text;
  3027. prcphistcd = subNode.selectSingleNode("prcphistcd").text;
  3028. var ls_enter = (i==nodelistPrcpinfo.length)?"":"\n";
  3029. if(prcphistcd == "T")
  3030. {
  3031. if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
  3032. {
  3033. prcplist += "[임] " + orgprcpnm + " " + drugmthdspccdnm + ls_enter
  3034. }
  3035. else
  3036. {
  3037. prcplist += "[임] " + orgprcpnm + ls_enter
  3038. }
  3039. }
  3040. else
  3041. {
  3042. if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
  3043. {
  3044. prcplist += orgprcpnm + " " + drugmthdspccdnm + ls_enter
  3045. }
  3046. else
  3047. {
  3048. prcplist += orgprcpnm + ls_enter
  3049. }
  3050. }
  3051. }
  3052. }
  3053. prerec += (prcplist=="")?"":("\n" + prcplist);
  3054. if(prerec == "")
  3055. {
  3056. messageBox("환자처방정보가 없습니다.", "E999");
  3057. return;
  3058. }
  3059. insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
  3060. var li_row = grd_mainlist.row;
  3061. setMainlistOneRow(li_row, "I", "col2", prerec, true, true);
  3062. }
  3063. //========================================================================
  3064. // 인증저장
  3065. //========================================================================
  3066. function fSignSave(pi_mergecnt)
  3067. {
  3068. var pid = model.getValue("/root/main/paminfo/pid");
  3069. var orddd = model.getValue("/root/main/cond/recinfo/orddd");
  3070. var cretno = model.getValue("/root/main/paminfo/cretno");
  3071. var orddrid = model.getValue("/root/main/paminfo/orddrid");
  3072. var orddeptcd = model.getValue("/root/main/paminfo/orddeptcd");
  3073. var ioflag = model.getValue("/root/main/paminfo/ioflag");
  3074. var signno = "0";//model.getValue("/root/main/endsummary/endsummaryrecord/signno");
  3075. // 인증 로직 호출
  3076. Sign.certreload = false; // 전자서명 호출시 인증저장 버튼을 누를때마다 인증서가 뜨지 않도록
  3077. // 인증할 정보를 만든다.
  3078. var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
  3079. var lx_signnode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
  3080. model.removenode("/root/main/signdata/recinfo");
  3081. model.makeNode("/root/main/signdata/recinfo");
  3082. var lx_signsavenode = instance1.selectSingleNode("/root/main/signdata/recinfo");
  3083. if (lx_signnode.length > 0)
  3084. {
  3085. while(lx_signtmpnode = lx_signnode.nextNode())
  3086. {
  3087. lx_signsavenode.appendChild(lx_signtmpnode);
  3088. }
  3089. }
  3090. if(Sign.signprocess() == true){
  3091. model.makeNode("/root/send/savedata/recinfo/signdata");
  3092. model.makeValue("/root/send/savedata/recinfo/signdata/pid", pid);
  3093. model.makeValue("/root/send/savedata/recinfo/signdata/certflag", "C");
  3094. model.makeValue("/root/send/savedata/recinfo/signdata/orddd", orddd);
  3095. model.makeValue("/root/send/savedata/recinfo/signdata/signno", signno);
  3096. model.makeValue("/root/send/savedata/recinfo/signdata/cretno", cretno);
  3097. model.makeValue("/root/send/savedata/recinfo/signdata/recdd", getCurrentDate());
  3098. model.makeValue("/root/send/savedata/recinfo/signdata/rectm", getCurrentTime());
  3099. model.makeValue("/root/send/savedata/recinfo/signdata/recsaveflag", "Y");
  3100. model.makeValue("/root/send/savedata/recinfo/signdata/signflag", "01");
  3101. model.makeValue("/root/send/savedata/recinfo/signdata/signgenrflag", ioflag);
  3102. model.makeValue("/root/send/savedata/recinfo/signdata/formcd", sFORMCD);
  3103. model.makeValue("/root/send/savedata/recinfo/signdata/orddeptcd", orddeptcd);
  3104. model.makeValue("/root/send/savedata/recinfo/signdata/orddrid", orddrid);
  3105. model.makeValue("/root/send/savedata/recinfo/signdata/signbfcnts", Sign.signedInfos[3]);
  3106. model.makeValue("/root/send/savedata/recinfo/signdata/signaftcnts", Sign.signedInfos[2]);
  3107. model.makeValue("/root/send/savedata/recinfo/signdata/mergecnt", pi_mergecnt);
  3108. // var signdata =
  3109. // "pid" // 등록번호
  3110. // + "▦certflag" // 인증여부( T : 임시저장, C : 인증저장)
  3111. // + "▦orddd" // 입원일자(입원,응급)/진료일자(외래)
  3112. // + "▦signno" // 서명번호
  3113. // + "▦cretno" // 생성번호
  3114. // + "▦recdd" // 실제 기록이 이루어진 기록일자(통합기록에서 보여짐)
  3115. // + "▦rectm" // 실제 기록이 이루어진 기록시간(통합기록에서 보여짐)
  3116. // + "▦recsaveflag" // 전자서명 인적정보 변경여부(기록일시 변경되는 경우 : Y, 그외 : N)
  3117. // + "▦signflag" // 서명자료구분(01 : 진료, 02 : 간호, 20 : 가정간호)
  3118. // + "▦signgenrflag" // 외래/입원구분 (코드정의서 M0010 참조)
  3119. // + "▦formcd" // 각 기록지별 서식코드(0000001670 - 욕창간호기록)
  3120. // + "▦orddeptcd" // 진료부서코드
  3121. // + "▦orddrid" // 진료의사ID
  3122. // + "▦signbfcnts" // 인증할 데이터 정보(미기록 노드 제거된 정보)
  3123. // + "▦signaftcnts" // 공인인증 처리후 데이터
  3124. // + "▩" ;
  3125. //
  3126. // signdata = signdata + pid
  3127. // + "▦" + "C"
  3128. // + "▦" + orddd
  3129. // + "▦" + signno
  3130. // + "▦" + cretno
  3131. // + "▦" + getCurrentDate()
  3132. // + "▦" + getCurrentTime()
  3133. // + "▦" + "Y"
  3134. // + "▦" + "01"
  3135. // + "▦" + ioflag
  3136. // + "▦" + sFORMCD
  3137. // + "▦" + orddeptcd
  3138. // + "▦" + orddrid
  3139. // + "▦" + Sign.signedInfos[3]
  3140. // + "▦" + Sign.signedInfos[2]
  3141. // + "▩" ;
  3142. //
  3143. // model.makeValue("/root/send/savedata/recinfo/signdata", signdata);
  3144. }
  3145. else
  3146. {
  3147. return false;
  3148. }
  3149. return true;
  3150. }
  3151. // 인증데이터 생성함수
  3152. function fMake_SignData() {
  3153. /*
  3154. //Sign.XPATH_MAINNODE = "/root/send/savedata";
  3155. Sign.addnode("/root/main/intvinfo/intvgnrl");
  3156. */
  3157. Sign.addnode("/root/main/signdata");
  3158. //Sign.XPATH_MAINNODE = "/root/send/savedata";
  3159. //Sign.addnode("/root/send/savedata");
  3160. }
  3161. // XSLT 관련
  3162. function fHiddenCommonInfo(){
  3163. patinfo.style.display="none";
  3164. }
  3165. /**
  3166. * @---------------------------------------------------
  3167. * @creat : 20110101
  3168. * @author : 최원돈
  3169. * @desc : 기록이동
  3170. * @---------------------------------------------------
  3171. */
  3172. function fClkBtnrecMove(ps_flag)
  3173. {
  3174. // 선택이 올바른지 체크
  3175. var j = 0;
  3176. var li_row = 0;
  3177. var li_flag4_cnt = 0;
  3178. var li_flagNot_cnt = 0;
  3179. var ls_orddd = "";
  3180. var ls_formrecdeptcd = "";
  3181. var ls_wrdflag = "";
  3182. var ls_wmid = "";
  3183. if (grd_mainlist.rows < 1 || grd_mainlist.row < 0) { return; } // 선택된 row가 없다면 Pass
  3184. li_row = grd_mainlist.row;
  3185. if ( grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F1"
  3186. || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F2"
  3187. || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F3")
  3188. {
  3189. messageBox("Title, 술식구분, 과는 옮길 수 없습니다.", "E999");
  3190. return;
  3191. }
  3192. else if (grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F4")
  3193. {
  3194. if (!chkValidationModifyMainlist(li_row + 1, false)) // Main List 수정 가능여부 확인
  3195. {
  3196. return;
  3197. }
  3198. var ls_orddd = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("orddd"));
  3199. var ls_dutplcecd = getUserInfo("dutplcecd");
  3200. var ls_wrdflag = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wrdflag"));
  3201. var ls_wmid = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wmid"));
  3202. if (ps_flag == "U")
  3203. {
  3204. if ( grd_mainlist.valueMatrix(li_row - 1, grd_mainlist.colref("inptflag")) == "F1"
  3205. || grd_mainlist.valueMatrix(li_row - 1, grd_mainlist.colref("inptflag")) == "F2")
  3206. {
  3207. messageBox("이동할 수 없습니다!", "E999");
  3208. return;
  3209. }
  3210. var li_findInsertFistRow = getFindRowUpFirstFold(li_row - 1, ls_orddd, ls_dutplcecd, ls_wrdflag); // 상위 Fold 중 가장 가까운 Fold를 찾는다.
  3211. if (li_findInsertFistRow == 0)
  3212. {
  3213. messageBox("이동할 수 없습니다!", "E999");
  3214. return;
  3215. }
  3216. var li_findMoveLastRow = getFindRowFoldLast(li_row + 1, ls_orddd, ls_dutplcecd, ls_wrdflag, ls_wmid); // 폴더의 마지막 Row를 찾는다.
  3217. var li_cnt = li_findMoveLastRow - li_row;
  3218. for (var i=0; i<=li_cnt; i++)
  3219. {
  3220. setMove(true, "above", li_findInsertFistRow + i, li_row + 1 + i); // Row를 이동한다.
  3221. }
  3222. grd_mainlist.row = li_findInsertFistRow; // 현재 row를 옮겨준다.
  3223. }
  3224. else if (ps_flag == "D")
  3225. {
  3226. var li_findMoveLastRow = getFindRowFoldLast(li_row + 1, ls_orddd, ls_dutplcecd, ls_wrdflag, ls_wmid); // 폴더의 마지막 Row를 찾는다.
  3227. if (li_findMoveLastRow == grd_mainlist.rows - 1)
  3228. {
  3229. messageBox("이동할 수 없습니다!", "E999");
  3230. return;
  3231. }
  3232. var li_cnt = li_findMoveLastRow - li_row + 1;
  3233. var li_findInsertFistRow = getFindRowDownLastFold(li_row + 1, ls_orddd, ls_dutplcecd); // 상위 Fold 중 가장 가까운 Fold를 찾는다.
  3234. if (li_findInsertFistRow == 0)
  3235. {
  3236. messageBox("이동할 수 없습니다!", "E999");
  3237. return;
  3238. }
  3239. var li_findMoveLastRow2 = 0;
  3240. if (grd_mainlist.valueMatrix(li_findInsertFistRow, grd_mainlist.colRef("inptflag")) == "F3")
  3241. {
  3242. li_findMoveLastRow2 = li_findInsertFistRow;
  3243. }
  3244. else
  3245. {
  3246. var ls_wrdflag2 = grd_mainlist.valueMatrix(li_findInsertFistRow, grd_mainlist.colRef("wrdflag"));
  3247. var ls_wmid2 = grd_mainlist.valueMatrix(li_findInsertFistRow, grd_mainlist.colRef("wmid"));
  3248. li_findMoveLastRow2 = getFindRowFoldLast(li_findInsertFistRow + 1, ls_orddd, ls_dutplcecd, ls_wrdflag2, ls_wmid2); // 폴더의 마지막 Row를 찾는다.
  3249. }
  3250. for (var i=0; i<li_cnt; i++)
  3251. {
  3252. setMove(true, "below", li_findMoveLastRow2, li_row); // Row를 이동한다.
  3253. }
  3254. grd_mainlist.row = li_findMoveLastRow2 - li_cnt + 1; // 현재 row를 옮겨준다.
  3255. }
  3256. grd_mainlist.rebuildStyle();
  3257. setMainlistAll(true); // Main Grid 전체 Style 설정
  3258. }
  3259. else
  3260. {
  3261. if (!chkValidationModifyMainlist(li_row, false)) // Main List 수정 가능여부 확인
  3262. {
  3263. return;
  3264. }
  3265. if (ps_flag == "U")
  3266. {
  3267. if (grd_mainlist.valueMatrix(li_row - 1, grd_mainlist.colref("skipyn")) == "Y"
  3268. || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("wmid")) != grd_mainlist.valueMatrix(li_row-1, grd_mainlist.colref("wmid")))
  3269. {
  3270. messageBox("다른 폴더로 이동할 수 없습니다!", "E999");
  3271. return;
  3272. }
  3273. setMove(false, "above", li_row - 1, li_row + 1); // Row를 이동한다.
  3274. grd_mainlist.row = li_row - 1; // 현재 row를 옮겨준다.
  3275. }
  3276. else if (ps_flag == "D")
  3277. {
  3278. if (li_row == grd_mainlist.rows - 1)
  3279. {
  3280. messageBox("아래로 옮길 수 없는 마지막 행입니다!", "E999");
  3281. return;
  3282. }
  3283. if (grd_mainlist.valueMatrix(li_row+1, grd_mainlist.colref("skipyn")) == "Y"
  3284. || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("wmid")) != grd_mainlist.valueMatrix(li_row+1, grd_mainlist.colref("wmid")))
  3285. {
  3286. messageBox("다른 폴더로 이동할 수 없습니다!", "E999");
  3287. return;
  3288. }
  3289. setMove(false, "below", li_row + 1, li_row); // Row를 이동한다.
  3290. grd_mainlist.row = li_row + 1; // 현재 row를 옮겨준다.
  3291. }
  3292. grd_mainlist.rebuildStyle();
  3293. setMainlistAll(true); // Main Grid 전체 Style 설정
  3294. }
  3295. }
  3296. // Row를 이동한다.
  3297. function setMove(pb_foldyn, pb_flag, pi_destRow, pi_srcRow)
  3298. {
  3299. if (pb_foldyn)
  3300. {
  3301. var ls_wrdflag = grd_mainlist.valueMatrix((pb_flag=="below"? pi_destRow : pi_destRow - 1), grd_mainlist.colref("wrdflag"));
  3302. }
  3303. grd_mainlist.insertRow(pi_destRow, pb_flag, false); // 옮겨질 row를 추가한다.
  3304. var li_destRow = (pb_flag=="below"? pi_destRow + 1 : pi_destRow);
  3305. fcopyMainlistRow(li_destRow, pi_srcRow); // 메인 기록정보의 Row를 복사한다.
  3306. if (pb_foldyn)
  3307. {
  3308. grd_mainlist.valueMatrix(li_destRow, grd_mainlist.colref("wrdflag")) = ls_wrdflag;
  3309. }
  3310. grd_mainlist.deleteRow(pi_srcRow, false); // 옮겨진 row를 삭제한다.
  3311. }
  3312. // 상위 Fold 중 가장 가까운 Fold의 Row를 찾는다.
  3313. function getFindRowUpFirstFold(pi_row, ps_orddd, ps_dutplcecd, ps_wrdflag)
  3314. {
  3315. // 금일 날짜정보 찾기
  3316. var li_daterow = grd_mainlist.findRow(ps_orddd, 0, grd_mainlist.colref("orddd"), false, true);
  3317. // 작성부서 찾기
  3318. var li_deptrow = grd_mainlist.findRow(ps_dutplcecd, li_daterow, grd_mainlist.colref("formrecdeptcd"), false, true);
  3319. // 술식구분 찾기
  3320. var li_wrdflagrow = grd_mainlist.findRow(ps_wrdflag, li_deptrow, grd_mainlist.colref("wrdflag"), false, true);
  3321. return getFindRowUpLastFold(li_wrdflagrow, pi_row, ps_orddd, ps_dutplcecd, ps_wrdflag, 0); // 금일 기록구분의 지정 row 위의 마지막 폴더를 찾는다.
  3322. }
  3323. // 기록구분의 지정 row 위의 마지막 Fold row를 찾는다.
  3324. function getFindRowUpLastFold(pi_row, pi_lastrow, ps_orddd, ps_dutplcecd, ps_wrdflag, pi_foldrow)
  3325. {
  3326. if ( pi_row == pi_lastrow
  3327. || ps_orddd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd"))
  3328. || ps_dutplcecd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("formrecdeptcd"))
  3329. || ps_wrdflag != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag")))
  3330. {
  3331. return pi_foldrow;
  3332. }
  3333. else
  3334. {
  3335. if ( grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("inptflag")) == "F3"
  3336. || grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("inptflag")) == "F4"
  3337. || grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid")) != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wmid")))
  3338. {
  3339. pi_foldrow = pi_row + 1;
  3340. }
  3341. return getFindRowUpLastFold(pi_row + 1, pi_lastrow, ps_orddd, ps_dutplcecd, ps_wrdflag, pi_foldrow);
  3342. }
  3343. }
  3344. // 하위 Fold 중 가장 가까운 Fold의 Row를 찾는다.
  3345. function getFindRowDownLastFold(pi_row, ps_orddd, ps_dutplcecd)
  3346. {
  3347. if ( pi_row == grd_mainlist.rows - 1
  3348. || grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("inptflag")) == "F3"
  3349. || ps_orddd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ))
  3350. || ps_dutplcecd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("formrecdeptcd" ))
  3351. )
  3352. {
  3353. return 0;
  3354. }
  3355. else
  3356. {
  3357. if ( grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("inptflag")) == "F4"
  3358. || grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid")) != grd_mainlist.valueMatrix(pi_row - 1, grd_mainlist.colRef("wmid")))
  3359. {
  3360. return pi_row;
  3361. }
  3362. return getFindRowDownLastFold(pi_row + 1, ps_orddd, ps_dutplcecd);
  3363. }
  3364. }
  3365. // 진료일자 술식구분의 폴더의 마지막 row를 찾아서 설정한다.
  3366. function getFindRowFoldLast(pi_row, ps_orddd, ps_dutplcecd, ps_wrdflag, ps_wmid)
  3367. {
  3368. if (pi_row == grd_mainlist.rows - 1)
  3369. {
  3370. return pi_row;
  3371. }
  3372. else if ( ps_orddd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ))
  3373. || ps_dutplcecd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("formrecdeptcd" ))
  3374. || ps_wrdflag != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag"))
  3375. || ps_wmid != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid")))
  3376. {
  3377. return pi_row - 1;
  3378. }
  3379. else
  3380. {
  3381. return getFindRowFoldLast(pi_row + 1, ps_orddd, ps_dutplcecd, ps_wrdflag, ps_wmid);
  3382. }
  3383. }
  3384. // 메인 기록정보의 Row를 복사한다.
  3385. function fcopyMainlistRow(pi_destRow, pi_srcRow)
  3386. {
  3387. for (i=0; i<=grd_mainlist.colref("inptseq"); i++)
  3388. {
  3389. grd_mainlist.valueMatrix(pi_destRow, i) = grd_mainlist.valueMatrix(pi_srcRow, i);
  3390. }
  3391. if (grd_mainlist.valueMatrix(pi_destRow, grd_mainlist.colref("status")) != "i")
  3392. {
  3393. grd_mainlist.valueMatrix(pi_destRow, grd_mainlist.colref("status")) = "m";
  3394. opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
  3395. }
  3396. return;
  3397. }