SPMMP01900_OutlineView.xrw 178 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>Outline View</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <temp>
  11. <stepinfo>
  12. <info>
  13. <stepno/>
  14. <stepflagcd/>
  15. <stepmemo/>
  16. <lnkstepno/>
  17. <times/>
  18. <startendflag/>
  19. <swimlineno/>
  20. <refseq/>
  21. <decirflag/>
  22. <setno/>
  23. <settypecd/>
  24. <m/>
  25. <stepnm/>
  26. <formexistyn/>
  27. <dcsnstep/>
  28. <orgstepno/>
  29. <fixedStCntl/>
  30. <tmpstepnm/>
  31. <stepattrflag/>
  32. <stepsettypecd/>
  33. </info>
  34. </stepinfo>
  35. <decisioninfo>
  36. <info>
  37. <stepno/>
  38. <deciseq/>
  39. <lnkstepno/>
  40. <m/>
  41. </info>
  42. </decisioninfo>
  43. <selectedstep>
  44. <stepno/>
  45. <stepflagcd/>
  46. <csvlist/>
  47. </selectedstep>
  48. <uid/>
  49. </temp>
  50. <outlineinfo>
  51. <info>
  52. <cpgno/>
  53. <cpghistseq/>
  54. <cpgnm/>
  55. <swimlineno>0</swimlineno>
  56. <cpgflagcd/>
  57. <cpgorddeptcd/>
  58. <settype/>
  59. </info>
  60. <menu>
  61. <popupmenu1>
  62. <item>
  63. <name>연결설정</name>
  64. <func>fSetLink</func>
  65. </item>
  66. <item>
  67. <name>연결해제</name>
  68. <func>fDelLink</func>
  69. </item>
  70. <item>
  71. <name>-</name>
  72. <func/>
  73. </item>
  74. <item>
  75. <name>시작스텝</name>
  76. <func>fSetStartStep</func>
  77. </item>
  78. <item>
  79. <name>종료스텝</name>
  80. <func>fSetEndStep</func>
  81. </item>
  82. <item>
  83. <name>-</name>
  84. <func/>
  85. </item>
  86. <item>
  87. <name>입원필요 스텝</name>
  88. <func>fSetInHospStep</func>
  89. </item>
  90. <item>
  91. <name>퇴원필요 스텝</name>
  92. <func>fSetDschHospStep</func>
  93. </item>
  94. <item>
  95. <name>-</name>
  96. <func/>
  97. </item>
  98. <item>
  99. <name>외래예약필요 스텝</name>
  100. <func>fSetOutHospStep</func>
  101. </item>
  102. <item>
  103. <name>DSC필요 스텝</name>
  104. <func>fSetDSCHospStep</func>
  105. </item>
  106. <item>
  107. <name>-</name>
  108. <func/>
  109. </item>
  110. <item>
  111. <name>삭제</name>
  112. <func>fDelCntl</func>
  113. </item>
  114. <item>
  115. <name>-</name>
  116. <func/>
  117. </item>
  118. <item>
  119. <name>스텝 상세정보</name>
  120. <func>fViewDetailPopup</func>
  121. </item>
  122. </popupmenu1>
  123. <popupmenu2>
  124. <item>
  125. <name>스윔라인추가</name>
  126. <func>fAddSwimLine</func>
  127. </item>
  128. <item>
  129. <name>스윔라인삭제</name>
  130. <func>fDelSwimLine</func>
  131. </item>
  132. <item>
  133. <name>-</name>
  134. <func/>
  135. </item>
  136. <item>
  137. <name>초기화</name>
  138. <func>fOutlineCntlInit</func>
  139. </item>
  140. </popupmenu2>
  141. <popupmenu3>
  142. <item>
  143. <name>결정하기</name>
  144. <func>fDecision</func>
  145. </item>
  146. </popupmenu3>
  147. <popupmenu4>
  148. <item>
  149. <name>D0 Step 추가</name>
  150. <func>fAddD0Step</func>
  151. </item>
  152. <item>
  153. <name>-</name>
  154. <func/>
  155. </item>
  156. <item>
  157. <name>스윔라인추가</name>
  158. <func>fAddSwimLine</func>
  159. </item>
  160. <item>
  161. <name>스윔라인삭제</name>
  162. <func>fDelSwimLine</func>
  163. </item>
  164. <item>
  165. <name>-</name>
  166. <func/>
  167. </item>
  168. <item>
  169. <name>초기화</name>
  170. <func>fOutlineCntlInit</func>
  171. </item>
  172. </popupmenu4>
  173. <popupmenu5>
  174. <item>
  175. <name>시작스텝 선택</name>
  176. <func>fSetupStartStep</func>
  177. </item>
  178. <item>
  179. <name>종료스텝 선택</name>
  180. <func>fSetupEndStep</func>
  181. </item>
  182. <item>
  183. <name>-</name>
  184. <func/>
  185. </item>
  186. <item>
  187. <name>단일 스텝 선택</name>
  188. <func>fSetupOneStep</func>
  189. </item>
  190. </popupmenu5>
  191. <popupmenu6>
  192. <item>
  193. <name>시작스텝 선택</name>
  194. <func>fSetupStartStep</func>
  195. </item>
  196. </popupmenu6>
  197. <popupmenu7>
  198. <item>
  199. <name>결정하기모드 취소</name>
  200. <func>fCnclDecisionMode</func>
  201. </item>
  202. </popupmenu7>
  203. <popupmenu8>
  204. <item>
  205. <name>CP 적용범위 선택</name>
  206. <func>fSetupCPStep</func>
  207. </item>
  208. </popupmenu8>
  209. </menu>
  210. </outlineinfo>
  211. <decisionlist/>
  212. <seldecision/>
  213. <seldecisionstep/>
  214. <seldecisionstepno/>
  215. <seldecisionlist/>
  216. <prcp/>
  217. <sortedsteplist/>
  218. </main>
  219. <hidden>
  220. </hidden>
  221. <send>
  222. </send>
  223. <init>
  224. </init>
  225. <temp>
  226. <copysset>
  227. <copy>
  228. </copy>
  229. </copysset>
  230. <getvalue/>
  231. <getdata>
  232. <authflag/>
  233. </getdata>
  234. <selecedkind>
  235. <kind/>
  236. </selecedkind>
  237. <savedfolder>
  238. <item>
  239. </item>
  240. </savedfolder>
  241. <delsteplist/>
  242. <deldecisionlist/>
  243. <decisionlist/>
  244. <openeruid/>
  245. <startstepno/>
  246. <endstepno/>
  247. </temp>
  248. </root>
  249. </instance>
  250. <script type="javascript" ev:event="xforms-ready">
  251. <![CDATA[
  252. OpenerKind = opener.window.javascript.OpenerKind;
  253. fInitialize();
  254. if(opener.window.javascript.OpenerKind == "GPS"){
  255. opener.window.javascript.fInitializeOutline();
  256. }else{
  257. ivw_detail.src= "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw";
  258. }
  259. ]]>
  260. </script>
  261. <script type="javascript" ev:event="xforms-model-construct-done">
  262. <![CDATA[
  263. //권한설정
  264. if(opener.window.javascript.OpenerKind == "GPS"){
  265. setSpclScrnAuth("R", false);
  266. //model.setValue("/root/temp/getdata/authflag", opener.model.getValue("/root/temp/getdata/authflag") );
  267. //버튼 영역 보이지 않음
  268. grp_button.visible = false;
  269. grp_swimline.visible = true;
  270. //컨트롤 사이즈 변경
  271. grp_swimline.attribute("width") = "1205px";
  272. if( parseInt(opener.ivw_outline.attribute("height")) == 766 ){
  273. grp_swimline.attribute("height") = "764px";
  274. }else if( parseInt(opener.ivw_outline.attribute("height")) == 480 ){
  275. grp_swimline.attribute("height") = "478px";
  276. }else{ // ( parseInt(opener.ivw_outline.attribute("height")) == 883 )
  277. grp_swimline.attribute("height") = "811px";
  278. }
  279. }else{
  280. if( opener.window.javascript.getAuth() == "10000000" ){
  281. setSpclScrnAuth("R", false);
  282. }else{
  283. //버튼 영역 보이지 않음
  284. grp_button.visible = true;
  285. setSpclScrnAuth("X", false);
  286. }
  287. }
  288. ]]>
  289. </script>
  290. <submission id="TRMMP02202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/prcp"/>
  291. <submission id="MRMMP01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
  292. </model>
  293. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  294. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  295. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  296. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  297. <script type="javascript">
  298. <![CDATA[
  299. // 아래 스크립트는 "SPMMP01900.js" 파일 import로 대체할 예정임!!
  300. var lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno"); //총 스윔라인 수
  301. var cpgflagcd = "";
  302. var cpgflag = "";
  303. var settype = "";
  304. var grpControlCnt; //생성된 총 그룹 컨트롤 갯수(컨트롤 생성시 위치 재배치를 위해 따로 관리)
  305. var controlCnt = 0; //생성된 컨트롤 갯수(나머지 컨트롤 카운트)
  306. var dcsCntlCnt = 1; //decision 컨트롤의 총 갯수(인스턴수 마지막 인덱스가 된다)
  307. var lineYpos;
  308. var linesControlMaxCnt = new Array(); //스윔라인 영역의 갯수
  309. var swimlineControlArray = new Array(); //라인 컨트롤의 배열(라인종류를 담는다)
  310. var selectSectionsLine = new Array(); //4*1 의 변경된 색상을 갖는 라인배열...
  311. selectSectionsLine[0] = "";
  312. selectSectionsLine[1] = "";
  313. selectSectionsLine[2] = "";
  314. selectSectionsLine[3] = "";
  315. var swimLineHight = 165; //한 스윔라인의 높이 //<-210
  316. var swimLineWidth = 815; //스윔라인의 넓이 //<-792
  317. var selectedLineSection = ""; //선택된 라인(ex:1,2...)
  318. var selectedControl = null; //선택된 아이템(컨트롤)
  319. var currentStepCntl = null; //현재 포커스를 가진 아이템(그룹아이디)
  320. var changedCntl = null; //스텝의 개요를 변경할 때, 이전에 값이 변한 스텝의 id 가 필요함.
  321. var prevStepCntl = null; //부모가 될 아이템(그룹아이디)
  322. var childStepCntl = null; //자식이 될 아이템(그룹아이디)
  323. var maxControlCnt = 2; //한줄 단위로, 최대 default 컨트롤 갯수
  324. var initControlCnt = 0; //외곽 스윔라인 컨트롤 갯수(나머지 컨트롤을 초기화 할때 initControlCnt 부터 다시 카운트 한다)
  325. var stepRef = "/root/main/steplist/info";
  326. var dcsRef = "/root/main/decisionlist/info";
  327. var sortedStepRef = "/root/main/sortedsteplist/info";
  328. var tmpIncreaseVal = 0; //임시변수, 스타트포인트의 감소 문제를 해결하고 나면, 삭제 필!
  329. var outsideControlCnt = 0; //바깥 아웃라인의 라인컨트롤 갯수(컨트롤 생성시, outsideControlCnt+1보다 큰 컨트롤들을 삭제한다)
  330. var transViewSize = 0;
  331. var connectionMode = "false";
  332. var decisionMode = "false";
  333. var readyPrcp = "N";
  334. var val_callfCreateControlYN = "N"; //약속처방/서식이 등록이 되었는지 여부, 스텝 좌측의 '*' 유무를 가린다
  335. var OpenerKind = "";
  336. /**
  337. * @group :
  338. * @ver : 2007.07
  339. * @by : 전지은
  340. * @---------------------------------------------------
  341. * @type : function
  342. * @access : public
  343. * @desc : generater 로딩 후 cpg 조회시, outline을 구성하기 위해 초기 변수를 셋팅해준다.
  344. * @param :
  345. * @return :
  346. * @---------------------------------------------------
  347. */
  348. function initGlobalVariant(arg1, arg2){
  349. grpControlCnt = arg1;
  350. outsideControlCnt = arg2;
  351. linesControlMaxCnt = new Array();
  352. for(var i=0; i<parseInt(lineNo); i++){
  353. var no = i + 1;
  354. var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no.toString() + "']");
  355. linesControlMaxCnt[i] = nodeList.length;
  356. if(linesControlMaxCnt[i] > 2 && linesControlMaxCnt[i] > linesControlMaxCnt[i-1]){
  357. maxControlCnt = linesControlMaxCnt[i];
  358. }
  359. }
  360. nodeList = instance1.selectNodes(dcsRef);
  361. dcsCntlCnt = nodeList.length + 1;
  362. if(maxControlCnt > 2){
  363. //fAdjustLine("ex", "392");
  364. fAdjustLine("allEx", "392");
  365. }
  366. }
  367. /**
  368. * @group :
  369. * @ver : 2007.07
  370. * @by : 전지은
  371. * @---------------------------------------------------
  372. * @type : function
  373. * @access : public
  374. * @desc : opener에서 스윔라인 수를 수정할 경우, outline 및 모든 컨틀롤 초기화
  375. * @param :
  376. * @return :
  377. * @---------------------------------------------------
  378. */
  379. function fOutlineCntlInit(){
  380. for(var i=0; i<=controlCnt; i++){
  381. var cntlID = swimlineControlArray[i];
  382. if( !( cntlID == "" || cntlID == null ) ){
  383. if( cntlID.substr(cntlID.length-3, 1) == "_" ){
  384. cntlID = cntlID.substr(0, cntlID.length-3);
  385. }
  386. grp_swimline.removeChild(cntlID);
  387. grp_swimline.refresh();
  388. }
  389. }
  390. outsideControlCnt = 0;
  391. tmpIncreaseVal = 0;
  392. controlCnt = 0;
  393. grpControlCnt = 0;
  394. //maxControlCnt = 2;
  395. //swimlineControlArray.slice(0, swimlineControlArray.length);
  396. swimlineControlArray = new Array();
  397. //linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
  398. //인스턴스를 비운다.
  399. model.removeNodeset("/root/main/steplist");
  400. model.removeNodeset("/root/main/decisionlist");
  401. model.makeNode("/root/main/decisionlist");
  402. selectSectionsLine[0] = "";
  403. selectSectionsLine[1] = "";
  404. selectSectionsLine[2] = "";
  405. selectSectionsLine[3] = "";
  406. selectedLineSection = "";
  407. selectedControl = null;
  408. currentStepCntl = null;
  409. changedCntl = null;
  410. prevStepCntl = null;
  411. dcsCntlCnt = 1;
  412. swimLineHight = 165; //한 스윔라인의 높이 //<-210
  413. swimLineWidth = 815; //스윔라인의 넓이
  414. maxControlCnt = 2;
  415. connectionMode = "false";
  416. }
  417. /**
  418. * @group :
  419. * @ver : 2007.07
  420. * @by : 전지은
  421. * @---------------------------------------------------
  422. * @type : function
  423. * @access : public
  424. * @desc : 초기화
  425. * @param :
  426. * @return :
  427. * @---------------------------------------------------
  428. */
  429. function fInitialize() {
  430. model.setValue("/root/temp/getdata/authflag", opener.model.getValue("/root/temp/getdata/authflag") );
  431. lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno");
  432. cpgflagcd = opener.model.getValue("/root/main/masterinfo/info/cpgflagcd");
  433. cpgflag = model.getValue("/root/main/outlineinfo/info/cpgflagcd");
  434. if(cpgflagcd == "01") settype = "W";
  435. else settype = "G";
  436. if( !(lineNo == "0" || lineNo == "") ){
  437. arrNum = parseInt(lineNo) - 1;
  438. linesControlMaxCnt = new Array(arrNum);
  439. }else{
  440. linesControlMaxCnt = new Array(lineNo);
  441. }
  442. //linesControlMaxCnt.slice(0, linesControlMaxCnt.length-1);
  443. for(var i=0; i<lineNo; i++){
  444. linesControlMaxCnt[i] = 0;
  445. }
  446. var y=0;
  447. var cy=swimLineHight;
  448. controlCnt = 0;
  449. grpControlCnt = 0;
  450. //if( maxControlCnt > 2 ) swimLineWidth = 392 * maxControlCnt; //최대 갯수에 따라 변경됨...
  451. ctrlID = "xforms:line" + (controlCnt++);
  452. ctrl = grp_swimline.createChild("xforms:line", "id:"+ctrlID + "; x1:0px; y1:0px ; x2:" + swimLineWidth + "px; y2: 0px; ");
  453. swimlineControlArray[controlCnt-1] = ctrlID+"_UW"; //up+width
  454. for(var i=1; i<=lineNo; i++){
  455. fCreateSwimLine(y, cy);
  456. y = cy; //세로 아웃라인의 y1
  457. cy = cy + swimLineHight; //세로 아웃라인의 y2
  458. }
  459. //초기화 시, 아이뷰어의 대상 화면을 결정한다.
  460. //model.setValue("/root/main/temp/uid", getOpenerUID());
  461. }
  462. /**
  463. * @group :
  464. * @ver : 2007.07
  465. * @by : 전지은
  466. * @---------------------------------------------------
  467. * @type : function
  468. * @access : public
  469. * @desc : 버튼을 생성한다. (사용 안함)
  470. * @param :
  471. * @return :
  472. * @---------------------------------------------------
  473. *
  474. function fCreateButton(){
  475. var button1 = "xforms:button";
  476. var ctrlID;
  477. var ctrl = null;
  478. ctrlID = button1 + (controlCnt++);
  479. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + 612 + ";top:" +5 + ";width:42; height:19 ; text:" + "A");
  480. ctrl.attribute("class") = "btn2_letter2";
  481. ctrlID = button1 + (controlCnt++);
  482. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 45) + ";top:" + 5 + ";width:42; height:19 ; text:" + "D");
  483. ctrl.attribute("class") = "btn2_letter2";
  484. ctrlID = button1 + (controlCnt++);
  485. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 90) + ";top:" + 5 + ";width:42; height:19 ; text:" + "B");
  486. ctrl.attribute("class") = "btn2_letter2";
  487. ctrlID = button1 + (controlCnt++);
  488. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 135) + ";top:" + 5 + ";width:42; height:19 ; text:" + "삭제");
  489. ctrl.attribute("class") = "btn2_letter2";
  490. }
  491. */
  492. /**
  493. * @group :
  494. * @ver : 2007.07
  495. * @by : 전지은
  496. * @---------------------------------------------------
  497. * @type : function
  498. * @access : public
  499. * @desc : 라인을 생성한다.
  500. * @param : y, cy
  501. * @return :
  502. * @---------------------------------------------------
  503. */
  504. function fCreateSwimLine(y, cy) {
  505. var line1 = "xforms:line";
  506. var ctrlID;
  507. var ctrl = null;
  508. var x=0;
  509. var cx = swimLineWidth -2;
  510. ctrlID = line1 + (controlCnt++);
  511. ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + y + "px; x2:" + x + "px; y2:" + cy+ "px; ");
  512. swimlineControlArray[controlCnt-1] = ctrlID+"_LH"; //left+height
  513. ctrlID = line1 + (controlCnt++);
  514. ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + cx + "px; y1:" + y + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
  515. swimlineControlArray[controlCnt-1] = ctrlID+"_RH"; //right+height
  516. ctrlID = line1 + (controlCnt++);
  517. ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + cy + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
  518. swimlineControlArray[controlCnt-1] = ctrlID+"_DW"; //down+width
  519. ctrl.refresh();
  520. outsideControlCnt = controlCnt;
  521. }
  522. /**
  523. * @group :
  524. * @ver : 2007.07
  525. * @by : 전지은
  526. * @---------------------------------------------------
  527. * @type : function
  528. * @access : public
  529. * @desc : 마지막 스윔라인을 삭제한다.
  530. * @param :
  531. * @return :
  532. * @---------------------------------------------------
  533. */
  534. function fDelLastSwimLine(){
  535. var endPnt = parseInt(outsideControlCnt);
  536. var cnt = 0;
  537. for (var i=endPnt; i>=0; i--){
  538. var str = swimlineControlArray[i];
  539. if(!isNull(str)){
  540. if(str.substr(0,12) != "xforms:group"){
  541. var cntlStr = str.substr(str.length-2, 2);
  542. if( cnt<3 && (cntlStr== "DW" || cntlStr == "RH" || cntlStr == "LH") ){
  543. grp_swimline.removeChild( str.substr(0, str.length-3) );
  544. swimlineControlArray[i] = "";
  545. cnt++;
  546. }else {
  547. return;
  548. }
  549. }
  550. }
  551. }
  552. var a = swimlineControlArray.slice(0, (endPnt-3));
  553. var b = swimlineControlArray.slice(endPnt, swimlineControlArray.length);
  554. swimlineControlArray.slice(0, swimlineControlArray.length);
  555. swimlineControlArray = a.concat(b);
  556. outsideControlCnt = outsideControlCnt - 3;
  557. //(요기) 마지막 라인을 삭제 하고 다시 마지막에 라인을 추가했을 때, 라인 선택을 하면 스크립트 오류 발생, 전체 컨트롤을 처음부터 다시 그려줘야 오류가 안 생긴다
  558. /*
  559. var stepNodeList = instance1.selectNodes(stepRef);
  560. var nodeListCSV = getNodeListCSV(stepNodeList);
  561. opener.window.javascript.fCreateOutLineView(); //fOutlineCntlInit(), fInitialize()
  562. var agr1 = model.getValue("/root/outlineinfo/swimlineno"); //그려야 할 컨트롤 갯수
  563. var agr2 = (parseInt(model.getValue("/root/outlineinfo/swimlineno")) * 3) - 1; //아웃라인을 구성하는 라인 컨트롤 갯수
  564. initGlobalVariant(agr1, agr2);
  565. setCSVToNode("/root/main/steplist", nodeListCSV, "info");
  566. */
  567. }
  568. /**
  569. * @group :
  570. * @ver : 2007.07
  571. * @by : 전지은
  572. * @---------------------------------------------------
  573. * @type : function
  574. * @access : public
  575. * @desc : 외곽 스윔라인의 길이를 연장한다.
  576. * @param : flag(extention/reduction), width, alpha(MGPS에서 열때는 width가 더 넓다)
  577. * @return :
  578. * @---------------------------------------------------
  579. */
  580. function fAdjustLine( flag, width, alpha ){
  581. //alert( swimLineWidth, + " , " + width, alpha );
  582. var asLineControl = null;
  583. var lngth = swimlineControlArray.length;
  584. var str;
  585. var width = parseInt(width);
  586. if(flag == "allEx"){
  587. if( alpha == "" || alpha == null ) {
  588. var alphaValue = 0;
  589. }
  590. else {
  591. var alphaValue = parseInt(alpha);
  592. //detail view의 그리드에 대한 사이즈 설정
  593. if(opener.window.javascript.OpenerKind == "GEN"){
  594. ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw";
  595. }
  596. }
  597. if(maxControlCnt <= 3){
  598. width = 1190 - swimLineWidth - 20 + alphaValue; //20:우측 세로스크롤이 생길 영역의 넓이
  599. //width = swimLineWidth - 1190;
  600. }else {
  601. width = (maxControlCnt * width) - swimLineWidth; //최대 max 스텝수가 3개 이상일 때 벗어나는 오류 조치 (2009.02.25)
  602. }
  603. transViewSize = width;
  604. flag = "ex";
  605. } else if(flag == "allRe"){
  606. width = transViewSize;
  607. flag = "re";
  608. }
  609. if(flag == "ex"){
  610. for (i=0; i<lngth; i++){
  611. str = swimlineControlArray[i];
  612. if( !(str =="" || str == null) ){
  613. if( str.substr(str.length-2, 2) == "UW" ){
  614. asLineControl = document.controls( str.substr(0, str.length-3) );
  615. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
  616. swimLineWidth = parseInt(asLineControl.attribute("x2"));
  617. } else if(str.substr(str.length-2, 2) == "DW" ){
  618. asLineControl = document.controls(str.substr(0, str.length-3));
  619. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
  620. } else if(str.substr(str.length-2, 2) == "RH" ){
  621. asLineControl = document.controls(str.substr(0, str.length-3));
  622. asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) + width;
  623. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
  624. }
  625. }
  626. }
  627. } else if(flag == "re"){
  628. for (i=0; i<lngth; i++){
  629. str = swimlineControlArray[i];
  630. if( !(str =="" || str == null) ){
  631. if( str.substr(str.length-2, 2) == "UW" ){
  632. asLineControl = document.controls( str.substr(0, str.length-3) );
  633. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
  634. swimLineWidth = asLineControl.attribute("x2");
  635. } else if(str.substr(str.length-2, 2) == "DW" ){
  636. asLineControl = document.controls(str.substr(0, str.length-3));
  637. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
  638. } else if(str.substr(str.length-2, 2) == "RH" ){
  639. asLineControl = document.controls(str.substr(0, str.length-3));
  640. asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) - width;
  641. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
  642. }
  643. }
  644. }
  645. }
  646. selectedControl = null;
  647. if(opener.window.javascript.OpenerKind == "GPS"){
  648. fCreateControl();
  649. fInitLoadingForm();
  650. }
  651. }
  652. /**
  653. * @group :
  654. * @ver : 2007.07
  655. * @by : 전지은
  656. * @---------------------------------------------------
  657. * @type : function
  658. * @access : public
  659. * @desc : 컨트롤을 왼쪽으로 옮긴다. (한꺼번에 모든 컨트롤을 다시 재생성 하므로, 사용 안 함)
  660. * @param : no
  661. * @return :
  662. * @---------------------------------------------------
  663. *
  664. function fModeControl( no ){
  665. //같은 라인에 미리 생성된 아이템의 x1, x2 좌표를 - 시킨다.
  666. var y1 = (no-1) * swimLineHight;
  667. var y2 = y1 + swimLineHight;
  668. for(var i = 0; i < grpControlCnt; i++){
  669. var cntl = document.controls( "xforms:group" + i );
  670. var cntlY1 = parseInt(cntl.attribute("top"));
  671. var cntlY2 = parseInt(cntl.attribute("height"));
  672. if(cntlY1 > y1 && (cntlY1+cntlY2) < y2) {
  673. var orgX = parseInt(cntl.attribute("left"));
  674. cntl.attribute("left") = orgX - 200;
  675. }
  676. }
  677. }
  678. */
  679. /**
  680. * @group :
  681. * @ver : 2007.07
  682. * @by : 전지은
  683. * @---------------------------------------------------
  684. * @type : function
  685. * @access : public
  686. * @desc : 해당 스텝에 대한 노드(인스턴스)를 먼저 생성한다.
  687. * @param : flag(A/D/B), no(selectedLineSection)
  688. * @return :
  689. * @---------------------------------------------------
  690. */
  691. function fMakeNode( flag, no ){
  692. if( isNull(opener.model.getValue("/root/main/masterinfo/info/swimlineno")) ){
  693. messageBox ( "스윔라인 수를", "C001" );
  694. return;
  695. }
  696. no = parseInt(no);
  697. grpControlCnt = parseInt(grpControlCnt) + 1;
  698. linesControlMaxCnt[no-1] = parseInt( linesControlMaxCnt[no-1] ) + 1; // no = 라인수
  699. model.resetInstanceNode("/root/main/temp/stepinfo/info");
  700. model.setValue("/root/main/temp/stepinfo/info/stepno", grpControlCnt);
  701. model.setValue("/root/main/temp/stepinfo/info/stepflagcd", flag);
  702. model.setValue("/root/main/temp/stepinfo/info/swimlineno", no);
  703. model.setValue("/root/main/temp/stepinfo/info/refseq", linesControlMaxCnt[no-1]);
  704. model.setValue("/root/main/temp/stepinfo/info/stepmemo", "");
  705. model.setValue("/root/main/temp/stepinfo/info/m", "i");
  706. model.setValue("/root/main/temp/stepinfo/info/orgstepno", model.getValue("/root/main/temp/stepinfo/info/stepno"));
  707. if( cpgflagcd == "02" ) {
  708. model.setValue("/root/main/temp/stepinfo/info/stepnm", flag + grpControlCnt); //2009.03.03 디폴트 추가
  709. model.setValue("/root/main/temp/stepinfo/info/times", "1"); //CPG는 모든 스텝이 1일차임.
  710. }
  711. model.setValue("/root/main/temp/stepinfo/info/stepattrflag", "0/0/0/0"); //CPG의 속성 정보 컬럼
  712. //2008.07.30 pymi control 생성시 control id를 담음
  713. //model.setNode("/root/main/temp/stepinfo/info/fixedStCntl");
  714. if( maxControlCnt < linesControlMaxCnt[no-1] ){
  715. maxControlCnt = linesControlMaxCnt[no-1];
  716. fAdjustLine("ex", "392");
  717. }
  718. model.makeNode( stepRef + "[" + grpControlCnt + "]");
  719. model.copyNode ( stepRef + "[" + grpControlCnt + "]" , "/root/main/temp/stepinfo/info");
  720. //각 노드셋(stepRef) 마다 menu 를 생성하는 makeValue 문은 삭제했음.
  721. if(selectedControl != null){
  722. var selID = selectedControl.attribute("id");
  723. var curNo = parseInt( selID.substr(12, selID.length-12) ) + 1;
  724. //if( model.getValue(stepRef + "[" + curNo + "]/stepno") > selectedLineSection ){
  725. //★ 추가되는 컨트롤의 라인수 및 조회순서가 selectedControl 보다 크면, 그대로, 작으면 selectedControl 은 -1 (일단 null)
  726. // selectedControl = null;
  727. //}
  728. }
  729. return grpControlCnt;
  730. }
  731. /**
  732. * @group :
  733. * @ver : 2007.07
  734. * @by : 전지은
  735. * @---------------------------------------------------
  736. * @type : function
  737. * @access : public
  738. * @desc : 컨트롤을 생선한다.
  739. * @param :
  740. * @return :
  741. * @---------------------------------------------------
  742. */
  743. function fCreateControl(){
  744. var ctrlID;
  745. var ctrl = null;
  746. var grpWidth = 392; //좌표를 기준으로 한 영역의 사이즈 (실제 컨트롤 width=290)
  747. var halfpoint = grpWidth/2;
  748. var marginX = 38; //영역 안의 왼쪽 여백 ( 38+ 290 + 38 = 392 )
  749. var pntCnt = 0; //기준점의 갯수
  750. var cntlCnt = 0; //해당 라인의 컨트롤 총 갯수
  751. var y = 0;
  752. var psition = 0; //k 번째 컨트롤 포지션(포커스된 컨트롤의 라인 내 순서)
  753. var startPoint = 0; //라인당 컨트롤들을 위치시킬 시작x위치
  754. stepCnt = parseInt(grpControlCnt); //새로 그릴 스텝(컨트롤) 갯수
  755. var lngth = swimlineControlArray.length - 1;
  756. var cntlID;
  757. var fcstinhospdayno = opener.model.getValue("/root/main/masterinfo/info/fcstinhospdayno");
  758. //아웃라인을 제외한 컨트롤을 모두 삭제 (스텝 추가/삭제 후 계속 전체 재생성하므로, 아웃라인 제외한 컨트롤 삭제 처리)
  759. for(var i=outsideControlCnt; i<=lngth; i++){
  760. cntlID = swimlineControlArray[i];
  761. if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
  762. cntlID = cntlID.substr(0, cntlID.length-3);
  763. }
  764. grp_swimline.removeChild(cntlID);
  765. swimlineControlArray[i] = "";
  766. }
  767. controlCnt = outsideControlCnt;
  768. swimlineControlArray.slice(0, outsideControlCnt);
  769. grpControlCnt = 0;
  770. for(var i=1; i<=stepCnt ; i++){
  771. var flag = model.getValue(stepRef + "[" + i + "]/stepflagcd");
  772. var lineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
  773. var position = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
  774. var kind = model.getValue(stepRef + "[" + i + "]/startendflag");
  775. var times = model.getValue(stepRef + "[" + i + "]/times");
  776. var stepnm = model.getValue(stepRef + "[" + i + "]/stepnm");
  777. var stepno = model.getValue(stepRef + "[" + i + "]/stepno");
  778. var tmpstepnm = model.getValue(stepRef + "[" + i + "]/tmpstepnm");
  779. var stepattrflag = model.getValue(stepRef + "[" + i + "]/stepattrflag"); //CP는 표시해줄 필요 없고, CPG일 경우 0이 아니면 O/M/T/MO 존재 표시
  780. cntlCnt = linesControlMaxCnt[lineno-1];
  781. y = ( (lineno-1) * swimLineHight ) + 20; //122 + 20 + 20 = 165
  782. startPoint = ( (swimLineWidth - (392 * cntlCnt) ) / 2 + 1 ) + ((position-1) * 392); // ★ 문제... 좌표가 -1씩 줄어든다...
  783. startPoint = startPoint - (position-2);
  784. //1. 마름모 모양의 라인들과 그리드를 담을 그룹을 생성한다.
  785. controlCnt++;
  786. ctrlID = "xforms:group" + (grpControlCnt++);
  787. var ctrlGrp = grp_swimline.createChild("xforms:group", "id:" + ctrlID + ";left:" + startPoint + "px; top:" + y + "px; width:" + 392 + " px; height:" + 122 + "px; background-color:transparent;"); //290*135
  788. swimlineControlArray[outsideControlCnt + (grpControlCnt-1)] = ctrlID;
  789. if( flag == "D" ) {
  790. //2. 결정스텝의 textarea를 생성한다.
  791. var text1 = "xforms:textarea";
  792. ctrlID = text1 + (controlCnt++);
  793. if(opener.window.javascript.OpenerKind == "GPS"){
  794. //GPS 창에서는 조회모임 (editable 속성은 디자인 시점에 결정되므로 두가지 케이스로 나눔)
  795. var txtareactrl = ctrlGrp.createChild(text1, "id:"+ ctrlID + "; ref:" + stepRef + "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + (marginX+60) + "px; top:" + 40 + "px; width:" + 175 + "px; height:" + 43+ "px; border-width:0px; border-style:solid; scroll:autovscroll; ");
  796. }else{
  797. var txtareactrl = ctrlGrp.createChild(text1, "id:"+ ctrlID + "; ref:" + stepRef + "[" + grpControlCnt + "]/stepmemo; left:" + (marginX+60) + "px; top:" + 40 + "px; width:" + 175 + "px; height:" + 43+ "px; border-width:0px; border-style:solid; scroll:autovscroll; ");
  798. }
  799. txtareactrl.refresh();
  800. txtareactrl.attribute("onmousedown") = "fPopupMenuEvent()"; //이벤트와 컨트롤을 연결하는 동적 이벤트
  801. txtareactrl.attribute("xforms-value-changed") = "fSetMemo()";
  802. txtareactrl.attribute("DOMFocusIn") = "fFocusIn()";
  803. //txtareactrl.attribute("DOMFocusOut") = "fFocusOut()";
  804. txtareactrl.attribute("onmouseover") = "fMouseOverEvent()";
  805. //3. 마름모 라인을 생성한다.
  806. var line1 = "xforms:line";
  807. if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '30']") != null ){
  808. ctrlID = line1 + (controlCnt++);
  809. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:2; border-color:#c8e67b;");
  810. ctrlID = line1 + (controlCnt++);
  811. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:2; border-color:#c8e67b;");
  812. ctrlID = line1 + (controlCnt++);
  813. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:2; border-color:#c8e67b;");
  814. ctrlID = line1 + (controlCnt++);
  815. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:2; border-color:#c8e67b;");
  816. }else if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '20']") != null ){
  817. ctrlID = line1 + (controlCnt++);
  818. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:2; border-color:#e5f3c2;");
  819. ctrlID = line1 + (controlCnt++);
  820. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:2; border-color:#e5f3c2;");
  821. ctrlID = line1 + (controlCnt++);
  822. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:2; border-color:#e5f3c2;");
  823. ctrlID = line1 + (controlCnt++);
  824. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:2; border-color:#e5f3c2;");
  825. }else{
  826. ctrlID = line1 + (controlCnt++);
  827. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:2");
  828. ctrlID = line1 + (controlCnt++);
  829. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:2");
  830. ctrlID = line1 + (controlCnt++);
  831. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:2");
  832. ctrlID = line1 + (controlCnt++);
  833. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:2");
  834. }
  835. //day 정보를 표시한다.
  836. if( !isNull(fcstinhospdayno) || !isNull(tmpstepnm) || cpgflagcd == "02" ){
  837. var leftPos = 270;
  838. var topPos = 52;
  839. var cntl;
  840. var ctrlType = "xforms:img";
  841. var ctrlID = ctrlType + (controlCnt++);
  842. ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 66 + "; top:" + 51 + "; width:20px; height:20px; background-stretch:stretch;");
  843. ctrlType = "xforms:caption";
  844. ctrlID = ctrlType + (controlCnt++);
  845. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 66 + "; top:" + 52 + "; width:100px; height:20px; font-size:8pt; font-weight:bolder;");
  846. // 2008.07.30 pymi
  847. //cntl.attribute("text") = "D" + times;
  848. if( instance1.selectSingleNode(stepRef + "["+ i + "]/fixedStCntl" ) != null ) { // cp 검색의 경우
  849. cntl.attribute("text") = stepnm;
  850. model.setValue(stepRef + "["+ i + "]/fixedStCntl", ctrlID);
  851. } else {
  852. cntl.attribute("text") = opener.model.getValue("/root/temp/daylist/day[id = '"+ times +"']/nm]");
  853. model.setValue(stepRef + "["+ i + "]/stepnm", cntl.attribute("text"));
  854. }
  855. //2008.08.19 pymi (e)
  856. }
  857. } else if( flag == "A" || flag == "B" ) {
  858. //액션, 브런치 스텝의 textarea를 생성한다.
  859. var text2 = "xforms:textarea";
  860. ctrlID = text2 + (controlCnt++);
  861. if(opener.window.javascript.OpenerKind == "GPS"){
  862. if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '30']") != null )
  863. var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000; background-color:#c8e67b");
  864. else if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '20']") != null )
  865. var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000; background-color:#e5f3c2");
  866. else var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000;");
  867. }else{
  868. var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000; ");
  869. }
  870. txtareactrl.refresh();
  871. txtareactrl.attribute("border-color") = "#000000";
  872. txtareactrl.attribute("onmousedown") = "fPopupMenuEvent()";
  873. txtareactrl.attribute("xforms-value-changed") = "fSetMemo()";
  874. txtareactrl.attribute("DOMFocusIn") = "fFocusIn()";
  875. //txtareactrl.attribute("DOMFocusOut") = "fFocusOut()";
  876. txtareactrl.attribute("onmouseover") = "fMouseOverEvent()";
  877. //day 정보를 표시한다.
  878. if( !isNull(fcstinhospdayno) || !isNull(tmpstepnm) || cpgflagcd == "02" ){
  879. var leftPos =308;
  880. var topPos = 1;
  881. var cntl;
  882. var ctrlType = "xforms:img";
  883. var ctrlID = ctrlType + (controlCnt++);
  884. ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 32 + "; top:" + 0 + "; width:20px; height:20px; background-stretch:stretch;");
  885. ctrlType = "xforms:caption";
  886. ctrlID = ctrlType + (controlCnt++);
  887. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 32 + "; top:" + 1 + "; width:100px; height:20px; font-size:8pt; font-weight:bolder;");
  888. //cntl.attribute("text") = "D" + times + " : "+stepnm;
  889. //2008.07.30 pymi (s)
  890. if( instance1.selectSingleNode(stepRef + "["+ i + "]/fixedStCntl" ) != null ) { // cp 검색의 경우
  891. cntl.attribute("text") = stepnm;
  892. model.setValue(stepRef + "["+ i + "]/fixedStCntl", ctrlID);
  893. } else { // 생성기에서 재원일수만 넣고 자동으로 outline을 그렸을 경우
  894. cntl.attribute("text") = opener.model.getValue("/root/temp/daylist/day[id = '"+ times +"']/nm]");
  895. model.setValue(stepRef + "["+ i + "]/stepnm", cntl.attribute("text"));
  896. }
  897. //2008.08.19 pymi (e)
  898. }
  899. }
  900. //시작, 스텝여부를 표시한다.
  901. if( kind == "S" || kind == "E" ){ //opener.window.javascript.OpenerKind != "GPS" 조건 제거 (2008.12.15)
  902. fChangeSelectCntl("#ff9900", txtareactrl);
  903. }
  904. if( model.getValue(stepRef + "[" + i + "]/decirflag") == "I" ){
  905. // decirflag : 입원필요 스텝
  906. var leftPos =330;
  907. var topPos = 20;
  908. var cntl;
  909. var ctrlType = "xforms:caption";
  910. var ctrlID = ctrlType + (controlCnt++);
  911. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  912. cntl.attribute("text") = "[입원\n필요]";
  913. }
  914. //2008.06.17 pymi(추가)
  915. if( model.getValue(stepRef + "[" + i + "]/decirflag") == "D" ){
  916. // decirflag : 퇴원필요 스텝
  917. var leftPos =330;
  918. var topPos = 20;
  919. var cntl;
  920. var ctrlType = "xforms:caption";
  921. var ctrlID = ctrlType + (controlCnt++);
  922. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  923. cntl.attribute("text") = "[퇴원\n필요]";
  924. }
  925. if( model.getValue(stepRef + "[" + i + "]/decirflag") == "O" ){
  926. // decirflag : 외래예약필요 스텝
  927. var leftPos =330;
  928. var topPos = 20;
  929. var cntl;
  930. var ctrlType = "xforms:caption";
  931. var ctrlID = ctrlType + (controlCnt++);
  932. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  933. cntl.attribute("text") = "[외래\n예약\n필요]";
  934. }
  935. //2008.06.17 pymi(종료)
  936. // 2008.08.06 pymi(추가)
  937. if( model.getValue(stepRef + "[" + i + "]/decirflag") == "C" ){
  938. // decirflag : DSC 필요 스텝
  939. var leftPos =330;
  940. var topPos = 20;
  941. var cntl;
  942. var ctrlType = "xforms:caption";
  943. var ctrlID = ctrlType + (controlCnt++);
  944. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  945. cntl.attribute("text") = "[DSC\n필요]";
  946. }
  947. // 2008.08.06 pymi(종료)
  948. /*
  949. if( opener.window.javascript.OpenerKind == "GPS" ){
  950. if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + i + "' and prcpdd = '" + getCurrentDate() + "']/stepno") ){
  951. fChangeSelectCntl("#FF0000", txtareactrl); //당일=빨강색
  952. }else if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + i + "' and (stepstat = '20' or stepstat = '30' )]/stepno") ){
  953. fChangeSelectCntl("#8EBCFF", txtareactrl); //진행중=하늘색
  954. }else{
  955. if( kind == "S" || kind == "E" ) //2008.12.06
  956. fChangeSelectCntl("#ff9900", txtareactrl); //시작/종료=주황색
  957. }
  958. }
  959. */
  960. //서식존재 여부를 표시한다.
  961. if( cpgflagcd == "01" ){
  962. if(model.getValue(stepRef + "[" + i + "]/formexistyn") != "Y"){
  963. var cntl;
  964. var ctrlType = "xforms:img";
  965. var ctrlID = ctrlType + (controlCnt++);
  966. if( flag == "D" ) {
  967. //Decision
  968. var leftPos = 330;
  969. var topPos = 52;
  970. }else{
  971. //Action
  972. var leftPos =330;
  973. var topPos = 1;
  974. }
  975. ctrl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_s_essential.gif; left:" + leftPos + "; top:" + topPos + "; background-stretch:stretch;");
  976. ctrl.hint = "처방 및 서식이 등록되지 않은 스텝입니다.";
  977. }
  978. }
  979. //@CPG 속성의 존재 여부 표시한다.
  980. else if( cpgflagcd == "02" ){
  981. if(model.getValue(stepRef + "[" + i + "]/formexistyn") == "Y"){
  982. var cntl;
  983. var ctrlType = "xforms:img";
  984. var ctrlID = ctrlType + (controlCnt++);
  985. if( flag == "D" ) {
  986. //Decision
  987. var leftPos = 330;
  988. var topPos = 52;
  989. }else{
  990. //Action
  991. var leftPos =330;
  992. var topPos = 1;
  993. }
  994. ctrl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_essential.gif; left:" + leftPos + "; top:" + topPos + "; background-stretch:stretch;");
  995. ctrl.hint = "작성해야 할 서식이 등록되어 있습니다.";
  996. }
  997. var iAttrFlag = stepattrflag.split("/");
  998. var cntl;
  999. var topPos = 4;
  1000. var kWidth = 15;
  1001. var ctrlType = "xforms:caption";
  1002. var attrFlagNm = "";
  1003. var attrFlagCd = "";
  1004. for( var k=0; k<iAttrFlag.length; k++ ){
  1005. var leftPos = 238 + ((k+1)*15) + (k+2);
  1006. if( iAttrFlag[k] != "0" ) var colorCd = "#000000"; //검정
  1007. else var colorCd = "#c0c0c0"; //회색
  1008. if(k==0) {
  1009. attrFlagNm = "O";
  1010. attrFlagCd = "@O"; //처방 (@O)
  1011. }
  1012. else if(k==1) {
  1013. attrFlagNm = "M";
  1014. attrFlagCd = "@M"; //모니터링 (@M)
  1015. }
  1016. else if(k==2) {
  1017. attrFlagNm = "T";
  1018. attrFlagCd = "@T"; //제한시간 (@T)
  1019. }
  1020. else if(k==3) {
  1021. attrFlagNm = "MO";
  1022. attrFlagCd = "@D"; //약속처방모니터링오더 (@Dummy)
  1023. kWidth = 22;
  1024. }
  1025. var ctrlID = ctrlType + (controlCnt++) + "_" + attrFlagCd; //CPG 속성 정보 아이콘 버튼 => xforms:caption00_@X
  1026. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:" + kWidth + "px; height:20px; color:" + colorCd + "; text-align:center; background-color:#ffcc99;");
  1027. cntl.attribute("text") = attrFlagNm;
  1028. cntl.attribute("onmouseover") = "fMouseOverEvent()";
  1029. cntl.attribute("DOMFocusOut") = "fFocusOut()";
  1030. //cntl.attribute("onmousedown") = "fOpenAttrPopupEvent()";
  1031. cntl.attribute("onmousedown") = "fPopupMenuEvent()";
  1032. }
  1033. //CPG+CP 인 경우, CP스텝을 표시해줌 (2010.06.28)
  1034. if(model.getValue(stepRef + "[" + i + "]/settypecd") == "W"){
  1035. var leftPos =0;
  1036. var topPos = 0;
  1037. var cntl;
  1038. var ctrlType = "xforms:caption";
  1039. var ctrlID = ctrlType + (controlCnt++);
  1040. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:23px; font-size:8pt; font-weight:bolder; "); //; color:#ff0000
  1041. cntl.attribute("text") = "[CP]";
  1042. }
  1043. } //end CPG 속성
  1044. }
  1045. //스텝 구간의 시작과 끝 설정 (2010.06.03)
  1046. /*var appScopStartNo = "";
  1047. var appScopEndNo = "";
  1048. var appScopYN = "N";
  1049. if(opener.window.javascript.OpenerKind == "GPS"){
  1050. var appStepScopList = opener.instance1.selectNodes("/root/main/steppath/info[stepstat='30']");
  1051. if( appStepScopList.length > 0 ){
  1052. for(var k=0; k<appStepScopList.length; k++){
  1053. var node = appStepScopList.item(k);
  1054. if(k == 0) appScopStartNo = node.selectSingleNode("stepno").text;
  1055. else if(k == appStepScopList.length-1){
  1056. appScopEndNo = node.selectSingleNode("stepno").text;
  1057. }
  1058. }
  1059. }
  1060. }*/
  1061. // 라인 연결 재설정
  1062. for(var i=1; i<=stepCnt ; i++){
  1063. var cntlKind = model.getValue( stepRef + "[" + i + "]/stepflagcd");
  1064. var cntlno = model.getValue( stepRef + "[" + i + "]/stepno");
  1065. //var stepstat = opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + cntlno + "' and stepstat='30']/stepstat");
  1066. if( cntlKind == "D" ) {
  1067. var dcsnstep = opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + cntlno + "']/answstepno");
  1068. nodeList = instance1.selectNodes(dcsRef);
  1069. dcsCntlCnt = nodeList.length;
  1070. for(var k=0; k<dcsCntlCnt; k++){
  1071. var node = nodeList.item(k);
  1072. var stepNode = node.selectSingleNode("stepno");
  1073. var lnkNode = node.selectSingleNode("lnkstepno");
  1074. if( !isNull(lnkNode.text) && cntlno == stepNode.value ){ //2919 line에서 설정됨..
  1075. if( dcsnstep != null ){
  1076. if( !isNull(dcsnstep.text) && dcsnstep.text == lnkNode.text)
  1077. fCreateControl_Line( stepNode.text, lnkNode.text, "#FF0000" );
  1078. else
  1079. fCreateControl_Line( stepNode.text, lnkNode.text );
  1080. } else {
  1081. fCreateControl_Line( stepNode.text, lnkNode.text );
  1082. }
  1083. }
  1084. //if( cntlno == appScopStartNo ) appScopYN = "Y"; //적용 구간 시작
  1085. //else if( cntlno == appScopEndNo ) appScopYN = "N"; //적용 구간 종료
  1086. }
  1087. dcsCntlCnt++;
  1088. } else {
  1089. var lnkno = model.getValue( stepRef + "[" + i + "]/lnkstepno");
  1090. if( !isNull(lnkno) ){
  1091. /*
  1092. if( cntlno == appScopStartNo ) appScopYN = "Y"; //적용 구간 시작
  1093. if( cntlno == appScopEndNo ) appScopYN = "N"; //적용 구간 종료
  1094. if( appScopYN == "N" ){
  1095. fCreateControl_Line( cntlno, lnkno );
  1096. }else{
  1097. if( lnkno != appScopEndNo )
  1098. fCreateControl_Line( cntlno, lnkno, "#FF0000" );
  1099. else{
  1100. if( stepstat != null && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + lnkno + "' and stepstat='30']") != null )
  1101. fCreateControl_Line( cntlno, lnkno, "#FF0000" );
  1102. else fCreateControl_Line( cntlno, lnkno );
  1103. }
  1104. }
  1105. if( lnkno == appScopEndNo ) appScopYN = "N"; //적용 구간 종료
  1106. */
  1107. if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + cntlno + "' and stepstat='30']") != null && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + lnkno + "' and stepstat='30']") != null )
  1108. fCreateControl_Line( cntlno, lnkno, "#FF0000" );
  1109. else
  1110. fCreateControl_Line( cntlno, lnkno );
  1111. }
  1112. }
  1113. }
  1114. }
  1115. function fInitLoadingForm(){
  1116. //-------------------------------서식(main) 호출(2008.09.05)---------------------------//
  1117. if( opener.window.javascript.OpenerKind != "GPS" ) return;
  1118. //if( opener.window.javascript.cpgflagcd != "02" ) return;
  1119. if(opener.window.javascript.loadFormTab != "O") return;
  1120. //전처방 로딩이 완료되면 진료대상자에서 진료기록을 호출하는 로직
  1121. var mainObj = getMainViewer();
  1122. var srcOrdPatListwnd = mainObj.javascript.getOpenWindow("SMMMO04100");
  1123. //마취기록지에서 처방창을 열경우 마취기록지를 initialize 시키지 않는 로직
  1124. var srcAnstRecwnd = mainObj.javascript.getOpenWindow("SMMMR03700");
  1125. var anstrereload = mainObj.javascript.getParameter("SMMMR03700_refresh");
  1126. if (srcAnstRecwnd != null) {
  1127. var anstrereload = srcAnstRecwnd.javascript.getParameter("SMMMR03700_refresh");
  1128. }
  1129. //최초 적용 시, 처방창에서 이미 기록지 호출이 되었으므로, 재호출 안함 -> opener.window.javascript.appstepstatflag != "i" 조건 추가 (2008.09.29)
  1130. if ( anstrereload != "false" && srcOrdPatListwnd != null && opener.window.javascript.appstepstatflag != "i" ) {
  1131. var fstopenflag = opener.model.getValue("/root/temp1/refresh_obj/refreshyn"); //처방화면이 최초 생성 여부
  1132. //alert( "Refresy_YN = " + fstopenflag );
  1133. if( fstopenflag == "N") {
  1134. opener.model.setValue("/root/init/fstopenflag", "Y"); //잠시, 값 치환
  1135. srcOrdPatListwnd.javascript.fChngMainEMRScrn();
  1136. var scrnwnd = getOpenWindow("SPMMB08400");
  1137. if(scrnwnd != null){
  1138. scrnwnd.javascript.fCloseOpenEmrWnd();
  1139. }
  1140. }else return;
  1141. }else return;
  1142. opener.model.setValue("/root/temp1/refresh_obj/refreshyn", "Y"); //최초조회가 아닌경우, refresh 여부 "Y"
  1143. opener.model.setValue("/root/init/fstopenflag", "N"); //처방최초 open여부를 재설정, 진료기록을 열기위해
  1144. //--------------------------------------------------------------------------------//
  1145. //2008.09.04 순서 변경
  1146. opener.window.javascript.fMssg(); //Drop 및 퇴원예고 유도... 알림 Message 출력
  1147. }
  1148. /**
  1149. * @group :
  1150. * @ver : 2007.07
  1151. * @by : 전지은
  1152. * @---------------------------------------------------
  1153. * @type : function
  1154. * @access : public
  1155. * @desc : 컨트롤간의 연결라인을 그려준다.
  1156. * @param : cntlno, lnkno
  1157. * @return :
  1158. * @---------------------------------------------------
  1159. */
  1160. function fCreateControl_Line( cntlno, lnkno, color ){
  1161. currentStepCntl = document.controls("xforms:group" + (parseInt(cntlno)-1) );
  1162. prevStepCntl = document.controls("xforms:group" + (parseInt(lnkno)-1) );
  1163. if(currentStepCntl != null && prevStepCntl != null){
  1164. var frXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15; //★ 오류발생
  1165. var frYPoint = parseInt(currentStepCntl.attribute("top")) + parseInt(currentStepCntl.attribute("height"));
  1166. var toXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15; // err
  1167. var toYPoint = parseInt(prevStepCntl.attribute("top"));
  1168. ctrlID = "xforms:line" + (controlCnt++);
  1169. var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:2;");
  1170. if( !isNull(color) ){
  1171. ctrl.attribute("border-color") = color;
  1172. }
  1173. //connection line
  1174. swimlineControlArray[controlCnt-1] = ctrlID+"_CN";
  1175. /*
  1176. //복잡한 CPG는 연결이 한눈에 들어오지 않으므로, 화살표 표시 추가 (2009.02.26)
  1177. if( cpgflagcd == "02" ){
  1178. var lftXPoint = toXPoint - 5;
  1179. var lftYPoint = toYPoint - 5;
  1180. var rgtXPoint = toXPoint + 5;
  1181. var rgtYPoint = toYPoint + 5;
  1182. ctrlID = "xforms:line" + (controlCnt++);
  1183. var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + toXPoint + "px; y1:" + toYPoint + "px; x2:" + frXPoint2 + "px; y2:" + frYPoint2 + "px; border-width:2;");
  1184. if( !isNull(color) ){
  1185. ctrl.attribute("border-color") = color;
  1186. }
  1187. ctrlID = "xforms:line" + (controlCnt++);
  1188. var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + toXPoint + "px; y1:" + toYPoint + "px; x2:" + toXPoint2 + "px; y2:" + toYPoint2 + "px; border-width:2;");
  1189. if( !isNull(color) ){
  1190. ctrl.attribute("border-color") = color;
  1191. }
  1192. }
  1193. */
  1194. prevStepCntl = null;
  1195. currentStepCntl = null;
  1196. ctrl.refresh();
  1197. }
  1198. }
  1199. /**
  1200. * @group :
  1201. * @ver : 2007.07
  1202. * @by : 전지은
  1203. * @---------------------------------------------------
  1204. * @type : function
  1205. * @access : public
  1206. * @desc : 하위 스텝을 선택하면, 연결한다.
  1207. * @param :
  1208. * @return :
  1209. * @---------------------------------------------------
  1210. */
  1211. function fSetLink(){
  1212. var prntID = currentStepCntl.attribute("id");
  1213. var prntControl = document.controls(prntID);
  1214. prevStepCntl = prntControl; //하위
  1215. //setStepLink(prntControl, null);
  1216. }
  1217. /**
  1218. * @group :
  1219. * @ver : 2007.07
  1220. * @by : 전지은
  1221. * @---------------------------------------------------
  1222. * @type : function
  1223. * @access : public
  1224. * @desc : 연결 이벤트시, 목적 컨트롤을 클릭했을 경우, 해당하는 두개의 컨트롤 사이를에 라인을 생성한다.
  1225. * @param : prevStepCntl, currentStepCntl
  1226. * @return :
  1227. * @---------------------------------------------------
  1228. */
  1229. function fConnectToLine(prevStepCntl, currentStepCntl){
  1230. var ctrlID;
  1231. var ctrl = null;
  1232. //비교 대상인 두개 컨트롤 ID
  1233. var prevStepCntlID = prevStepCntl.attribute("id"); //하위(자식)
  1234. var currentCntlID = currentStepCntl.attribute("id"); //상위(부모)
  1235. if( !isNull(currentCntlID) && !isNull(prevStepCntlID) && currentCntlID.substr(0, 12) == "xforms:group" && prevStepCntlID.substr(0, 12) == "xforms:group" ){
  1236. prevStepCntlID = parseInt( prevStepCntlID.substr(12, prevStepCntlID.length-12) ) + 1;
  1237. currentCntlID = parseInt( currentCntlID.substr(12, currentCntlID.length-12) ) + 1;
  1238. //비교 대상인 두개 컨트롤 top과 높이
  1239. var prevStepCntlTop = parseInt(prevStepCntl.attribute("top"));
  1240. var prevStepCntlHigh = parseInt(prevStepCntl.attribute("height"));
  1241. var currentCntlTop = parseInt(currentStepCntl.attribute("top"));
  1242. var currentCntlHigh = parseInt(currentStepCntl.attribute("height"));
  1243. if ( prevStepCntlTop == currentCntlTop ) {
  1244. //동일한 컨트롤을 선택한 경우
  1245. prevStepCntl = null;
  1246. return;
  1247. } else {
  1248. var curcntlType = model.getValue( stepRef + "[" + currentCntlID + "]/stepflagcd");
  1249. var preCntlType = model.getValue( stepRef + "[" + prevStepCntlID + "]/stepflagcd");
  1250. var frXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15;
  1251. var toXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15;
  1252. var frYPoint;
  1253. var toYPoint;
  1254. //하위를 먼저 클릭하고 연결을 결정한 다음, 상단을 클릭한 경우,
  1255. if( prevStepCntlTop > currentCntlTop ) {
  1256. frYPoint = prevStepCntlTop - 1;
  1257. toYPoint = currentCntlTop + currentCntlHigh;
  1258. if( model.getValue( stepRef + "[" + currentCntlID + "]/startendflag") == "E" ){
  1259. //messageBox("종료 Step은 다음 Step을 가질 수", "I004");
  1260. //return;
  1261. model.setValue( stepRef + "[" + currentCntlID + "]/startendflag", "");
  1262. }
  1263. if( model.getValue( stepRef + "[" + prevStepCntlID + "]/startendflag") == "S" ){
  1264. //messageBox("시작 Step 앞에는 스텝이 올 수", "I004");
  1265. //return;
  1266. model.setValue( stepRef + "[" + prevStepCntlID + "]/startendflag", "");
  1267. }
  1268. if(curcntlType == "D"){
  1269. model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno", "" );
  1270. copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
  1271. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
  1272. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
  1273. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
  1274. dcsCntlCnt++;
  1275. } else {
  1276. if( model.getValue(stepRef + "[" + currentCntlID + "]/lnkstepno") == "" ) {
  1277. model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno") );
  1278. if(model.getValue(stepRef + "[" + currentCntlID + "]/m") != "i"){
  1279. model.setValue(stepRef + "[" + currentCntlID + "]/m", "u");
  1280. }
  1281. } else {
  1282. btn_connection.attribute("text") = "입력";
  1283. connectionMode = "false";
  1284. //messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
  1285. return;
  1286. }
  1287. }
  1288. //현재 스텝을 부모 스텝과 연결한다.
  1289. ctrlID = "xforms:line" + (controlCnt++);
  1290. grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:2;");
  1291. swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
  1292. //상단을 먼저 클릭하고 연결을 결정한 다음, 하위를 클릭한 경우
  1293. } else if( prevStepCntlTop < currentCntlTop ) {
  1294. frYPoint = prevStepCntlTop + prevStepCntlHigh - 1;
  1295. toYPoint = currentCntlTop;
  1296. if( model.getValue( stepRef + "[" + prevStepCntlID + "]/startendflag") == "E" ){
  1297. //messageBox("종료 Step은 다음 Step을 가질 수 ", "I004");
  1298. //return;
  1299. model.setValue( stepRef + "[" + prevStepCntlID + "]/startendflag", "");
  1300. }
  1301. if( model.getValue( stepRef + "[" + currentCntlID + "]/startendflag") == "S" ){
  1302. //messageBox("시작 Step 앞에는 스텝이 올 수", "I004");
  1303. //return;
  1304. model.setValue( stepRef + "[" + currentCntlID + "]/startendflag", "");
  1305. }
  1306. if(preCntlType == "D"){
  1307. model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , "" );
  1308. copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
  1309. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
  1310. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
  1311. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
  1312. dcsCntlCnt++;
  1313. } else {
  1314. if( model.getValue(stepRef + "[" + prevStepCntlID + "]/lnkstepno") == "" ) {
  1315. model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + currentCntlID + "]/stepno") );
  1316. if(model.getValue(stepRef + "[" + prevStepCntlID + "]/m") != "i"){
  1317. model.setValue(stepRef + "[" + prevStepCntlID + "]/m", "u");
  1318. }
  1319. } else {
  1320. btn_connection.attribute("text") = "입력";
  1321. connectionMode = "false";
  1322. // messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
  1323. return;
  1324. }
  1325. }
  1326. ctrlID = "xforms:line" + (controlCnt++);
  1327. grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:2;");
  1328. swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
  1329. }
  1330. }
  1331. //prevStepCntl = null;
  1332. }
  1333. }
  1334. /**
  1335. * @group :
  1336. * @ver : 2007.07
  1337. * @by : 전지은
  1338. * @---------------------------------------------------
  1339. * @type : function
  1340. * @access : public
  1341. * @desc : 포커스를 갖는 컨트롤의 외곽선 색상을 변경한다.
  1342. * @param : lineColor, cntl
  1343. * @return :
  1344. * @---------------------------------------------------
  1345. */
  1346. function fChangeSelectCntl(lineColor, cntl){
  1347. if( cntl != null ){
  1348. var controlSize = cntl.attribute("width"); //175px or 290px //추가된 서식(저장 전)이 있을때, fullsize->축소 때 err
  1349. var cntlID = cntl.attribute("id");
  1350. var num = parseInt(cntlID.substr(15, (cntlID.length-1)))+1;
  1351. var parentCtrlID = cntl.parent.attribute("id"); //textarea의 parent 컨트롤인 그룹
  1352. var parentNum = parseInt( parentCtrlID.substr(12, parentCtrlID.length-12) ) + 1;
  1353. if(lineColor == "#000000") lineColor = getStepBaseColor(parentNum);
  1354. if( controlSize == "175px" ) {
  1355. var line1 = document.controls("xforms:line" + num );
  1356. var line2 = document.controls("xforms:line" + (num+1) );
  1357. var line3 = document.controls("xforms:line" + (num+2) );
  1358. var line4 = document.controls("xforms:line" + (num+3) );
  1359. line1.attribute("border-color") = lineColor;
  1360. line2.attribute("border-color") = lineColor;
  1361. line3.attribute("border-color") = lineColor;
  1362. line4.attribute("border-color") = lineColor;
  1363. } else if( controlSize == "290px" ){
  1364. cntl.attribute("border-color") = lineColor;
  1365. }
  1366. }
  1367. }
  1368. /**
  1369. * @group :
  1370. * @ver : 2007.10
  1371. * @by : 전지은
  1372. * @---------------------------------------------------
  1373. * @type : function
  1374. * @access : public
  1375. * @desc : GPS일 경우, 기본 스텝 색상으로 복귀할 때, 스텝 적용 상태에 따라 색상을 달리한다.
  1376. * @param : stepNumber
  1377. * @return : lineColor
  1378. * @---------------------------------------------------
  1379. */
  1380. function getStepBaseColor(stepNumber){
  1381. //2008.12.15 진행경로를 border 색이 아닌 background 색으로 나타냄.
  1382. /*if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepNumber + "' and prcpdd = '" + getCurrentDate() + "']/stepno") ){
  1383. return "#FF0000";
  1384. }else
  1385. */
  1386. if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepNumber + "' and stepstat = '30' and stepflagcd='D']" )){
  1387. //return "#8EBCFF";
  1388. return "#c8e67b";
  1389. }else if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepNumber + "' and stepstat = '20' and stepflagcd='D']" )){
  1390. return "#e5f3c2";
  1391. }else{
  1392. return "#000000";
  1393. }
  1394. }
  1395. /**
  1396. * @group :
  1397. * @ver : 2007.07
  1398. * @by : 전지은
  1399. * @---------------------------------------------------
  1400. * @type : function
  1401. * @access : public
  1402. * @desc : 클릭한 지점의 영역에 해당하는 외곽선의 색상을 변경한다.
  1403. * @param : flag, no
  1404. * @return :
  1405. * @---------------------------------------------------
  1406. */
  1407. function fChangeOutLineCntl(flag, no){
  1408. var asLineControl = null;
  1409. var str;
  1410. var count = 0;
  1411. if( !( selectSectionsLine[0] == "" ) && flag == "reset"){
  1412. for(var i=0; i<4; i++){
  1413. str = selectSectionsLine[i];
  1414. if(str != ""){
  1415. asLineControl = document.controls( str.substr(0, str.length-3) );
  1416. asLineControl.attribute("border-color") = "#000000";
  1417. asLineControl.attribute("border-width") = "1px";
  1418. selectSectionsLine[i] = "";
  1419. } else{
  1420. return;
  1421. }
  1422. }
  1423. } else if(flag == "select"){
  1424. var lngth = swimlineControlArray.length;
  1425. for(var i=0; i<lngth; i++){
  1426. str = swimlineControlArray[i];
  1427. if( !(str =="" || str == null) ){
  1428. if( str.substr(str.length-2, 2) == "LH" ){
  1429. if(no == count){
  1430. str = swimlineControlArray[i];
  1431. asLineControl = document.controls( str.substr(0, str.length-3) );
  1432. asLineControl.attribute("border-color") = "#A683B1";
  1433. asLineControl.attribute("border-width") = "2px";
  1434. selectSectionsLine[0] = str;
  1435. str = swimlineControlArray[i+1];
  1436. asLineControl = document.controls( str.substr(0, str.length-3) );
  1437. asLineControl.attribute("border-color") = "#A683B1";
  1438. asLineControl.attribute("border-width") = "2px";
  1439. selectSectionsLine[1] = str;
  1440. str = swimlineControlArray[i+2];
  1441. asLineControl = document.controls( str.substr(0, str.length-3) );
  1442. asLineControl.attribute("border-color") = "#A683B1";
  1443. asLineControl.attribute("border-width") = "2px";
  1444. selectSectionsLine[2] = str;
  1445. str = swimlineControlArray[i-1];
  1446. asLineControl = document.controls( str.substr(0, str.length-3) );
  1447. asLineControl.attribute("border-color") = "#A683B1";
  1448. asLineControl.attribute("border-width") = "2px";
  1449. selectSectionsLine[3] = str;
  1450. return;
  1451. }
  1452. count++;
  1453. }
  1454. }
  1455. }
  1456. }
  1457. }
  1458. /**
  1459. * @group :
  1460. * @ver : 2007.07
  1461. * @by : 전지은
  1462. * @---------------------------------------------------
  1463. * @type : function
  1464. * @access : public
  1465. * @desc : textarea 의 오른쪽 마우스 버튼 이벤트 생성(팝업메뉴 허용 이벤트)
  1466. * @param :
  1467. * @return :
  1468. * @---------------------------------------------------
  1469. */
  1470. function fPopupMenuEvent(curStepCntl){
  1471. if( isNull(curStepCntl) ){
  1472. var ctrl = null;
  1473. ctrl = (event.target);
  1474. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
  1475. var id = selControl.parent.attribute("id");
  1476. currentStepCntl = document.controls(id); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
  1477. }else{
  1478. currentStepCntl = document.controls(curStepCntl); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
  1479. }
  1480. var curID = currentStepCntl.attribute("id");
  1481. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1482. opener.model.setValue( "/root/main/stepinfo/info/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno") );
  1483. opener.model.setValue( "/root/main/stepinfo/info/times", model.getValue(stepRef + "[" + curNo + "]/times") );
  1484. opener.ipt_times.refresh();
  1485. opener.ipt_times_old.refresh();
  1486. opener.model.setValue( "/root/main/stepinfo/info/stepnm", model.getValue(stepRef + "[" + curNo + "]/stepnm") );
  1487. opener.ipt_stepnm.refresh();
  1488. opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
  1489. opener.tar_stepmemo.refresh();
  1490. // 2008.08.21 pymi
  1491. //opener.model.setValue( "/root/main/stepinfo/info/daynm", model.getValue(stepRef + "[" + curNo + "]/tmpstepnm") );
  1492. //opener.cmb_stepnm.refresh();
  1493. model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno"));
  1494. model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
  1495. opener.model.setValue( "/root/main/stepinfo/info/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
  1496. opener.model.setValue( "/root/main/stepinfo/info/setno", model.getValue(stepRef + "[" + curNo + "]/setno"));
  1497. if(event.button == 3){
  1498. event.preventDefault();
  1499. if( opener.window.javascript.OpenerKind != "GPS" ){
  1500. if( opener.model.getValue("/root/temp/getdata/authflag") == "M" || opener.model.getValue("/root/temp1/getdata/authflag") == "M" )
  1501. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu1/item", "name", "func", false);
  1502. return;
  1503. }else{
  1504. if( model.getValue("/root/temp/getdata/authflag") != "U" ) return;
  1505. if( model.getValue("/root/main/outlineinfo/info/cpgflagcd") == "02" ){
  1506. if( model.getValue(stepRef + "[" + curNo + "]/stepflagcd") == "D"){
  1507. if( decisionMode == "false" ){
  1508. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu3/item", "name", "func", false);
  1509. }else{
  1510. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu7/item", "name", "func", false);
  1511. }
  1512. }else{
  1513. if( model.getValue(stepRef + "[" + curNo + "]/settypecd") == "W" ){
  1514. if( opener.model.getValue("/root/main/steppath/info[stepno='"+curNo+"']/stepstat") == "10" )
  1515. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu8/item", "name", "func", false);
  1516. else initPopupMenu();
  1517. }else{
  1518. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu5/item", "name", "func", false);
  1519. }
  1520. }
  1521. }else{
  1522. //중간타기 CP 허용에 따른 시작스텝 설정 메뉴 추가 (2009.02.19)
  1523. var D0stepNode = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[times = '0']/stepno");
  1524. if( opener.model.getValue("/root/temp1/getdata/appstat") < "10" && D0stepNode == null ){ //D0 CP이거나 이미 진행중인 경우 중간타기 불가
  1525. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu6/item", "name", "func", false);
  1526. }else{
  1527. initPopupMenu();
  1528. }
  1529. }
  1530. }
  1531. }
  1532. }
  1533. /**
  1534. * @group :
  1535. * @ver : 2007.07
  1536. * @by : 전지은
  1537. * @---------------------------------------------------
  1538. * @type : function
  1539. * @access : public
  1540. * @desc :
  1541. * @param :
  1542. * @return :
  1543. * @---------------------------------------------------
  1544. */
  1545. function fFocusOut(){
  1546. window.setPopupMenu(false);
  1547. }
  1548. /**
  1549. * @group :
  1550. * @ver : 2007.07
  1551. * @by : 전지은
  1552. * @---------------------------------------------------
  1553. * @type : function
  1554. * @access : public
  1555. * @desc :
  1556. * @param :
  1557. * @return :
  1558. * @---------------------------------------------------
  1559. */
  1560. function fFocusIn(){
  1561. if( currentStepCntl == null ){
  1562. var ctrl = (event.target);
  1563. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
  1564. var curID = selControl.parent.attribute("id");
  1565. currentStepCntl = document.controls(curID); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
  1566. if( selectedControl == null ){
  1567. selectedControl = currentStepCntl;
  1568. }
  1569. }
  1570. changedCntl = currentStepCntl;
  1571. opener.ipt_stepnm.disabled = false;
  1572. opener.tar_stepmemo.disabled = false;
  1573. //if(cpgflagcd == "01"){
  1574. opener.ipt_times.disabled = false;
  1575. opener.ipt_times_old.disabled = false;
  1576. //}
  1577. // 2008.08.21 pymi
  1578. if(opener.window.javascript.OpenerKind == "GPS"){
  1579. opener.cmb_stepnm.disabled = false;
  1580. } else {
  1581. if( opener.rdo_ioflagcd.value != "O") opener.cmb_stepnm.disabled = false;
  1582. }
  1583. }
  1584. /**
  1585. * @group :
  1586. * @ver : 2007.07
  1587. * @by : 전지은
  1588. * @---------------------------------------------------
  1589. * @type : function
  1590. * @access : public
  1591. * @desc : 스텝 안의 내용을 처음 입력하거나 변경하면, Opener의 memo 란에 내용이 함께 반영된다.
  1592. * @param :
  1593. * @return :
  1594. * @---------------------------------------------------
  1595. */
  1596. function fSetMemo(){
  1597. //현재 선택된 스텝이 아니라, 이전에 선택되어 수정된 스텝의 내용을 반영해야 함.
  1598. //var curID = currentStepCntl.attribute("id");
  1599. var ctrl = (event.target);
  1600. var curID = changedCntl.attribute("id");
  1601. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1602. var checkChar = model.getValue(stepRef + "[" + curNo + "]/stepmemo");
  1603. //alert ( checkChar.isByteSize(300) );
  1604. if(checkChar.isByteSize(2048) == false){
  1605. //messageBox("한글 300자, ", "E003");
  1606. }
  1607. if( opener.tar_stepmemo.disabled == false ){
  1608. //글자 길이 체크한다
  1609. var checkChar = model.getValue(stepRef + "[" + curNo + "]/stepmemo");
  1610. if( getStringLength(checkChar) > 2048 ){
  1611. model.setValue( stepRef + "[" + curNo + "]/stepmemo", checkChar.substr(0, 2048) );
  1612. messageBox("문자열의 길이가 2048 Byte를", "E003");
  1613. }
  1614. opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
  1615. // 선택된 스텝이 없을 때 상단의 스텝정보에 데이터 입력을 막기 위해 처리함 (2007.12.17 수정)
  1616. if( ctrl.substr(0, 15) == "xforms:textarea" ){
  1617. var curID2 = currentStepCntl.attribute("id");
  1618. var curNo2 = parseInt( curID2.substr(12, curID2.length-12) ) + 1;
  1619. opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo2 + "]/stepmemo") );
  1620. }
  1621. opener.tar_stepmemo.refresh();
  1622. changedCntl.refresh();
  1623. }
  1624. if(model.getValue(stepRef + "[" + curNo + "]/m") != "i"){
  1625. model.setValue(stepRef + "[" + curNo + "]/m", "u");
  1626. }
  1627. }
  1628. /**
  1629. * @group :
  1630. * @ver : 2007.07
  1631. * @by : 전지은
  1632. * @---------------------------------------------------
  1633. * @type : function
  1634. * @access : public
  1635. * @desc : 연결설정 모드일 경우, 컨트롤에 마우스를 over 하면 마우스 커서가 바뀐다.
  1636. * @param :
  1637. * @return :
  1638. * @---------------------------------------------------
  1639. */
  1640. function fMouseOverEvent(){
  1641. var ctrl = (event.target);
  1642. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
  1643. var cntlID = selControl.attribute("id");
  1644. var selMode = connectionMode;
  1645. //xforms:caption00_@X
  1646. //cntlID.substr(cntlID.length-3, 1)
  1647. if( cntlID.substr(cntlID.length-3, 2) == "_@" ){
  1648. if( selControl.attribute("color") == "#000000" ){
  1649. selMode = "true";
  1650. }
  1651. }
  1652. if(selMode == "true"){
  1653. selControl.attribute("cursor") = "pointer";
  1654. } else {
  1655. selControl.attribute("cursor") = "default";
  1656. }
  1657. }
  1658. /**
  1659. * @group :
  1660. * @ver : 2007.07
  1661. * @by : 전지은
  1662. * @---------------------------------------------------
  1663. * @type : function
  1664. * @access : public
  1665. * @desc : 선택한 지점에 스임라인을 추가한다.
  1666. * @param :
  1667. * @return :
  1668. * @---------------------------------------------------
  1669. */
  1670. function fAddSwimLine(){
  1671. if( selectedLineSection != "" ){
  1672. var trgline;
  1673. var trgStepNo;
  1674. var org_CurrentStepCntl = currentStepCntl;
  1675. //스윔라인을 추가한다.
  1676. var y = parseInt(lineNo) * swimLineHight; //세로 아웃라인의 y1
  1677. var cy = y + swimLineHight; //세로 아웃라인의 y2
  1678. var lngth = swimlineControlArray.length - 1;
  1679. //아웃라인을 제외한 나머지 컨트롤을 삭제
  1680. for(var i=outsideControlCnt; i<=lngth; i++){
  1681. var cntlID = swimlineControlArray[i];
  1682. if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
  1683. cntlID = cntlID.substr(0, cntlID.length-3);
  1684. }
  1685. grp_swimline.removeChild(cntlID);
  1686. swimlineControlArray[i] = "";
  1687. }
  1688. /*
  1689. swimlineControlArray.slice(0, outsideControlCnt);
  1690. controlCnt = outsideControlCnt;
  1691. fCreateSwimLine(y, cy);
  1692. */
  1693. //GOTO aaaaaa
  1694. lineNo = parseInt(lineNo) + 1;
  1695. model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo);
  1696. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1697. opener.ipt_swimlineno.refresh();
  1698. //배열 인덱스를 하나 더 생성
  1699. linesControlMaxCnt[linesControlMaxCnt.length] = 0;
  1700. if( lineNo != parseInt(selectedLineSection)+1 ){
  1701. for(var i=1; i<=grpControlCnt; i++ ){
  1702. trgline = model.getValue(stepRef + "[" + i + "]/swimlineno");
  1703. trgStepNo = model.getValue(stepRef + "[" + i + "]/stepno");
  1704. if( trgline > selectedLineSection ){
  1705. model.setValue( stepRef + "[" + i + "]/swimlineno", parseInt(trgline)+1 );
  1706. }
  1707. }
  1708. var start = parseInt(selectedLineSection)-1;
  1709. var end = linesControlMaxCnt.length-1;
  1710. var a = linesControlMaxCnt.slice(0, selectedLineSection);
  1711. var b = linesControlMaxCnt.slice(selectedLineSection, end);
  1712. var c = linesControlMaxCnt[linesControlMaxCnt.length-1];
  1713. linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
  1714. linesControlMaxCnt = a.concat(c, b);
  1715. //추가할 라인의 바로 윗줄 스텝의 연결번호를 지운다.
  1716. var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + selectedLineSection + "']");
  1717. for(var i= 0; i<nodeList.length; i++){
  1718. var node = nodeList.item(i);
  1719. var lnkNode = node.selectSingleNode("lnkstepno");
  1720. model.setValue(lnkNode, "");
  1721. lnkNode = node.selectSingleNode("stepno");
  1722. var stepNo = model.getValue(lnkNode);
  1723. model.removeNodeset(dcsRef + "[stepno = '" + stepNo + "']");
  1724. }
  1725. nodeList = instance1.selectNodes(dcsRef);
  1726. dcsCntlCnt = nodeList.length + 1;
  1727. }
  1728. //aaaaaa:
  1729. var org_grpControlCnt = grpControlCnt;
  1730. var org_controlCnt = controlCnt;
  1731. var org_linesControlMaxCnt = linesControlMaxCnt;
  1732. fInitialize();
  1733. grpControlCnt = org_grpControlCnt;
  1734. controlCnt = org_controlCnt;
  1735. linesControlMaxCnt = org_linesControlMaxCnt;
  1736. fCreateControl();
  1737. selectedControl = null;
  1738. //currentStepCntl = null;
  1739. prevStepCntl = null;
  1740. //20071120 추가 시작 (라인을 추가하면 추가된 라인에 포커스를 맞춘다)
  1741. currentStepCntl = org_CurrentStepCntl;
  1742. selectedLineSection = parseInt(selectedLineSection) + 1;
  1743. fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
  1744. fChangeOutLineCntl("select", selectedLineSection-1); //전체 선의 색상을 다시 셋팅...
  1745. //20071120 추가 끝
  1746. }else {
  1747. return;
  1748. }
  1749. }
  1750. /**
  1751. * @group :
  1752. * @ver : 2008.07
  1753. * @by : 전지은
  1754. * @---------------------------------------------------
  1755. * @type : function
  1756. * @access : public
  1757. * @desc : 선택한 지점에 스임라인 윗줄에 D0 swimline과 step을 추가한다.
  1758. * @param :
  1759. * @return :
  1760. * @---------------------------------------------------
  1761. */
  1762. function fAddD0Step(){
  1763. if( selectedLineSection != "" ){
  1764. var trgline;
  1765. var trgStepNo;
  1766. var org_CurrentStepCntl = currentStepCntl;
  1767. var lngth = swimlineControlArray.length - 1;
  1768. if( instance1.selectSingleNode(stepRef + "/stepno") == null ){
  1769. return;
  1770. }
  1771. //아웃라인을 제외한 나머지 컨트롤을 삭제
  1772. for(var i=outsideControlCnt; i<=lngth; i++){
  1773. var cntlID = swimlineControlArray[i];
  1774. if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
  1775. cntlID = cntlID.substr(0, cntlID.length-3);
  1776. }
  1777. grp_swimline.removeChild(cntlID);
  1778. swimlineControlArray[i] = "";
  1779. }
  1780. //mian viewer의 스윔라인수 값(+1) 변경
  1781. lineNo = parseInt(lineNo) + 1;
  1782. model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo);
  1783. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1784. opener.ipt_swimlineno.refresh();
  1785. //<steplist>에 <stepinfo>를 맨 앞에 생성
  1786. model.resetInstanceNode("/root/main/temp/stepinfo/info");
  1787. model.makeNode("/root/main/temp/stepform/info");
  1788. model.copyNode("/root/main/temp/stepform/info", "/root/main/temp/stepinfo/info");
  1789. var srcNode = instance1.selectSingleNode("/root/main/temp/stepform/info");
  1790. var desNode = instance1.selectSingleNode(stepRef);
  1791. var lastrow = instance1.selectNodes(stepRef).length;
  1792. var pdesNode = instance1.selectSingleNode(stepRef + "[" + lastrow + "]");
  1793. desNode.insertAfter(srcNode, pdesNode);
  1794. lastrow++;
  1795. model.removeNodeset("/root/main/temp/stepform/info"); //copy를 위해 임시로 만든 노드 삭제
  1796. model.setValue(stepRef + "[" + lastrow + "]/stepno", ++grpControlCnt); //D0 step 정보 셋팅
  1797. model.setValue(stepRef + "[" + lastrow + "]/stepflagcd", "A");
  1798. model.setValue(stepRef + "[" + lastrow + "]/swimlineno", "1");
  1799. model.setValue(stepRef + "[" + lastrow + "]/refseq", "1");
  1800. model.setValue(stepRef + "[" + lastrow + "]/times", "0");
  1801. model.setValue(stepRef + "[" + lastrow + "]/m", "i");
  1802. model.setValue(stepRef + "[" + lastrow + "]/orgstepno", grpControlCnt);
  1803. model.setValue(stepRef + "[" + lastrow + "]/startendflag", "S");
  1804. model.setValue(stepRef + "[" + lastrow + "]/stepnm", "외래");
  1805. //if( instance1.selectSingleNode("/root/main/sortedsteplist/info/stepno") != null ){
  1806. //다음줄의 Step과 자동 연결
  1807. if( instance1.selectSingleNode("/root/main/steplist/info[swimlineno='1' and refseq='1']/stepno") != null ){
  1808. //model.setValue(stepRef + "[" + lastrow + "]/lnkstepno", model.getValue("/root/main/sortedsteplist/info[1]/stepno"));
  1809. model.setValue(stepRef + "[" + lastrow + "]/lnkstepno", model.getValue("/root/main/steplist/info[swimlineno='1' and refseq='1']/stepno"));
  1810. }
  1811. //}
  1812. //모든 step의 swimline 수를 +1 늘림
  1813. for(var i=grpControlCnt-1; i>=1; i-- ){
  1814. trgline = model.getValue(stepRef + "[" + i + "]/swimlineno");
  1815. model.setValue( stepRef + "[" + i + "]/swimlineno", parseInt(trgline)+1 );
  1816. if( model.getValue(stepRef + "[" + i + "]/m") != "i" ){
  1817. model.setValue( stepRef + "[" + i + "]/m", "u");
  1818. }
  1819. //시작 스텝 존재시, 시작스텝 취소
  1820. if( model.getValue(stepRef + "[" + i + "]/startendflag") == "S" ){
  1821. model.setValue( stepRef + "[" + i + "]/startendflag", "");
  1822. }
  1823. //라인의 수와, 컨트롤의 수가 일치하지 않기때문에 밑에서 따로 수행해야 함
  1824. //linesControlMaxCnt[i] = linesControlMaxCnt[i-1];
  1825. }
  1826. for( var i=linesControlMaxCnt.length; i>=1; i-- ){
  1827. linesControlMaxCnt[i] = linesControlMaxCnt[i-1];
  1828. }
  1829. //linesControlMaxCnt[] 마지막 index 에 step1개 셋팅
  1830. linesControlMaxCnt[0] = 1;
  1831. //alert( linesControlMaxCnt );
  1832. var org_grpControlCnt = grpControlCnt;
  1833. var org_controlCnt = controlCnt;
  1834. var org_linesControlMaxCnt = linesControlMaxCnt;
  1835. fInitialize();
  1836. grpControlCnt = org_grpControlCnt;
  1837. controlCnt = org_controlCnt;
  1838. linesControlMaxCnt = org_linesControlMaxCnt;
  1839. fCreateControl();
  1840. selectedControl = null;
  1841. prevStepCntl = null;
  1842. //라인을 추가하면 추가된 라인에 포커스를 맞춘다
  1843. currentStepCntl = org_CurrentStepCntl;
  1844. selectedLineSection = 1;
  1845. fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
  1846. fChangeOutLineCntl("select", selectedLineSection-1); //전체 선의 색상을 다시 셋팅...
  1847. }
  1848. }
  1849. /**
  1850. * @group :
  1851. * @ver : 2007.07
  1852. * @by : 전지은
  1853. * @---------------------------------------------------
  1854. * @type : function
  1855. * @access : public
  1856. * @desc : 컨트롤이나 스윔라인을 삭제한다.
  1857. * @param :
  1858. * @return :
  1859. * @---------------------------------------------------
  1860. */
  1861. function fDelCntl(){
  1862. var header = "supsetno▦deptcd▦updtdd▦updttm▦setno▦settypecd▦m▩";
  1863. var delSetInfoCSV = "";
  1864. if( currentStepCntl == null && isNull(selectedLineSection) ){
  1865. messageBox("삭제할 대상을", "C002");
  1866. return;
  1867. }
  1868. if( selectedLineSection != "" ){
  1869. //스윔라인을 삭제한다.
  1870. //fDelSwimLine( selectedLineSection );
  1871. var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + selectedLineSection + "' and formexistyn = 'Y']");
  1872. if(nodeList.length >= 1){
  1873. var msg = messageBox("저장된 처방 혹은 서식 정보가 존재합니다.\nStep을 삭제하면 처방 및 서식도 함께 삭제됩니다.\n\n정말로 ", "Q001");
  1874. if(msg == 6){
  1875. //yes
  1876. for(var i= 0; i<nodeList.length; i++){
  1877. var node = nodeList.item(i);
  1878. var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
  1879. var setno = node.selectSingleNode("setno");
  1880. if(cpgflagcd == "01"){
  1881. var settypecd = "W";
  1882. } else if(cpgflagcd == "02"){
  1883. var settypecd = "G";
  1884. }
  1885. delSetInfoCSV = delSetInfoCSV + "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
  1886. }
  1887. opener.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
  1888. fDelStep("L", selectedLineSection);
  1889. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1890. opener.ipt_swimlineno.refresh();
  1891. } else if(msg == 7) {
  1892. return false;
  1893. }
  1894. } else {
  1895. fDelStep("L", selectedLineSection);
  1896. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1897. opener.ipt_swimlineno.refresh();
  1898. }
  1899. }else {
  1900. //스텝 컨트롤을 삭제한다.
  1901. var curID = currentStepCntl.attribute("id");
  1902. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1903. if( model.getValue( stepRef + "[" + curNo + "]/formexistyn" ) == "Y" ){
  1904. var msg = messageBox("저장된 처방 혹은 서식 정보가 존재합니다. \nStep을 삭제하면 처방 및 서식도 함께 삭제됩니다. \n정말로 ", "Q001");
  1905. if(msg == 6){
  1906. //yes
  1907. var nodeList = instance1.selectNodes(stepRef + "[" + curNo + "]");
  1908. var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
  1909. var setno = model.getValue(stepRef + "[" + curNo + "]/setno");
  1910. if(cpgflagcd == "01"){
  1911. var settypecd = "W";
  1912. } else if(cpgflagcd == "02"){
  1913. var settypecd = "G";
  1914. }
  1915. delSetInfoCSV = "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
  1916. opener.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
  1917. fDelStep("C");
  1918. } else if(msg == 7) {
  1919. return false;
  1920. }
  1921. } else {
  1922. fDelStep("C");
  1923. }
  1924. // ★ selectedControl 과 동일하다면 selectedControl를 null 로 셋팅한다.
  1925. // selectedControl = null;
  1926. }
  1927. }
  1928. /**
  1929. * @group :
  1930. * @ver : 2007.07
  1931. * @by : 전지은
  1932. * @---------------------------------------------------
  1933. * @type : function
  1934. * @access : public
  1935. * @desc : 스윔라인을 삭제한다.
  1936. * @param :
  1937. * @return :
  1938. * @---------------------------------------------------
  1939. */
  1940. function fDelSwimLine(){
  1941. fDelStep("L", selectedLineSection);
  1942. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1943. opener.ipt_swimlineno.refresh();
  1944. }
  1945. /**
  1946. * @group :
  1947. * @ver : 2007.07
  1948. * @by : 전지은
  1949. * @---------------------------------------------------
  1950. * @type : function
  1951. * @access : public
  1952. * @desc : 스텝 컨트롤을 삭제한다.
  1953. * @param : flag(C:control, L:line), no
  1954. * @return :
  1955. * @---------------------------------------------------
  1956. */
  1957. function fDelStep(flag, no){
  1958. if(flag == "C"){
  1959. var curID = currentStepCntl.attribute("id");
  1960. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1961. var lineNumber = parseInt( model.getValue( stepRef + "[" + curNo + "]/swimlineno" ) );
  1962. var stepRefSeq = parseInt( model.getValue( stepRef + "[" + curNo + "]/refseq" ) );
  1963. var curStepNo = parseInt( model.getValue( stepRef + "[" + curNo + "]/stepno" ) );
  1964. //삭제하려는 라인이 최대갯수의 컨트롤을 갖는 줄이라면, 스윔라인 길이 축소
  1965. //동일갯수를 갖던 라인이 그대로 있으면 길이 축소 안해야 함.
  1966. var adjustLineYN = "N";
  1967. if(maxControlCnt == curRowCtrlMaxCnt){
  1968. adjustLineYN = "Y";
  1969. var curRowCtrlMaxCnt = linesControlMaxCnt[lineNumber-1];
  1970. for( var i=0; i<linesControlMaxCnt.length; i++ ){
  1971. if( linesControlMaxCnt[i] > curRowCtrlMaxCnt ){
  1972. adjustLineYN = "N";
  1973. break;
  1974. }
  1975. }
  1976. }
  1977. if( adjustLineYN == "Y" ){
  1978. if( grp_swimline.attribute("width") != "835px" ){
  1979. if(maxControlCnt >3){
  1980. fAdjustLine("re", "392");
  1981. maxControlCnt--;
  1982. }
  1983. }else{
  1984. if(maxControlCnt > 2){
  1985. fAdjustLine("re", "392");
  1986. maxControlCnt--;
  1987. }
  1988. }
  1989. }
  1990. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다. (1건이므로 for 필요 없음..)
  1991. var nodeList = instance1.selectNodes(stepRef + "[stepno = '" + curNo + "']");
  1992. for(var i= 0; i<nodeList.length; i++){
  1993. var node = nodeList.item(i);
  1994. var iNode = node.selectSingleNode("m");
  1995. if(iNode.text != "i"){
  1996. var destNodeList = instance1.selectNodes("/root/temp/delsteplist/info");
  1997. model.setValue(iNode, "d");
  1998. model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]");
  1999. model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]", node);
  2000. model.setValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/stepno", model.getValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/orgstepno"));
  2001. }
  2002. }
  2003. fDelLink( curNo ); //선택된 스텝에 연결된 모든 라인을 없댄다.(하위스텝번호를 없앤다)
  2004. model.removeNodeset(stepRef + "[stepno = '" + curNo + "']");
  2005. grpControlCnt = grpControlCnt -1;
  2006. var stepList = instance1.selectNodes(stepRef);
  2007. for(var i = curNo; i<= stepList.length; i++){
  2008. var iSwimlineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
  2009. var iRefseq = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
  2010. var iStepno = model.getValue(stepRef + "[" + i + "]/stepno");
  2011. if( lineNumber == iSwimlineno && stepRefSeq < iRefseq ){
  2012. //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
  2013. model.setValue( stepRef + "[" + i + "]/refseq", parseInt( iRefseq ) - 1 );
  2014. }
  2015. //for(var k=1; k<=i; k++){
  2016. nodeList = instance1.selectNodes(stepRef + "[lnkstepno = '" + iStepno + "']");
  2017. for(var k= 0; k<nodeList.length; k++){
  2018. var node = nodeList.item(k);
  2019. var iNode = node.selectSingleNode("lnkstepno");
  2020. //model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
  2021. model.setValue(iNode, i);
  2022. }
  2023. if( iStepno > curNo ){
  2024. nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + iStepno + "']");
  2025. for(var k= 0; k<nodeList.length; k++){
  2026. var node = nodeList.item(k);
  2027. var iNode = node.selectSingleNode("lnkstepno");
  2028. var mNode = node.selectSingleNode("m");
  2029. model.setValue(iNode, i);
  2030. }
  2031. //@@
  2032. model.setValue( stepRef + "[" + i + "]/stepno", parseInt(iStepno)-1 );
  2033. nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + iStepno + "']");
  2034. for(var k= 0; k<nodeList.length; k++){
  2035. var node = nodeList.item(k);
  2036. var iNode = node.selectSingleNode("stepno");
  2037. var mNode = node.selectSingleNode("m");
  2038. model.setValue(iNode, i);
  2039. }
  2040. }
  2041. }
  2042. linesControlMaxCnt[lineNumber-1] = linesControlMaxCnt[lineNumber-1] - 1;
  2043. currentStepCntl = null;
  2044. selectedControl = null;
  2045. //선택 스텝 정보를 비운 후 disable
  2046. opener.model.resetInstanceNode("/root/main/stepinfo/info");
  2047. opener.tar_stepmemo.refresh();
  2048. opener.ipt_stepnm.refresh();
  2049. opener.ipt_times.refresh();
  2050. opener.cmb_stepnm.refresh(); //2008.08.19 pymi
  2051. opener.tar_stepmemo.disabled = true;
  2052. opener.ipt_stepnm.disabled = true;
  2053. opener.ipt_times.disabled = true;
  2054. opener.cmb_stepnm.disabled = true; //2008.08.19 pymi
  2055. }else if(flag == "L"){
  2056. var org_CurrentStepCntl = currentStepCntl;
  2057. var org_SelectedLineSection = selectedLineSection;
  2058. var delNodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "']");
  2059. var delCount = delNodeList.length;
  2060. fChgDschTimes(parseInt(no)+1); //2008.11.12
  2061. //상위 스텝의 연결스텝번호 수정, 위 아래간의 스텝 연결선 유지 (2008.07.02 추가)
  2062. if( delNodeList.length == 1 && no > 1 ){ //삭제되는 스텝이 1개일 경우 (A버튼)
  2063. var lnkNo = instance1.selectSingleNode(stepRef + "[swimlineno = '" + no + "']/lnkstepno");
  2064. var rowNo = parseInt( instance1.selectSingleNode(stepRef + "[swimlineno = '" + (parseInt(no)-1) + "']/stepno").text );
  2065. model.setValue(stepRef + "["+ rowNo +"]/lnkstepno", lnkNo.text);
  2066. if( model.getValue(stepRef + "["+ rowNo +"]/m") != "i" ){
  2067. model.setValue(stepRef + "["+ rowNo +"]/m", "u");
  2068. }
  2069. }else if( delNodeList.length >= 2 && no > 1 ){ //삭제되는 스텝이 2개 이상일 경우 (D버튼)
  2070. //var deltNos = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "']");
  2071. if( delNodeList.length > 0 ){
  2072. for( var i=0; i<delNodeList.length; i++ ){
  2073. var deltNode = delNodeList.item(i);
  2074. var deltStepNo = deltNode.selectSingleNode("stepno");
  2075. var deltLnkNo = deltNode.selectSingleNode("lnkstepno");
  2076. //dcsRef
  2077. //model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/m", "u" );
  2078. //model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/lnkstepno", deltLnkNo.text );
  2079. var trgtNos = instance1.selectNodes(dcsRef + "[lnkstepno = '" + deltStepNo.text + "']");
  2080. if( trgtNos.length > 0 ){
  2081. /*
  2082. for( var k=trgtNos.length-1; k>=0; k-- ){
  2083. var trgtNode = trgtNos.item(i);
  2084. if( trgtNode.selectSingleNode("m").text != "i" ){
  2085. model.setValue(trgtNode.selectSingleNode("m"), "u");
  2086. }
  2087. model.setValue( trgtNode.selectSingleNode("lnkstepno"), deltLnkNo.text );
  2088. }
  2089. */
  2090. if( instance1.selectSingleNode( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/m" ).text != "i" ){
  2091. model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/m", "u" );
  2092. }
  2093. model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/lnkstepno", deltLnkNo.text );
  2094. }
  2095. }
  2096. }
  2097. }
  2098. var delStepNoListTxt = "";
  2099. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  2100. for(var i=0; i<delNodeList.length; i++){
  2101. var dstNode = delNodeList.item(i);
  2102. var dstFcsNode = dstNode.selectSingleNode("stepno");
  2103. var curNo = model.getValue(dstFcsNode);
  2104. var iNode = dstNode.selectSingleNode("m");
  2105. var StepNoNode = dstNode.selectSingleNode("stepno"); // orgstepno
  2106. delStepNoListTxt = delStepNoListTxt + StepNoNode.text + "|";
  2107. if(iNode.text != "i"){
  2108. var destNodeList = instance1.selectNodes("/root/temp/delsteplist/info");
  2109. model.setValue(iNode, "d");
  2110. model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]");
  2111. model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]", dstNode);
  2112. var stpNo = model.getValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/stepno");
  2113. var orgNo = model.getValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/orgstepno");
  2114. model.setValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/stepno", orgNo);
  2115. model.setValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/orgstepno", stpNo);
  2116. }
  2117. //연결선 정보 및 컨트롤 삭제
  2118. fDelLink( curNo );
  2119. }
  2120. var delNodeLngth = delStepNoListTxt.split("|");
  2121. model.removeNodeset (stepRef + "[swimlineno = '" + no + "']"); //copy 후 인스턴스 삭제
  2122. var a = linesControlMaxCnt.slice(0, parseInt(no)-1);
  2123. var b = linesControlMaxCnt.slice(no, linesControlMaxCnt.length);
  2124. linesControlMaxCnt = new Array();
  2125. linesControlMaxCnt = a.concat(b);
  2126. grpControlCnt = grpControlCnt - delCount;
  2127. //삭제 스텝 제거 후, 전체 스텝 리스트 loop
  2128. var nodeList = instance1.selectNodes(stepRef);
  2129. for(var i=nodeList.length-1 ; i>=0; i--){
  2130. var dstNode = nodeList.item(i);
  2131. var dstFcsNode = dstNode.selectSingleNode("swimlineno");
  2132. //var addTimesNode = dstNode.selectSingleNode("times"); //2008.11.12
  2133. if( dstFcsNode.text > no ){
  2134. model.setValue(dstFcsNode, parseInt(model.getValue(dstFcsNode)) - 1);
  2135. /*
  2136. var ioflag = opener.model.getValue("/root/main/masterinfo/info/ioflagcd");
  2137. f( cpgflagcd == "01" && ioflag == "I" && parseInt(no) > 1 ){ //입원 CP의 경우만 회차 순차적으로 지정(2008.11.12)
  2138. model.setValue(addTimesNode, parseInt(model.getValue(addTimesNode)) - 1);
  2139. }
  2140. */
  2141. }
  2142. var dstFcsNode = dstNode.selectSingleNode("stepno");
  2143. var lnkFcsNode = dstNode.selectSingleNode("lnkstepno");
  2144. var mFcsNode = dstNode.selectSingleNode("m");
  2145. var org_dstFcsVal = dstFcsNode.text; //비교대상인 스텝의 원 스텝번호(노드 객체로 비교하면, setvalue로 인해 값이 변한다)
  2146. //for(var k=0; k<delNodeLngth.length; k++){
  2147. for(var k=delNodeLngth.length-1; k>=0; k--){
  2148. var delFcsNode = delStepNoListTxt.split("|")[k];
  2149. if( parseInt(delFcsNode) < parseInt(org_dstFcsVal) ){
  2150. //@@
  2151. model.setValue( dstFcsNode, parseInt(model.getValue(dstFcsNode))-1 );
  2152. mFcsNode = dstNode.selectSingleNode("m");
  2153. if( mFcsNode.text != "i" ){
  2154. model.setValue(mFcsNode, "u");
  2155. }
  2156. }
  2157. if( parseInt(delFcsNode) < parseInt(lnkFcsNode.text) ){
  2158. model.setValue( lnkFcsNode, parseInt(model.getValue(lnkFcsNode))-1 );
  2159. mFcsNode = dstNode.selectSingleNode("m");
  2160. if( mFcsNode.text != "i" ){
  2161. model.setValue(mFcsNode, "u");
  2162. }
  2163. }
  2164. }
  2165. }
  2166. var nodeList = instance1.selectNodes(dcsRef);
  2167. if(nodeList.length > 0 ){
  2168. for(var i=nodeList.length-1 ; i>=0; i--){
  2169. var dstNode = nodeList.item(i);
  2170. var dstFcsNode = dstNode.selectSingleNode("stepno");
  2171. var lnkFcsNode = dstNode.selectSingleNode("lnkstepno");
  2172. var mFcsNode = dstNode.selectSingleNode("m");
  2173. var org_dstFcsVal = dstFcsNode.text; //비교대상인 스텝의 원 스텝번호(노드 객체로 비교하면, setvalue로 인해 값이 변한다)
  2174. //for(var k=0; k<delNodeLngth.length; k++){
  2175. for(var k=delNodeLngth.length-1; k>=0; k--){
  2176. var delFcsNode = delStepNoListTxt.split("|")[k];
  2177. if( parseInt(delFcsNode) < parseInt(dstFcsNode.text) ){
  2178. model.setValue( dstFcsNode, parseInt(model.getValue(dstFcsNode))-1 );
  2179. mFcsNode = dstNode.selectSingleNode("m");
  2180. if( mFcsNode.text != "i" ){
  2181. model.setValue(mFcsNode, "u");
  2182. }
  2183. }
  2184. if( parseInt(delFcsNode) < parseInt(lnkFcsNode.text) ){
  2185. model.setValue( lnkFcsNode, parseInt(model.getValue(lnkFcsNode))-1 );
  2186. if( mFcsNode.text != "i" ){
  2187. model.setValue(mFcsNode, "u");
  2188. }
  2189. }
  2190. /*
  2191. if( parseInt(delFcsNode.text) <= parseInt(lnkFcsNode.text) ){
  2192. model.setValue( lnkFcsNode, parseInt(model.getValue(lnkFcsNode))-1 );
  2193. if( mFcsNode.text != "i" ){
  2194. model.setValue(mFcsNode, "u");
  2195. }
  2196. }
  2197. */
  2198. }
  2199. }
  2200. }
  2201. //마지막 스윔라인을 삭제한다.
  2202. fDelLastSwimLine();
  2203. lineNo--;
  2204. model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo); //총 스윔라인 수
  2205. if(org_SelectedLineSection > lineNo){
  2206. selectedLineSection = "";
  2207. currentStepCntl = null;
  2208. selectSectionsLine[0] = "";
  2209. selectSectionsLine[1] = "";
  2210. selectSectionsLine[2] = "";
  2211. selectSectionsLine[3] = "";
  2212. fChangeOutLineCntl("reset", lineNo);
  2213. }else if( org_SelectedLineSection <= lineNo ){
  2214. currentStepCntl = org_CurrentStepCntl;
  2215. selectedLineSection = org_SelectedLineSection;
  2216. }
  2217. }
  2218. fCreateControl();
  2219. selectedControl = null;
  2220. prevStepCntl = null;
  2221. }
  2222. /**
  2223. * @group :
  2224. * @ver : 2007.07
  2225. * @by : 전지은
  2226. * @---------------------------------------------------
  2227. * @type : function
  2228. * @access : public
  2229. * @desc : 컨트롤(인스턴스)을 삭제했다면, 다음 스텝번호들의 시퀀스를 -1 씩 감소시킨다.
  2230. * @param : stepNo, lineNo
  2231. * @return :
  2232. * @---------------------------------------------------
  2233. */
  2234. function fResetSeq(stepNo, lineNo){
  2235. var end = grpControlCnt.length;
  2236. for(var i=stepNo; i<=end; i++){
  2237. var curcntlType = model.getValue( stepRef + "[" + i + "]/stepflagcd");
  2238. if( model.getValue(stepRef + "[" + i + "]/swimlineno") == lineNo ){
  2239. //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
  2240. model.setValue( stepRef + "[" + i + "]/refseq", parseInt( model.getValue(stepRef + "[" + i + "]/refseq") ) - 1 );
  2241. }else if( model.getValue(stepRef + "[" + i + "]/swimlineno") > lineNo ){
  2242. for(var k=1; k<i; k++){
  2243. if( model.getValue( stepRef + "[" + i + "]/stepno") == model.getValue(stepRef + "[" + k + "]/lnkstepno") )
  2244. model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
  2245. }
  2246. }
  2247. model.setValue( stepRef + "[" + i + "]/stepno", i-1 );
  2248. }
  2249. }
  2250. /**
  2251. * @group :
  2252. * @ver : 2007.07
  2253. * @by : 전지은
  2254. * @---------------------------------------------------
  2255. * @type : function
  2256. * @access : public
  2257. * @desc : 컨트롤을 연결하는 연결선을 삭제한다.
  2258. * @param : trgNo
  2259. * @return :
  2260. * @---------------------------------------------------
  2261. */
  2262. function fDelLink( trgNo ){
  2263. if(currentStepCntl == null){
  2264. // messageBox("삭제할 대상을", "C002");
  2265. // return;
  2266. }
  2267. //현재 컨트롤의 인스턴스에서 lnkstepno 를 삭제한 후, fCreateControl() 를 호출한다.
  2268. if( isNull(trgNo) ){
  2269. var curID = currentStepCntl.attribute("id");
  2270. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  2271. var delYN = "N";
  2272. } else {
  2273. var curNo = trgNo;
  2274. var delYN = "Y";
  2275. }
  2276. var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
  2277. var cntlNo = model.getValue( stepRef + "[" + curNo + "]/stepno");
  2278. //1. 선택한 스텝의 하위 스텝과의 연결을 해제한다.
  2279. if( type == "D"){
  2280. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  2281. var nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + curNo + "']");
  2282. for(var i= 0; i<nodeList.length; i++){
  2283. var node = nodeList.item(i);
  2284. var iNode = node.selectSingleNode("m");
  2285. if(iNode.text != "i"){
  2286. var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist/info");
  2287. var stepNode = model.getValue(node.selectSingleNode("stepno"));
  2288. model.setValue(iNode, "d");
  2289. model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]");
  2290. model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]", node);
  2291. }
  2292. }
  2293. model.removeNodeset(dcsRef + "[stepno = '" + curNo + "']");
  2294. } else {
  2295. //"A"나 "B"는 해당노드의 lnkstepno만 비워준다.
  2296. model.setValue( stepRef + "[" + curNo + "]/lnkstepno", "" );
  2297. if( model.getValue( stepRef + "[" + curNo + "]/m") != "i"){ //model.getValue( stepRef + "[" + curNo + "]/m") != "i" && delYN == "N"
  2298. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2299. }
  2300. }
  2301. //2. 선택한 스텝의 상위 스텝과의 연결을 해제한다.
  2302. var nodeList = instance1.selectNodes(stepRef + "[lnkstepno = '" + curNo + "']");
  2303. for(var i= 0; i<nodeList.length; i++){
  2304. var dstNode = nodeList.item(i);
  2305. var iNode = dstNode.selectSingleNode("lnkstepno");
  2306. model.setValue( iNode, "" );
  2307. iNode = dstNode.selectSingleNode("m");
  2308. if(iNode.text != "i"){ //iNode.text != "i" && delYN == "N"
  2309. model.setValue( iNode, "u" );
  2310. }
  2311. }
  2312. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  2313. var nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + curNo + "']");
  2314. if(nodeList.length > 0 ){
  2315. for(var i= 0; i<nodeList.length; i++){
  2316. var node = nodeList.item(i);
  2317. var iNode = node.selectSingleNode("m");
  2318. if(iNode.text != "i"){
  2319. var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist/info");
  2320. var stepNode = model.getValue(node.selectSingleNode("stepno"));
  2321. model.setValue(iNode, "d");
  2322. model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]");
  2323. model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]", node);
  2324. }
  2325. }
  2326. }
  2327. model.removeNodeset(dcsRef + "[lnkstepno = '" + curNo + "']");
  2328. nodeList = instance1.selectNodes(dcsRef);
  2329. dcsCntlCnt = nodeList.length + 1;
  2330. //오른쪽 버튼의 연결삭제를 선택한 경우
  2331. if( isNull(trgNo) ){
  2332. //controlCnt = initControlCnt;
  2333. fCreateControl();
  2334. }
  2335. selectedControl = null;
  2336. currentStepCntl = null;
  2337. prevStepCntl = null;
  2338. selectedLineSection = "";
  2339. }
  2340. /**
  2341. * @group :
  2342. * @ver : 2007.07
  2343. * @by : 전지은
  2344. * @---------------------------------------------------
  2345. * @type : function
  2346. * @access : public
  2347. * @desc : 시작 스텝으로 설정한다.
  2348. * @param :
  2349. * @return :
  2350. * @---------------------------------------------------
  2351. */
  2352. function fSetStartStep(){
  2353. var curID = currentStepCntl.attribute("id");
  2354. fChildrenCtrlToSelCtrl(curID, "S");
  2355. }
  2356. /**
  2357. * @group :
  2358. * @ver : 2007.07
  2359. * @by : 전지은
  2360. * @---------------------------------------------------
  2361. * @type : function
  2362. * @access : public
  2363. * @desc : 종료 스텝으로 설정한다.
  2364. * @param :
  2365. * @return :
  2366. * @---------------------------------------------------
  2367. */
  2368. function fSetEndStep(){
  2369. var curID = currentStepCntl.attribute("id");
  2370. fChildrenCtrlToSelCtrl(curID, "E");
  2371. }
  2372. /**
  2373. * @group :
  2374. * @ver : 2007.07
  2375. * @by : 전지은
  2376. * @---------------------------------------------------
  2377. * @type : function
  2378. * @access : public
  2379. * @desc : Day 이미지를 생성한다.
  2380. * @param :
  2381. * @return :
  2382. * @---------------------------------------------------
  2383. *
  2384. * 수정이력: 2008.08 pymi CP 표기법 변경으로 daynm, stepnm 함수 인자 추가
  2385. */
  2386. function fSetDayImage(stepno, days, daynm, stepnm){
  2387. var curID = currentStepCntl.attribute("id");
  2388. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  2389. var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
  2390. var times = model.getValue( stepRef + "[" + curNo + "]/times" );
  2391. var no = parseInt(stepno)-1;
  2392. var curStepnm = "";
  2393. if( stepnm != "" || !isNull(stepnm)) curStepnm = "(" +stepnm + ")";
  2394. if(days != "" ){
  2395. if(type == "D"){
  2396. var leftPos = 66; //200
  2397. var topPos = 51; //51
  2398. } else {
  2399. var leftPos = 32; //308
  2400. var topPos =0; //1
  2401. }
  2402. var cntl;
  2403. var ctrlType = "xforms:img";
  2404. var ctrlID = ctrlType + (controlCnt++);
  2405. currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + leftPos + "; top:" + topPos + "; width:20px; height:20px; background-stretch:stretch;");
  2406. ctrlType = "xforms:caption";
  2407. ctrlID = ctrlType + (controlCnt++);
  2408. // 2008.07.30 pymi (s) 기존의 컨트롤을 삭제한다. : 삭제하지 않으면 text가 겹쳐져보임
  2409. var fixedStCntl = model.getValue(stepRef + "[stepno = '" + stepno + "']/fixedStCntl");
  2410. if( !isNull(fixedStCntl)) currentStepCntl.removeChild(fixedStCntl);
  2411. // 2008.07.30 pymi (e)
  2412. cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + (topPos+1) + "; width:100px; height:20px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  2413. // 2008.08.18 pymi CP 표기법을 display
  2414. //cntl.attribute("text") = "D" + days;
  2415. cntl.attribute("text") = daynm + curStepnm;
  2416. // 2008.07.30 pymi (s)기존의 컨트롤을 setting
  2417. model.setValue(stepRef + "[stepno = '" + stepno + "']/fixedStCntl", ctrlID);
  2418. model.setValue(stepRef + "[stepno = '" + stepno + "']/stepnm", daynm + curStepnm);
  2419. model.setValue(stepRef + "[stepno = '" + stepno + "']/tmpstepnm", stepnm);
  2420. // 2008.07.30 pymi (e)
  2421. } else{
  2422. fCreateControl();
  2423. curID = "xforms:group" + no;
  2424. fChildrenCtrlToSelCtrl(curID);
  2425. }
  2426. if( model.getValue(stepRef + "[stepno='"+stepno+"']/m") != "i" ){
  2427. model.setValue( stepRef + "[stepno='"+stepno+"']/m", "u" );
  2428. }
  2429. }
  2430. /**
  2431. * @group :
  2432. * @ver : 2007.07
  2433. * @by : 전지은
  2434. * @---------------------------------------------------
  2435. * @type : function
  2436. * @access : public
  2437. * @desc : Detail 정보를 조회, 저장한다.
  2438. * @param :
  2439. * @return :
  2440. * @---------------------------------------------------
  2441. */
  2442. function fViewDetailInfo(OpenerKind){
  2443. if( allInfoSave() ){
  2444. //opener.window.javascript.fSizeControl();
  2445. if(cpgflagcd == "01"){
  2446. model.setValue("/root/main/outlineinfo/info/cpgflagcd", "W");
  2447. } else if(cpgflagcd == "02"){
  2448. model.setValue("/root/main/outlineinfo/info/cpgflagcd", "G");
  2449. }
  2450. var nodeList = instance1.selectNodes(stepRef);
  2451. //var nodeList = instance1.selectNodes(sortedStepRef);
  2452. var csv = getNodeListCSV(nodeList);
  2453. model.setValue("/root/main/temp/selectedstep/csvlist", csv);
  2454. if(opener.btn_action_tab.selected == true){
  2455. //grp_swimline.vscroll.attribute("pos") = "0";
  2456. //grp_swimline.hscroll.attribute("pos") = "0"
  2457. var vscrollPos = grp_swimline.vscroll.attribute("pos");
  2458. var hscrollPos = grp_swimline.hscroll.attribute("pos");
  2459. ivw_detail.attribute("top") = vscrollPos;
  2460. ivw_detail.attribute("left") = hscrollPos;
  2461. if( currentStepCntl == null && grpControlCnt == 0 && OpenerKind != "GPS" ){
  2462. var msg = messageBox("스텝을 ", "C002");
  2463. return;
  2464. }else{
  2465. if(currentStepCntl == null ){ //currentStepCntl == null && grpControlCnt > 0
  2466. currentStepCntl = document.controls("xforms:group0");
  2467. model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[1]/stepno"));
  2468. model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[1]/stepflagcd"));
  2469. }
  2470. grp_swimline.attribute("overflow") = "hidden";
  2471. opener.cap_outlineinfo.attribute("text") = "OCS 정보";
  2472. var setno = null;
  2473. var selectedDay = null;
  2474. var saveStatus = null;
  2475. var nodelist = null;
  2476. if(OpenerKind != "GPS"){
  2477. if( prevStepCntl == null ){
  2478. // if( ivw_detail.src != "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw" )
  2479. // ivw_detail.attribute("src") = "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw";
  2480. // else{
  2481. ivw_detail.window.javascript.fInitData();
  2482. ivw_detail.visible = true;
  2483. // }
  2484. }else{;
  2485. if( prevStepCntl.attribute("id") != currentStepCntl.attribute("d") ){
  2486. ivw_detail.attribute("src") = "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw";
  2487. }
  2488. }
  2489. }
  2490. //ivw_detail.attribute("overflow") = "scroll";
  2491. //ivw_detail.visible = true;
  2492. }
  2493. return;
  2494. }else if(opener.btn_outline_tab.selected == true){
  2495. grp_swimline.attribute("overflow") = "scroll";
  2496. //grp_swimline.attribute("height") = swimLineHight * parseInt(lineNo) ;
  2497. //ivw_detail.attribute("height") = swimLineHight * parseInt(lineNo) ;
  2498. //grp_swimline.refresh();
  2499. if( OpenerKind != "GPS" && ivw_detail.visible == true ){
  2500. if( val_callfCreateControlYN == "Y" ){
  2501. var org_currentStepCntl = currentStepCntl.attribute("id");
  2502. fCreateControl();
  2503. currentStepCntl = document.controls(org_currentStepCntl);
  2504. var currentStepCntlID = currentStepCntl.attribute("id");
  2505. fChildrenCtrlToSelCtrl(currentStepCntlID);
  2506. // fChangeSelectCntl("#A683B1", currentStepCntl);
  2507. val_callfCreateControlYN = "N";
  2508. }
  2509. }
  2510. if(opener.window.javascript.preSelectedTab == "btn_action_tab" && ivw_detail.attribute("src") == "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw" ){
  2511. if( ivw_detail.instance1.selectSingleNode("/root/main/prcp/prcplist[status != 'S' and status != '-']") || ivw_detail.instance1.selectSingleNode("/root/main/form/forminfo/formlist[status = 'i' or status = 'd' or status = 'u']") ){
  2512. if( opener.model.getValue("/root/temp/getdata/authflag") == "M" ){ //조회모드일 때에는 저장하지 않는다 (!= 'S')
  2513. opener.btn_newver.dispatch("DOMActivate");
  2514. }
  2515. }
  2516. }
  2517. opener.cap_outlineinfo.attribute("text") = "OutLine 정보";
  2518. ivw_detail.visible = false;
  2519. return;
  2520. } else if(opener.btn_detail_tab.selected == true){
  2521. if( ivw_detail.attribute("src") != "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw"
  2522. || ivw_detail.attribute("src") == "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw" && readyPrcp == "Y"){
  2523. if(OpenerKind != "GPS"){
  2524. if(opener.window.javascript.preSelectedTab == "btn_action_tab" && ivw_detail.attribute("src") == "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw" ){
  2525. opener.btn_newver.dispatch("DOMActivate");
  2526. }
  2527. }
  2528. //grp_swimline.vscroll.attribute("pos") = "0";
  2529. //grp_swimline.hscroll.attribute("pos") = "0";
  2530. var vscrollPos = grp_swimline.vscroll.attribute("pos");
  2531. var hscrollPos = grp_swimline.hscroll.attribute("pos");
  2532. ivw_detail.attribute("top") = vscrollPos;
  2533. ivw_detail.attribute("left") = hscrollPos;
  2534. var stepinfo = opener.javascript.getParameter("stepinfo");
  2535. setParameter("stepinfo", stepinfo);
  2536. ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw";
  2537. grp_swimline.attribute("overflow") = "hidden";
  2538. opener.cap_outlineinfo.attribute("text") = "환자계획표";
  2539. }else{
  2540. opener.btn_action_tab.selected = true;
  2541. opener.btn_action_tab.refresh();
  2542. }
  2543. ivw_detail.visible = true;
  2544. return;
  2545. }
  2546. }else{
  2547. return false;
  2548. }
  2549. }
  2550. /**
  2551. * @group :
  2552. * @ver : 2007.10
  2553. * @by : 전지은
  2554. * @---------------------------------------------------
  2555. * @type : function
  2556. * @access : public
  2557. * @desc : 선택한 스텝의 상세정보를 팝업으로 본다.
  2558. * @param :
  2559. * @return :
  2560. * @---------------------------------------------------
  2561. */
  2562. function fViewDetailPopup(){
  2563. opener.btn_detailpopup.dispatch("DOMActivate");
  2564. }
  2565. /**
  2566. * @group :
  2567. * @ver : 2007.07
  2568. * @by : 전지은
  2569. * @---------------------------------------------------
  2570. * @type : function
  2571. * @access : public
  2572. * @desc : Detail 정보를 조회, 저장한다.
  2573. * @param :
  2574. * @return :
  2575. * @---------------------------------------------------
  2576. */
  2577. function fCopyPrcpList(){
  2578. copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", ivw_detail.model, opener.model);
  2579. ivw_detail.grd_prcplist.dispatch("onmousedown");
  2580. ivw_detail.window.javascript.appendChildPrcp ( "/root/reset/prcplist", "/root/main/prcp", "main" ); //검색라인추가
  2581. }
  2582. /**
  2583. * @group :
  2584. * @ver : 2007.07
  2585. * @by : 전지은
  2586. * @---------------------------------------------------
  2587. * @type : function
  2588. * @access : public
  2589. * @desc : Master 정보를 저장한다.
  2590. * @param :
  2591. * @return : true, false
  2592. * @---------------------------------------------------
  2593. */
  2594. function allInfoSave(){
  2595. if( opener.model.getValue("/root/temp/getdata/authflag") != "M" ){
  2596. return true;
  2597. }
  2598. if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") == ""){
  2599. messageBox("Master 정보가 존재하지 않아 실행 ", "E001");
  2600. return;
  2601. }else if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") != ""){
  2602. var msg = messageBox("Master 정보가 저장되지 않았습니다. 임시", "Q002");
  2603. if(msg == 6){
  2604. if( !fCheckEssVal("N") ){
  2605. return;
  2606. if( opener.window.javascript.preSelectedTab == "btn_action_tab" ){
  2607. opener.btn_action_tab.selected = true;
  2608. }else if( opener.window.javascript.preSelectedTab == "btn_detail_tab" ){
  2609. opener.btn_detail_tab.selected = true;
  2610. }
  2611. }
  2612. if( opener.model.getValue("/root/temp/getdata/authflag") == "M" ){
  2613. opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
  2614. return true;
  2615. }
  2616. } else if(msg == 7) {
  2617. return false;
  2618. }
  2619. }else{
  2620. if( (instance1.selectSingleNode(stepRef + "[m = 'i' or m = 'u']/stepno") != null || instance1.selectSingleNode(dcsRef + "[m = 'i' or m = 'u']/stepno") != null
  2621. || instance1.selectSingleNode("/root/temp/delsteplist/info/stepno") != null || instance1.selectSingleNode("/root/temp/deldecisionlist/info/stepno") != null)
  2622. || (ivw_detail.visible == true && (ivw_detail.instance1.selectSingleNode("/root/main/prcp/prcplist[status != 'S' and status != '-']") != null) || ivw_detail.instance1.selectSingleNode("/root/main/form/forminfo/formlist[status = 'i' or status = 'd' or status = 'u']") != null) ){
  2623. var msg = messageBox("저장되지 않은 정보가 존재합니다. 임시", "Q002");
  2624. if(msg == 6){
  2625. if( !fCheckEssVal("N") ){
  2626. return;
  2627. if( opener.window.javascript.preSelectedTab == "btn_action_tab" ){
  2628. opener.btn_action_tab.selected = true;
  2629. }else if( opener.window.javascript.preSelectedTab == "btn_detail_tab" ){
  2630. opener.btn_detail_tab.selected = true;
  2631. }
  2632. }
  2633. opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
  2634. return true;
  2635. } else if(msg == 7) {
  2636. return false;
  2637. }
  2638. }
  2639. return true;
  2640. }
  2641. }
  2642. /**
  2643. * @group :
  2644. * @ver : 2007.07
  2645. * @by : 전지은
  2646. * @---------------------------------------------------
  2647. * @type : function
  2648. * @access : public
  2649. * @desc : 선택한 하나의 스텝만 저장한다. (앞으로 중점적으로 정리한다!)
  2650. * @param :
  2651. * @return :
  2652. * @---------------------------------------------------
  2653. */
  2654. function fSaveStep(stepNumber){
  2655. //★ 선택된 스텝만 저장(수정)하고, 해당 스텝의 저장 flag 만 바꾼다.
  2656. /*
  2657. if( isNull(stepNumber) ){
  2658. var nodelist = instance1.selectNodes(stepRef);
  2659. //opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
  2660. }else{
  2661. var nodelist = instance1.selectNodes(stepRef + "["+stepNumber+"]");
  2662. }
  2663. */
  2664. //var nodelist = instance1.selectNodes(stepRef);
  2665. var nodelist = instance1.selectNodes(stepRef + "["+stepNumber+"]");
  2666. var stepCSV = getNodeListCSV(nodelist);
  2667. //저장으로 넘겼기 때문에, 알아서 상태를 바꿔준다
  2668. model.setValue(stepRef + "[" + stepNumber + "]/m", "");
  2669. opener.window.javascript.fSaveStepInfo(stepCSV);
  2670. //특정 스텝의 프로토콜 변경사항 저장 후, mainviewer의 steplist 노드에도 변경된 setno 정보 변경 (2009.03.02 추가)
  2671. var iSettypecd = instance1.selectSingleNode(stepRef + "[stepno='" + stepNumber + "']/settypecd");
  2672. var iSetno = instance1.selectSingleNode(stepRef + "[stepno='" + stepNumber + "']/setno");
  2673. if( iSettypecd != null && iSetno != null ){
  2674. opener.model.setValue(stepRef+"[stepno='" + stepNumber + "']/settypecd", iSettypecd.text);
  2675. opener.model.setValue(stepRef+"[stepno='" + stepNumber + "']/setno", iSetno.text);
  2676. opener.model.setValue("root/main/sortedsteplist/info[stepno='" + stepNumber + "']/settypecd", iSettypecd.text);
  2677. opener.model.setValue("root/main/sortedsteplist/info[stepno='" + stepNumber + "']/setno", iSetno.text);
  2678. }
  2679. //opener.window.javascript.fSaveWithStepInfo();
  2680. //opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
  2681. }
  2682. function fTempletSave(){
  2683. opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
  2684. }
  2685. /**
  2686. * @group :
  2687. * @ver : 2007.07
  2688. * @by : 전지은
  2689. * @---------------------------------------------------
  2690. * @type : function
  2691. * @access : public
  2692. * @desc : 저장 후, status 값이 I 이거나 U 인 것들을 - 상태로 변환, D 인 것은 삭제한다.
  2693. * @param :
  2694. * @return :
  2695. * @---------------------------------------------------
  2696. */
  2697. function fChangeStatus(){
  2698. var nodeList = instance1.selectNodes(stepRef + "[m = 'i' or m = 'u']");
  2699. for(var i= 0; i<nodeList.length; i++){
  2700. var node = nodeList.item(i);
  2701. var statusNode = node.selectSingleNode("m");
  2702. model.setValue(statusNode, "");
  2703. var stepnoNode = node.selectSingleNode("stepno");
  2704. var orgstepnoNode = node.selectSingleNode("orgstepno");
  2705. model.setValue(orgstepnoNode,stepnoNode.text);
  2706. }
  2707. nodeList = instance1.selectNodes(dcsRef + "[m = 'i' or m = 'u']");
  2708. for(var i= 0; i<nodeList.length; i++){
  2709. var node = nodeList.item(i);
  2710. var statusNode = node.selectSingleNode("m");
  2711. model.setValue(statusNode, "");
  2712. }
  2713. model.removeNodeset("/root/temp/delsteplist");
  2714. model.removeNodeset("/root/temp/deldecisionlist");
  2715. model.makeNode("/root/temp/delsteplist");
  2716. model.makeNode("/root/temp/deldecisionlist");
  2717. }
  2718. /**
  2719. * @group :
  2720. * @ver : 2007.07
  2721. * @by : 전지은
  2722. * @---------------------------------------------------
  2723. * @type : function
  2724. * @access : public
  2725. * @desc : 그룹 컨트롤 아이디를 받아서, currentStepCntl을 설정하고, 자식 컨트롤 중 textarea 컨트롤을 반환받아 selControl로 설정, fChangeSelectCntl()를 호출한다.
  2726. * @param : ctrl, flag(시작, 종료스텝 구분, null이면 그외 스텝)
  2727. * @return :
  2728. * @---------------------------------------------------
  2729. */
  2730. function fChildrenCtrlToSelCtrl(ctrl, flag){
  2731. if( flag != "SET" ){
  2732. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(그룹)
  2733. var childrens = selControl.children;
  2734. }else{
  2735. currentStepCntl = document.controls(ctrl); //현재 선택한 컨트롤(그룹)
  2736. var childrens = currentStepCntl.children;
  2737. }
  2738. var elNm = "";
  2739. var curNo = parseInt( ctrl.substr(12, ctrl.length-12) ) + 1;
  2740. for(var i=0; i<childrens.length; i++){
  2741. if(childrens.item(i).elementName == "xforms:textarea"){
  2742. elNm = childrens.item(i).attribute("id");
  2743. }
  2744. }
  2745. var selControl = document.controls(elNm);
  2746. if( flag != "SET" ){
  2747. selectedControl = document.controls(elNm); //2007.12.16 추가(OPS 탭에서 Outline탭으로 옮기고 스텝 선택 시 발생하는 오류때문)
  2748. }
  2749. if(flag == "S" && opener.window.javascript.OpenerKind != "GPS" ){
  2750. //시작 스텝 설정
  2751. if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
  2752. if( instance1.selectSingleNode(stepRef + "[startendflag='S']") != null ){
  2753. messageBox("시작 Step을 2개 이상 설정", "E001");
  2754. return;
  2755. }
  2756. model.setValue( stepRef + "[" + curNo + "]/startendflag", "S" );
  2757. fChangeSelectCntl("#ff9900", selectedControl);
  2758. } else {
  2759. model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
  2760. fChangeSelectCntl("#000000", selControl);
  2761. }
  2762. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  2763. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2764. }
  2765. } else if(flag == "E" && opener.window.javascript.OpenerKind != "GPS" ){
  2766. //종료 스텝 설정
  2767. if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
  2768. model.setValue( stepRef + "[" + curNo + "]/startendflag", "E" );
  2769. fChangeSelectCntl("#ff9900", selectedControl);
  2770. } else {
  2771. model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
  2772. fChangeSelectCntl("#000000", selControl);
  2773. }
  2774. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  2775. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2776. }
  2777. } else if(flag == "H" && opener.window.javascript.OpenerKind != "GPS" ){
  2778. //종료 스텝 설정
  2779. if( cpgflagcd == "01" && isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
  2780. model.setValue( stepRef + "[" + curNo + "]/decirflag", "I" );
  2781. //fChangeSelectCntl("#ff9900", selectedControl);
  2782. var leftPos =330;
  2783. var topPos = 20;
  2784. var cntl;
  2785. var ctrlType = "xforms:caption";
  2786. var ctrlID = ctrlType + (controlCnt++);
  2787. cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  2788. cntl.attribute("text") = "[입원\n필요]";
  2789. } else {
  2790. //2008.06.18 pymi(추가)
  2791. if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "D") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "O") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "C")) {
  2792. model.setValue( stepRef + "[" + curNo + "]/decirflag", "I" );
  2793. //2008.06.18 pymi(종료)
  2794. } else {
  2795. model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
  2796. }
  2797. //fChangeSelectCntl("#000000", selControl);
  2798. fCreateControl();
  2799. }
  2800. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  2801. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2802. }
  2803. //2008.06.16 pymi(추가)
  2804. } else if(cpgflagcd == "01" && flag == "D" && opener.window.javascript.OpenerKind != "GPS" ){
  2805. if( isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
  2806. model.setValue( stepRef + "[" + curNo + "]/decirflag", "D" );
  2807. //fChangeSelectCntl("#ff9900", selectedControl);
  2808. var leftPos =330;
  2809. var topPos = 20;
  2810. var cntl;
  2811. var ctrlType = "xforms:caption";
  2812. var ctrlID = ctrlType + (controlCnt++);
  2813. cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  2814. cntl.attribute("text") = "[퇴원\n필요]";
  2815. } else {
  2816. if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "I" ) || ( model.getValue(stepRef + "[" + curNo + "]/decirflag") == "O") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "C")) {
  2817. model.setValue(stepRef + "[" + curNo + "]/decirflag", "D" );
  2818. } else {
  2819. model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
  2820. }
  2821. //fChangeSelectCntl("#000000", selControl);
  2822. fCreateControl();
  2823. }
  2824. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  2825. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2826. }
  2827. } else if(cpgflagcd == "01" && flag == "O" && opener.window.javascript.OpenerKind != "GPS" ){
  2828. //외래예약필요 step 처리
  2829. if( isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
  2830. model.setValue( stepRef + "[" + curNo + "]/decirflag", "O" );
  2831. //fChangeSelectCntl("#ff9900", selectedControl);
  2832. var leftPos =330;
  2833. var topPos = 20;
  2834. var cntl;
  2835. var ctrlType = "xforms:caption";
  2836. var ctrlID = ctrlType + (controlCnt++);
  2837. cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  2838. cntl.attribute("text") = "[외래\n예약\n필요]";
  2839. } else {
  2840. if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "I" ) || ( model.getValue(stepRef + "[" + curNo + "]/decirflag") == "D") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "C")) {
  2841. model.setValue(stepRef + "[" + curNo + "]/decirflag", "O" );
  2842. } else {
  2843. model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
  2844. }
  2845. //fChangeSelectCntl("#000000", selControl);
  2846. fCreateControl();
  2847. }
  2848. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  2849. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2850. }
  2851. //2008.06.16 pymi(종료)
  2852. //2008.08.06 pymi(s)
  2853. } else if(flag == "C" && opener.window.javascript.OpenerKind != "GPS" ){
  2854. //DSC 필요 step 처리
  2855. if( isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
  2856. model.setValue( stepRef + "[" + curNo + "]/decirflag", "C" );
  2857. //fChangeSelectCntl("#ff9900", selectedControl);
  2858. var leftPos =330;
  2859. var topPos = 20;
  2860. var cntl;
  2861. var ctrlType = "xforms:caption";
  2862. var ctrlID = ctrlType + (controlCnt++);
  2863. cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  2864. cntl.attribute("text") = "[DSC\n필요]";
  2865. } else {
  2866. if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "I" ) || ( model.getValue(stepRef + "[" + curNo + "]/decirflag") == "D") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "O")) {
  2867. model.setValue(stepRef + "[" + curNo + "]/decirflag", "C" );
  2868. } else {
  2869. model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
  2870. }
  2871. //fChangeSelectCntl("#000000", selControl);
  2872. fCreateControl();
  2873. }
  2874. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  2875. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  2876. }
  2877. }
  2878. //2008.08.06 pymi(e)
  2879. else {
  2880. if( flag != "SET" ){
  2881. currentStepCntl = selControl;
  2882. }
  2883. if(selectedControl != null){
  2884. //alert("selectedControl = " + selectedControl.attribute("id"));
  2885. if( opener.window.javascript.OpenerKind == "GPS" ){
  2886. fChangeSelectCntl("#000000", selectedControl);
  2887. }else if( opener.window.javascript.OpenerKind != "GPS" && isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
  2888. fChangeSelectCntl("#000000", selectedControl);
  2889. }else{
  2890. fChangeSelectCntl("#ff9900", selectedControl);
  2891. }
  2892. }
  2893. //alert("selControl = " + selControl.attribute("id"));
  2894. fChangeSelectCntl("#A683B1", selControl);
  2895. }
  2896. //if( flag != "SET" ){
  2897. selectedControl = selControl;
  2898. //}
  2899. var stepnm = opener.model.getValue( "/root/main/stepinfo/info/stepnm");
  2900. var stepmemo = opener.model.getValue( "/root/main/stepinfo/info/stepmemo");
  2901. var steptimes = opener.model.getValue( "/root/main/stepinfo/info/times");
  2902. return (stepnm+"|"+stepmemo+"|"+steptimes);
  2903. }
  2904. /**
  2905. * @group :
  2906. * @ver : 2007.07
  2907. * @by : 전지은
  2908. * @---------------------------------------------------
  2909. * @type : function
  2910. * @access : public
  2911. * @desc : M-GPS에서 일괄 발행을 위한 decision 스텝의 대답을 얻는다.
  2912. * @param : ctrl
  2913. * @return :
  2914. * @---------------------------------------------------
  2915. */
  2916. function fDecision(){
  2917. var curID = currentStepCntl.attribute("id");
  2918. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  2919. var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno"); //현재 선택한 스텝
  2920. grd_decision.rowHidden(0) = true;
  2921. if(decisionMode == "false"){
  2922. model.setValue("/root/main/seldecisionstep", trgStep);
  2923. model.setValue("/root/main/seldecisionstepno", curNo);
  2924. decisionMode = "true";
  2925. //currentStepCntl.attribute("id")
  2926. grp_msgbox.attribute("top") = parseInt(currentStepCntl.attribute("top")) + 90;
  2927. grp_msgbox.attribute("left") = parseInt(currentStepCntl.attribute("left")) + 250;
  2928. grp_msgbox.visible = true;
  2929. return;
  2930. }
  2931. grp_msgbox.visible = false;
  2932. if(opener.btn_outline_tab.selected == true){
  2933. var srcStep = model.getValue("/root/main/seldecisionstep"); //바로 이전에 선택된 (상위 스텝)
  2934. //이전 선택된 결정의 상태를 조회하여야 함. 2010.04.28 KHJ
  2935. var appStepStatNode = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+srcStep+"']/stepstat");
  2936. //결정된 스텝이 있는지 확인.
  2937. var decisionYNNode = opener.instance1.selectSingleNode("/root/main/steppath/info[stepstat=30]/stepno");
  2938. var appStepStat = "";
  2939. //결정된 스텝이 있다면 30 없다면 10
  2940. if (decisionYNNode != null) appStepStat = "30";
  2941. else appStepStat = "10";
  2942. //스텝 경로에 있는 스텝의 경우 스텝 경로 상태 사용
  2943. if( appStepStatNode != null ) appStepStat = appStepStatNode.text;
  2944. var currDcsnStep = model.getValue(stepRef + "[stepno='"+srcStep+"']/dcsnstep"); //결정된 스텝
  2945. var currDcsnStepNo = 0;
  2946. if( !isNull(currDcsnStep) ) currDcsnStepNo = parseInt(currDcsnStep); //결정된 스텝 번호
  2947. //이미 결정되어 발행된 스텝인 경우 재설정 불가능 처리
  2948. //if( appStepStat > "10" ){
  2949. if( appStepStat == "30" ){
  2950. messageBox("이미 발행된 스텝은 결정을 변경", "E001"); //불가
  2951. decisionMode = "false";
  2952. return;
  2953. }
  2954. //연결된 스텝들 중에서만 선택하도록 처리, 그외에는 return (dcsRef 이용)
  2955. if( instance1.selectSingleNode( dcsRef + "[stepno='"+srcStep+"' and lnkstepno='"+trgStep+"']/stepno" ) == null ){
  2956. if( srcStep == trgStep ) messageBox("결정할 스텝을 선택", "I008"); //하시오
  2957. else messageBox("연결된 스텝 외에는 선택", "E001"); //불가
  2958. decisionMode = "false";
  2959. return;
  2960. }
  2961. grd_decision_answlist.addRow(true, true);
  2962. model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/stepno" , srcStep);
  2963. model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/lnkstepno" , trgStep);
  2964. //CP적용환자 테이블( MMPHAPPT )에 저장한다.
  2965. var tSwimlineno = model.getValue(stepRef + "[" + curNo + "]/swimlineno");
  2966. if( !opener.window.javascript.fInsCPGAppPatInfo( "D", srcStep, trgStep, tSwimlineno) ){
  2967. return;
  2968. }
  2969. model.setValue("/root/main/seldecisionstep", "");
  2970. model.setValue("/root/main/seldecisionstepno", "")
  2971. decisionMode = "false";
  2972. model.makeValue(stepRef + "[stepno='"+srcStep+"']/dcsnstep", trgStep);
  2973. opener.model.makeValue(stepRef + "[stepno='"+srcStep+"']/dcsnstep", trgStep);
  2974. opener.model.setValue("/root/main/steppath/info" + "[stepno='"+srcStep+"']/answstepno" , trgStep);
  2975. }
  2976. opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
  2977. //적용스템 경로 출력 (2010.05.18 JJE)
  2978. var flag = model.getValue(stepRef + "[stepno='"+trgStep+"']/settypecd");
  2979. if( isNull(flag) ) flag = "G";
  2980. opener.window.javascript.fGetAppScopList( flag );
  2981. }
  2982. /**
  2983. * @group :
  2984. * @ver : 2009.04
  2985. * @by : 전지은
  2986. * @---------------------------------------------------
  2987. * @type : function
  2988. * @access : public
  2989. * @desc : M-GPS에서 CPG의 decision 취소
  2990. * @param : ctrl
  2991. * @return :
  2992. * @---------------------------------------------------
  2993. */
  2994. function fCnclDecisionMode(){
  2995. grp_msgbox.visible = false;
  2996. decisionMode = "false";
  2997. }
  2998. /**
  2999. * @group :
  3000. * @ver : 2007.08
  3001. * @by : 전지은
  3002. * @---------------------------------------------------
  3003. * @type : function
  3004. * @access : public
  3005. * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다.
  3006. * @param : ctrl
  3007. * @return :
  3008. * @---------------------------------------------------
  3009. */
  3010. function GPS_fGetFormList(flag, val){
  3011. if( flag == "S" ){
  3012. opener.window.javascript.fGetFormList("S", val);
  3013. return;
  3014. }else if( flag == "D" ){
  3015. opener.window.javascript.fGetFormList("D", val);
  3016. return;
  3017. }
  3018. }
  3019. /**
  3020. * @group :
  3021. * @ver : 2007.08
  3022. * @by : 전지은
  3023. * @---------------------------------------------------
  3024. * @type : function
  3025. * @access : public
  3026. * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다. (사용 안 함)
  3027. * @param : mode
  3028. * @return :
  3029. * @---------------------------------------------------
  3030. */
  3031. function fGetPrcpList( mode ){
  3032. if( mode == "step" ){
  3033. if(currentStepCntl != null){
  3034. var curID = currentStepCntl.attribute("id");
  3035. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  3036. if(cpgflagcd == "01"){
  3037. var settypecd = "W";
  3038. } else if(cpgflagcd == "02"){
  3039. var settypecd = "G";
  3040. }
  3041. model.removeNodeset("/root/send");
  3042. model.makeNode("/root/send");
  3043. model.makeValue ( "/root/send/cond1", model.getValue(stepRef + "[" + curNo + "]/setno") );
  3044. model.makeValue ( "/root/send/cond2", settypecd);
  3045. model.makeValue ( "/root/send/cpgno", model.getValue("/root/main/outlineinfo/info/cpgno") );
  3046. model.makeValue ( "/root/send/cpghistseq", model.getValue("/root/main/outlineinfo/info/cpghistseq") );
  3047. model.makeValue ( "/root/send/cpgflagcd", cpgflagcd);
  3048. model.makeValue ( "/root/send/dayno", model.getValue(stepRef + "[" + curNo + "]/times") );
  3049. model.makeValue ( "/root/send/setcond", model.getValue(stepRef + "[" + curNo + "]/setno") );
  3050. model.makeValue ( "/root/send/cpgappno", opener.model.getValue("/root/temp1/getdata/cpgappno") );
  3051. model.makeValue ( "/root/send/case", "step");
  3052. submit("TRMMP02202", false); //submit("TRMMB00202", false) 와 동일
  3053. }else if( mode == "step" ){
  3054. ivw_detail.window.javascript.fGetPrcpSetList();
  3055. }
  3056. }
  3057. }
  3058. /**
  3059. * @group :
  3060. * @ver : 2007.10
  3061. * @by : 전지은
  3062. * @---------------------------------------------------
  3063. * @type : function
  3064. * @access : public
  3065. * @desc : 스텝 저장 전, 필수 값 체크를 한다
  3066. * @param : mode
  3067. * @return :
  3068. * @---------------------------------------------------
  3069. */
  3070. function fCheckEssVal( essYN, stepNo ){
  3071. cpgflagcd = opener.model.getValue("/root/main/masterinfo/info/cpgflagcd");
  3072. var fcstinhospdayno = opener.model.getValue("/root/main/masterinfo/info/fcstinhospdayno");
  3073. if( instance1.selectSingleNode("/root/main/steplist/info") != null ){
  3074. if( (cpgflagcd == "01" && essYN == "Y") || (cpgflagcd == "02" && !isNull(fcstinhospdayno)) ){
  3075. // 저장 필수체크
  3076. // 1. Day 체크
  3077. if( instance1.selectSingleNode(stepRef + "[times = '']") != null ){
  3078. messageBox("모든 Step의 Day는 ", "I003");
  3079. return false;
  3080. }
  3081. }
  3082. // 임시저장+저장 필수체크
  3083. // 2. 시작스텝 체크
  3084. var nodeList = instance1.selectNodes(stepRef);
  3085. var startNodeList = instance1.selectNodes(stepRef + "[startendflag = 'S']");
  3086. var endNodeList = instance1.selectNodes(stepRef + "[startendflag = 'E']");
  3087. if( nodeList.length > 1 && startNodeList.length <= 0 ){
  3088. if( instance1.selectSingleNode(stepRef + "[swimlineno='1' and refseq='1']") != null ){
  3089. model.setValue(stepRef + "[swimlineno='1' and refseq='1']/startendflag", "S");
  3090. }else{
  3091. var minLineNo = nodeList.length;
  3092. for(var i=0; i<nodeList.length; i++){
  3093. var node = nodeList.item(i);
  3094. var iSwimLineNo = parseInt(node.selectSingleNode("swimlineno").text);
  3095. if( iSwimLineNo <= minLineNo ){
  3096. minLineNo = iSwimLineNo;
  3097. }
  3098. }
  3099. model.setValue(stepRef + "[swimlineno='"+minLineNo+"' and refseq='1']/startendflag", "S");
  3100. }
  3101. }else if( nodeList.length > 1 && startNodeList.length > 1 ){
  3102. messageBox("시작스텝은 둘 이상 존재할 수", "I004");
  3103. return false;
  3104. }
  3105. var notStartNodeList = instance1.selectNodes(stepRef + "[startendflag != 'S']");
  3106. if( notStartNodeList.length > 1 ){
  3107. for(var i=0; i<notStartNodeList.length; i++){
  3108. var node = notStartNodeList.item(i);
  3109. var stepNode = node.selectSingleNode("stepno");
  3110. var role1 = instance1.selectSingleNode(stepRef + "[lnkstepno='" + stepNode.text + "']");
  3111. var role2 = instance1.selectSingleNode(dcsRef + "[lnkstepno='" + stepNode.text + "']");
  3112. if( role1 == null && role2 == null ){
  3113. messageBox("시작스텝은 둘 이상 존재할 수", "I004");
  3114. return false;
  3115. }
  3116. }
  3117. }
  3118. // 3. 스텝간의 연결 체크(종료스텝 필)
  3119. if( cpgflagcd == "01" && nodeList.length > 1 && endNodeList.length <= 0 ){
  3120. //end스텝 강제 설정 방법 변경 (2008.12.09)
  3121. var maxLineNo = model.getValue("/root/main/outlineinfo/info/swimlineno");
  3122. var notEndNodeList = instance1.selectNodes(stepRef + "[swimlineno='"+ maxLineNo +"']");
  3123. for(var i=0; i<notEndNodeList.length; i++){
  3124. var node = notEndNodeList.item(i);
  3125. var startendflagNode = node.selectSingleNode("startendflag");
  3126. model.setValue(startendflagNode, "E");
  3127. }
  3128. }
  3129. //CPG end스텝 자동 설정 (2009.03.02)
  3130. if( cpgflagcd == "02" && nodeList.length > 1){
  3131. for( var i=nodeList.length-1; i>=0; i-- ){
  3132. var iNode = nodeList.item(i);
  3133. var lnkNode = iNode.selectSingleNode("stepno");
  3134. var startendflag = iNode.selectSingleNode("startendflag");
  3135. var lnkstepno = iNode.selectSingleNode("lnkstepno");
  3136. var stepflagcd = iNode.selectSingleNode("stepflagcd");
  3137. if( isNull(lnkstepno.text) && startendflag.text !='S' && stepflagcd.text == 'A' ){
  3138. var lnkNodes = instance1.selectNodes(stepRef + "[lnkstepno='"+lnkNode.text+"']");
  3139. var dcsNodes = instance1.selectNodes(dcsRef + "[lnkstepno='" + +lnkNode.text + "']");
  3140. if(lnkNodes.length>0 || dcsNodes.length>0 ){
  3141. model.setValue(startendflag, "E");
  3142. }
  3143. }
  3144. }
  3145. }
  3146. if( !isNull(fcstinhospdayno) && fcstinhospdayno != "1") { // 하루짜리 CP는 체크 하지 않도록 수정. 2016.03.31 엄영만
  3147. if( instance1.selectSingleNode(stepRef + "[stepflagcd='A' and startendflag!='E' and lnkstepno='']") != null ){
  3148. messageBox("스텝간의 연결 혹은 종료스텝 설정을", "I007") ;
  3149. return false;
  3150. }
  3151. }
  3152. //등록일 경우만 check
  3153. if( essYN == "Y" ){
  3154. if( cpgflagcd == "01" ){
  3155. //4. 퇴원필요 Step 처리 여부
  3156. //2008.07.29 pymi 저장시 퇴원필요 step 처리여부
  3157. if(ivw_detail.visible == true) {
  3158. var dschStep = ivw_detail.instance1.selectNodes("/root/main/prcp/prcplist[prcpkindcd = '60' or prcpkindcd = '70']");
  3159. if( dschStep.length > 0 ) {
  3160. curSetno = ivw_detail.model.getValue("/root/hidden/prmsprcpsetdetlset/setno");
  3161. curStepno = ivw_detail.instance1.selectSingleNode("root/temp/steplist/stepinfo[setno ='" + curSetno + "']/stepno");
  3162. if( "D" != instance1.selectSingleNode("/root/main/steplist/info[stepno = '" + curStepno.text + "']/decirflag").text ) {
  3163. messageBox("퇴원필요step을 지정", "I008");
  3164. return false;
  3165. }
  3166. }
  3167. }
  3168. }
  3169. }
  3170. }else{
  3171. fcstinhospdayno = opener.model.getValue("/root/main/masterinfo/info/fcstinhospdayno");
  3172. if( cpgflagcd != "01" && !isNull(fcstinhospdayno) && fcstinhospdayno != opener.model.getValue("/root/main/masterinfo/info/swimlineno") ){
  3173. if( messageBox("스윔라인수와 재원일수가 일치하지 않아서\n회차 정보를 자동입력할 수 없습니다.\n\n", "Q003") == 7 ){
  3174. return false;
  3175. }
  3176. }
  3177. }
  3178. return true;
  3179. }
  3180. /**
  3181. * @group :
  3182. * @ver : 2007.10
  3183. * @by : 전지은
  3184. * @---------------------------------------------------
  3185. * @type : function
  3186. * @access : public
  3187. * @desc : 저장 후 셋번호 바뀌면, 스텝에 바뀐 셋 번호를 매핑시킨다
  3188. * @param : mode
  3189. * @return :
  3190. * @---------------------------------------------------
  3191. */
  3192. function fSetStepSetNo(){
  3193. var nodeList = opener.instance1.selectNodes("/root/temp/tempnode/prms");
  3194. var trgNode = null;
  3195. var prmsSetNode = null;
  3196. for( var i=0; i<nodeList.length; i++ ){
  3197. var node = nodeList.item(i);
  3198. var oldSetNode = node.selectSingleNode("oldsetno");
  3199. var newSetNode = node.selectSingleNode("newsetno");
  3200. trgNode = instance1.selectSingleNode(stepRef + "[setno = '" + oldSetNode.text + "']/setno");
  3201. if(trgNode){
  3202. model.setValue(trgNode, newSetNode.text);
  3203. }
  3204. //2007.10.30 추가 (임시저장 할 때, 이전 버전의 셋번호에 업데이트하는 오류 처리)
  3205. if( ivw_detail.visible == true ){
  3206. prmsSetNode = ivw_detail.instance1.selectSingleNode("/root/hidden/prmsprcpsetdetlset[setno = '" + oldSetNode.text + "']/setno");
  3207. if(prmsSetNode != null){
  3208. model.setValue(prmsSetNode, newSetNode.text);
  3209. }
  3210. }
  3211. }
  3212. var nodeList = instance1.selectNodes(stepRef);
  3213. var csv = getNodeListCSV(nodeList);
  3214. model.setValue("/root/main/temp/selectedstep/csvlist", csv);
  3215. //if(opener.btn_action_tab.selected == true ){
  3216. if( ivw_detail.visible == true ){
  3217. ivw_detail.window.javascript.fSetStepSetNo();
  3218. }
  3219. }
  3220. /**
  3221. * @group :
  3222. * @ver : 2007.12
  3223. * @by : 전지은
  3224. * @---------------------------------------------------
  3225. * @type : function
  3226. * @access : public
  3227. * @desc : 입원으로 전환되는 스텝임을 정한다
  3228. * @param :
  3229. * @return :
  3230. * @---------------------------------------------------
  3231. */
  3232. function fSetInHospStep(){
  3233. var curID = currentStepCntl.attribute("id");
  3234. fChildrenCtrlToSelCtrl(curID, "H");
  3235. }
  3236. /**
  3237. * @group :
  3238. * @ver : 2008.06
  3239. * @by : 박유미
  3240. * @---------------------------------------------------
  3241. * @type : function
  3242. * @access : public
  3243. * @desc : 퇴원으로 전환되는 스텝임을 정한다
  3244. * @param :
  3245. * @return :
  3246. * @---------------------------------------------------
  3247. */
  3248. function fSetDschHospStep(){
  3249. var curID = currentStepCntl.attribute("id");
  3250. fChildrenCtrlToSelCtrl(curID, "D");
  3251. }
  3252. /**
  3253. * @group :
  3254. * @ver : 2008.06
  3255. * @by : 박유미
  3256. * @---------------------------------------------------
  3257. * @type : function
  3258. * @access : public
  3259. * @desc : 외래예약 스텝임을 정한다
  3260. * @param :
  3261. * @return :
  3262. * @---------------------------------------------------
  3263. */
  3264. function fSetOutHospStep(){
  3265. var curID = currentStepCntl.attribute("id");
  3266. fChildrenCtrlToSelCtrl(curID, "O");
  3267. }
  3268. /**
  3269. * @group :
  3270. * @ver : 2008.08
  3271. * @by : 박유미
  3272. * @---------------------------------------------------
  3273. * @type : function
  3274. * @access : public
  3275. * @desc : DSC 필요 스텝임을 정한다
  3276. * @param :
  3277. * @return :
  3278. * @---------------------------------------------------
  3279. */
  3280. function fSetDSCHospStep(){
  3281. var curID = currentStepCntl.attribute("id");
  3282. fChildrenCtrlToSelCtrl(curID, "C");
  3283. }
  3284. /**
  3285. * @group :
  3286. * @ver : 2008.11
  3287. * @by : 전지은
  3288. * @---------------------------------------------------
  3289. * @type : function
  3290. * @access : public
  3291. * @desc : 삭제하는 라인의 다음 라인이 퇴원일이라면, 퇴원일스텝의 times를 조정해주어야 함. (2008.11.12)
  3292. * @param : no (마지막라인no)
  3293. * @return :
  3294. * @---------------------------------------------------
  3295. */
  3296. function fChgDschTimes(no){
  3297. var ioflag = opener.model.getValue("/root/main/masterinfo/info/ioflagcd");
  3298. if( cpgflagcd == "01" && ioflag == "I" ){
  3299. var dschStepList = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "' and stepnm='퇴원일']");
  3300. if(dschStepList.length > 0){
  3301. for(var i=0; i<dschStepList.length; i++){
  3302. var node = dschStepList.item(i);
  3303. var dschTimesNode = node.selectSingleNode("times");
  3304. var mNode = node.selectSingleNode("m");
  3305. model.setValue(dschTimesNode, parseInt(dschTimesNode.text)-1);
  3306. if(mNode.text != "i") model.setValue(mNode, "u");
  3307. }
  3308. }
  3309. }
  3310. }
  3311. /**
  3312. * @group :
  3313. * @ver : 2008.12
  3314. * @by : 전지은
  3315. * @---------------------------------------------------
  3316. * @type : function
  3317. * @access : public
  3318. * @desc : M-GPS에서 시작 스텝 설정 시 값 설정
  3319. * @param :
  3320. * @return :
  3321. * @---------------------------------------------------
  3322. */
  3323. function fSetupStartStep(){
  3324. fSetupStartEndStep("S");
  3325. }
  3326. /**
  3327. * @group :
  3328. * @ver : 2008.12
  3329. * @by : 전지은
  3330. * @---------------------------------------------------
  3331. * @type : function
  3332. * @access : public
  3333. * @desc : M-GPS에서 종료 스텝 설정 시 값 설정
  3334. * @param :
  3335. * @return :
  3336. * @---------------------------------------------------
  3337. */
  3338. function fSetupEndStep(){
  3339. fSetupStartEndStep("E");
  3340. }
  3341. /**
  3342. * @group :
  3343. * @ver : 2008.12
  3344. * @by : 전지은
  3345. * @---------------------------------------------------
  3346. * @type : function
  3347. * @access : public
  3348. * @desc : M-GPS에서 해당 스텝만 발행되도록 스텝 설정 시 값 설정
  3349. * @param :
  3350. * @return :
  3351. * @---------------------------------------------------
  3352. */
  3353. function fSetupOneStep(){
  3354. //fSetupStartEndStep("S");
  3355. var startFlag1 = opener.instance1.selectSingleNode("/root/main/steppath/info[startendflag='S']/startendflag");
  3356. var startFlag2 = instance1.selectSingleNode(stepRef + "[startendflag='S']/startendflag");
  3357. if( startFlag1 != null ) model.setValue(startFlag1, "");
  3358. if( startFlag2 != null ) model.setValue(startFlag2, "");
  3359. fSetupStartEndStep("E");
  3360. }
  3361. /**
  3362. * @group :
  3363. * @ver : 2008.12
  3364. * @by : 전지은
  3365. * @---------------------------------------------------
  3366. * @type : function
  3367. * @access : public
  3368. * @desc : M-GPS에서 시작/종료 스텝 설정 시 값 설정 및 취소
  3369. * @param : flag (S:시작스텝, E:종료스텝)
  3370. * @return :
  3371. * @---------------------------------------------------
  3372. */
  3373. function fSetupStartEndStep( flag ){
  3374. var nFlag = "";
  3375. if( flag == "S" ) nFlag = "E";
  3376. else nFlag = "S";
  3377. var curID = currentStepCntl.attribute("id");
  3378. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  3379. var srcStep = "";
  3380. var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno"); //현재 선택한 시작될 스텝
  3381. var startEndFlag = opener.model.getValue("/root/main/steppath/info" + "[" + curNo + "]/startendflag");
  3382. /*
  3383. if(opener.btn_outline_tab.selected == true){
  3384. if(startEndFlag == flag){
  3385. //시작스텝 취소 or 종료스텝 취소
  3386. opener.window.javascript.fInsCPGAppPatInfo( flag, srcStep, "" );
  3387. }else if(startEndFlag == nFlag){
  3388. //종료스텝 취소-시작스텝 설정 or 시작스텝 취소-종료스텝 설정
  3389. }else{
  3390. //CP적용환자 테이블( MMPHAPPT )에 저장한다.
  3391. if( !opener.window.javascript.fInsCPGAppPatInfo( flag, srcStep, trgStep ) ){ //false 리턴시 종료.. 아래 내용 수행 안함
  3392. return;
  3393. }
  3394. }
  3395. }
  3396. */
  3397. //시작스텝 설정 or 취소-종료스텝 설정
  3398. var sFlag = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+trgStep+"']");
  3399. if( sFlag == null ){
  3400. var orgStartStepNo = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[startendflag='"+flag+"']/stepno"); //원래 시작 스텝
  3401. if( orgStartStepNo != null ){
  3402. srcStep = orgStartStepNo.text;
  3403. }
  3404. if( !isNull(srcStep) ){
  3405. model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", ""); //이전 시작스텝 - 설정 취소
  3406. //opener.model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", "");
  3407. if (opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag") != null) {
  3408. opener.model.setValue("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag" , "");
  3409. }
  3410. }
  3411. //messageBox("결정되지 않은 경로", "I009");
  3412. //return;
  3413. //server에서 decision을 미리 내린다(자동결정기능)
  3414. var tSwimlineno = model.getValue(stepRef + "[" + curNo + "]/swimlineno");
  3415. if( !opener.window.javascript.fInsCPGAppPatInfo( "A", trgStep, "", tSwimlineno) ){
  3416. return;
  3417. }
  3418. model.setValue("/root/main/seldecisionstep", "");
  3419. model.setValue("/root/main/seldecisionstepno", "")
  3420. var stepPathList = opener.instance1.selectNodes("/root/main/steppath/info" + "[stepflagcd='D']"); //원래 시작 스텝
  3421. for( var i=0; i<stepPathList.length; i++ ){
  3422. var node = stepPathList.item(i);
  3423. var decNode = node.selectSingleNode("stepno");
  3424. var ansNode = node.selectSingleNode("answstepno");
  3425. model.setValue(stepRef + "[stepno='"+ decNode.text +"']/dcsnstep", ansNode.text);
  3426. opener.model.makeValue(stepRef + "[stepno='"+ decNode.text +"']/dcsnstep", ansNode.text);
  3427. }
  3428. //## 스텝 경로 수정 후, 기존 선택된 결정값 초기화 2010.04.30 KHJ
  3429. var DStepNodeList = instance1.selectNodes(stepRef + "[stepflagcd='D']");
  3430. var openerDStepNodeList = opener.instance1.selectNodes("/root/main/steppath/info" + "[stepflagcd='D']");
  3431. for (var i=0;i<DStepNodeList.length;i++) {
  3432. var DStepNode = DStepNodeList.item(i);
  3433. var DStepNo = DStepNode.selectSingleNode("stepno");
  3434. var sameYN = "N";
  3435. for (var j=0;j<openerDStepNodeList.length;j++) {
  3436. var openerDStepNode = openerDStepNodeList.item(j);
  3437. var openerDStepNo = openerDStepNode.selectSingleNode("stepno");
  3438. if (DStepNo.text == openerDStepNo.text) sameYN = "Y";
  3439. }
  3440. // 스텝 경로에 없는 결정(Decision)은 dcsnstep을 0 처리
  3441. if (sameYN == "N") {
  3442. model.setValue(stepRef + "[stepno='"+DStepNo.text+"']/dcsnstep", "");
  3443. opener.model.makeValue(stepRef + "[stepno='"+ DStepNo.text +"']/dcsnstep", "");
  3444. }
  3445. }
  3446. }
  3447. var orgStartStepNo = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[startendflag='"+flag+"']/stepno"); //원래 시작 스텝
  3448. if( orgStartStepNo != null ){
  3449. srcStep = orgStartStepNo.text;
  3450. }
  3451. if( !isNull(srcStep) ){
  3452. model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", ""); //이전 시작스텝 - 설정 취소
  3453. //opener.model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", "");
  3454. if (opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag") != null) {
  3455. opener.model.setValue("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag" , "");
  3456. }
  3457. }
  3458. model.makeValue(stepRef + "[stepno='"+trgStep+"']/startendflag", flag);
  3459. //opener.model.makeValue(stepRef + "[stepno='"+trgStep+"']/startendflag", flag);
  3460. if( opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+trgStep+"']/startendflag") != null ){
  3461. opener.model.setValue("/root/main/steppath/info" + "[stepno='"+trgStep+"']/startendflag" , flag);
  3462. }
  3463. opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
  3464. //적용스템 경로 출력 (2010.05.18 JJE)
  3465. opener.window.javascript.fGetAppScopList();
  3466. if( flag == "S" ) model.setValue("/root/temp/startstepno", trgStep);
  3467. else model.setValue("/root/temp/endstepno", trgStep);
  3468. //직접 refresh 수행
  3469. fCreateControl();
  3470. selectedControl = null;
  3471. //currentStepCntl = document.controls(id);
  3472. fChangeSelectCntl("#A683B1", currentStepCntl);
  3473. }
  3474. /**
  3475. * @group :
  3476. * @ver : 2010.06
  3477. * @by : 전지은
  3478. * @---------------------------------------------------
  3479. * @type : function
  3480. * @access : public
  3481. * @desc : CPG에서 decision 스텝의 결정을 취소
  3482. * @param :
  3483. * @return :
  3484. * @---------------------------------------------------
  3485. */
  3486. function fCnclDecisionAct(){
  3487. var curID = currentStepCntl.attribute("id");
  3488. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  3489. var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno"); //현재 선택한 스텝
  3490. var tSwimlineno = model.getValue(stepRef + "[" + curNo + "]/swimlineno");
  3491. var appStepStat = opener.model.getValue("/root/main/steppath/info" + "[stepno='"+trgStep+"']/stepstat");
  3492. var appStepStat = opener.model.getValue("/root/main/steppath/info" + "[stepno='"+trgStep+"']/answstepno");
  3493. grd_decision.rowHidden(0) = true;
  3494. if( isNull(appStepStat) || appStepStat == 0 ){
  3495. messageBox("현재 미결정 상태", "I009");
  3496. return;
  3497. }
  3498. else if( appStepStat == 30 ){
  3499. messageBox("이미 발행된 스텝은 결정을 변경", "E001"); //불가
  3500. return;
  3501. }
  3502. if( !opener.window.javascript.fInsCPGAppPatInfo( "D", trgStep, "0", tSwimlineno) ){
  3503. return;
  3504. }
  3505. opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
  3506. opener.window.javascript.fGetAppScopList(); //적용스텝 경로 출력 (2010.05.18 JJE)
  3507. fCreateControl();
  3508. selectedControl = null;
  3509. //currentStepCntl = document.controls(curID);
  3510. fChangeSelectCntl("#A683B1", currentStepCntl);
  3511. }
  3512. /**
  3513. * @group :
  3514. * @ver : 2010.06
  3515. * @by : 전지은
  3516. * @---------------------------------------------------
  3517. * @type : function
  3518. * @access : public
  3519. * @desc : CPG+CP 에서, CP 스텝을 적용범위로 지정
  3520. * @param :
  3521. * @return :
  3522. * @---------------------------------------------------
  3523. */
  3524. function fSetupCPStep(){
  3525. var OpenPath_StartStep = opener.instance1.selectSingleNode("/root/main/steppath/info[startendflag='S']/startendflag");
  3526. var OpenPath_EndStep = opener.instance1.selectSingleNode("/root/main/steppath/info[startendflag='E']/startendflag");
  3527. var Open_StartStep = opener.instance1.selectSingleNode("/root/main/steplist/info[startendflag='S']/startendflag");
  3528. var Open_EndStep = opener.instance1.selectSingleNode("/root/main/steplist/info[startendflag='E']/startendflag");
  3529. var StartStep = instance1.selectSingleNode("/root/main/steplist/info[startendflag='S']/startendflag");
  3530. var EndStep = instance1.selectSingleNode("/root/main/steplist/info[startendflag='E']/startendflag");
  3531. if( OpenPath_StartStep != null ) model.setValue(OpenPath_StartStep, "");
  3532. if( OpenPath_EndStep != null ) model.setValue(OpenPath_EndStep, "");
  3533. if( Open_StartStep != null ) model.setValue(Open_StartStep, "");
  3534. if( Open_EndStep != null ) model.setValue(Open_EndStep, "");
  3535. if( StartStep != null ) model.setValue(StartStep, "");
  3536. if( EndStep != null ) model.setValue(EndStep, "");
  3537. var cpNodeList = opener.instance1.selectNodes("/root/main/steppath/info" + "[settypecd='W']");
  3538. if( cpNodeList.length > 0 ){
  3539. var node = null;
  3540. var startendflagNode = null;
  3541. var stepnoNode = null;
  3542. node = cpNodeList.item(0);
  3543. startendflagNode = node.selectSingleNode("startendflag");
  3544. stepnoNode = node.selectSingleNode("stepno");
  3545. model.setValue(startendflagNode, "S");
  3546. opener.model.makeValue("/root/main/steplist/info[stepno='"+stepnoNode.text+"']/startendflag", "S");
  3547. model.makeValue(stepRef + "[stepno='"+stepnoNode.text+"']/startendflag", "S");
  3548. model.setValue("/root/temp/startstepno", stepnoNode.text);
  3549. node = cpNodeList.item(cpNodeList.length-1);
  3550. startendflagNode = node.selectSingleNode("startendflag");
  3551. stepnoNode = node.selectSingleNode("stepno");
  3552. model.setValue(startendflagNode, "E");
  3553. opener.model.makeValue("/root/main/steplist/info[stepno='"+stepnoNode.text+"']/startendflag", "E");
  3554. model.makeValue(stepRef + "[stepno='"+stepnoNode.text+"']/startendflag", "E");
  3555. model.setValue("/root/temp/endstepno", stepnoNode.text);
  3556. opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
  3557. //적용스템 경로 출력 (2010.05.18 JJE)
  3558. opener.window.javascript.fGetAppScopList("W");
  3559. //직접 refresh 수행
  3560. fCreateControl();
  3561. selectedControl = null;
  3562. //currentStepCntl = document.controls(id);
  3563. fChangeSelectCntl("#A683B1", currentStepCntl);
  3564. }
  3565. }
  3566. function fOpenAttrPopupEvent(){
  3567. alert("function");
  3568. }
  3569. /**
  3570. * @group :
  3571. * @ver : 2010.06
  3572. * @by : 전지은
  3573. * @---------------------------------------------------
  3574. * @type : function
  3575. * @access : public
  3576. * @desc : 생성기 Main의 속성 리스트 항목을 재조회
  3577. * @param :
  3578. * @return :
  3579. * @---------------------------------------------------
  3580. */
  3581. function fInitMainAttList( inqrflag ){
  3582. //opener.window.javascript.fInitAttList();
  3583. var title = "";
  3584. var guide = "";
  3585. if(inqrflag == "R"){
  3586. title = "필수처방 미발행 사유 문진";
  3587. guide = "용도 (미시행사유 입력용), 팝업시점 (퇴원예고)";
  3588. }else if(inqrflag == "D"){
  3589. title = "선택필수처방 미발행 사유 문진";
  3590. guide = "용도 (선택필수 미시행사유 입력용), 팝업시점 (퇴원예고)";
  3591. }
  3592. if( opener.instance1.selectSingleNode("/root/main/inqrinfo/inqrheader[inqrflag='"+inqrflag+"']") == null ){
  3593. var i = opener.grd_popup.rows;
  3594. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrno", "");
  3595. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrhistno", "");
  3596. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/cpgno", "");
  3597. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/cpghistseq", "");
  3598. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/title", title);
  3599. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrnm", title);
  3600. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/guide", guide);
  3601. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/pntmflag", "1");
  3602. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrflag", inqrflag);
  3603. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/stepno", "0");
  3604. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/stepnm", "");
  3605. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/qestcnts", "");
  3606. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/cpgappno", "");
  3607. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrstatcd", "-");
  3608. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqroffyn", "-");
  3609. opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqranswdd", "-");
  3610. opener.grd_popup.refresh();
  3611. }
  3612. }
  3613. ]]>
  3614. </script>
  3615. </xhtml:head>
  3616. <xhtml:body pagewidth="835" style="margin:0; margin-left:0; margin-top:0; margin-right:0; margin-bottom:0; ">
  3617. <group id="grp_swimline" overflow="scroll" scroll="auto" style="left:0px; top:0px; width:835px; height:653px; margin:0; margin-left:0; margin-top:0; margin-right:0; margin-bottom:0; ">
  3618. <script type="javascript" ev:event="onmousedown">
  3619. <![CDATA[
  3620. var ctrl = null;
  3621. ctrl = (event.target);
  3622. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
  3623. var cX = event.x;
  3624. var cY = event.y;
  3625. var tY = event.targetY;
  3626. var onmouseX = parseInt(grp_swimline.attribute("width")) - 18 ; //803 or ?
  3627. //1. 마우스 오른쪽 버튼을 클릭한 경우
  3628. var curID = selControl.parent.attribute("id");
  3629. currentStepCntl = document.controls(curID); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
  3630. //그룹을 선택했을 경우,
  3631. if(ctrl.substr(0, 12) == "xforms:group" || ctrl.substr(0, 12) == "grp_swimline" && parseInt(cX) < onmouseX && parseInt(cY) < 638){
  3632. if(curID.substr(0, 12) == "grp_swimline"){
  3633. tY = parseInt( selControl.attribute("top") );
  3634. }
  3635. //영역 선택 : 현재 Y 지점 위치 = 스크롤의 현재위치를 더한 targetY / 스윔라인 높이 + 1
  3636. var org_selectedLineSection = selectedLineSection;
  3637. selectedLineSection = Math.floor( (parseInt(tY) + parseInt(grp_swimline.vscroll.attribute("pos")) ) / swimLineHight)+1;
  3638. if( ctrl.substr(0, 12) == "xforms:group" ){
  3639. selectedLineSection = Math.floor( parseInt(tY) / swimLineHight)+1;
  3640. }
  3641. if(selectedLineSection > lineNo){
  3642. fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
  3643. return;
  3644. } else {
  3645. fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
  3646. fChangeOutLineCntl("select", selectedLineSection-1); //전체 선의 색상을 다시 셋팅...
  3647. if(selectedControl != null){
  3648. if( isNull(selectedControl.parent.attribute("id")) ){
  3649. return;
  3650. }
  3651. var sCurID = selectedControl.parent.attribute("id"); //error
  3652. sCurID = sCurID.substr(12, sCurID.length-12);
  3653. if( !isNull(model.getValue(stepRef + "[" + (parseInt(sCurID)+1) + "]/startendflag")) ){ //조건삭제 (opener.window.javascript.OpenerKind != "GPS" && ) 2008.12.22
  3654. fChangeSelectCntl("#ff9900", selectedControl);
  3655. }else{
  3656. fChangeSelectCntl("#000000", selectedControl);
  3657. }
  3658. selectedControl = null;
  3659. }
  3660. }
  3661. if (event.button == 3 && (ctrl.substr(0, 12) == "xforms:group" || ctrl.substr(0, 12) == "grp_swimline") && parseInt(cX) < 790 && parseInt(cY) < 638){ //cX<795로 고쳐볼것..
  3662. if( opener.model.getValue("/root/temp/getdata/authflag") == "M" && opener.window.javascript.OpenerKind != "GPS" ){
  3663. if( selectedLineSection == 1 && instance1.selectSingleNode(stepRef + "/stepno") != null ){
  3664. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu4/item", "name", "func", false); //첫번째 라인은 D0 step 추가 메뉴 있음
  3665. }else{
  3666. window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu2/item", "name", "func", false);
  3667. }
  3668. }
  3669. }
  3670. //버튼들의 enable/disable
  3671. //btn_initialize.disabled = false;
  3672. btn_start.disabled = true;
  3673. btn_end.disabled = true;
  3674. btn_action.disabled = false;
  3675. btn_decision.disabled = false;
  3676. btn_branch.disabled = false;
  3677. btn_disconnection.disabled = true;
  3678. btn_connection.disabled = false;
  3679. btn_addline.disabled = false;
  3680. btn_remove.disabled = false;
  3681. opener.ipt_stepnm.disabled = true;
  3682. opener.tar_stepmemo.disabled = true;
  3683. opener.ipt_times.disabled = true;
  3684. opener.ipt_times_old.disabled = true;
  3685. opener.cmb_stepnm.disabled = true; // 2008.08.21 pymi
  3686. opener.ipt_stepnm.value = "";
  3687. opener.tar_stepmemo.value = "";
  3688. opener.ipt_times.value = "";
  3689. opener.ipt_times_old.value = "";
  3690. opener.cmb_stepnm.value = ""; // 2008.08.21 pymi
  3691. if( opener.instance1.selectSingleNode( "/root/main/stepinfo/info/stepno") != null ){
  3692. opener.model.setValue( "/root/main/stepinfo/info/stepno", "" );
  3693. opener.model.setValue( "/root/main/stepinfo/info/stepmemo", "" );
  3694. opener.model.setValue( "/root/main/stepinfo/info/stepflagcd", "" );
  3695. opener.model.setValue( "/root/main/stepinfo/info/daynm", "" );
  3696. }
  3697. }
  3698. else if(ctrl.substr(0, 15) == "xforms:textarea"){
  3699. //fPopupMenuEvent() 후 실행된다.
  3700. if( prevStepCntl == null ) {
  3701. if(connectionMode == "true"){
  3702. prevStepCntl = currentStepCntl;
  3703. }
  3704. //단순 컨트롤 선택이라면, 라인의 색상을 바꾼다.
  3705. if(selectedControl != null){
  3706. if( isNull(selectedControl.parent.attribute("id")) ){
  3707. //alert( "selectedControl.parent = null ");
  3708. return;
  3709. }
  3710. var sCurID = selectedControl.parent.attribute("id"); //erroor
  3711. sCurID = sCurID.substr(12, sCurID.length-12);
  3712. if( !isNull(model.getValue(stepRef + "[" + (parseInt(sCurID)+1) + "]/startendflag")) ){ //조건삭제 (opener.window.javascript.OpenerKind != "GPS" && ) 2008.12.22
  3713. fChangeSelectCntl("#ff9900", selectedControl);
  3714. } else {
  3715. fChangeSelectCntl("#000000", selectedControl);
  3716. }
  3717. selectedControl = null;
  3718. }
  3719. selectedControl = selControl;
  3720. fChangeSelectCntl("#A683B1", selControl); //현재 선택한 컨트롤의 외곽선 색상을 빨간색으로 설졍
  3721. if(selectedLineSection != ""){
  3722. selectedLineSection = "";
  3723. fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
  3724. }
  3725. //마우스 우측버튼(메뉴팝업 호출) 시, 수행안하는 action
  3726. if( event.button == 3 ) return;
  3727. //M-GPS가 opener 일 경우, 서식 코드를 조회한다.
  3728. if(opener.window.javascript.OpenerKind == "GPS"){
  3729. //결정하기 메뉴 선택 후, 대상 스텝을 선택할 경우, 선택 스텝에 대한 정보를 저장하고, 선의 색상을 바꾼다.
  3730. if(decisionMode == "true"){
  3731. var id = currentStepCntl.attribute("id");
  3732. fDecision();
  3733. fCreateControl();
  3734. selectedControl = null;
  3735. currentStepCntl = document.controls(id);
  3736. fChangeSelectCntl("#A683B1", currentStepCntl);
  3737. }
  3738. }
  3739. } else {
  3740. //컨트롤 간의 연결 시,
  3741. fConnectToLine( prevStepCntl, currentStepCntl );
  3742. prevStepCntl = null ;
  3743. }
  3744. //버튼들의 enable/disable
  3745. //btn_initialize.disabled = false;
  3746. btn_action.disabled = true;
  3747. btn_decision.disabled = true;
  3748. btn_branch.disabled = true;
  3749. btn_addline.disabled = true;
  3750. btn_start.disabled = false;
  3751. btn_end.disabled = false;
  3752. btn_connection.disabled = false;
  3753. btn_remove.disabled = false;
  3754. }
  3755. else if(ctrl.substr(0, 14) == "xforms:caption"){
  3756. //CPG의 속성 아이콘 선택 시
  3757. var sCurID = selControl.attribute("id");
  3758. if( sCurID.substr(sCurID.length-3, 2) == "_@" ){
  3759. if( selControl.attribute("color") == "#000000" ){
  3760. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  3761. var sAttrFlag = sCurID.substr(sCurID.length-1, 1);
  3762. switch( sAttrFlag ){
  3763. case "O" :
  3764. opener.window.javascript.fOpenStepDetlInfo();
  3765. break;
  3766. case "M" :
  3767. //opener.model.makeValue("/root/main/masterinfo/info/cpgattadmin", "A");
  3768. //opener.model.makeValue("/root/main/masterinfo/info/stepattadmin", curNo);
  3769. opener.javascript.setParameter("cpgattadmin", "A");
  3770. opener.javascript.setParameter("stepattadmin", curNo);
  3771. opener.window.javascript.fOpenAttAdm();
  3772. break;
  3773. case "T" :
  3774. //opener.model.makeValue("/root/main/masterinfo/info/cpgattadmin", "C");
  3775. //opener.model.makeValue("/root/main/masterinfo/info/stepattadmin", curNo);
  3776. opener.javascript.setParameter("cpgattadmin", "C");
  3777. opener.javascript.setParameter("stepattadmin", curNo);
  3778. opener.window.javascript.fOpenAttAdm();
  3779. break;
  3780. case "D" :
  3781. break;
  3782. default :
  3783. break;
  3784. }
  3785. }
  3786. }
  3787. }
  3788. ]]>
  3789. </script>
  3790. <script type="javascript" ev:event="DOMFocusOut">
  3791. <![CDATA[
  3792. window.setPopupMenu(false);
  3793. ]]>
  3794. </script>
  3795. <iviewer id="ivw_detail" visibility="hidden" style="left:0px; top:0px; width:835px; height:653px; "/>
  3796. <input id="ipt_swimlineno" ref="/root/main/outlineinfo/info/swimlineno" visibility="hidden" style="left:793px; top:45px; width:20px; height:19px; "/>
  3797. <group id="grp_dcsgrid" visibility="hidden" style="left:0px; top:445px; width:420px; height:205px; ">
  3798. <shape id="roundrect1" class="roundrect_btnset" appearance="roundrect" ellipsewidth="20" ellipseheight="20" style="left:0px; top:0px; width:420px; height:205px; "/>
  3799. <img id="img1" src="../../../com/commonweb/images/icon_n.gif" style="left:7px; top:10px; width:10px; height:13px; background-stretch:stretch; "/>
  3800. <caption id="caption2" style="left:20px; top:5px; width:380px; height:23px; ">결정할 Step을 선택한 후 '확인'을 눌러주세요!</caption>
  3801. <button id="button2" class="btn2_letter2" style="left:323px; top:180px; width:42px; height:19px; ">
  3802. <caption>확인</caption>
  3803. <script type="javascript" ev:event="DOMActivate">
  3804. <![CDATA[
  3805. ]]>
  3806. </script>
  3807. </button>
  3808. <button id="button3" class="btn2_letter2" style="left:368px; top:180px; width:42px; height:19px; ">
  3809. <caption>취소</caption>
  3810. <script type="javascript" ev:event="DOMActivate">
  3811. <![CDATA[
  3812. grp_dcsgrid.visible = false;
  3813. ]]>
  3814. </script>
  3815. </button>
  3816. <datagrid id="grd_decision" nodeset="/root/main/seldecision/info" autoresize="true" caption="stepmemo^stepno^lnkstepno" colsep="^" colwidth="383, 100, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:10px; top:30px; width:400px; height:145px; ">
  3817. <col ref="stepnm"/>
  3818. <col ref="stepno" visibility="hidden"/>
  3819. <col ref="lnkstepno" visibility="hidden"/>
  3820. </datagrid>
  3821. <datagrid id="grd_decision_answlist" nodeset="/root/main/seldecisionlist/info" autoresize="true" caption="stepno^lnkstep" colsep="^" colwidth="50, 50" mergecellsfixedrows="bycolrec" rowsep="|" style="left:305px; top:100px; width:105px; height:75px; ">
  3822. <col ref="stepno" visibility="hidden"/>
  3823. <col ref="lnkstepno" visibility="hidden"/>
  3824. </datagrid>
  3825. <input id="ipt_dcs_stepno" visibility="hidden" style="left:380px; top:80px; width:30px; height:19px; "/>
  3826. </group>
  3827. <group id="group1" visibility="hidden" style="left:720px; top:45px; width:70px; height:20px; ">
  3828. <caption id="cap_monitoringyn" style="left:16px; top:0px; width:15px; height:20px; text-align:center; background-color:#ffcc99; ">M</caption>
  3829. <caption id="cap_orderyn" style="left:0px; top:0px; width:15px; height:20px; text-align:center; background-color:#ffcc99; ">O</caption>
  3830. <caption id="cap_limtmyn" style="left:32px; top:0px; width:15px; height:20px; color:#000000; text-align:center; background-color:#ffcc99; ">T</caption>
  3831. <caption id="cap_monitoringorderyn" style="left:48px; top:0px; width:22px; height:20px; color:#c0c0c0; text-align:center; background-color:#ffcc99; ">MO</caption>
  3832. </group>
  3833. <group id="grp_msgbox" visibility="hidden" overflow="scroll" style="left:685px; top:65px; width:125px; height:55px; ">
  3834. <caption id="cap_msgbox" autoresize="true" style="left:5px; top:5px; width:117px; height:45px; color:#ff0000; text-align:center; ">
  3835. <![CDATA[결정할 Action 스텝을
  3836. 선택하십시오.]]>
  3837. </caption>
  3838. </group>
  3839. </group>
  3840. <group id="grp_button" visibility="hidden" style="left:557px; top:4px; width:256px; height:43px; background-color:transparent; ">
  3841. <button id="btn_branch" class="btn2_letter2" visibility="hidden" style="left:205px; top:20px; width:42px; height:19px; ">
  3842. <caption>D</caption>
  3843. </button>
  3844. <script type="javascript" ev:event="onclick">
  3845. <![CDATA[
  3846. var ctrl = null;
  3847. ctrl = (event.target);
  3848. var selControl = document.controls(ctrl);
  3849. var controlText = selControl.attribute("text");
  3850. var controlID = selControl.attribute("id");
  3851. if(event.button == 1){
  3852. if(ctrl.substr(0, 4) == "btn_"){
  3853. switch( controlID ){
  3854. case "btn_remove" :
  3855. fDelCntl();
  3856. break;
  3857. case "btn_start" :
  3858. if ( currentStepCntl == null ){
  3859. messageBox("스텝을", "C002");
  3860. return;
  3861. }
  3862. fSetStartStep();
  3863. break;
  3864. case "btn_end" :
  3865. if ( currentStepCntl == null ){
  3866. messageBox("스텝을", "C002");
  3867. return;
  3868. }
  3869. fSetEndStep();
  3870. break;
  3871. case "btn_connection" :
  3872. if(controlText == "입력"){
  3873. selControl.attribute("text") = "연결";
  3874. connectionMode = "true";
  3875. btn_disconnection.disabled = true;
  3876. }else{
  3877. selControl.attribute("text") = "입력";
  3878. connectionMode = "false";
  3879. currentStepCntl == null;
  3880. btn_disconnection.disabled = false;
  3881. }
  3882. model.refresh();
  3883. break;
  3884. case "btn_disconnection" :
  3885. if ( currentStepCntl == null ){
  3886. messageBox("스텝을", "C002");
  3887. return;
  3888. }
  3889. var curID = currentStepCntl.attribute("id");
  3890. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  3891. fDelLink();
  3892. break;
  3893. case "btn_detailinfo" :
  3894. if(currentStepCntl != null)
  3895. fViewDetailInfo();
  3896. break;
  3897. case "btn_addline" :
  3898. fAddSwimLine();
  3899. break;
  3900. case "btn_initialize" :
  3901. //fOutlineCntlInit();
  3902. opener.model.setValue("/root/main/masterinfo/info/swimlineno", "");
  3903. lineNo = "";
  3904. opener.ipt_swimlineno.refresh();
  3905. opener.window.javascript.fCreateOutLineView();
  3906. /*
  3907. opener.model.setValue("/root/main/masterinfo/info/swimlineno", "");
  3908. lineNo = "";
  3909. opener.ipt_swimlineno.disabled = false;
  3910. opener.ipt_swimlineno.refresh();
  3911. //fInitialize();
  3912. linesControlMaxCnt = new Array(0);
  3913. */
  3914. break;
  3915. default :
  3916. if ( isNull(selectedLineSection) ){
  3917. messageBox("스윔라인을", "C002");
  3918. return;
  3919. }
  3920. if(selectedLineSection > lineNo){
  3921. messageBox("스윔라인을", "C002");
  3922. return;
  3923. }
  3924. if(controlText == "A"){
  3925. var rtnNum = fMakeNode("A", selectedLineSection);
  3926. } else if(controlText == "D"){
  3927. var rtnNum = fMakeNode("D", selectedLineSection);
  3928. } else if(controlText == "B"){
  3929. var rtnNum = fMakeNode("B", selectedLineSection);
  3930. }
  3931. fCreateControl(); //컨트롤 재배치를 위해 컨트롤을 모두 삭제한 후, 다시 생성한다.
  3932. currentStepCntl = document.controls( "xforms:group" + (rtnNum-1) ); //모든 컨트롤이 다시생되면, 방금 전 생성한 컨트롤에 포커스를 맞춘다.
  3933. break;
  3934. }
  3935. }
  3936. }
  3937. ]]>
  3938. </script>
  3939. <button id="btn_action" class="btn_number" style="left:62px; top:1px; width:39px; height:19px; ">
  3940. <caption>A</caption>
  3941. </button>
  3942. <button id="btn_decision" class="btn_number" style="left:104px; top:1px; width:39px; height:19px; ">
  3943. <caption>D</caption>
  3944. </button>
  3945. <button id="btn_start" class="btn_number" style="left:146px; top:1px; width:42px; height:19px; ">
  3946. <caption>S</caption>
  3947. </button>
  3948. <button id="btn_end" class="btn_number" style="left:188px; top:1px; width:39px; height:19px; ">
  3949. <caption>E</caption>
  3950. </button>
  3951. <button id="btn_connection" class="btn_number" style="left:62px; top:22px; width:39px; height:19px; ">
  3952. <caption>입력</caption>
  3953. <hint>
  3954. <![CDATA[ 현재 설정된 모드를 알려줍니다. ]]>
  3955. </hint>
  3956. </button>
  3957. <button id="btn_initialize" class="btn2_letter3" visibility="hidden" style="left:186px; top:22px; width:53px; height:19px; ">
  3958. <caption>초기화</caption>
  3959. </button>
  3960. <button id="btn_addline" class="btn2_letter4" style="left:146px; top:22px; width:64px; height:19px; ">
  3961. <caption>라인추가</caption>
  3962. </button>
  3963. <button id="btn_remove" class="btn_number" style="left:212px; top:22px; width:42px; height:19px; ">
  3964. <caption>삭제</caption>
  3965. </button>
  3966. <button id="btn_disconnection" class="btn_number" style="left:104px; top:22px; width:39px; height:19px; ">
  3967. <caption>해제</caption>
  3968. </button>
  3969. <caption id="caption1" visibility="hidden" style="left:243px; top:4px; width:10px; height:20px; ">
  3970. <![CDATA[a]]>
  3971. <script type="javascript" ev:event="onclick">
  3972. <![CDATA[
  3973. //alert(swimlineControlArray);
  3974. //alert ( "parent : " + selectedControl.parent.attribute("id") + ", " + selectedControl.attribute("id") );
  3975. if( currentStepCntl != null ){
  3976. var curID = currentStepCntl.attribute("id");
  3977. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  3978. }else{
  3979. var curNo = "";
  3980. }
  3981. alert("curNo = " + curNo + " , grpControlCnt = " + grpControlCnt + ", swimlineControlArray = " + swimlineControlArray);
  3982. ]]>
  3983. </script>
  3984. </caption>
  3985. </group>
  3986. <!--
  3987. <script type="javascript" ev:event="onclick">
  3988. <![CDATA[
  3989. model.alert(event.target);
  3990. ]]>
  3991. </script>
  3992. -->
  3993. </xhtml:body>
  3994. </xhtml:html>