12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 치과기록 ( SMMRE00100_치과기록.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- - Author : 최원돈 (2010.10.25~
- - ref : C:\KNUProject\application\webapps\emr\medirecweb\js\MMR00100.js
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var sSELINFO_PATH = "/root/main/selinfo"
- var sSELRECINFO_PATH = "/root/main/selinfo/recinfo"
- var sSELRECLIST_PATH = "/root/main/selinfo/recinfo/reclist"
- var sSELREFINFO_PATH = "/root/main/selinfo/refinfo"
- var sSELREFLIST_PATH = "/root/main/selinfo/refinfo/reflist"
- var sSELFOLDINFO_PATH = "/root/main/selinfo/foldinfo"
- var sSELFOLDLIST_PATH = "/root/main/selinfo/foldinfo/foldlist"
- var sSELWORDINFO_PATH = "/root/main/selinfo/wordinfo"
- var sSELWORDLIST_PATH = "/root/main/selinfo/wordinfo/wordlist"
- var sSELRECINFO_ORG_PATH = "/root/data/selinfo/recinfo"
- var sSELRECLIST_ORG_PATH = "/root/data/selinfo/recinfo/reclist"
- var sMODINFO_PATH = "/root/data/modinfo"
- var sMODRECINFO_PATH = "/root/data/modinfo/recinfo"
- var sDELINFO_PATH = "/root/data/delinfo"
- var sDELRECINFO_PATH = "/root/data/delinfo/recinfo"
- var sRECBASELIST_PATH = "/root/hidden/recbaseinfo/recbaselist";
- var aSKIPCOL = new Array("etcimgheight");
- var sLISTTMP = " ";
- // MAINLIST COLUMNS
- var aRECCOL = {"F1":[1 ]
- ,"F2":[1 ]
- ,"F3":[1 ]
- ,"F4":[1 ]
- ,"I" :[1,2 ]
- ,"T" :[1,2 ]
- ,"D" :[1,2,3]
- ,"W" :[1,2 ]
- ,"IM":[1,2 ]
- ,"FT":[1,2 ]
- }
- // PK COLUMNS
- var aPKCOLID_MASTLIST = new Array( "instcd"
- , "pid"
- , "orddd"
- , "cretno"
- , "orddeptcd"
- , "formrecdeptcd"
- , "wrdflag"
- , "wmid"
- , "recoseq" );
- var aWRDFLAG = { "CC" : [true, true]
- , "PI" : [true, true]
- , "PDH" : [true, true]
- , "PMH" : [true, true]
- , "진단" : [true, true]
- , "진료" : [true, true]
- , "계획" : [true, true]
- , "NEXT" : [true, true]
- , "템플릿" : [false, true]}
- // 서식 코드 값
- var aRECFLAGCD = { "CC" : "A1"
- , "PI" : "A2"
- , "PDH" : "A8"
- , "PMH" : "A3"
- , "진단" : "A5"
- , "진료" : "A4"
- , "계획" : "A9"
- , "주의사항" : "A11"
- , "NEXT" : "A30"}
-
- var sIMAGEFOLD1 = "C:\\Program Files\\himed\\webapps";
- var sIMAGEFOLD2 = sIMAGEFOLD1 + "\\emr";
- var sIMAGEFOLD3 = sIMAGEFOLD2 + "\\dentirecweb";
- var sIMAGEFOLD4 = sIMAGEFOLD3 + "\\" + ((getSystemCd()=="")?"LOCAL":getSystemCd());
- var sIMAGEFOLD = sIMAGEFOLD4 + "\\" + ((getGlobalVariable("logindt")=="")?"LOCAL":getGlobalVariable("logindt"));
- var sFTPFOLD4 = sIMAGEFOLD3 + "\\" + ((getSystemCd()=="")?"FTP_LOCAL":("FTP_" + getSystemCd()));
- var sFTPFOLD = sFTPFOLD4 + "\\" + ((getGlobalVariable("logindt")=="")?"FTP_LOCAL":getGlobalVariable("logindt"));
- var iFocusIndx = 0;
- var sFORMCD = '1000009251';
- // input popup의 object 위치 초기값을 저장한다.
- var iopt_checktext1width = 0;
- var iopt_checktext2width = 0;
- var iopt_checktext3width = 0;
- var iopt_checktext4width = 0;
- var iopt_checktext5width = 0;
- var iinpt_inptedit1width = 0;
- var iinpt_inptedit2width = 0;
- var iinpt_inptedit3width = 0;
- var iinpt_inptedit4width = 0;
- var iinpt_inptedit5width = 0;
- var iinpt_inptedit1left = 0;
- var iinpt_inptedit2left = 0;
- var iinpt_inptedit3left = 0;
- var iinpt_inptedit4left = 0;
- var iinpt_inptedit5left = 0;
- var icmb_inptdddl1width = 0;
- var icmb_inptdddl2width = 0;
- var icmb_inptdddl3width = 0;
- var icmb_inptdddl4width = 0;
- var icmb_inptdddl5width = 0;
- var icmb_inptdddl1left = 0;
- var icmb_inptdddl2left = 0;
- var icmb_inptdddl3left = 0;
- var icmb_inptdddl4left = 0;
- var icmb_inptdddl5left = 0;
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 기록블라인드 처리에 따른 초기화
- * @---------------------------------------------------
- */
- function fRecMainReady()
- {
- model.setValue("/root/main/cond/foldinfo/bizflag", (mmbfGetUserEnvQuestValue("030")=="002")?"B":"A"); // 업무구분 환경설정값 셋팅
- creatMainListImgFold(true); // 메인 이미지를 위한 폴더를 생성한다.
- setMainlistImageRatio50(true); // 메인 이미지 30 비율로 설정한다.
- // treeview 초기화
- grp_foldtree.attribute ("left" ) = parseInt(grp_foldtree.attribute ("left" )) + 300;
- grp_foldtree.attribute ("width" ) = parseInt(grp_foldtree.attribute ("width" )) + 300;
- grp_foldtree.attribute ("height") = parseInt(grp_foldtree.attribute ("height")) + 300;
- tr_fold.attribute ("width" ) = parseInt(tr_fold.attribute ("width" )) + 300;
- tr_fold.attribute ("height") = parseInt(tr_fold.attribute ("height")) + 300;
- btn_drugprint.attribute("left" ) = parseInt(btn_drugprint.attribute("left" )) + 300;
- // input popup의 object 위치 초기값을 저장한다.
- iopt_checktext1width = parseInt(opt_checktext1.attribute("width"));
- iopt_checktext2width = parseInt(opt_checktext2.attribute("width"));
- iopt_checktext3width = parseInt(opt_checktext3.attribute("width"));
- iopt_checktext4width = parseInt(opt_checktext4.attribute("width"));
- iopt_checktext5width = parseInt(opt_checktext5.attribute("width"));
- iinpt_inptedit1width = parseInt(inpt_inptedit1.attribute("width"));
- iinpt_inptedit2width = parseInt(inpt_inptedit2.attribute("width"));
- iinpt_inptedit3width = parseInt(inpt_inptedit3.attribute("width"));
- iinpt_inptedit4width = parseInt(inpt_inptedit4.attribute("width"));
- iinpt_inptedit5width = parseInt(inpt_inptedit5.attribute("width"));
- iinpt_inptedit1left = parseInt(inpt_inptedit1.attribute("left" ));
- iinpt_inptedit2left = parseInt(inpt_inptedit2.attribute("left" ));
- iinpt_inptedit3left = parseInt(inpt_inptedit3.attribute("left" ));
- iinpt_inptedit4left = parseInt(inpt_inptedit4.attribute("left" ));
- iinpt_inptedit5left = parseInt(inpt_inptedit5.attribute("left" ));
- icmb_inptdddl1width = parseInt(cmb_inptdddl1.attribute ("width"));
- icmb_inptdddl2width = parseInt(cmb_inptdddl2.attribute ("width"));
- icmb_inptdddl3width = parseInt(cmb_inptdddl3.attribute ("width"));
- icmb_inptdddl4width = parseInt(cmb_inptdddl4.attribute ("width"));
- icmb_inptdddl5width = parseInt(cmb_inptdddl5.attribute ("width"));
- icmb_inptdddl1left = parseInt(cmb_inptdddl1.attribute ("left" ));
- icmb_inptdddl2left = parseInt(cmb_inptdddl2.attribute ("left" ));
- icmb_inptdddl3left = parseInt(cmb_inptdddl3.attribute ("left" ));
- icmb_inptdddl4left = parseInt(cmb_inptdddl4.attribute ("left" ));
- icmb_inptdddl5left = parseInt(cmb_inptdddl5.attribute ("left" ));
- fInitRecPamInfo();
- fReadyFormInitData();
- model.refresh();
- // setFoldReset(); // 폴더를 초기화(선택취소)한다.
- //
- // fGetRecWordinfo(); //기록용 술식어및폴더별술식어를 조회한다.
- fGetrecinfo(); // 치과진료메인을 조회한다. -- 임시
-
- fGetrefinfo(); // 술식어 참조를 조회한다.
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 조회기간 설정 초기화
- * @---------------------------------------------------
- */
- function fReadyFormInitData()
- {
- model.removenode("/root/init/wrddeptlist");
- model.makeNode("/root/init/wrddeptlist");
- fGetHardCDList("N", 242, 0 , "/root/init/wrddeptlist"); // 치과 부서(하드코드 리스트)를 조회한다. cf) mmbfGetHardCodeInfoNm(ref, rsltref, hardcd)
-
- var ls_btwrdflag1 = "bt_wrdflag1";
-
- // 술식구분을 사용자정의코드로 선택
- switch (mmbfGetUserEnvQuestValue("031"))
- {
- case "001" :
- ls_btwrdflag1 = "bt_wrdflag1";
- break;
- case "002" :
- ls_btwrdflag1 = "bt_wrdflag2";
- break;
- case "003" :
- ls_btwrdflag1 = "bt_wrdflag3";
- break;
- case "004" :
- ls_btwrdflag1 = "bt_wrdflag4";
- break;
- case "005" :
- ls_btwrdflag1 = "bt_wrdflag5";
- break;
- case "006" :
- ls_btwrdflag1 = "bt_wrdflag6";
- break;
- case "007" :
- ls_btwrdflag1 = "bt_wrdflag7";
- break;
- case "008" :
- ls_btwrdflag1 = "bt_wrdflag8";
- break;
- case "009" :
- ls_btwrdflag1 = "bt_wrdflag9";
- break;
- default :
- ls_btwrdflag1 = "bt_wrdflag1";
- break;
- }
-
- opener.ivw_dentifmla.window.document.controls.item(ls_btwrdflag1).dispatch("onclick");
- ipt_student.value = "";
- ipt_tutor.value = "";
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 환자 원무 정보 셋팅
- * @---------------------------------------------------
- */
- function fInitRecPamInfo()
- {
- try
- {
- var node = getGlobalVariable("paminfo");
- model.removeNodeset("/root/main/paminfo");
- setCSVToNode("/root/main", node, "paminfo");
- model.setValue("/root/main/cond/recinfo/pid" , model.getValue("/root/main/paminfo/pid" ));
- 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"));
- model.setValue("/root/main/cond/recinfo/cretno" , model.getValue("/root/main/paminfo/cretno" ));
- model.setValue("/root/main/cond/recinfo/orddeptcd", model.getValue("/root/main/paminfo/orddeptcd"));
- model.setValue("/root/main/cond/inptioflag" , model.getValue("/root/main/paminfo/ioflag" ));
- model.setValue("/root/main/cond/recinfo/ioflag" , model.getValue("/root/main/paminfo/ioflag" ));
- }
- catch (e)
- {
- //alert("fInitRecPamInfo");
- throw e;
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 치과진료메인 조회
- * @---------------------------------------------------
- */
- function fGetrecinfo()
- {
- model.setValue("/root/main/cond/recinfo/recfromdt" , opener.model.getValue("/root/init/reqmedireclist/recfromdt" ));
- model.setValue("/root/main/cond/recinfo/rectodt" , opener.model.getValue("/root/init/reqmedireclist/rectodt" ));
- model.setValue("/root/main/cond/recinfo/reqformrecdeptcd", opener.model.getValue("/root/send/reqmedireclist/formrecdeptcd"));
- // 초기화 START
- //mainlist 초기화
- model.removenode(sSELRECINFO_PATH);
- model.makeNode(sSELRECINFO_PATH);
- //send parameter 초기화
- model.removeNodeset("/root/send/savedata/recinfo");
- model.makeNode("/root/send/savedata/recinfo");
- model.removenode("/root/send/reqcond");
- model.makeNode("/root/send/reqcond");
- model.copyNode("/root/send/reqcond", "/root/main/cond/recinfo");
- // 초기화 END
- grd_mainlist.rebuildStyle();
- //submit 호출
- if(!submit("TRMRE00101")){
- messageBox("조회를 실패하였습니다.", "E999");
- setMainlistAll(true); // Main Grid 전체 Style 설정
- return;
- }
-
- // 조회시간을 설정한다.
- var ls_searchdt = "";
- var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and skipyn!='Y' and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
- var lx_timenode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
- if (lx_timenode.length > 0)
- {
- ls_searchdt = lx_timenode.item(0).selectSingleNode("searchdt").NodeValue;
- }
- model.setValue("/root/main/cond/recinfo/reqsearchdt", ls_searchdt);
- // 메인 이미지를 위한 폴더를 생성한다.
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- if (!fso.FolderExists(sIMAGEFOLD))
- {
- creatMainListImgFold(false);
- }
- insertInptFlag1Rec(); // Title을 무조건 발생시킨다.
- setRecImgColInstance(); // IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 로컬에 저장한다.
- setActiveInit(false); // 초기화 (조회, 저장 후)
- //치과기록PMH조회화면 재로딩
- var mainObj = getMainViewer();
- curPmhSrchObj = mainObj.javascript.getOpenWindow("SMMRE00800"); // 활성화된 PMH 검색
- if(curPmhSrchObj != null) {curPmhSrchObj.javascript.fRecMainReady(); } // 활성화된 PMH 화면이 있는 경우 조회
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 초기화 (조회, 저장 후)
- * @---------------------------------------------------
- */
- function setActiveInit(pb_refresh)
- {
- createTempNode(); // Temp 노드를 생성한다.
- setMainlistAll(pb_refresh); // Main Grid 전체 Style 설정
- model.removeNodeset(sMODRECINFO_PATH);
- model.makeNode(sMODRECINFO_PATH);
- model.removeNodeset(sDELRECINFO_PATH);
- model.makeNode(sDELRECINFO_PATH);
-
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(false); // 인증저장버튼 색을 초기화한다.
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 치과진료메인 저장
- * @---------------------------------------------------
- */
- function fClkBtnrecSave(ps_prcpsignflag)
- {
- if (ps_prcpsignflag == "0") // 임시저장(0) 일 경우 인증저장 자료가 있다면 에러메세지
- {
- var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and formrecdeptcd='" + getUserInfo("dutplcecd") + "' and prcpsignflag='2'" ;
- var lx_signnode = instance1.selectNodes(sSELRECLIST_ORG_PATH + "[" + ls_cond + "]");
- if (lx_signnode.length > 0)
- {
- messageBox("인증저장 자료가 존재해서 임시저장을 할 수 없습니다. 인증(확정)저장을 하세요!", "E999");
- return;
- }
- }
- else if (ps_prcpsignflag == "2") // 인증저장(2) 일 경우 임시저장(0)을 인증저장(2)으로 갱신
- {
- var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and (skipyn!='Y' or inptflag='F4') and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
- var lx_signnode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
- if (lx_signnode.length > 0)
- {
- var ls_currentdt = getCurrentDate() + getCurrentTime();
- for (var j=0; j <lx_signnode.length; j++)
- {
- var lx_node = lx_signnode.item(j);
- lx_node.selectSingleNode("prcpsignflag").NodeValue = ps_prcpsignflag;
- lx_node.selectSingleNode("signrecoseq").NodeValue = lx_node.selectSingleNode("recoseq").NodeValue;
- lx_node.selectSingleNode("inptseq").NodeValue = (j+1);
- if (lx_node.selectSingleNode("status").NodeValue=="")
- {
- lx_node.selectSingleNode("status").NodeValue = "m";
- lx_node.selectSingleNode("rgstdt").NodeValue = ls_currentdt;
- }
- }
- }
- }
- if (model.getValue("/root/main/condEtc/imgratio") == 0) // 'Y'일 경우에만 RESET 진행
- {
- var ls_cond = "inptflag = 'IM'";
- var lx_recImagenode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
- if (lx_recImagenode.length > 0)
- {
- for (var j=0; j <lx_recImagenode.length; j++)
- {
- var lx_node = lx_recImagenode.item(j);
- for (var i=2; i<=3; i++) // COL2~COL12까지 type을 설정한다.
- {
- lx_node.selectSingleNode("col" + i).NodeValue = "";
- }
- }
- }
- }
-
- if(chkMsetIdenNode(aPKCOLID_MASTLIST, sSELRECLIST_ORG_PATH, sSELRECINFO_PATH, sDELRECINFO_PATH, sMODRECINFO_PATH, true, "insertseq", aSKIPCOL, "m", "i")) // 동일여부체크
- {
- messageBox("저장할 데이터가", "I004");
- return;
- }
- model.removeNodeset("/root/send/savedata/recinfo");
- model.makeNode("/root/send/savedata/recinfo");
- var modrecinfo = instance1.selectSingleNode(sMODRECINFO_PATH);
- var modreclist = modrecinfo.childNodes;
- var delrecinfo = instance1.selectSingleNode(sDELRECINFO_PATH);
- var delreclist = delrecinfo.childNodes;
- var saverecinfo = instance1.selectSingleNode("/root/send/savedata/recinfo");
- if (modreclist.length > 0) // 추가 또는 수정정보를 save에 등록한다.
- {
- while(modrecchild1 = modreclist.nextNode())
- {
- saverecinfo.appendChild(modrecchild1);
- }
- }
-
- if (delreclist.length > 0) // 삭제정보를 save에 등록한다.
- {
- while(delrecchild1 = delreclist.nextNode())
- {
- saverecinfo.appendChild(delrecchild1);
- }
- }
- if ( ps_prcpsignflag == "2" // 인증저장(2) 일 경우 인증을 실행 및 성공해야 진행함.
- && !fSignSave(modreclist.length))
- {
- return;
- }
- model.refresh();
- //send parameter 설정
- model.setValue("/root/main/cond/recinfo/prcpsignflag", ps_prcpsignflag);
-
- model.makeNode("/root/send/savedata/recinfo/reqcond");
- model.copyNode("/root/send/savedata/recinfo/reqcond", "/root/main/cond/recinfo");
- grd_mainlist.rebuildStyle();
- if(!submit("TXMRE00101")){
- messageBox("저장을 실패하였습니다.", "E999");
- setMainlistAll(true); // Main Grid 전체 Style 설정
- return;
- }
- // 조회시간을 설정한다.
- var ls_searchdt = "";
- var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and skipyn!='Y' and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
- var lx_timenode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
- if (lx_timenode.length > 0)
- {
- ls_searchdt = lx_timenode.item(0).selectSingleNode("searchdt").NodeValue;
- }
- model.setValue("/root/main/cond/recinfo/reqsearchdt", ls_searchdt);
- // 메인 이미지를 위한 폴더를 생성한다.
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- if (!fso.FolderExists(sIMAGEFOLD))
- {
- creatMainListImgFold(false);
- }
- insertInptFlag1Rec(); // Title을 무조건 발생시킨다.
-
- setRecImgColInstance(); // IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 col2~col12에 입력해준다.
- setActiveInit(true); // 초기화 (조회, 저장 후)
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 기록용 술식어및폴더별술식어를 조회한다.
- * @---------------------------------------------------
- */
- function fGetRecWordinfo(){
- initWordSelectValue(); // 술식어 선택 공통변수 초기화
- model.setValue("/root/main/cond/wordinfo/bizflag", model.getValue("/root/main/cond/foldinfo/bizflag"));
- model.setValue("/root/main/cond/wordinfo/deptcd", model.getValue("/root/main/cond/foldinfo/deptcd"));
- model.setValue("/root/main/cond/wordinfo/wrdflag", model.getValue("/root/main/cond/recinfo/wrdflag"));
-
- // 초기화 START
- //mainlist 초기화
- model.removenode(sSELWORDINFO_PATH);
- model.makeNode(sSELWORDINFO_PATH);
- //send parameter 초기화
- model.removeNodeset("/root/send/wordinfo/reqcond");
- model.makeNode("/root/send/wordinfo/reqcond");
- model.copyNode("/root/send/wordinfo/reqcond", "/root/main/cond/wordinfo");
- // 초기화 END
- //submit 호출
- if(!submit("TRMRE00103")){
- messageBox("조회를 실패하였습니다.", "E999");
- return;
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 술식어 참조를 조회
- * @---------------------------------------------------
- */
- function fGetrefinfo()
- {
- // 초기화 START
- //mainlist 초기화
- model.removenode(sSELREFINFO_PATH);
- model.makeNode(sSELREFINFO_PATH);
- //send parameter 초기화
- model.removeNodeset("/root/send/refinfo/reqcond");
- model.makeNode("/root/send/refinfo/reqcond");
- model.copyNode("/root/send/refinfo/reqcond", "/root/main/cond/refinfo");
- // 초기화 END
- //submit 호출
- if(!submit("TRMRE00301")){
- messageBox("조회를 실패하였습니다.", "E999");
- return;
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 폴더를 조회
- * @---------------------------------------------------
- */
- function fGetfoldinfo()
- {
- model.setValue("/root/main/cond/foldinfo/wrdflag", model.getValue("/root/main/cond/recinfo/wrdflag"));
-
- // 초기화 START
- //mainlist 초기화
- model.removenode(sSELFOLDINFO_PATH);
- model.makeNode(sSELFOLDINFO_PATH);
- //send parameter 초기화
- model.removeNodeset("/root/send/foldinfo/reqcond");
- model.makeNode("/root/send/foldinfo/reqcond");
- model.copyNode("/root/send/foldinfo/reqcond", "/root/main/cond/foldinfo");
- // 초기화 END
- //submit 호출
- if(!submit("TRMRE00501")){
- messageBox("조회를 실패하였습니다.", "E999");
- return;
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : Temp 노드를 생성한다.
- * @---------------------------------------------------
- */
- function createTempNode()
- {
- model.removeNodeset(sSELRECINFO_ORG_PATH);
- model.makeNode(sSELRECINFO_ORG_PATH);
- model.copyNode(sSELRECINFO_ORG_PATH, sSELRECINFO_PATH);
- // temp 노드에 image col2~12 정보 삭제
- var ls_cond = "inptflag = 'IM'";
- // 삭제 내역 중 IMAGE 의 COL1~COL2값을 STRING으로 재설정
- // IMAGE 정보를 모두 찾는다.
- var lx_recImagenode = instance1.selectNodes(sSELRECLIST_ORG_PATH + "[" + ls_cond + "]");
- for (var j=0; j <lx_recImagenode.length; j++)
- {
- for (var i=2; i<=3; i++) // COL2~COL12까지 type을 설정한다.
- {
- lx_recImagenode.item(j).selectSingleNode("col" + i).NodeValue = "";
- }
- }
- }
- // 선택 Column Disalbed 가져오기
- function getColDisabled(ps_inptflag, pi_colid)
- {
- if (!chkValidationModifyMainlist(grd_mainlist.row, false)) // Main List 수정 가능여부 확인
- {
- return true;
- }
- var ls_col2id = grd_mainlist.colRef("col2");
- var ls_col3id = grd_mainlist.colRef("col3");
- switch(ps_inptflag)
- {
- case 'I' : // INPUT
- case 'T' :
- if (pi_colid == ls_col2id)
- {
- return false;
- }
- break;
- case 'D' : // DENTAL OUTPUT
- if (pi_colid == ls_col3id)
- {
- return false;
- }
- break;
- case 'W' : // WORD
- if (pi_colid == ls_col2id
- && grd_mainlist.valueMatrix(grd_mainlist.row, grd_mainlist.colRef("popinptyn")) == "N")
- {
- return false;
- }
- break;
- default:
- break;
- }
- return true;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 오른쪽 버튼 메뉴 파일 다운로드
- * @---------------------------------------------------
- */
- function downloadFile()
- {
- var li_row = grd_mainlist.row;
-
- if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("inptflag")) == "FT")
- {
- if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rgstdrid")) == "")
- {
- messageBox("파일 다운로드는 저장 후 가능합니다.", "E999");
- }
- else
- {
- var filepath = grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("filepath"));
- var filenm = grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("filenm"));
- var localfile = window.fileDialog("save","|",false,filenm,"","All Files(*.*)|*.*");
- if (localfile != "") {
- model.download(getActionURL("TRMRE00102")+"&filepath="+filepath,localfile, false, false);
- var rtn = messageBox("파일을", "Q004");
- if( rtn == 6 ) {
- window.exec(localfile);
- }
- }
- }
- }
- else
- {
- messageBox("첨부파일만 다운로드가 가능합니다.", "E999");
- }
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 오른쪽 버튼 메뉴 삭제 함수
- * @---------------------------------------------------
- */
- function delMainlistRow()
- {
- var delnode = instance1.selectSingleNode(sDELRECINFO_PATH);
- var la_recsel = new Array();
- // 삭제 ros Desc 임시 저장
- var j = 0;
- var li_getrow = 0;
- for(var i=(grd_mainlist.selectedRows-1); i>=0; i--)
- {
- li_getrow = grd_mainlist.selectedRow(i);
- if (chkValidationModifyMainlist(li_getrow, false)) // Main List 수정 가능여부 확인
- {
- la_recsel[j++] = li_getrow;
- }
- }
- // 삭제 노드를 '삭제노드'에 임시 저장을 하고, 삭제함(=> 저장 시 삭제정보 활용)
- for(i=0; i<la_recsel.length; i++)
- {
- li_row = la_recsel[i];
- var ls_pkcond = "";
- var lb_skipyn = (grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("skipyn")) == "Y") ? true : false;
- if (!lb_skipyn) // 비교 및 저장 대상일 경우
- {
- // 비교하기 위해서 PK 를 추출
- for (j=0; j<aPKCOLID_MASTLIST.length; j++)
- {
- if (ls_pkcond != "")
- {
- ls_pkcond += " and ";
- }
- var ls_pkvalue = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef(aPKCOLID_MASTLIST[j]));
-
- if (ls_pkvalue == "")
- {
- ls_pkcond = "";
- break;
- }
- ls_pkcond += aPKCOLID_MASTLIST[j] + "='" + ls_pkvalue + "'";
- }
- if (ls_pkcond == "") // PK가 존재하지 않을 경우 [추가일 경우]
- {
- grd_mainlist.deleteRow(li_row, false);
- }
- else
- {
- var ls_cond = sSELRECLIST_PATH + "[" + ls_pkcond + "]";
- delnode.appendChild(instance1.selectSingleNode(ls_cond));
-
- delnode.lastChild.selectSingleNode("delyn").NodeValue = "Y";
- delnode.lastChild.selectSingleNode("status").NodeValue = "d";
- grd_mainlist.deleteRow(li_row, false);
- }
- }
- }
- var ls_orddd = model.getValue("/root/main/cond/recinfo/orddd");
- var ls_dutplcecd = getUserInfo("dutplcecd");
- // F4 삭제
- for(i=grd_mainlist.rows-1; i>0; i--)
- {
- if( grd_mainlist.valueMatrix(i, grd_mainlist.colRef("orddd")) == ls_orddd
- && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
- && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "F4")
- {
- if ( i == grd_mainlist.rows-1
- || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("skipyn")) == "Y"
- || grd_mainlist.valueMatrix(i, grd_mainlist.colRef("wmid")) != grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("wmid")))
- {
- ls_pkcond = "";
- // 비교하기 위해서 PK 를 추출
- for (j=0; j<aPKCOLID_MASTLIST.length; j++)
- {
- if (ls_pkcond != "")
- {
- ls_pkcond += " and ";
- }
-
- var ls_pkvalue = grd_mainlist.valueMatrix(i, grd_mainlist.colRef(aPKCOLID_MASTLIST[j]));
-
- if (ls_pkvalue == "")
- {
- ls_pkcond = "";
- break;
- }
- ls_pkcond += aPKCOLID_MASTLIST[j] + "='" + ls_pkvalue + "'";
- }
-
- if (ls_pkcond == "") // PK가 존재하지 않을 경우 [추가일 경우]
- {
- grd_mainlist.deleteRow(i, false);
- }
- else
- {
- var ls_cond = sSELRECLIST_PATH + "[" + ls_pkcond + "]";
-
- delnode.appendChild(instance1.selectSingleNode(ls_cond));
-
- delnode.lastChild.selectSingleNode("delyn").NodeValue = "Y";
- delnode.lastChild.selectSingleNode("status").NodeValue = "d";
-
- grd_mainlist.deleteRow(i, false);
- }
- }
- }
- }
- // F3 삭제
- for(i=grd_mainlist.rows-1; i>0; i--)
- {
- if( grd_mainlist.valueMatrix(i, grd_mainlist.colRef("orddd")) == ls_orddd
- && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
- && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "F3")
- {
- if ( i == grd_mainlist.rows-1
- || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("inptflag")) == "F2"
- || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("inptflag")) == "F3")
- {
- grd_mainlist.deleteRow(i, false);
- }
- }
- }
- // F2 삭제
- for(i=grd_mainlist.rows-1; i>0; i--)
- {
- if( grd_mainlist.valueMatrix(i, grd_mainlist.colRef("orddd")) == ls_orddd
- && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
- && grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "F2")
- {
- if ( i == grd_mainlist.rows-1
- || grd_mainlist.valueMatrix(i+1, grd_mainlist.colRef("inptflag")) == "F2")
- {
- grd_mainlist.deleteRow(i, false);
- }
- }
- }
- model.refresh();
-
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : Main List 수정 가능여부 확인
- * @---------------------------------------------------
- */
- function chkValidationModifyMainlist(pi_row, pb_chkinptflag)
- {
- // 진료(처방)일자와 기록 일자가 동일해야 수정가능
- if (model.getValue("/root/main/cond/recinfo/orddd") != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("orddd")))
- {
- return false;
- }
- // 사용자부서와 진료과가 동일해야 수정가능
- if (getUserInfo("dutplcecd") != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("formrecdeptcd")))
- {
- return false;
- }
- var ls_inptflag = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("inptflag"))
- if (pb_chkinptflag) // row 전체 설정 시 필요한 체크 ex) Font
- {
- if ( ls_inptflag != "I"
- && ls_inptflag != "T"
- && ls_inptflag != "D"
- && ls_inptflag != "W")
- {
- return false; // INPUT, 치식, 술식 일 경우만 수정 가능
- }
- }
- return true;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 술식 팝업메뉴 '입력' 클릭 시 메인에 삽입
- * @---------------------------------------------------
- */
- function insertWordPopupMenu()
- {
- var lb_startyn = true;
- var lb_endyn = false;
-
- grd_wrdlist.isselected(0) = false;
-
- var li_selectedRows = grd_wrdlist.selectedRows;
-
- // for(var i=li_selectedRows; i>=0; i--)
- for(var i=0; i<=li_selectedRows; i++)
- {
- if (grd_wrdlist.selectedRow(i) > 0)
- {
- if (i == 0) // 마지막에 refresh
- {
- lb_endyn = true;
- }
- insertDatagridRec(grd_wrdlist, grd_wrdlist.selectedRow(i), lb_startyn, lb_endyn);
- lb_startyn = false;
- }
- }
-
- initWordSelect(); // 술식어 선택 초기화
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110307
- * @author : 최원돈
- * @desc : 술식어 선택 초기화
- * @---------------------------------------------------
- */
- function initWordSelect()
- {
- var li_selectedRows = grd_wrdlist.selectedRows;
- for(i=li_selectedRows; i>=0; i--)
- {
- grd_wrdlist.isselected(grd_wrdlist.selectedRow(i)) = false;
- }
-
- initWordSelectValue() // 술식어 선택 공통변수 초기화
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110307
- * @author : 최원돈
- * @desc : 술식어 선택 공통변수 초기화
- * @---------------------------------------------------
- */
- function initWordSelectValue()
- {
- if (wordSelectedIdx > 0)
- {
- wordSelectedRow = new Array();
- wordSelectedIdx = 0;
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110307
- * @author : 최원돈
- * @desc : 술식어 선택 DESC
- * @---------------------------------------------------
- */
- function sortNumber(a, b)
- {
- return b - a;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110307
- * @author : 최원돈
- * @desc : 술식어 선택 값 저장
- * @---------------------------------------------------
- */
- function initWordSelectedSave()
- {
- var isSelected = false;
- if (wordSelectedRow.length == 0)
- {
- wordSelectedRow[wordSelectedIdx] = grd_wrdlist.row;
- grd_wrdlist.AddListSelect(wordSelectedRow[i]);
- wordSelectedIdx++;
- }
- else
- {
- for (var j=wordSelectedRow.length-1; j>=0; j--) // 재선택 확인
- {
- if (wordSelectedRow[j]== grd_wrdlist.row)
- {
- isSelected = true;
- grd_wrdlist.isselected(grd_wrdlist.row) = false;
- break;
- }
- }
-
- var li_selectedRows = grd_wrdlist.selectedRows;
- for(i=li_selectedRows; i>=0; i--) // 선택 초기화
- {
- grd_wrdlist.isselected(grd_wrdlist.selectedRow(i)) = false;
- }
- grd_wrdlist.isselected(grd_wrdlist.row) = false;
- if(isSelected) // 재선택 시 삭제
- {
- if (j==wordSelectedRow.length-1)
- {
- wordSelectedRow.pop();
- }
- else
- {
- wordSelectedRow.splice(j,2,wordSelectedRow[j+1]);
- }
- }
- else
- {
- wordSelectedRow[wordSelectedIdx] = grd_wrdlist.row;
- }
- wordSelectedRow.sort(sortNumber);
- for(var i=wordSelectedRow.length-1; i>=0; i--)
- {
- grd_wrdlist.AddListSelect(wordSelectedRow[i]);
- }
- if(isSelected)
- {
- wordSelectedIdx--;
- }
- else
- {
- wordSelectedIdx++;
- }
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : input popup의 object 를 설정한다.
- * @---------------------------------------------------
- */
- function setinptPopup(pi_row)
- {
- opt_currentrow.value = pi_row;
-
- ls_bigostyle1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle" ));
- ls_bigogubun1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun" ));
- ls_checktext1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext" ));
- ls_bigotext1 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext" ));
- ls_bigostyle2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle2"));
- ls_bigogubun2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun2"));
- ls_checktext2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext2"));
- ls_bigotext2 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext2" ));
- ls_bigostyle3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle3"));
- ls_bigogubun3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun3"));
- ls_checktext3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext3"));
- ls_bigotext3 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext3" ));
- ls_bigostyle4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle4"));
- ls_bigogubun4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun4"));
- ls_checktext4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext4"));
- ls_bigotext4 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext4" ));
- ls_bigostyle5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigostyle5"));
- ls_bigogubun5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigogubun5"));
- ls_checktext5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("checktext5"));
- ls_bigotext5 = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("bigotext5" ));
- // Visible을 설정한다.
- bool_checktext1.visible = (ls_bigostyle1 == "CHECKBOX")? true : false;
- bool_checktext2.visible = (ls_bigostyle2 == "CHECKBOX")? true : false;
- bool_checktext3.visible = (ls_bigostyle3 == "CHECKBOX")? true : false;
- bool_checktext4.visible = (ls_bigostyle4 == "CHECKBOX")? true : false;
- bool_checktext5.visible = (ls_bigostyle5 == "CHECKBOX")? true : false;
- opt_checktext1.visible = (ls_bigostyle1 == "CHECKBOX")? true : false;
- opt_checktext2.visible = (ls_bigostyle2 == "CHECKBOX")? true : false;
- opt_checktext3.visible = (ls_bigostyle3 == "CHECKBOX")? true : false;
- opt_checktext4.visible = (ls_bigostyle4 == "CHECKBOX")? true : false;
- opt_checktext5.visible = (ls_bigostyle5 == "CHECKBOX")? true : false;
- inpt_inptedit1.visible = (ls_bigostyle1 == "EDIT" )? true : false;
- inpt_inptedit2.visible = (ls_bigostyle2 == "EDIT" )? true : false;
- inpt_inptedit3.visible = (ls_bigostyle3 == "EDIT" )? true : false;
- inpt_inptedit4.visible = (ls_bigostyle4 == "EDIT" )? true : false;
- inpt_inptedit5.visible = (ls_bigostyle5 == "EDIT" )? true : false;
- cmb_inptdddl1.visible = (ls_bigostyle1 == "DDDL" )? true : false;
- cmb_inptdddl2.visible = (ls_bigostyle2 == "DDDL" )? true : false;
- cmb_inptdddl3.visible = (ls_bigostyle3 == "DDDL" )? true : false;
- cmb_inptdddl4.visible = (ls_bigostyle4 == "DDDL" )? true : false;
- cmb_inptdddl5.visible = (ls_bigostyle5 == "DDDL" )? true : false;
- // Position을 설정한다.
- opt_checktext1.attribute("width") = (opt_checktext1.visible) ? iopt_checktext1width + 250 : iopt_checktext1width;
- opt_checktext2.attribute("width") = (opt_checktext2.visible) ? iopt_checktext2width + 250 : iopt_checktext2width;
- opt_checktext3.attribute("width") = (opt_checktext3.visible) ? iopt_checktext3width + 250 : iopt_checktext3width;
- opt_checktext4.attribute("width") = (opt_checktext4.visible) ? iopt_checktext4width + 250 : iopt_checktext4width;
- opt_checktext5.attribute("width") = (opt_checktext5.visible) ? iopt_checktext5width + 250 : iopt_checktext5width;
- inpt_inptedit1.attribute("width") = (inpt_inptedit1.visible) ? iinpt_inptedit1width + 280 : iinpt_inptedit1width;
- inpt_inptedit2.attribute("width") = (inpt_inptedit2.visible) ? iinpt_inptedit2width + 280 : iinpt_inptedit2width;
- inpt_inptedit3.attribute("width") = (inpt_inptedit3.visible) ? iinpt_inptedit3width + 280 : iinpt_inptedit3width;
- inpt_inptedit4.attribute("width") = (inpt_inptedit4.visible) ? iinpt_inptedit4width + 280 : iinpt_inptedit4width;
- inpt_inptedit5.attribute("width") = (inpt_inptedit5.visible) ? iinpt_inptedit5width + 280 : iinpt_inptedit5width;
- inpt_inptedit1.attribute("left" ) = (inpt_inptedit1.visible) ? iinpt_inptedit1left - 150 : iinpt_inptedit1left ;
- inpt_inptedit2.attribute("left" ) = (inpt_inptedit2.visible) ? iinpt_inptedit2left - 150 : iinpt_inptedit2left ;
- inpt_inptedit3.attribute("left" ) = (inpt_inptedit3.visible) ? iinpt_inptedit3left - 150 : iinpt_inptedit3left ;
- inpt_inptedit4.attribute("left" ) = (inpt_inptedit4.visible) ? iinpt_inptedit4left - 150 : iinpt_inptedit4left ;
- inpt_inptedit5.attribute("left" ) = (inpt_inptedit5.visible) ? iinpt_inptedit5left - 150 : iinpt_inptedit5left ;
- cmb_inptdddl1.attribute ("width") = (cmb_inptdddl1.visible ) ? icmb_inptdddl1width + 280 : icmb_inptdddl1width ;
- cmb_inptdddl2.attribute ("width") = (cmb_inptdddl2.visible ) ? icmb_inptdddl2width + 280 : icmb_inptdddl2width ;
- cmb_inptdddl3.attribute ("width") = (cmb_inptdddl3.visible ) ? icmb_inptdddl3width + 280 : icmb_inptdddl3width ;
- cmb_inptdddl4.attribute ("width") = (cmb_inptdddl4.visible ) ? icmb_inptdddl4width + 280 : icmb_inptdddl4width ;
- cmb_inptdddl5.attribute ("width") = (cmb_inptdddl5.visible ) ? icmb_inptdddl5width + 280 : icmb_inptdddl5width ;
- cmb_inptdddl1.attribute ("left" ) = (cmb_inptdddl1.visible ) ? icmb_inptdddl1left - 280 : icmb_inptdddl1left ;
- cmb_inptdddl2.attribute ("left" ) = (cmb_inptdddl2.visible ) ? icmb_inptdddl2left - 280 : icmb_inptdddl2left ;
- cmb_inptdddl3.attribute ("left" ) = (cmb_inptdddl3.visible ) ? icmb_inptdddl3left - 280 : icmb_inptdddl3left ;
- cmb_inptdddl4.attribute ("left" ) = (cmb_inptdddl4.visible ) ? icmb_inptdddl4left - 280 : icmb_inptdddl4left ;
- cmb_inptdddl5.attribute ("left" ) = (cmb_inptdddl5.visible ) ? icmb_inptdddl5left - 280 : icmb_inptdddl5left ;
- // MainList의 값을 설정한다.
-
- //selectNodelist
- model.setValue("/root/main/inptinfo/dddl1" , (cmb_inptdddl1.visible ) ? ls_bigotext1 : "");
- model.setValue("/root/main/inptinfo/dddl2" , (cmb_inptdddl2.visible ) ? ls_bigotext2 : "");
- model.setValue("/root/main/inptinfo/dddl3" , (cmb_inptdddl3.visible ) ? ls_bigotext3 : "");
- model.setValue("/root/main/inptinfo/dddl4" , (cmb_inptdddl4.visible ) ? ls_bigotext4 : "");
- model.setValue("/root/main/inptinfo/dddl5" , (cmb_inptdddl5.visible ) ? ls_bigotext5 : "");
-
- model.setValue("/root/main/inptinfo/edit1" , (inpt_inptedit1.visible ) ? ls_bigotext1 : "");
- model.setValue("/root/main/inptinfo/edit2" , (inpt_inptedit2.visible ) ? ls_bigotext2 : "");
- model.setValue("/root/main/inptinfo/edit3" , (inpt_inptedit3.visible ) ? ls_bigotext3 : "");
- model.setValue("/root/main/inptinfo/edit4" , (inpt_inptedit4.visible ) ? ls_bigotext4 : "");
- model.setValue("/root/main/inptinfo/edit5" , (inpt_inptedit5.visible ) ? ls_bigotext5 : "");
-
- model.setValue("/root/main/inptinfo/checktext1" , (opt_checktext1.visible ) ? ls_checktext1 : "");
- model.setValue("/root/main/inptinfo/checktext2" , (opt_checktext2.visible ) ? ls_checktext2 : "");
- model.setValue("/root/main/inptinfo/checktext3" , (opt_checktext3.visible ) ? ls_checktext3 : "");
- model.setValue("/root/main/inptinfo/checktext4" , (opt_checktext4.visible ) ? ls_checktext4 : "");
- model.setValue("/root/main/inptinfo/checktext5" , (opt_checktext5.visible ) ? ls_checktext5 : "");
-
- model.setValue("/root/main/inptinfo/checkvalue1", (bool_checktext1.visible) ? ls_bigotext1 : "");
- model.setValue("/root/main/inptinfo/checkvalue2", (bool_checktext2.visible) ? ls_bigotext2 : "");
- model.setValue("/root/main/inptinfo/checkvalue3", (bool_checktext3.visible) ? ls_bigotext3 : "");
- model.setValue("/root/main/inptinfo/checkvalue4", (bool_checktext4.visible) ? ls_bigotext4 : "");
- model.setValue("/root/main/inptinfo/checkvalue5", (bool_checktext5.visible) ? ls_bigotext5 : "");
- // input popup의 DDDL LIST 를 설정한다.
- model.removenode("/root/main/inptinfo/dddlinfo1");
- model.makeNode ("/root/main/inptinfo/dddlinfo1");
- model.removenode("/root/main/inptinfo/dddlinfo2");
- model.makeNode ("/root/main/inptinfo/dddlinfo2");
- model.removenode("/root/main/inptinfo/dddlinfo3");
- model.makeNode ("/root/main/inptinfo/dddlinfo3");
- model.removenode("/root/main/inptinfo/dddlinfo4");
- model.makeNode ("/root/main/inptinfo/dddlinfo4");
- model.removenode("/root/main/inptinfo/dddlinfo5");
- model.makeNode ("/root/main/inptinfo/dddlinfo5");
- if (cmb_inptdddl1.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo1", ls_bigogubun1, ls_bigotext1, "/root/main/inptinfo/dddl1"); }
- if (cmb_inptdddl2.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo2", ls_bigogubun2, ls_bigotext2, "/root/main/inptinfo/dddl2"); }
- if (cmb_inptdddl3.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo3", ls_bigogubun3, ls_bigotext3, "/root/main/inptinfo/dddl3"); }
- if (cmb_inptdddl4.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo4", ls_bigogubun4, ls_bigotext4, "/root/main/inptinfo/dddl4"); }
- if (cmb_inptdddl5.visible) { setdddlinfo("/root/main/inptinfo/dddlinfo5", ls_bigogubun5, ls_bigotext5, "/root/main/inptinfo/dddl5"); }
- model.refresh();
-
- return;
- }
- // input popup의 DDDL 정보를 설정한다.
- function setdddlinfo(ps_path, ps_bigogubun, ps_bigotext, ps_dddlpath)
- {
- var lx_dddlinfo = instance1.selectSingleNode(ps_path);
- var lx_refnode = instance1.selectNodes(sSELREFLIST_PATH + "[gubun='" + ps_bigogubun + "']");
- while(lx_node = lx_refnode.nextNode())
- {
- lx_dddlinfo.appendChild(lx_node);
- if ( ps_bigotext != ""
- && ps_bigotext == lx_node.selectSingleNode("codename").text)
- {
- model.setValue(ps_dddlpath, lx_node.selectSingleNode("code").text);
- }
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 치과기록 메인기록 onmousedown Event
- * @---------------------------------------------------
- */
- function fMainlistOnmousedown()
- {
- grup_inptrec.attribute("visibility") = "hidden";
- if ( grd_mainlist.isCell(event.target)
- && grd_mainlist.mouserow >= grd_mainlist.fixedrows)
- {
- if (event.button == "3") // 오른쪽 마우스 버튼 => popup menu
- {
- setPopupMenu("grd_mainlist", false, "/root/popupmenu/recmenuinfo/menulist/item", "name", "func");
- }
- else if (event.button == "1") // 왼쪽 마우스 버튼
- {
- if (grd_mainlist.mouseCol == grd_mainlist.colRef("col1"))
- {
- var ls_inptflag = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("inptflag"));
- switch (ls_inptflag)
- {
- case "FT" : // FTP 일 경우 다운로드
- if (grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("rgstdrid")) == "")
- {
- messageBox("파일보기는 저장 후 가능합니다.", "E999");
- return;
- }
-
- var filepath = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("filepath"));
- var filenm = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("filenm"));
-
- creatMainListFtpFold(false);
- var localfile = sFTPFOLD+"\\"+filenm;
- model.download(getActionURL("TRMRE00102")+"&filepath="+filepath, localfile, false, false);
- window.exec(localfile);
- break;
-
- case "IM" : // IMAGE 일 경우 IMAGE POPUP을 이용하여 수정
- var li_row = grd_mainlist.mouseRow;
- if (!chkValidationModifyMainlist(li_row, false)) // Main List 수정 가능여부 확인
- {
- return true;
- }
-
- // 현재 담고있는 이미지가 있다면 삭제
- model.removenode("/root/temp/imgerec");
- model.makeNode("/root/temp/imgerec");
- // TEMP Node를 생성한다.
- model.copynode("/root/temp/imgerec", "/root/temp/imgerecbackup")
- model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemno" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemno")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemcd" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemcd")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemkind" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemkind")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemlevlno", grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemlevlno")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemnm" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemnm")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/degnitemlevlcd", grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("degnitemlevlcd")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/reccnts" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("reccnts")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/recimge" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("recimge")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/rowno" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rowno")));
- model.setvalue("/root/temp/imgerec/recinfo/recitem/colno" , grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("colno")));
- // 그림챠트 popup Call
- setParameter("openmode", "DentiRec");
-
- modalUrl("../../../emr/medirecweb/xrw/SMMMR03600_이미지편집.xrw",1,100,100,"이미지편집");
- // 그림챠트에서 입력한 정보를 가져온다.
- var lx_recitemnode = instance1.selectSingleNode("/root/temp/imgerec/recinfo").childNodes;
- var li_recitemcnt = lx_recitemnode.length;
- var lb_refresh = false;
- var i = lx_recitemnode.length - 1; // 수정은 무조건 마지막 한 건
- var lx_node = lx_recitemnode.item(i);
- setMainlistOneRow(li_row, "IM", "col1", "그림챠트", false, false);
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemno" )) = lx_node.selectSingleNode("degnitemno").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemcd" )) = lx_node.selectSingleNode("degnitemcd").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemkind" )) = lx_node.selectSingleNode("degnitemkind").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemlevlno" )) = parseInt(lx_node.selectSingleNode("degnitemlevlno").text);
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemnm" )) = lx_node.selectSingleNode("degnitemnm").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemlevlcd" )) = lx_node.selectSingleNode("degnitemlevlcd").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("reccnts" )) = lx_node.selectSingleNode("reccnts").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("recimge" )) = lx_node.selectSingleNode("recimge").text.replace(/\r\n/g, "");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("rowno" )) = lx_node.selectSingleNode("rowno").text;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("colno" )) = lx_node.selectSingleNode("colno").text;
- if (model.getValue("/root/main/condEtc/imgratio") > 0)
- {
- var la_value = getMainlistImg(lx_recitemnode.item(i).selectSingleNode("recimge").text, li_row); // Grid에 맞는 이미지와 이미지 높이를 반환한다.
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("etcimgheight")) = la_value[0]; // 이미지 높이를 저장한다.
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("etcimgfilepath")) = la_value[1]; // 이미지 파일 경로를 저장한다.
- setMainlistOneRow(li_row, "IM", "col2", "", false, false);
- }
- else
- {
- setMainlistOneRow(li_row, "IM", "col2", grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("degnitemnm")), false, false);
- }
- setMainlistAutoResize(true, true, true); // 메인의 column 높이를 자동으로 설정한다.
- break;
- default :
- break;
- }
- }
- else if (grd_mainlist.mouseCol == grd_mainlist.colRef("col2"))
- {
- var ls_inptflag = grd_mainlist.valueMatrix(grd_mainlist.mouseRow,grd_mainlist.colRef("inptflag"));
- switch (ls_inptflag)
- {
- case "W" : // 술식일 경우 POPUP OBJECT 를 사용하여 입력
- var li_row = grd_mainlist.mouseRow;
-
- if (!chkValidationModifyMainlist(li_row, false) // Main List 수정 가능여부 확인 : 진료(처방)일자와 기록 일자가 동일해야 수정가능
- || grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("popinptyn")) != "Y")
- {
- return;
- }
- grup_inptrec.attribute("top") = (event.clientY < 520) ? event.clientY : event.clientY - 160;
-
- setinptPopup(li_row); // input popup의 object 를 설정한다.
- grup_inptrec.attribute("visibility") = "visible";
- break;
- default :
- break;
- }
- }
- }
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인 첨부파일을 위한 폴더를 생성한다.
- * @---------------------------------------------------
- */
- function creatMainListFtpFold(pb_recreate)
- {
- // 이미지를 저장할 로컬 폴더 생성
- fExistFolder(sIMAGEFOLD1, false);
- fExistFolder(sIMAGEFOLD2, false);
- fExistFolder(sIMAGEFOLD3, false);
- fExistFolder(sFTPFOLD4 , false);
- fExistFolder(sFTPFOLD , false);
- }
- // Flag 별 화면 설정
- function setwrdflag()
- {
- ls_flagtxt = document.controls.item(event.target).text;
- out_wrdflag.value = aRECFLAGCD[ls_flagtxt];
- out_wrdflagnm.value = ls_flagtxt;
- switch (ls_flagtxt)
- {
- case "진단" :
- btn_diagcopy.disabled = false;
- btn_prcp.disabled = true;
- break;
- case "계획" :
- btn_diagcopy.disabled = true;
- btn_prcp.disabled = false;
- break;
- case "진료" :
- btn_diagcopy.disabled = true;
- btn_prcp.disabled = false;
- break;
- default :
- btn_diagcopy.disabled = true;
- btn_prcp.disabled = true;
- break;
- }
-
- setFoldReset(); // 폴더를 초기화(선택취소)한다.
- if (model.getValue("/root/main/cond/foldinfo/bizflag") == "A")
- {
- cmb_wrddept.visible = true;
- if (model.getValue("/root/main/cond/foldinfo/deptcd") == "") {
- model.setValue("/root/main/cond/foldinfo/deptcd", getUserInfo("dutplcecd"));
- }
- }
- else
- {
- cmb_wrddept.visible = false;
- }
- fGetfoldinfo(); //술식어폴더를 조회한다.
- fGetRecWordinfo(); //기록용 술식어및폴더별술식어를 조회한다.
-
- ipt_student.value = "";
- ipt_tutor.value = "";
-
- if (rdo_inputflag.value != "M") // S
- {
- model.setFocus("ipt_recnm");
- }
- else // M(멀티)
- {
- model.setFocus("txt_recnm");
- }
- return;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 폴더를 초기화(선택취소)한다.
- * @---------------------------------------------------
- */
- function setFoldReset()
- {
- model.setValue("/root/main/cond/selectIndxcd", "");
- model.setValue("/root/main/cond/wordinfo/wmid", "0");
- btn_wmid.attribute("class")="btn2_letter4";
- grp_foldtree.visible = false;
- }
- /////////////////////////////////////////////////////////////////////////////////////
- // 유형별 입력 Start
- /////////////////////////////////////////////////////////////////////////////////////
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 직접입력
- * @---------------------------------------------------
- */
- function inputRecinfo()
- {
- var li_row = grd_mainlist.row;
- var ls_inptflag = grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag"));
- var ls_rectxt = ls_inptflag=="T" ? grd_mainlist.valueMatrix(li_row, grd_mainlist.col) : trim(grd_mainlist.valueMatrix(li_row, grd_mainlist.col));
- if (ls_inptflag == 'W') // 술식어 이면 술식어기록도 수정해야 함.
- {
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("wrdrec")) = ls_rectxt;
- }
- setMainlistOneRow(li_row, ls_inptflag, "col" + (grd_mainlist.col - (grd_mainlist.colref("col1") - 1)), ls_rectxt, false, true);
- if (grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("rgstdt")) != "")
- {
- grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("status")) = "m";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
- return;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : Main Grid 전체 Style 설정
- * @---------------------------------------------------
- */
- function setMainlistAll(pb_refresh) //pi_rowcnt, ps_inptflag, ps_colid, ps_value, pb_refreshyn
- {
- var li_rows = grd_mainlist.rows;
- if (li_rows < 1)
- {
- return;
- }
- //Rec 정보 설정
- setRecinfo(0, li_rows-1, "", true, false);
- setMainlistAutoResize(false, pb_refresh, true); // 메인의 column 높이를 자동으로 설정한다.
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 InptFlag1 기록정보 설정
- * @---------------------------------------------------
- */
- function insertInptFlag1Rec()
- {
- var li_row = grd_mainlist.row; // Title은 Top에 위치
- setMainlistOneRow(li_row, "F1", "col1", "<<치과기록>>", true, true);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 InptFlag2 기록정보 설정
- * @---------------------------------------------------
- */
- function insertInptFlag2Rec(pb_refreshyn)
- {
- var li_row = grd_mainlist.row;
- setMainlistOneRow(li_row, "F2", "col1", model.getValue("/root/main/cond/recinfo/orddd").toDate().getDateFormat("YYYY.MM.DD ") + getUserInfo("dutplcenm"), true, pb_refreshyn);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 InptFlag3 기록정보 설정
- * @---------------------------------------------------
- */
- function insertInptFlag3Rec(pb_refreshyn)
- {
- var li_row = grd_mainlist.row;
- setMainlistOneRow(li_row, "F3", "col1", out_wrdflagnm.value, true, pb_refreshyn);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 InptFlag4 기록정보 설정
- * @---------------------------------------------------
- */
- function insertInptFlag4Rec(pb_refreshyn)
- {
- var li_row = grd_mainlist.row;
- var ls_value = model.getValue(sSELFOLDLIST_PATH+"[" + (parseInt(iFocusIndx) + 1) + "]/titlepath");
- setMainlistOneRow(li_row, "F4", "col1", ls_value, true, pb_refreshyn);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 INPUT 기록정보 설정
- * @---------------------------------------------------
- */
- function insertInputRec()
- {
- if(trim(ipt_recnm.currentText) == "")
- {
- return;
- }
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var li_row = grd_mainlist.row;
- setMainlistOneRow(li_row, "I", "col2", trim(ipt_recnm.currentText), true, true);
- ipt_recnm.value = "";
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 INPUT (TEXT) 기록정보 설정
- * @---------------------------------------------------
- */
- function insertTextInputRec()
- {
- if( trim(ipt_recnm.currentText) == ""
- && trim(txt_recnm.currentText) == "")
- {
- return;
- }
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var li_row = grd_mainlist.row;
- var ls_ipttxt = "";
-
- if (rdo_inputflag.value == "S") // 싱글일 경우
- {
- ls_ipttxt = trim(ipt_recnm.currentText);
- ipt_recnm.value = "";
- }
- else
- {
- ls_ipttxt = trim(txt_recnm.currentText);
- txt_recnm.value = "";
- }
-
- setMainlistOneRow(li_row, "I", "col2", ls_ipttxt, true, true);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 치과기록 메인기록의 콤보박스 팝업내용을 메인기록에 적용하기
- * @---------------------------------------------------
- */
- function fInputRecPop()
- {
- grup_inptrec.attribute("visibility") = "hidden";
- var li_row = grd_mainlist.row;
- ls_content = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("content" ));
- ls_bigostyle1 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle" ));
- ls_bigogubun1 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun" ));
- ls_checktext1 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext" ));
- ls_bigostyle2 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle2"));
- ls_bigogubun2 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun2"));
- ls_checktext2 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext2"));
- ls_bigostyle3 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle3"));
- ls_bigogubun3 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun3"));
- ls_checktext3 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext3"));
- ls_bigostyle4 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle4"));
- ls_bigogubun4 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun4"));
- ls_checktext4 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext4"));
- ls_bigostyle5 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigostyle5"));
- ls_bigogubun5 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigogubun5"));
- ls_checktext5 = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("checktext5"));
- // MainList의 값을 설정한다.
- if (cmb_inptdddl1.visible ) { ls_bigotext1 = model.getValue("/root/main/inptinfo/dddlnm1" ); }
- if (cmb_inptdddl2.visible ) { ls_bigotext2 = model.getValue("/root/main/inptinfo/dddlnm2" ); }
- if (cmb_inptdddl3.visible ) { ls_bigotext3 = model.getValue("/root/main/inptinfo/dddlnm3" ); }
- if (cmb_inptdddl4.visible ) { ls_bigotext4 = model.getValue("/root/main/inptinfo/dddlnm4" ); }
- if (cmb_inptdddl5.visible ) { ls_bigotext5 = model.getValue("/root/main/inptinfo/dddlnm5" ); }
- if (inpt_inptedit1.visible ) { ls_bigotext1 = model.getValue("/root/main/inptinfo/edit1" ); }
- if (inpt_inptedit2.visible ) { ls_bigotext2 = model.getValue("/root/main/inptinfo/edit2" ); }
- if (inpt_inptedit3.visible ) { ls_bigotext3 = model.getValue("/root/main/inptinfo/edit3" ); }
- if (inpt_inptedit4.visible ) { ls_bigotext4 = model.getValue("/root/main/inptinfo/edit4" ); }
- if (inpt_inptedit5.visible ) { ls_bigotext5 = model.getValue("/root/main/inptinfo/edit5" ); }
- if (bool_checktext1.visible) { ls_bigotext1 = model.getValue("/root/main/inptinfo/checkvalue1"); }
- if (bool_checktext2.visible) { ls_bigotext2 = model.getValue("/root/main/inptinfo/checkvalue2"); }
- if (bool_checktext3.visible) { ls_bigotext3 = model.getValue("/root/main/inptinfo/checkvalue3"); }
- if (bool_checktext4.visible) { ls_bigotext4 = model.getValue("/root/main/inptinfo/checkvalue4"); }
- if (bool_checktext5.visible) { ls_bigotext5 = model.getValue("/root/main/inptinfo/checkvalue5"); }
- // 1. 출력내용에 항목 추가
- var ls_txt = ls_content;
- // 2. 내용에 공백 추가
- if ( ls_checktext1 != ""
- || ls_bigostyle1 != "")
- {
- ls_txt += sLISTTMP;
- }
-
- // 기록내용 작성
- var ls_rectxt = ls_txt;
- // 3. 내용에 텍스트 추가
- if (ls_checktext1 != "")
- {
- ls_txt += ls_checktext1;
- }
- // 4. 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle1 == "DDDL")
- {
- ls_txt += "【" + ls_bigotext1 + " ▼】";
- }
- else if (ls_bigostyle1 == "EDIT")
- {
- ls_txt += "【" + ((ls_bigotext1=="")?"_":ls_bigotext1) + "】";
- }
- else if (ls_bigostyle1 == "CHECKBOX")
- {
- ls_txt += "【" + ((ls_bigotext1==""||ls_bigotext1=="N")?" ":"√") + "】";
- }
- // 기록내용 추가
- if (ls_bigostyle1 == "TEXT")
- {
- ls_rectxt += ((ls_checktext1=="")?"":ls_checktext1 + " ");
- }
- else if (ls_bigotext1 != "")
- {
- if (ls_bigostyle1 == "CHECKBOX")
- {
- ls_rectxt += (ls_bigotext1=="Y" && ls_checktext1!="" )?ls_checktext1 + " ":"";
- }
- else
- {
- ls_rectxt += ((ls_checktext1=="")?"":ls_checktext1 + " ") + ls_bigotext1 + " ";
- }
- }
- // 내용에 텍스트 추가
- if (ls_checktext2 != "")
- {
- ls_txt += ls_checktext2;
- }
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle2 == "DDDL")
- {
- ls_txt += "【" + ls_bigotext2 + " ▼】";
- }
- else if (ls_bigostyle2 == "EDIT")
- {
- ls_txt += "【" + ((ls_bigotext2=="")?"_":ls_bigotext2) + "】";
- }
- else if (ls_bigostyle2 == "CHECKBOX")
- {
- ls_txt += "【" + ((ls_bigotext2==""||ls_bigotext2=="N")?" ":"√") + "】";
- }
- // 기록내용 추가
- if (ls_bigostyle2 == "TEXT")
- {
- ls_rectxt += ((ls_checktext2=="")?"":ls_checktext2 + " ");
- }
- else if (ls_bigotext2 != "")
- {
- if (ls_bigostyle2 == "CHECKBOX")
- {
- ls_rectxt += (ls_bigotext2=="Y" && ls_checktext2!="" )?ls_checktext2 + " ":"";
- }
- else
- {
- ls_rectxt += ((ls_checktext2=="")?"":ls_checktext2 + " ") + ls_bigotext2 + " ";
- }
- }
- // 내용에 텍스트 추가
- if (ls_checktext3 != "")
- {
- ls_txt += ls_checktext3;
- }
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle3 == "DDDL")
- {
- ls_txt += "【" + ls_bigotext3 + " ▼】";
- }
- else if (ls_bigostyle3 == "EDIT")
- {
- ls_txt += "【" + ((ls_bigotext3=="")?"_":ls_bigotext3) + "】";
- }
- else if (ls_bigostyle3 == "CHECKBOX")
- {
- ls_txt += "【" + ((ls_bigotext3==""||ls_bigotext3=="N")?" ":"√") + "】";
- }
- // 기록내용 추가
- if (ls_bigostyle3 == "TEXT")
- {
- ls_rectxt += ((ls_checktext3=="")?"":ls_checktext3 + " ");
- }
- else if (ls_bigotext3 != "")
- {
- if (ls_bigostyle3 == "CHECKBOX")
- {
- ls_rectxt += (ls_bigotext3=="Y" && ls_checktext3!="" )?ls_checktext3 + " ":"";
- }
- else
- {
- ls_rectxt += ((ls_checktext3=="")?"":ls_checktext3 + " ") + ls_bigotext3 + " ";
- }
- }
- // 내용에 텍스트 추가
- if (ls_checktext4 != "")
- {
- ls_txt += ls_checktext4;
- }
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle4 == "DDDL")
- {
- ls_txt += "【" + ls_bigotext4 + " ▼】";
- }
- else if (ls_bigostyle4 == "EDIT")
- {
- ls_txt += "【" + ((ls_bigotext4=="")?"_":ls_bigotext4) + "】";
- }
- else if (ls_bigostyle4 == "CHECKBOX")
- {
- ls_txt += "【" + ((ls_bigotext4==""||ls_bigotext4=="N")?" ":"√") + "】";
- }
-
- // 기록내용 추가
- if (ls_bigostyle4 == "TEXT")
- {
- ls_rectxt += ((ls_checktext4=="")?"":ls_checktext4 + " ");
- }
- else if (ls_bigotext4 != "")
- {
- if (ls_bigostyle4 == "CHECKBOX")
- {
- ls_rectxt += (ls_bigotext4=="Y" && ls_checktext4!="" )?ls_checktext4 + " ":"";
- }
- else
- {
- ls_rectxt += ((ls_checktext4=="")?"":ls_checktext4 + " ") + ls_bigotext4 + " ";
- }
- }
- // 내용에 텍스트 추가
- if (ls_checktext5 != "")
- {
- ls_txt += ls_checktext5;
- }
-
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle5 == "DDDL")
- {
- ls_txt += "【" + ls_bigotext5 + " ▼】";
- }
- else if (ls_bigostyle5 == "EDIT")
- {
- ls_txt += "【" + ((ls_bigotext5=="")?"_":ls_bigotext5) + "】";
- }
- else if (ls_bigostyle5 == "CHECKBOX")
- {
- ls_txt += "【" + ((ls_bigotext5==""||ls_bigotext5=="N")?" ":"√") + "】";
- }
- // 기록내용 추가
- if (ls_bigostyle5 == "TEXT")
- {
- ls_rectxt += ((ls_checktext5=="")?"":ls_checktext5 + " ");
- }
- else if (ls_bigotext5 != "")
- {
- if (ls_bigostyle5 == "CHECKBOX")
- {
- ls_rectxt += (ls_bigotext5=="Y" && ls_checktext5!="" )?ls_checktext5 + " ":"";
- }
- else
- {
- ls_rectxt += ((ls_checktext5=="")?"":ls_checktext5 + " ") + ls_bigotext5 + " ";
- }
- }
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext" )) = ls_bigotext1;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext2")) = ls_bigotext2;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext3")) = ls_bigotext3;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext4")) = ls_bigotext4;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("bigotext5")) = ls_bigotext5;
-
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wrdrec" )) = trim(ls_rectxt);
- setMainlistOneRow(li_row, "W", "col2", ls_txt, false, true);
- if (grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("rgstdt")) != "")
- {
- grd_mainlist.valueMatrix(grd_mainlist.row,grd_mainlist.colRef("status")) = "m";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 치식 기록정보 추가설정 [DENTAL]
- * @---------------------------------------------------
- */
- function insertDentalOutputRec()
- {
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var ls_detlt = opener.ivw_dentifmla.window.javascript.getdetlt(); // 좌상 치식
- var ls_detrt = opener.ivw_dentifmla.window.javascript.getdetrt(); // 우상 치식
- var ls_detlb = opener.ivw_dentifmla.window.javascript.getdetlb(); // 좌하 치식
- var ls_detrb = opener.ivw_dentifmla.window.javascript.getdetrb(); // 우하 치식
- if (rdo_inputflag.value == "S") // 싱글일 경우
- {
- var ls_ipttxt = trim(ipt_recnm.currentText);
- ipt_recnm.value = "";
- }
- else
- {
- var ls_ipttxt = trim(txt_recnm.currentText);
- txt_recnm.value = "";
- }
-
- if (ls_ipttxt == "")
- {
- var lb_existsTxt = false;
- }
- else
- {
- var lb_existsTxt = true;
- }
-
- setMainlistOneRow(grd_mainlist.row, "D", "col2", ls_detlt + "│" + ls_detrt + "\n────────┼────────\n" + ls_detlb + "│" + ls_detrb, true, !lb_existsTxt);
- opener.ivw_dentifmla.window.javascript.selectBtnTab(0); // 치식탭1 선택
- if (lb_existsTxt)
- {
- setMainlistOneRow(grd_mainlist.row, "D", "col3", ls_ipttxt, false, true);
- }
-
- insertWordPopupMenu(); //'입력' 클릭 시 메인에 삽입
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 Ftp 기록정보 설정
- * @---------------------------------------------------
- */
- function insertFtpRec()
- {
- var maxcount = uploadchk.attribute("filecount");
- var maxsize = uploadchk.attribute("filesize");
- var ls_files = window.fileDialog("open","|",true); //,"","*", "모든 파일, (*.*)|*.*"); // ("open","|","true","","pdf","Adobe PDF 파일(*.pdf)|*.pdf");
- var ls_filelist = ls_files.split("|");
- var ls_fileNM = "";
- var ls_filenm = "";
- var ls_filepath = "";
- if (ls_filelist[0] == "") // 선택 정보가 없으면 return
- {
- return;
- }
-
- for(i = 0 ; i < ls_filelist.length ; i++ )
- {
- ls_fileNM = ls_filelist[i].split("\\"); //파일 경로에서 이름을 자른다.
- ls_filenm = ls_fileNM[ls_fileNM.length-1];
- ls_filepath = ls_filelist[i];
- var li_newrow = grd_mainlist.row;
- model.setValue("/root/main/filepath", ls_filepath);
- var fileSize = uploadchk.getFileSize(0);
- if (fileSize==0) {
- messageBox("파일용량이 0 이거나 또는 지정된 경로에 없는 파일입니다.\n"+ ls_filepath, "E999");
- return;
- }
- if (!checkFileSize(uploadchk)){
- messageBox("파일 크기가 최대치("+ (maxsize / 1048576) +"MB)를", "E003");
- return;
- }
- }
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var li_row = grd_mainlist.row;
- var lb_refresh = false;
- for(i = 0 ; i < ls_filelist.length ; i++ )
- {
- ls_fileNM = ls_filelist[i].split("\\"); //파일 경로에서 이름을 자른다.
- ls_filenm = ls_fileNM[ls_fileNM.length-1];
- ls_filepath = ls_filelist[i];
- setMainlistOneRow(li_row + i, "FT", "col2", ls_filenm, true, false);
- var li_newrow = grd_mainlist.row;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("filenm")) = ls_filenm;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("filepath")) = ls_filepath;
- if (i == (ls_filelist.length - 1)) // 마지막에 refresh()
- {
- lb_refresh = true;
- }
- setMainlistOneRow(li_newrow, "FT", "col1", "첨부파일", false, lb_refresh);
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 치과기록PMH조회화면 CALL
- * @---------------------------------------------------
- */
- function callPMH()
- {
- // // 그림챠트 popup Call
- // setParameter("openmode", "DentiRec");
- open("SMMRE00800");
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 Image 기록정보 설정
- * @---------------------------------------------------
- */
- function insertImageRec()
- {
- // 현재 담고있는 이미지가 있다면 삭제
- model.removenode("/root/temp/imgerec/recinfo");
- model.makeNode("/root/temp/imgerec/recinfo");
- // 그림챠트 popup Call
- setParameter("openmode", "DentiRec");
- modalUrl("../../../emr/medirecweb/xrw/SMMMR03600_이미지편집.xrw",1,100,100,"이미지편집");
- // 그림챠트에서 입력한 정보를 가져온다.
- var lx_recitemnode = instance1.selectSingleNode("/root/temp/imgerec/recinfo").childNodes;
- var li_recitemcnt = lx_recitemnode.length;
- var lb_refresh = false;
- for (var i=0; i <li_recitemcnt; i++)
- {
- var lx_node = lx_recitemnode.item(i);
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var li_row = grd_mainlist.row;
- setMainlistOneRow(li_row, "IM", "col1", "그림챠트", true, false);
- var li_newrow = grd_mainlist.row;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemno" )) = lx_node.selectSingleNode("degnitemno").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemcd" )) = lx_node.selectSingleNode("degnitemcd").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemkind" )) = lx_node.selectSingleNode("degnitemkind").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemlevlno")) = parseInt(lx_node.selectSingleNode("degnitemlevlno").text);
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemnm" )) = lx_node.selectSingleNode("degnitemnm").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemlevlcd")) = lx_node.selectSingleNode("degnitemlevlcd").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("reccnts" )) = lx_node.selectSingleNode("reccnts").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("recimge" )) = lx_node.selectSingleNode("recimge").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("rowno" )) = lx_node.selectSingleNode("rowno").text;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("colno" )) = lx_node.selectSingleNode("colno").text;
- if (model.getValue("/root/main/condEtc/imgratio") > 0)
- {
- var la_value = getMainlistImg(lx_recitemnode.item(i).selectSingleNode("recimge").text, li_newrow); //// Grid에 맞는 이미지와 이미지 높이를 반환한다.
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("etcimgheight")) = la_value[0]; // 이미지 높이 경로를 저장한다.
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("etcimgfilepath")) = la_value[1]; // 이미지 파일 경로를 저장한다.
- setMainlistOneRow(li_newrow, "IM", "col2", "", false, false);
- }
- else
- {
- setMainlistOneRow(li_newrow, "IM", "col2", grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("degnitemnm")), false, false);
- }
- if (i == li_recitemcnt - 1) // 마지막 row 이면 refresh한다.
- {
- lb_refresh = true;
- }
- if (lb_refresh) // 마지막 row 이면 refresh한다.
- {
- setMainlistAutoResize(true, true, true); // 메인의 column 높이를 자동으로 설정한다.
- }
- }
- }
- // Grid에 맞는 축소이미지와 이미지 높이를 반환한다.(이미지와 column의 넓이로 비율을 구해서 이미지의 높이를 조정한다.)
- function getMainlistImg(ps_recimge, pi_row)
- {
- var li_widthcol = getWidthColSum(2, 3); // 현재 col2~12의 넓이를 구한다.
- obj_thumnail2.Clear();
- obj_thumnail2.LoadImageBase64(ps_recimge); // Base64로 인코딩된 이미지를 로드한다.
- obj_thumnail2.SetViewMode(0);
- var strBase64 = obj_thumnail2.SaveImageBase64();
-
- var sz = obj_thumnail2.GetImageSizeEx(false); // 원이미지=>GetImageSize(), 현재 이미지 => GetImageSizeEx(true:원 이미지/false:편집 이미지)
- var la_arrSz = sz.split("|");
- var li_widthimg = la_arrSz[0] * model.getValue("/root/main/condEtc/imgratio");
- var li_heightimg = la_arrSz[1] * model.getValue("/root/main/condEtc/imgratio");
-
- var ll_ratiowidth = li_widthimg;
- var ll_ratioheight = li_heightimg;
-
- if (li_widthimg > li_widthcol)
- {
- ll_ratiowidth = li_widthcol;
- ll_ratioheight = Math.floor(li_heightimg * (li_widthcol / li_widthimg));
- }
- obj_thumnail.Clear();
- obj_thumnail.SetViewMode(1);
- obj_thumnail.SetControlSize(ll_ratiowidth, ll_ratioheight);
- obj_thumnail.LoadImageBase64(strBase64);
-
- var la_return = new Array();
- la_return[0] = ll_ratioheight;
- la_return[1] = sIMAGEFOLD + "\\SMMRE00100_grd_mainlist_" + pi_row + getCurrentDateTime() + ".jpg";
- obj_thumnail.SaveImage(1, la_return[1]);
- obj_thumnail.Clear();
- obj_thumnail2.Clear();
-
- return la_return;
- }
- // column들의 총 width 을 구한다.
- function getWidthColSum(pi_colfrom, pi_colto)
- {
- var li_width = 0;
- for (var i=pi_colfrom; i<=pi_colto; i++)
- {
- li_width += grd_mainlist.colwidth(grd_mainlist.colRef("col" + i));
- }
- return li_width;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인의 column 높이를 자동으로 설정한다.
- * @---------------------------------------------------
- */
- function setMainlistAutoResize(pb_bottomyn, pb_refresh, pb_autoresize)
- {
- if (pb_refresh)
- {
- model.refresh();
- }
-
- if (pb_autoresize)
- {
- grd_mainlist.autoresize = true;
- }
- if (model.getValue("/root/main/condEtc/imgratio") > 0)
- {
- // IMAGE 를 모두 찾아서 Row 높이 설정을 현재 IMAGE 높이에 맞춰서 강제 조정해준다.
- for (var li_row = 0; li_row < grd_mainlist.rows; li_row++)
- {
- if ( grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "IM"
- && grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("etcimgheight")) != "")
- {
- grd_mainlist.rowheight(li_row) = grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("etcimgheight"));
- }
- }
- }
- if (pb_bottomyn)
- {
- grd_mainlist.bottomrow = grd_mainlist.row
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 술식 기록정보 설정
- * @---------------------------------------------------
- */
- function insertDatagridRec(pd_dragGrid, pi_dragRow, pb_startYn, pb_endYn)
- {
- grup_inptrec.attribute("visibility") = "hidden";
-
- if (pb_startYn)
- {
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- }
- var li_row = (grd_mainlist.row < 0) ? grd_mainlist.rows - 1 : grd_mainlist.row;
- var li_newrow = li_row + 1;
- setMainlistOneRow(li_row , "W", "col1" , "", true, false);
- var li_wrpid = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("wrpid"));
- var ls_content = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("content" ));
-
- var ls_bigostyle1 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle" ));
- var ls_bigogubun1 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun" ));
- var ls_checktext1 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext" ));
-
- var ls_bigostyle2 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle2"));
- var ls_bigogubun2 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun2"));
- var ls_checktext2 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext2"));
-
- var ls_bigostyle3 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle3"));
- var ls_bigogubun3 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun3"));
- var ls_checktext3 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext3"));
-
- var ls_bigostyle4 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle4"));
- var ls_bigogubun4 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun4"));
- var ls_checktext4 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext4"));
-
- var ls_bigostyle5 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigostyle5"));
- var ls_bigogubun5 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("bigogubun5"));
- var ls_checktext5 = pd_dragGrid.valueMatrix(pi_dragRow, pd_dragGrid.colref("checktext5"));
-
- // 1. 출력내용에 항목 추가
- var ls_txt = ls_content;
- // 2. 내용에 공백 추가
- if ( ls_checktext1 != ""
- || ls_bigostyle1 != "")
- {
- ls_txt += sLISTTMP;
- }
-
- // 3. 내용에 텍스트 추가
- if (ls_checktext1 != "")
- {
- ls_txt += ls_checktext1;
- }
- // 4. 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle1 == "DDDL")
- {
- ls_txt += "【 ▼】";
- }
- else if (ls_bigostyle1 == "EDIT")
- {
- ls_txt += "【_】";
- }
- else if (ls_bigostyle1 == "CHECKBOX")
- {
- ls_txt += "【 】";
- }
- // 내용에 텍스트 추가
- if (ls_checktext2 != "")
- {
- ls_txt += ls_checktext2;
- }
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle2 == "DDDL")
- {
- ls_txt += "【 ▼】";
- }
- else if (ls_bigostyle2 == "EDIT")
- {
- ls_txt += "【_】";
- }
- else if (ls_bigostyle2 == "CHECKBOX")
- {
- ls_txt += "【 】";
- }
- // 내용에 텍스트 추가
- if (ls_checktext3 != "")
- {
- ls_txt += ls_checktext3;
- }
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle3 == "DDDL")
- {
- ls_txt += "【 ▼】";
- }
- else if (ls_bigostyle3 == "EDIT")
- {
- ls_txt += "【_】";
- }
- else if (ls_bigostyle3 == "CHECKBOX")
- {
- ls_txt += "【 】";
- }
- // 내용에 텍스트 추가
- if (ls_checktext4 != "")
- {
- ls_txt += ls_checktext4;
- }
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle4 == "DDDL")
- {
- ls_txt += "【 ▼】";
- }
- else if (ls_bigostyle4 == "EDIT")
- {
- ls_txt += "【_】";
- }
- else if (ls_bigostyle4 == "CHECKBOX")
- {
- ls_txt += "【 】";
- }
-
- // 내용에 텍스트 추가
- if (ls_checktext5 != "")
- {
- ls_txt += ls_checktext5;
- }
-
- // 내용에 언드라인 또는 대괄호 추가
- if (ls_bigostyle5 == "DDDL")
- {
- ls_txt += "【 ▼】";
- }
- else if (ls_bigostyle5 == "EDIT")
- {
- ls_txt += "【_】";
- }
- else if (ls_bigostyle5 == "CHECKBOX")
- {
- ls_txt += "【 】";
- }
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("content" )) = ls_content;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle" )) = ls_bigostyle1;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun" )) = ls_bigogubun1;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext" )) = ls_checktext1;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle2")) = ls_bigostyle2;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun2")) = ls_bigogubun2;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext2")) = ls_checktext2;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle3")) = ls_bigostyle3;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun3")) = ls_bigogubun3;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext3")) = ls_checktext3;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle4")) = ls_bigostyle4;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun4")) = ls_bigogubun4;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext4")) = ls_checktext4;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigostyle5")) = ls_bigostyle5;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("bigogubun5")) = ls_bigogubun5;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("checktext5")) = ls_checktext5;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("popinptyn")) = (ls_txt.lastIndexOf("【")==-1) ? "N":"Y";
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("wrdrec")) = ls_content;
- grd_mainlist.valueMatrix(li_newrow, grd_mainlist.colRef("wrpid")) = li_wrpid;
- setMainlistOneRow(li_newrow, "W", "col2" , ls_txt, false, pb_endYn);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : Main Grid에 1 Row 정보 설정
- * @---------------------------------------------------
- */
- function setMainlistOneRow(pl_row, ps_inptflag, ps_colid, ps_value, pb_stlyesetYn, pb_refreshyn)
- {
- var li_row = pl_row;
- if (pb_stlyesetYn)
- {
- var ls_insertType = "below";
- if ( ps_inptflag == "F1"
- && grd_mainlist.rows > 0 ) // Title은 Top에
- {
- ls_insertType = "above";
- li_row = 0;
- }
- li_row = insertLeftRow(1, li_row, ls_insertType); // 메인에 빈 Row 추가
- //Rec 기본정보 설정
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag" )) = ps_inptflag;
- if (ps_inptflag != "F1")
- {
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("instcd" )) = getUserInfo("dutplceinstcd");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("pid" )) = model.getValue("/root/main/cond/recinfo/pid");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("orddd" )) = model.getValue("/root/main/cond/recinfo/orddd");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("cretno" )) = model.getValue("/root/main/cond/recinfo/cretno");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("orddeptcd" )) = model.getValue("/root/main/cond/recinfo/orddeptcd");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("formrecdeptcd")) = getUserInfo("dutplcecd");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("ioflag" )) = model.getValue("/root/main/cond/inptioflag");
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("recoseq" )) = "imsi" + pl_row;
- if (ps_inptflag != "F2")
- {
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wrdflag")) = out_wrdflag.value;
- }
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wmid" )) = model.getValue("/root/main/cond/wordinfo/wmid");
- }
- if ( ps_inptflag == "F1"
- || ps_inptflag == "F2"
- || ps_inptflag == "F3"
- || ps_inptflag == "F4")
- {
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("skipyn")) = "Y";
- if (ps_inptflag == "F4")
- {
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("status")) = "i";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
- }
- else
- {
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("student" )) = ipt_student.value;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("tutor" )) = ipt_tutor.value;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("status")) = "i";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
- }
- //Rec 정보 설정
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colref(ps_colid)) = ps_value;
- //Rec 정보 설정
- setRecinfo(li_row, li_row, ps_colid, pb_stlyesetYn, true);
- if (pb_refreshyn)
- {
- if ( ps_inptflag == "F1"
- || ps_inptflag == "F2"
- || ps_inptflag == "F3"
- || ps_inptflag == "F4")
- {
- setMainlistAutoResize(false, true, false); // 메인의 column 높이를 자동으로 설정한다. (refresh만 진행)
- }
- else
- {
- setMainlistAutoResize(true, true, true); // 메인의 column 높이를 자동으로 설정한다.
- }
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : Rec정보에 설정
- * @---------------------------------------------------
- */
- function setRecinfo(pi_minrow, pi_maxrow, ps_colid, pb_stlyesetYn, pb_colspanYn)
- {
- var ls_reccond = "";
- var ls_colcond = "";
- for (li_row = pi_minrow; li_row <= pi_maxrow; li_row++)
- {
- ls_inptflag = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("inptflag"));
- ls_reccond = "[inptflag='" + ls_inptflag + "']";
- if (pb_stlyesetYn)
- {
- // row style setting
- setRowstyle(li_row, ls_reccond);
- // column style setting
- for(li_array = 0; li_array < aRECCOL[ls_inptflag].length; li_array++)
- {
- setColstyle("col" + aRECCOL[ls_inptflag][li_array], li_row, ls_reccond);
- }
- }
- if (pb_colspanYn) // column colspan setting
- {
- setColspan(ps_colid, li_row, ls_reccond);
- }
- if (ps_colid == "") // 전체 설정일 경우
- {
- setReversalStyleRec(li_row, ls_inptflag); // 반전 정보에 맞춰서 Style 변경
- }
-
- if ( ls_inptflag == "IM" // 이미지 일 경우 배경을 강제로 설정한다.
- && ( ps_colid == "col2"
- || ps_colid == "")
- && model.getValue("/root/main/condEtc/imgratio") > 0)
- {
- 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"));
- }
- }
- return;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : row style setting
- * @---------------------------------------------------
- */
- function setRowstyle(pi_row, ps_reccond)
- {
- var ls_rowcond = ps_reccond + "/rowstyleinfo";
- var lnl_style = instance1.selectSingleNode(sRECBASELIST_PATH + ls_rowcond); // Rec 기준정보에서 inptflag 에 해당하는 nodelist를 가져온다.
- if(lnl_style.length > 0)
- {
- var lnl_stylechild = lnl_style.childNodes;
- while(lnlc_stylechild = lnl_stylechild.nextNode())
- {
- var lnl_styleGchild = lnlc_stylechild.childNodes;
- var ls_stylename = "";
- var ls_stylevalue = "";
- while(lnlc_styleGchild = lnl_styleGchild.nextNode())
- {
- switch(lnlc_styleGchild.nodeName)
- {
- case 'stylename':
- ls_stylename = lnlc_styleGchild.NodeValue;
- break;
- case 'stylevalue':
- ls_stylevalue = lnlc_styleGchild.NodeValue;
- break;
- default:
- break;
- }
- }
- grd_mainlist.rowstyle(pi_row, "data", ls_stylename) = ls_stylevalue;
- }
- }
- return;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : column colspan setting 수행
- * @---------------------------------------------------
- */
- function setColspan(ps_colid, pi_row, ps_reccond)
- {
- var ls_colcond = ps_reccond + "/colmapinfo/colmaplist[colid='" + ps_colid + "']";
- var lnl_col = instance1.selectSingleNode(sRECBASELIST_PATH + ls_colcond); // Rec 기준정보에서 inptflag & colid 에 해당하는 nodelist를 가져온다.
- if(lnl_col.length > 0)
- {
- var lnl_colchild = lnl_col.childNodes;
- }
- else // 1 Row 일 경우
- {
- lnl_col = instance1.selectNodes(sRECBASELIST_PATH + ls_colcond);
- var lnl_colchild = lnl_col.item(0).childNodes;
- }
- if(lnl_col.length > 0)
- {
- var ls_value = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref(ps_colid));
- var ls_starttemp = "";
- var li_mincol = 0;
- var li_maxcol = 0;
- while(lnlc_colchild = lnl_colchild.nextNode())
- {
- switch(lnlc_colchild.nodeName)
- {
- case 'starttemp':
- ls_starttemp = lnlc_colchild.NodeValue;
- break;
- case 'mincol':
- li_mincol = parseInt(lnlc_colchild.NodeValue);
- break;
- case 'maxcol':
- li_maxcol = parseInt(lnlc_colchild.NodeValue);
- break;
- default:
- break;
- }
- }
- for (var li_col = li_mincol; li_col <= li_maxcol; li_col++)
- {
- grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("col" + li_col)) = ls_starttemp + ls_value;
- }
- }
- return;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : column style setting
- * @---------------------------------------------------
- */
- function setColstyle(ps_colid, pi_row, ps_reccond)
- {
- var ls_colcond = ps_reccond + "/colmapinfo/colmaplist[colid='" + ps_colid + "']";
- var lnl_col = instance1.selectSingleNode(sRECBASELIST_PATH + ls_colcond); // Rec 기준정보에서 inptflag & colid 에 해당하는 nodelist를 가져온다.
- if(lnl_col.length > 0)
- {
- var lnl_colchild = lnl_col.childNodes;
- }
- else // 1 Row 일 경우
- {
- lnl_col = instance1.selectNodes(sRECBASELIST_PATH + ls_colcond);
- var lnl_colchild = lnl_col.item(0).childNodes;
- }
- if(lnl_col.length > 0)
- {
- var li_mincol = 0;
- var li_maxcol = 0;
- while(lnlc_colchild = lnl_colchild.nextNode())
- {
- switch(lnlc_colchild.nodeName)
- {
- case 'mincol':
- li_mincol = lnlc_colchild.NodeValue;
- break;
- case 'maxcol':
- li_maxcol = lnlc_colchild.NodeValue;
- break;
- case 'styledefaultyn':
- ls_styledefaultyn = lnlc_colchild.NodeValue;
- break;
- case 'styleinfo':
- if(ls_styledefaultyn == "N")
- {
- var lnl_stylechild = lnlc_colchild.childNodes;
- while(lnlc_stylechild = lnl_stylechild.nextNode())
- {
- var lnl_styleGchild = lnlc_stylechild.childNodes;
- var ls_stylename = "";
- var ls_stylevalue = "";
- while(lnlc_styleGchild = lnl_styleGchild.nextNode())
- {
- switch(lnlc_styleGchild.nodeName)
- {
- case 'stylename':
- ls_stylename = lnlc_styleGchild.NodeValue;
- break;
- case 'stylevalue':
- ls_stylevalue = lnlc_styleGchild.NodeValue;
- break;
- default:
- break;
- }
- }
- grd_mainlist.cellstyle(ls_stylename, pi_row, grd_mainlist.colref("col" + li_mincol), pi_row, grd_mainlist.colref("col" + li_maxcol)) = ls_stylevalue;
- }
- }
- break;
- default:
- break;
- }
- }
- }
- return;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 반전 정보에 맞춰서 Style 변경
- * @---------------------------------------------------
- */
- function setReversalStyleRec(pi_row, ps_inptflag)
- {
- var li_colid = "";
-
- if (ps_inptflag == "D")
- {
- li_colid = grd_mainlist.colref("col3");
- }
- else
- {
- li_colid = grd_mainlist.colref("col2");
- }
- // 글자색반전
- var ls_color = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("color"));
- if (ls_color != "")
- {
- grd_mainlist.cellstyle("color", pi_row, li_colid, pi_row, li_colid) = ls_color;
- }
- // 이탤릭체반전
- if (grd_mainlist.valueMatrix(pi_row, grd_mainlist.colref("italicyn")) == "Y")
- {
- grd_mainlist.cellstyle("font-style", pi_row, li_colid, pi_row, li_colid) = "italic";
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인에 빈 Row 추가
- * @---------------------------------------------------
- */
- function insertLeftRow(Rows, pl_currentrow, ls_insertType)
- {
- for(var i=0; i<Rows; i++)
- {
- if (pl_currentrow < 0)
- {
- grd_mainlist.addRow(true);
- }
- else
- {
- grd_mainlist.insertRow(pl_currentrow, ls_insertType, false, true);
- }
- }
- return grd_mainlist.row;
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 구분 Rows를 체크하여 없으면 삽입한다.
- * @---------------------------------------------------
- */
- function insertDefaultRow()
- {
- var ls_wmid = model.getValue("/root/main/cond/wordinfo/wmid"); //업무구분정보
- var ls_addflag = setFlagInsertRow(); // 삽입할 Flag 유형 Row를 찾아서 row focus를 설정한다.
- var lb_insertFlag3 = false;
- // return "24"; 메인에 InptFlag2 ~ 4 기록정보 설정
- // return "34"; 메인에 InptFlag3 ~ 4 기록정보 설정
- // return "44"; 메인에 InptFlag4 기록정보 설정
- // return "" ; 메인에 InptFlag 기록정보 설정 없음
- if (ls_addflag == "24")
- {
- insertInptFlag2Rec(false); // 메인에 InptFlag2 기록정보 설정
- }
- if ( ls_addflag == "24"
- || ls_addflag == "34")
- {
- insertInptFlag3Rec(false); // 메인에 InptFlag2 기록정보 설정
- lb_insertFlag3 = true;
- }
- if ( ls_addflag != ""
- && ls_wmid != "0")
- {
- if (!lb_insertFlag3) // 기존에 FLAG3이 있고, FLAG4를 추가해야하면 마지막 FLAG4의 마지막 입력 정보를 찾는다.
- {
-
- }
-
- insertInptFlag4Rec(false); // 메인에 InptFlag4 기록정보 설정
- }
- }
- // 삽입할 Flag 유형 Row를 찾아서 row focus를 설정한다.
- function setFlagInsertRow()
- {
- var ls_currentdd = model.getValue("/root/main/cond/recinfo/orddd");
- var ls_wrdflag = out_wrdflag.value;
- var ls_wmid = model.getValue("/root/main/cond/wordinfo/wmid"); //업무구분정보
- // 금일 날짜정보 찾기
- var li_daterow = grd_mainlist.findRow(ls_currentdd, 0, grd_mainlist.colref("orddd"), false, true);
- // 작성부서 찾기
- var ls_dutplcecd = getUserInfo("dutplcecd");
- var li_deptrow = grd_mainlist.findRow(ls_dutplcecd, li_daterow, grd_mainlist.colref("formrecdeptcd"), false, true);
- if ( li_daterow < 0
- || li_deptrow < 0) // 금일 날짜정보 없거나 기록작성 부서가 없을 경우
- {
- grd_mainlist.row = 0;
- return "24";
- }
- else // 금일 날짜정보가 있을 경우
- {
- if (li_daterow != grd_mainlist.rows - 1) // 마지막 Row가 아닐 경우
- {
- // 진료일자의 술식구분을 찾는다.
- var li_wrdflagrow = grd_mainlist.findRow(ls_wrdflag, li_deptrow, grd_mainlist.colref("wrdflag"), false, true);
- // 진료일자에 술식구분이 있다면,
- if ( li_wrdflagrow > 0
- && grd_mainlist.valueMatrix(li_wrdflagrow, grd_mainlist.colRef("orddd")) == ls_currentdd
- && grd_mainlist.valueMatrix(li_wrdflagrow, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd)
- {
- if (li_wrdflagrow != grd_mainlist.rows - 1) // 마지막 Row가 아닐 경우
- {
- var li_wmidrow = grd_mainlist.findRow(ls_wmid, li_wrdflagrow+1, grd_mainlist.colref("wmid"), false, true);
- // 진료일자의 술식구분에 폴더가 있을 경우
- if ( li_wmidrow > 0
- && grd_mainlist.valueMatrix(li_wmidrow, grd_mainlist.colRef("orddd")) == ls_currentdd
- && grd_mainlist.valueMatrix(li_wmidrow, grd_mainlist.colRef("formrecdeptcd")) == ls_dutplcecd
- && grd_mainlist.valueMatrix(li_wmidrow, grd_mainlist.colRef("wrdflag")) == ls_wrdflag)
- {
- if (li_wmidrow != grd_mainlist.rows - 1)
- {
- setRowLastWrdflagInsert(li_wmidrow); // 금일 술식구분의 폴더의 마지막 row를 찾아서 row focus를 설정한다.
- }
- else
- {
- grd_mainlist.row = li_wmidrow;
- }
-
- return "";
- }
- else // 진료일자의 술식구분에 폴더가 없을 경우
- {
- grd_mainlist.row = li_wrdflagrow;
- setRowLastFoldInsert(li_wrdflagrow); // 진료일자의 술식구분의 마지막 row를 찾아서 설정한다.
- return "44";
- }
- }
- else
- {
- grd_mainlist.row = li_wrdflagrow;
- return "44";
- }
- }
- else // 진료일자 술식구분이 없을 경우
- {
- grd_mainlist.row = li_daterow;
- setRowLastDayInsert(li_daterow); // 진료일자의 마지막 row를 찾아서 설정한다.
- return "34";
- }
- }
- else // 마지막 Row 일 경우
- {
- grd_mainlist.row = li_daterow;
- return "34";
- }
- }
- }
- //tt
- // 진료일자 술식구분의 마지막 row를 찾아서 설정한다.
- function setRowLastFoldInsert(pi_row)
- {
- var ls_orddd = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ));
- var ls_wrdflag = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag"));
- var ls_dutplcecd = getUserInfo("dutplcecd");
- if ( pi_row == grd_mainlist.rows - 1
- || ls_orddd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("orddd" ))
- || ls_dutplcecd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("formrecdeptcd" ))
- || ls_wrdflag != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wrdflag")))
- {
- grd_mainlist.row = pi_row;
- return;
- }
- else
- {
- setRowLastFoldInsert(pi_row + 1);
- return;
- }
- }
- // 진료일자 술식구분의 폴더의 마지막 row를 찾아서 설정한다.
- function setRowLastWrdflagInsert(pi_row)
- {
- var ls_orddd = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ));
- var ls_wrdflag = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag"));
- var ls_wmid = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid"));
- var ls_dutplcecd = getUserInfo("dutplcecd");
- if ( pi_row == grd_mainlist.rows - 1
- || ls_orddd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("orddd" ))
- || ls_dutplcecd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("formrecdeptcd" ))
- || ls_wrdflag != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wrdflag"))
- || ls_wmid != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wmid")))
- {
- grd_mainlist.row = pi_row;
- return;
- }
- else
- {
- setRowLastWrdflagInsert(pi_row + 1);
- return;
- }
- }
- // 진료일자의 마지막 row를 찾아서 설정한다.
- function setRowLastDayInsert(pi_row)
- {
- var ls_orddd = grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd"));
- var ls_dutplcecd = getUserInfo("dutplcecd");
- if ( pi_row == grd_mainlist.rows - 1
- || ls_orddd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("orddd"))
- || ls_dutplcecd != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("formrecdeptcd")))
- {
- grd_mainlist.row = pi_row;
- return;
- }
- else
- {
- setRowLastDayInsert(pi_row + 1);
- return;
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////
- // 유형별 입력 End
- /////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////
- // 반전 Start
- /////////////////////////////////////////////////////////////////////////////////////
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 글자 검정색 설정
- * @---------------------------------------------------
- */
- function setColorBlack()
- {
- setColor("#000000"); // 글자색 설정
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 글자 빨간색 설정
- * @---------------------------------------------------
- */
- function setColorRed()
- {
- setColor("#FF0000"); // 글자색 설정
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 글자 초록색 설정
- * @---------------------------------------------------
- */
- function setColorGreen()
- {
- setColor("#4AB34A"); // 글자색 설정
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 글자 파란색 설정
- * @---------------------------------------------------
- */
- function setColorBlue()
- {
- setColor("#0000FF"); // 글자색 설정
- initPopupMenu(); // Reset Right Popupmenu
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 글자색 설정
- * @---------------------------------------------------
- */
- function setColor(ps_color)
- {
- var li_row = 0;
- var li_colid = "";
- var ls_color = "";
- var ls_coloryn = "";
- for(var i=0; i<grd_mainlist.selectedRows; i++)
- {
- li_row = grd_mainlist.selectedRow(i);
- if (chkValidationModifyMainlist(li_row, true)) // Main List 수정 가능여부 확인
- {
- if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("inptflag")) == "D")
- {
- li_colid = grd_mainlist.colref("col3");
- }
- else
- {
- li_colid = grd_mainlist.colref("col2");
- }
- grd_mainlist.cellstyle("color", li_row, li_colid, li_row, li_colid) = ps_color;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("color")) = ps_color;
- if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rgstdt")) != "")
- {
- grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("status")) = "m";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
- }
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 이탤릭체 반전
- * @---------------------------------------------------
- */
- function updateItalicReversalRec()
- {
- var li_row = grd_mainlist.row;
- var li_colid = "";
- var ls_fontstyle = "";
- var ls_italicyn = "";
- for(var i=0; i<grd_mainlist.selectedRows; i++)
- {
- li_row = grd_mainlist.selectedRow(i);
- if (chkValidationModifyMainlist(li_row, true)) // Main List 수정 가능여부 확인
- {
- if(grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("italicyn")) == "Y")
- {
- ls_fontstyle = "";
- ls_italicyn = "N";
- }
- else
- {
- ls_fontstyle = "italic";
- ls_italicyn = "Y";
- }
- if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("inptflag")) == "D")
- {
- li_colid = grd_mainlist.colref("col3");
- }
- else
- {
- li_colid = grd_mainlist.colref("col2");
- }
- grd_mainlist.cellstyle("font-style", li_row, li_colid, li_row, li_colid) = ls_fontstyle;
- grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("italicyn")) = ls_italicyn;
- if (grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("rgstdt")) != "")
- {
- grd_mainlist.valueMatrix(li_row,grd_mainlist.colRef("status")) = "m";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
- }
- }
- initPopupMenu(); // Reset Right Popupmenu
- }
- /////////////////////////////////////////////////////////////////////////////////////
- // 반전 End
- /////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////
- // Client File Access Start
- /////////////////////////////////////////////////////////////////////////////////////
- /* @group : 폴더 존재여부 파악
- * @ref : C:\KNUProject\application\webapps\emr\recmngtweb\js\SPMRI02400.js
- * @by : 최원돈
- */
- function fExistFolder(foldernm, pb_recreate)
- {
- var fso, folder, s;
- fso = new ActiveXObject("Scripting.FileSystemObject");
- try
- {
- folder = fso.GetFolder(foldernm);
- if (pb_recreate)
- {
- s = folder.DateCreated;
-
- if (s != "")
- {
- fDelFolder(foldernm);
- fMakeFolder(foldernm);
- }
- }
- }
- catch (e)
- {
- fMakeFolder(foldernm);
- }
- }
- /* @group : 폴더 생성
- * @ref : C:\KNUProject\application\webapps\emr\recmngtweb\js\SPMRI02400.js
- * @by : 최원돈
- */
- function fMakeFolder(foldernm)
- {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var a = fso.CreateFolder(foldernm);
- }
- /* @group : 폴더 삭제
- * @ref : C:\KNUProject\application\webapps\emr\recmngtweb\js\SPMRI02400.js
- * @by : 최원돈
- */
- function fDelFolder(foldernm)
- {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- fso.DeleteFolder(foldernm);
- }
- /////////////////////////////////////////////////////////////////////////////////////
- // Client File Access End
- /////////////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////////////
- // 이미지 제어 Start
- /////////////////////////////////////////////////////////////////////////////////////
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인 이미지 100 비율로 설정한다.
- * @---------------------------------------------------
- */
- function setMainlistImageRatio100(pb_return)
- {
- setMainlistImageRatio("100", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
-
- if (pb_return)
- {
- return;
- }
- initPopupMenu();
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인 이미지 50 비율로 설정한다.
- * @---------------------------------------------------
- */
- function setMainlistImageRatio50(pb_return)
- {
- setMainlistImageRatio("50", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
-
- if (pb_return)
- {
- return;
- }
- initPopupMenu();
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인 이미지 30 비율로 설정한다.
- * @---------------------------------------------------
- */
- function setMainlistImageRatio30(pb_return)
- {
- setMainlistImageRatio("30", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
-
- if (pb_return)
- {
- return;
- }
- initPopupMenu();
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인 이미지 0 비율로 설정한다.
- * @---------------------------------------------------
- */
- function setMainlistImageRatio0(pb_return)
- {
- setMainlistImageRatio("0", pb_return); // 이미지 비율에 따른 SIZE를 설정한다.
-
- if (pb_return)
- {
- return;
- }
- initPopupMenu();
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 이미지 비율에 따른 SIZE를 설정한다.
- * @---------------------------------------------------
- */
- function setMainlistImageRatio(ps_value, pb_return)
- {
- var ls_cond = "/root/popupmenu/recmenuinfo/menulist/item[func='setMainlistImageRatio" + ps_value + "' and checkyn='N']";
- var lx_nodemod = instance1.selectNodes(ls_cond);
- if (lx_nodemod.length > 0)
- {
- resetMainlistImageRatio(); // RESET CHECK
- for (var i=0; i <lx_nodemod.length; i++) // INPUT CHECK
- {
- var lx_node = lx_nodemod.item(i);
-
- var ls_value = lx_node.selectSingleNode("name").NodeValue;
- lx_node.selectSingleNode("name").NodeValue = "[√" + ls_value.substring(2, ls_value.length);
- lx_node.selectSingleNode("checkyn").NodeValue = "Y";
- model.setValue("/root/main/condEtc/imgratio", lx_node.selectSingleNode("value").NodeValue)
- }
- }
-
- if (pb_return)
- {
- return;
- }
-
- grd_mainlist.rebuildStyle();
- setRecImgColInstance(); // IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 col2~col12에 입력해준다.
- setMainlistAll(true); // Main Grid 전체 Style 설정
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 이미지 설정정보를 RESET
- * @---------------------------------------------------
- */
- function resetMainlistImageRatio()
- {
- var ls_cond = "/root/popupmenu/recmenuinfo/menulist/item[checkyn='Y']";
- var lx_nodemod = instance1.selectNodes(ls_cond);
- for (var i=0; i <lx_nodemod.length; i++)
- {
- var lx_node = lx_nodemod.item(i);
- var ls_value = lx_node.selectSingleNode("name").NodeValue;
- lx_node.selectSingleNode("name").NodeValue = "[ " + ls_value.substring(2, ls_value.length);
- lx_node.selectSingleNode("checkyn").NodeValue = "N";
- }
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 메인 이미지를 위한 폴더를 생성한다.
- * @---------------------------------------------------
- */
- function creatMainListImgFold(pb_recreate)
- {
- // 이미지를 저장할 로컬 폴더 생성
- fExistFolder(sIMAGEFOLD1, false);
- fExistFolder(sIMAGEFOLD2, false);
- fExistFolder(sIMAGEFOLD3, false);
- fExistFolder(sIMAGEFOLD4, pb_recreate);
- fExistFolder(sIMAGEFOLD , false);
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : IMAGE 정보일 경우 조회 후 recimge 정보(bolb type)를 col2~col12에 입력해준다.
- * @---------------------------------------------------
- */
- function setRecImgColInstance()
- {
- var ls_cond = "inptflag = 'IM'";
- for (var i=0; i<grd_mainlist.rows; i++)
- {
- if (grd_mainlist.valueMatrix(i, grd_mainlist.colRef("inptflag")) == "IM")
- {
- if (model.getValue("/root/main/condEtc/imgratio") > 0)
- {
- var la_value = getMainlistImg(grd_mainlist.valueMatrix(i, grd_mainlist.colRef("recimge")), i); // Grid에 맞는 이미지와 이미지 높이를 반환한다.
- grd_mainlist.valueMatrix(i, grd_mainlist.colRef("etcimgheight")) = la_value[0]; // 이미지 높이를 저장한다.
- grd_mainlist.valueMatrix(i, grd_mainlist.colRef("etcimgfilepath")) = la_value[1]; // 이미지 파일 경로를 저장한다.
- for (var j=2; j<=3; j++) // COL2~COL12까지 type을 설정한다.
- {
- grd_mainlist.valueMatrix(i, grd_mainlist.colRef("col" + j)) = "";
- }
- }
- else
- {
- for (var j=2; j<=3; j++) // COL2~COL12까지 type을 설정한다.
- {
- grd_mainlist.valueMatrix(i, grd_mainlist.colRef("col" + j)) = grd_mainlist.valueMatrix(i, grd_mainlist.colRef("degnitemnm"));
- }
- }
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////
- // 이미지 제어 End
- /////////////////////////////////////////////////////////////////////////////////////
- /**
- * @---------------------------------------------------
- * @copy& : 20100000
- * @ref : C:\KNUProject\application\webapps\emr\medirecweb\js\MMRCommon.js#GetPatDiagNm(itemCd)
- * @author : 최원돈
- * @desc : 환자진단정보 가져오기
- * @---------------------------------------------------
- */
- function GetPatDiagNm()
- {
- model.removeNodeset("/root/main/diaginfo");
- model.makeValue("/root/send/cond1", model.getValue("/root/main/cond/recinfo/pid" ));
- model.makeValue("/root/send/cond2", model.getValue("/root/main/cond/recinfo/orddd" ));
- model.makeValue("/root/send/cond3", model.getValue("/root/main/cond/recinfo/cretno" ));
- model.makeValue("/root/send/cond4", model.getValue("/root/main/cond/recinfo/orddeptcd"));
- model.makeValue("/root/send/cond5", model.getValue("/root/main/cond/inptioflag" ));
-
- if (submit("TRMMO00105", false))
- {
- var nodelistDiaginfo = model.instances(0).selectNodes("/root/main/diaginfo/diagcdlist");
- var ro = "";
- var ms = "";
- var diaglist = "";
-
- if(nodelistDiaginfo.length >= 1)
- {
- for(var i = 1; i <= nodelistDiaginfo.length; i++)
- {
- sDiagkindcd = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagkindcd");
- sDiagkindcdflag = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagkindcdflag");
- sTmpdiagcd = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/icd10cd");
- sTmpdiagengnm = model.getValue("/root/main/diaginfo/diagcdlist[" + i + "]/diagengnm");
-
- ro = (sDiagkindcd == "R") ? "R/O" : " - ";
- ms = (sDiagkindcdflag == "M") ? "주" : "부";
-
- //diaglist += ro + " " + ms + " " + sTmpdiagengnm + ((i==nodelistDiaginfo.length)?"":"\n");
- diaglist += ro + " " + ms + " " + sTmpdiagcd + " " + sTmpdiagengnm + ((i==nodelistDiaginfo.length)?"":"\n"); // 20151123 변진석 교수 코드 추가 요청 (최원돈)
- }
- }
- }
- if(diaglist == "")
- {
- messageBox("환자진단정보가 없습니다.", "E999");
- return;
- }
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var li_row = grd_mainlist.row;
- setMainlistOneRow(li_row, "I", "col2", diaglist, true, true);
- }
- /**
- * @---------------------------------------------------
- * @copy& : 20100000
- * @ref : C:\KNUProject\application\webapps\emr\medirecweb\js\MMRCommon.js#GetPatDiagNm(itemCd)
- * @author : 최원돈
- * @desc : 환자처방정보 가져오기
- * @ MMO001.js#fBfPrcpSrchCom에서 opener 때문에 사용할 수 없어서 1월 초 본원 오픈 후 김영학(진료-처방담당)씨가 지원해주기로함. (2010-12-15 최원돈)
- * @---------------------------------------------------
- */
- function GetPatDrugPrcpList()
- {
- var prcpdd = "";
- var bfflag = "bfprcp";
- var flag = "";
- var todd = "";
- var pid = model.getValue("/root/main/paminfo/pid");
- var orddd = model.getValue("/root/main/cond/recinfo/orddd");
- var cretno = model.getValue("/root/main/paminfo/cretno");
- var orddrid = model.getValue("/root/main/paminfo/orddrid");
- var orddeptcd = model.getValue("/root/main/paminfo/orddeptcd");
- var prcpgenrflag = model.getValue("/root/main/paminfo/ioflag");
-
- if (prcpgenrflag == "I" || prcpgenrflag == "E" || prcpgenrflag == "D")
- {
- prcpdd = model.getValue("/root/main/paminfo/formrecdd");
- }
- else
- {
- prcpdd = orddd;
- }
- //처방정보 가져오기(퇴원처방 prcpkindcd = 60)
- if(fBfPrcpSrchCom(pid, orddd, prcpdd, bfflag, flag, orddrid, todd, prcpgenrflag, orddeptcd, cretno, "TRMMO00100", true))
- {
- //투약
- 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')]");
- //처치
- 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')]");
- }
-
- var prcpkind = ""; //처방종류
- var orgprcpnm = ""; //처방명
- var drugmthdspccdnm = ""; //용법
- var prcpdelivefact = ""; //전달사항
- var prcplist = "";
- var prcphistcd = ""; //임시,인증구분
- var prcpclscd = "";
-
- var tmpdrugmthdspccdnm = "";
-
- if(nodelistDrugPrcpinfo.length >= 1)
- {
- for(var i = 1; i <= nodelistDrugPrcpinfo.length; i++)
- {
- var subNode = nodelistDrugPrcpinfo.item(i - 1);
- //orgprcpnm = subNode.selectSingleNode("orgprcpnm").text;
- tmpdrugmthdspccdnm = subNode.selectSingleNode("drugmthdspccdnm").text;
- prcpkind = subNode.selectSingleNode("tempcol13").text;
- orgprcpnm = subNode.selectSingleNode("tempcol6").text;
- drugmthdspccdnm = subNode.selectSingleNode("tempcol7").text;
- prcpclscd = subNode.selectSingleNode("prcpclscd").text;
-
- drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
-
- drugmthdspccdnm = drugmthdspccdnm.replace("[급]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[일]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[본]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("(집)", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[home]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[임상]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[prn]", "");
- prcpdelivefact = subNode.selectSingleNode("prcpdelivefact").text;
- prcphistcd = subNode.selectSingleNode("prcphistcd").text;
-
- var ls_enter = (i==nodelistDrugPrcpinfo.length)?"":"\n";
- if(prcphistcd == "T")
- {
- if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
- {
- prcplist += "[임] " + orgprcpnm + " " + drugmthdspccdnm + ls_enter;
- }
- else
- {
- prcplist += "[임] " + orgprcpnm + ls_enter;
- }
- }
- else
- {
- if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
- {
- prcplist += orgprcpnm + " " + drugmthdspccdnm + ls_enter
- }
- else
- {
- prcplist += orgprcpnm + ls_enter
- }
- }
- }
- }
-
- var prerec = (prcplist=="") ? "" : prcplist;
-
- var prcpkind = ""; //처방종류
- var orgprcpnm = ""; //처방명
- var drugmthdspccdnm = ""; //용법
- var prcpdelivefact = ""; //전달사항
- var prcplist = "";
- var prcphistcd = ""; //임시,인증구분
- var prcpclscd = "";
-
- var tmpdrugmthdspccdnm = "";
-
- if(nodelistPrcpinfo.length >= 1)
- {
- for(var i = 1; i <= nodelistPrcpinfo.length; i++)
- {
- var subNode = nodelistPrcpinfo.item(i - 1);
- prcpkind = subNode.selectSingleNode("tempcol13").text;
- orgprcpnm = subNode.selectSingleNode("tempcol6").text;
- tmpdrugmthdspccdnm = subNode.selectSingleNode("drugmthdspccdnm").text;
- drugmthdspccdnm = subNode.selectSingleNode("tempcol7").text;
- prcpclscd = subNode.selectSingleNode("prcpclscd").text;
-
- drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
-
- drugmthdspccdnm = drugmthdspccdnm.replace("[급]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[일]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[본]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("(집)", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[home]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[임상]", "");
- drugmthdspccdnm = drugmthdspccdnm.replace("[prn]", "");
- prcpdelivefact = subNode.selectSingleNode("prcpdelivefact").text;
- prcphistcd = subNode.selectSingleNode("prcphistcd").text;
-
- var ls_enter = (i==nodelistPrcpinfo.length)?"":"\n";
- if(prcphistcd == "T")
- {
- if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
- {
- prcplist += "[임] " + orgprcpnm + " " + drugmthdspccdnm + ls_enter
- }
- else
- {
- prcplist += "[임] " + orgprcpnm + ls_enter
- }
- }
- else
- {
- if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6")
- {
- prcplist += orgprcpnm + " " + drugmthdspccdnm + ls_enter
- }
- else
- {
- prcplist += orgprcpnm + ls_enter
- }
- }
- }
- }
- prerec += (prcplist=="")?"":("\n" + prcplist);
- if(prerec == "")
- {
- messageBox("환자처방정보가 없습니다.", "E999");
- return;
- }
- insertDefaultRow(); // 구분 Rows를 체크하여 없으면 삽입한다.
- var li_row = grd_mainlist.row;
- setMainlistOneRow(li_row, "I", "col2", prerec, true, true);
- }
- //========================================================================
- // 인증저장
- //========================================================================
- function fSignSave(pi_mergecnt)
- {
- var pid = model.getValue("/root/main/paminfo/pid");
- var orddd = model.getValue("/root/main/cond/recinfo/orddd");
- var cretno = model.getValue("/root/main/paminfo/cretno");
- var orddrid = model.getValue("/root/main/paminfo/orddrid");
- var orddeptcd = model.getValue("/root/main/paminfo/orddeptcd");
- var ioflag = model.getValue("/root/main/paminfo/ioflag");
- var signno = "0";//model.getValue("/root/main/endsummary/endsummaryrecord/signno");
- // 인증 로직 호출
- Sign.certreload = false; // 전자서명 호출시 인증저장 버튼을 누를때마다 인증서가 뜨지 않도록
- // 인증할 정보를 만든다.
- var ls_cond = "orddd='" + model.getValue("/root/main/cond/recinfo/orddd") + "' and formrecdeptcd='" + getUserInfo("dutplcecd") + "'" ; // and prcpsignflag != '2' 제외 하여 사용자 부서의 모든 내용을 인증처리함.
- var lx_signnode = instance1.selectNodes(sSELRECLIST_PATH + "[" + ls_cond + "]");
- model.removenode("/root/main/signdata/recinfo");
- model.makeNode("/root/main/signdata/recinfo");
- var lx_signsavenode = instance1.selectSingleNode("/root/main/signdata/recinfo");
- if (lx_signnode.length > 0)
- {
- while(lx_signtmpnode = lx_signnode.nextNode())
- {
- lx_signsavenode.appendChild(lx_signtmpnode);
- }
- }
- if(Sign.signprocess() == true){
- model.makeNode("/root/send/savedata/recinfo/signdata");
- model.makeValue("/root/send/savedata/recinfo/signdata/pid", pid);
- model.makeValue("/root/send/savedata/recinfo/signdata/certflag", "C");
- model.makeValue("/root/send/savedata/recinfo/signdata/orddd", orddd);
- model.makeValue("/root/send/savedata/recinfo/signdata/signno", signno);
- model.makeValue("/root/send/savedata/recinfo/signdata/cretno", cretno);
- model.makeValue("/root/send/savedata/recinfo/signdata/recdd", getCurrentDate());
- model.makeValue("/root/send/savedata/recinfo/signdata/rectm", getCurrentTime());
- model.makeValue("/root/send/savedata/recinfo/signdata/recsaveflag", "Y");
- model.makeValue("/root/send/savedata/recinfo/signdata/signflag", "01");
- model.makeValue("/root/send/savedata/recinfo/signdata/signgenrflag", ioflag);
- model.makeValue("/root/send/savedata/recinfo/signdata/formcd", sFORMCD);
- model.makeValue("/root/send/savedata/recinfo/signdata/orddeptcd", orddeptcd);
- model.makeValue("/root/send/savedata/recinfo/signdata/orddrid", orddrid);
- model.makeValue("/root/send/savedata/recinfo/signdata/signbfcnts", Sign.signedInfos[3]);
- model.makeValue("/root/send/savedata/recinfo/signdata/signaftcnts", Sign.signedInfos[2]);
- model.makeValue("/root/send/savedata/recinfo/signdata/mergecnt", pi_mergecnt);
- // var signdata =
- // "pid" // 등록번호
- // + "▦certflag" // 인증여부( T : 임시저장, C : 인증저장)
- // + "▦orddd" // 입원일자(입원,응급)/진료일자(외래)
- // + "▦signno" // 서명번호
- // + "▦cretno" // 생성번호
- // + "▦recdd" // 실제 기록이 이루어진 기록일자(통합기록에서 보여짐)
- // + "▦rectm" // 실제 기록이 이루어진 기록시간(통합기록에서 보여짐)
- // + "▦recsaveflag" // 전자서명 인적정보 변경여부(기록일시 변경되는 경우 : Y, 그외 : N)
- // + "▦signflag" // 서명자료구분(01 : 진료, 02 : 간호, 20 : 가정간호)
- // + "▦signgenrflag" // 외래/입원구분 (코드정의서 M0010 참조)
- // + "▦formcd" // 각 기록지별 서식코드(0000001670 - 욕창간호기록)
- // + "▦orddeptcd" // 진료부서코드
- // + "▦orddrid" // 진료의사ID
- // + "▦signbfcnts" // 인증할 데이터 정보(미기록 노드 제거된 정보)
- // + "▦signaftcnts" // 공인인증 처리후 데이터
- // + "▩" ;
- //
- // signdata = signdata + pid
- // + "▦" + "C"
- // + "▦" + orddd
- // + "▦" + signno
- // + "▦" + cretno
- // + "▦" + getCurrentDate()
- // + "▦" + getCurrentTime()
- // + "▦" + "Y"
- // + "▦" + "01"
- // + "▦" + ioflag
- // + "▦" + sFORMCD
- // + "▦" + orddeptcd
- // + "▦" + orddrid
- // + "▦" + Sign.signedInfos[3]
- // + "▦" + Sign.signedInfos[2]
- // + "▩" ;
- //
- // model.makeValue("/root/send/savedata/recinfo/signdata", signdata);
- }
- else
- {
- return false;
- }
-
- return true;
- }
- // 인증데이터 생성함수
- function fMake_SignData() {
- /*
- //Sign.XPATH_MAINNODE = "/root/send/savedata";
- Sign.addnode("/root/main/intvinfo/intvgnrl");
- */
- Sign.addnode("/root/main/signdata");
-
- //Sign.XPATH_MAINNODE = "/root/send/savedata";
- //Sign.addnode("/root/send/savedata");
- }
- // XSLT 관련
- function fHiddenCommonInfo(){
- patinfo.style.display="none";
- }
- /**
- * @---------------------------------------------------
- * @creat : 20110101
- * @author : 최원돈
- * @desc : 기록이동
- * @---------------------------------------------------
- */
- function fClkBtnrecMove(ps_flag)
- {
- // 선택이 올바른지 체크
- var j = 0;
- var li_row = 0;
- var li_flag4_cnt = 0;
- var li_flagNot_cnt = 0;
- var ls_orddd = "";
- var ls_formrecdeptcd = "";
- var ls_wrdflag = "";
- var ls_wmid = "";
- if (grd_mainlist.rows < 1 || grd_mainlist.row < 0) { return; } // 선택된 row가 없다면 Pass
-
- li_row = grd_mainlist.row;
- if ( grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F1"
- || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F2"
- || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F3")
- {
- messageBox("Title, 술식구분, 과는 옮길 수 없습니다.", "E999");
- return;
- }
- else if (grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("inptflag")) == "F4")
- {
- if (!chkValidationModifyMainlist(li_row + 1, false)) // Main List 수정 가능여부 확인
- {
- return;
- }
- var ls_orddd = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("orddd"));
- var ls_dutplcecd = getUserInfo("dutplcecd");
- var ls_wrdflag = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wrdflag"));
- var ls_wmid = grd_mainlist.valueMatrix(li_row, grd_mainlist.colRef("wmid"));
-
- if (ps_flag == "U")
- {
- if ( grd_mainlist.valueMatrix(li_row - 1, grd_mainlist.colref("inptflag")) == "F1"
- || grd_mainlist.valueMatrix(li_row - 1, grd_mainlist.colref("inptflag")) == "F2")
- {
- messageBox("이동할 수 없습니다!", "E999");
- return;
- }
- var li_findInsertFistRow = getFindRowUpFirstFold(li_row - 1, ls_orddd, ls_dutplcecd, ls_wrdflag); // 상위 Fold 중 가장 가까운 Fold를 찾는다.
-
- if (li_findInsertFistRow == 0)
- {
- messageBox("이동할 수 없습니다!", "E999");
- return;
- }
-
- var li_findMoveLastRow = getFindRowFoldLast(li_row + 1, ls_orddd, ls_dutplcecd, ls_wrdflag, ls_wmid); // 폴더의 마지막 Row를 찾는다.
- var li_cnt = li_findMoveLastRow - li_row;
-
- for (var i=0; i<=li_cnt; i++)
- {
- setMove(true, "above", li_findInsertFistRow + i, li_row + 1 + i); // Row를 이동한다.
- }
-
- grd_mainlist.row = li_findInsertFistRow; // 현재 row를 옮겨준다.
- }
- else if (ps_flag == "D")
- {
- var li_findMoveLastRow = getFindRowFoldLast(li_row + 1, ls_orddd, ls_dutplcecd, ls_wrdflag, ls_wmid); // 폴더의 마지막 Row를 찾는다.
- if (li_findMoveLastRow == grd_mainlist.rows - 1)
- {
- messageBox("이동할 수 없습니다!", "E999");
- return;
- }
- var li_cnt = li_findMoveLastRow - li_row + 1;
- var li_findInsertFistRow = getFindRowDownLastFold(li_row + 1, ls_orddd, ls_dutplcecd); // 상위 Fold 중 가장 가까운 Fold를 찾는다.
-
- if (li_findInsertFistRow == 0)
- {
- messageBox("이동할 수 없습니다!", "E999");
- return;
- }
- var li_findMoveLastRow2 = 0;
-
- if (grd_mainlist.valueMatrix(li_findInsertFistRow, grd_mainlist.colRef("inptflag")) == "F3")
- {
- li_findMoveLastRow2 = li_findInsertFistRow;
- }
- else
- {
- var ls_wrdflag2 = grd_mainlist.valueMatrix(li_findInsertFistRow, grd_mainlist.colRef("wrdflag"));
- var ls_wmid2 = grd_mainlist.valueMatrix(li_findInsertFistRow, grd_mainlist.colRef("wmid"));
-
- li_findMoveLastRow2 = getFindRowFoldLast(li_findInsertFistRow + 1, ls_orddd, ls_dutplcecd, ls_wrdflag2, ls_wmid2); // 폴더의 마지막 Row를 찾는다.
- }
- for (var i=0; i<li_cnt; i++)
- {
- setMove(true, "below", li_findMoveLastRow2, li_row); // Row를 이동한다.
- }
- grd_mainlist.row = li_findMoveLastRow2 - li_cnt + 1; // 현재 row를 옮겨준다.
- }
-
- grd_mainlist.rebuildStyle();
- setMainlistAll(true); // Main Grid 전체 Style 설정
- }
- else
- {
- if (!chkValidationModifyMainlist(li_row, false)) // Main List 수정 가능여부 확인
- {
- return;
- }
-
- if (ps_flag == "U")
- {
- if (grd_mainlist.valueMatrix(li_row - 1, grd_mainlist.colref("skipyn")) == "Y"
- || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("wmid")) != grd_mainlist.valueMatrix(li_row-1, grd_mainlist.colref("wmid")))
- {
- messageBox("다른 폴더로 이동할 수 없습니다!", "E999");
- return;
- }
-
- setMove(false, "above", li_row - 1, li_row + 1); // Row를 이동한다.
- grd_mainlist.row = li_row - 1; // 현재 row를 옮겨준다.
- }
- else if (ps_flag == "D")
- {
- if (li_row == grd_mainlist.rows - 1)
- {
- messageBox("아래로 옮길 수 없는 마지막 행입니다!", "E999");
- return;
- }
- if (grd_mainlist.valueMatrix(li_row+1, grd_mainlist.colref("skipyn")) == "Y"
- || grd_mainlist.valueMatrix(li_row, grd_mainlist.colref("wmid")) != grd_mainlist.valueMatrix(li_row+1, grd_mainlist.colref("wmid")))
- {
- messageBox("다른 폴더로 이동할 수 없습니다!", "E999");
- return;
- }
-
- setMove(false, "below", li_row + 1, li_row); // Row를 이동한다.
- grd_mainlist.row = li_row + 1; // 현재 row를 옮겨준다.
- }
-
- grd_mainlist.rebuildStyle();
- setMainlistAll(true); // Main Grid 전체 Style 설정
- }
- }
- // Row를 이동한다.
- function setMove(pb_foldyn, pb_flag, pi_destRow, pi_srcRow)
- {
- if (pb_foldyn)
- {
- var ls_wrdflag = grd_mainlist.valueMatrix((pb_flag=="below"? pi_destRow : pi_destRow - 1), grd_mainlist.colref("wrdflag"));
- }
-
- grd_mainlist.insertRow(pi_destRow, pb_flag, false); // 옮겨질 row를 추가한다.
-
- var li_destRow = (pb_flag=="below"? pi_destRow + 1 : pi_destRow);
- fcopyMainlistRow(li_destRow, pi_srcRow); // 메인 기록정보의 Row를 복사한다.
-
- if (pb_foldyn)
- {
- grd_mainlist.valueMatrix(li_destRow, grd_mainlist.colref("wrdflag")) = ls_wrdflag;
- }
-
- grd_mainlist.deleteRow(pi_srcRow, false); // 옮겨진 row를 삭제한다.
- }
- // 상위 Fold 중 가장 가까운 Fold의 Row를 찾는다.
- function getFindRowUpFirstFold(pi_row, ps_orddd, ps_dutplcecd, ps_wrdflag)
- {
- // 금일 날짜정보 찾기
- var li_daterow = grd_mainlist.findRow(ps_orddd, 0, grd_mainlist.colref("orddd"), false, true);
- // 작성부서 찾기
- var li_deptrow = grd_mainlist.findRow(ps_dutplcecd, li_daterow, grd_mainlist.colref("formrecdeptcd"), false, true);
- // 술식구분 찾기
- var li_wrdflagrow = grd_mainlist.findRow(ps_wrdflag, li_deptrow, grd_mainlist.colref("wrdflag"), false, true);
- return getFindRowUpLastFold(li_wrdflagrow, pi_row, ps_orddd, ps_dutplcecd, ps_wrdflag, 0); // 금일 기록구분의 지정 row 위의 마지막 폴더를 찾는다.
- }
- // 기록구분의 지정 row 위의 마지막 Fold row를 찾는다.
- function getFindRowUpLastFold(pi_row, pi_lastrow, ps_orddd, ps_dutplcecd, ps_wrdflag, pi_foldrow)
- {
- if ( pi_row == pi_lastrow
- || ps_orddd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd"))
- || ps_dutplcecd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("formrecdeptcd"))
- || ps_wrdflag != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag")))
- {
- return pi_foldrow;
- }
- else
- {
- if ( grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("inptflag")) == "F3"
- || grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("inptflag")) == "F4"
- || grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid")) != grd_mainlist.valueMatrix(pi_row + 1, grd_mainlist.colRef("wmid")))
- {
- pi_foldrow = pi_row + 1;
- }
-
- return getFindRowUpLastFold(pi_row + 1, pi_lastrow, ps_orddd, ps_dutplcecd, ps_wrdflag, pi_foldrow);
- }
- }
- // 하위 Fold 중 가장 가까운 Fold의 Row를 찾는다.
- function getFindRowDownLastFold(pi_row, ps_orddd, ps_dutplcecd)
- {
- if ( pi_row == grd_mainlist.rows - 1
- || grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("inptflag")) == "F3"
- || ps_orddd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ))
- || ps_dutplcecd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("formrecdeptcd" ))
- )
- {
- return 0;
- }
- else
- {
- if ( grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("inptflag")) == "F4"
- || grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid")) != grd_mainlist.valueMatrix(pi_row - 1, grd_mainlist.colRef("wmid")))
- {
- return pi_row;
- }
-
- return getFindRowDownLastFold(pi_row + 1, ps_orddd, ps_dutplcecd);
- }
- }
- // 진료일자 술식구분의 폴더의 마지막 row를 찾아서 설정한다.
- function getFindRowFoldLast(pi_row, ps_orddd, ps_dutplcecd, ps_wrdflag, ps_wmid)
- {
- if (pi_row == grd_mainlist.rows - 1)
- {
- return pi_row;
- }
- else if ( ps_orddd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("orddd" ))
- || ps_dutplcecd != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("formrecdeptcd" ))
- || ps_wrdflag != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wrdflag"))
- || ps_wmid != grd_mainlist.valueMatrix(pi_row, grd_mainlist.colRef("wmid")))
- {
- return pi_row - 1;
- }
- else
- {
- return getFindRowFoldLast(pi_row + 1, ps_orddd, ps_dutplcecd, ps_wrdflag, ps_wmid);
- }
- }
- // 메인 기록정보의 Row를 복사한다.
- function fcopyMainlistRow(pi_destRow, pi_srcRow)
- {
- for (i=0; i<=grd_mainlist.colref("inptseq"); i++)
- {
- grd_mainlist.valueMatrix(pi_destRow, i) = grd_mainlist.valueMatrix(pi_srcRow, i);
- }
-
- if (grd_mainlist.valueMatrix(pi_destRow, grd_mainlist.colref("status")) != "i")
- {
- grd_mainlist.valueMatrix(pi_destRow, grd_mainlist.colref("status")) = "m";
- opener.ivw_dentifmla.window.javascript.setBtnSignsaveColor(true); // 인증저장버튼 색을 설정한다.
- }
-
- return;
- }
|