SMMNE00100.js 160 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669
  1. /*
  2. EMC메인, ER Census(SMMNE00100.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var sSrchToolStatus = "";
  7. var xPathUser = "/root/UserData/list";
  8. var xPathUserPop = "/root/main/list";
  9. /* 20090116(ByJA)
  10. var pid = ""; //환자라벨출력 변수
  11. var patnm = ""; //환자라벨출력 변수
  12. var sexage = ""; //환자라벨출력 변수
  13. var rgstno = ""; //환자라벨출력 변수
  14. var orddd = ""; //환자라벨출력 변수
  15. var prtcnt = ""; //환자라벨출력 변수
  16. var scrnid = ""; //환자라벨출력 변수
  17. var barcdRef = ""; //환자라벨출력 변수
  18. */
  19. var gOrddd ="";
  20. var MemoUseYn = "";
  21. var ColorUseYn = "";
  22. var LabelPntCnt = "";
  23. var instUseForJci = "";
  24. var xOldPosflagcd = "";
  25. var xOldPosflag = "";
  26. /**
  27. * @group :
  28. * @ver : 2007.06.07
  29. * @by : 양천덕
  30. * @---------------------------------------------------
  31. * @type : function
  32. * @access : public
  33. * @desc : 초기 검색 조건 조회
  34. * @param :
  35. * @return :
  36. * @---------------------------------------------------
  37. */
  38. function fInit(pFlag){
  39. // parameter 로 센서스 조회
  40. //lzzfMakeBrcdPrntObj("CommAX");
  41. var instcd = getUserInfo("dutplceinstcd");
  42. // 간호하드코딩 테이블 조회_20090415(ByJA)
  43. var pCode = "'110', '131', '133','201'"; // 조회할 CdGrupID 코드정보
  44. var pDate = getCurrentDate(); //조회기준일자
  45. fGetNursHardCdInfo(pCode, pDate);
  46. MemoUseYn = model.getValue("/root/code/codeinfo/codelist[cdgrupid ="+"131"+"]/cdid");
  47. ColorUseYn = model.getValue("/root/code/codeinfo/codelist[cdgrupid ="+"131"+"]/supcdid");
  48. LabelPntCnt = model.getValue("/root/code/codeinfo/codelist[cdgrupid ="+"133"+"]/cdid");
  49. instUseForJci = model.getValue("/root/code/codeinfo/codelist[cdgrupid ='201']/cdid");
  50. nursemaininfo.colHidden(nursemaininfo.colRef("dschdt"))= true;
  51. //출력장수 세팅이 안되어 있을 경우 Default 1장 세팅
  52. if(LabelPntCnt == ""){
  53. LabelPntCnt = "1";
  54. }
  55. //병원별 적용(환자 메모 입력 추가 기능)
  56. if(MemoUseYn == "Y"){
  57. grid01Cnt = eval(getNodesetCount("/root/codedata/popupmenu/grid01/item"));
  58. grid02Cnt = eval(getNodesetCount("/root/codedata/popupmenu/grid02/item"));
  59. for(i = 1 ; i <= 4 ; i++){
  60. var sPopupName = "";
  61. var sPopupFunc = "";
  62. switch(i){
  63. case 1:
  64. sPopupName = "--------------";
  65. sPopupFunc = "";
  66. break;
  67. case 2:
  68. sPopupName = "메모 삽입";
  69. sPopupFunc = "fErPatInsmemo";
  70. break;
  71. case 3:
  72. sPopupName = "메모 편집";
  73. sPopupFunc = "fErPatSetmemo";
  74. break;
  75. case 4:
  76. sPopupName = "메모 삭제";
  77. sPopupFunc = "fErPatDelmemo";
  78. break;
  79. }
  80. model.makeValue("/root/codedata/popupmenu/grid01/item["+(i+grid01Cnt)+"]/name", sPopupName);
  81. model.makeValue("/root/codedata/popupmenu/grid01/item["+(i+grid01Cnt)+"]/func", sPopupFunc);
  82. model.makeValue("/root/codedata/popupmenu/grid02/item["+(i+grid02Cnt)+"]/name", sPopupName);
  83. model.makeValue("/root/codedata/popupmenu/grid02/item["+(i+grid02Cnt)+"]/func", sPopupFunc);
  84. }
  85. }
  86. if(checkOpener()){
  87. var sParamInfo = opener.javascript.getParameter("SMMNE001_Param");
  88. if(sParamInfo.length > 0 ){
  89. var sPid = getArrayData(sParamInfo,0,0,"▩","▦"); // 환자번호
  90. var sIndd = getArrayData(sParamInfo,0,1,"▩","▦"); // 입원일자
  91. var sCretno = getArrayData(sParamInfo,0,2,"▩","▦"); // 생성번호
  92. var sPageflag = getArrayData(sParamInfo,0,3,"▩","▦"); // OM 오더매니지 20090511 김홍점 추가
  93. gOrddd = getArrayData(sParamInfo,0,4,"▩","▦"); // OM 오더매니지 20090511 김홍점 추가
  94. if ( sPageflag == "om"){
  95. model.setValue("/root/main/cond/indschacptstat" ,"1");
  96. model.setValue("/root/main/pageflag", sPageflag );
  97. model.setValue("/root/main/cond/orddd", gOrddd );
  98. }else{
  99. model.setValue("/root/main/cond/pid", sPid);
  100. model.setValue("/root/main/cond/indd", sIndd);
  101. model.setValue("/root/main/cond/cretno", sCretno);
  102. model.setValue("/root/main/cond/indschacptstat" ,"4");
  103. model.setValue("/root/main/pageflag", "ec" );
  104. }
  105. }else{ // 상단정보 세팅
  106. model.setValue("/root/main/pageflag",getScreenMenuParameter() );
  107. model.setValue("/root/main/cond/orddd", getCurrentDate());
  108. }
  109. }else{
  110. model.setValue("/root/main/pageflag",getScreenMenuParameter() );
  111. model.setValue("/root/main/cond/orddd", getCurrentDate());
  112. }
  113. //model.setValue("/root/main/cond/wardcd", "2280200000");20090630 김홍점 하드코딩수정
  114. model.setValue("/root/main/cond/wardcd", (model.getValue("/root/code/codeinfo/codelist[cdgrupid='110']/cdid")).substring(0,10));//응급의료센터병동코드
  115. model.setValue("/root/main/cond/srchinstcd", (model.getValue("/root/code/codeinfo/codelist[cdgrupid='110']/cdid")).substring(11));//조회순서용 기관코드
  116. model.setValue("/root/main/cond/outdt", getCurrentDate()); // 재원구분 퇴원시 퇴원일자 Setting
  117. var sStat = pFlag
  118. fInitNode(sStat);
  119. model.removenode("/root/send");
  120. model.makeValue("/root/send/searchitem", "all");
  121. submit("TRMNE00203", false);
  122. fSelctionOutRmCombo();
  123. zbcfGetCodeList(
  124. new Array("M0117", "M0118", "M0119", "M0120", "P0008", "P0378", "M0378", "M0720"),
  125. new Array("/root/init/M0117list","/root/init/M0118list","/root/init/M0119list","/root/init/M0120list","/root/init/P0008list", "/root/init/P0378list", "/root/init/M0378list", "/root/init/M0720list"));
  126. var standard_yn = "orduseyn";
  127. var ord_deptflag = 'D';
  128. var rslt_ref = "/root/hidden/orddeptlist";
  129. var sort_field = "dispseq";
  130. var sort_method = "asc";
  131. zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref, sort_field, sort_method);
  132. var deptcd = model.getValue("/root/main/cond/orddeptcd");
  133. var resultRef = "/root/main/userlist";
  134. var flag = "_D";
  135. zsufGetUserInfoCombo(deptcd, resultRef, flag);
  136. model.makevalue("/root/hidden/erorddeptlist/dept/depthngnm", "-");
  137. model.makevalue("/root/hidden/erorddeptlist/dept/deptcd", "");
  138. for(i = 0 ; i < getNodesetCount("/root/hidden/orddeptlist/dept") ; i ++ ) {
  139. model.makevalue("/root/hidden/erorddeptlist/dept["+(i+2)+"]/depthngnm", model.getValue("/root/hidden/orddeptlist/dept["+(i+1)+"]/depthngnm") );
  140. model.makevalue("/root/hidden/erorddeptlist/dept["+(i+2)+"]/deptcd" , model.getValue("/root/hidden/orddeptlist/dept["+(i+1)+"]/deptcd") );
  141. }
  142. //입원대기사유구분 세팅
  143. group2.attribute("height") = 0;
  144. datagrid3.rowhidden(0) = true;
  145. datagrid3.deleteRow(1, true);
  146. fSeletedSrcTool();
  147. }
  148. /**
  149. * @group :
  150. * @ver : 2007.06.07
  151. * @by : 양천덕
  152. * @---------------------------------------------------
  153. * @type : function
  154. * @access : public
  155. * @desc : SWITCH화면별 노드 초기화
  156. * @param :
  157. * @return :
  158. * @---------------------------------------------------
  159. */
  160. function fInitNode(pFlag){
  161. if ( pFlag == "F" ){
  162. model.removeNodeset("/root/main/nursemainlist/nursemaininfo");
  163. model.removeNodeset("/root/main/ercensuslist/erpatientlist");
  164. fClearChildNodeSet("/root/main/ercensusinfo/patinfo");
  165. fClearChildNodeSet("/root/main/ercensusinfo/erorddrlist");
  166. fClearChildNodeSet("/root/main/ercensusinfo/erorddrlist1");
  167. fClearChildNodeSet("/root/main/ercensusinfo/erorddrlist2");
  168. }
  169. if ( pFlag == "nm" ){
  170. model.removeNodeset("/root/main/nursemainlist/nursemaininfo");
  171. }
  172. if ( pFlag == "ec" ){
  173. model.removeNodeset("/root/main/ercensuslist/erpatientlist");
  174. if(getNodesetCount("/root/main/ercensusinfo/patinfo/pid") > 0 ){
  175. fClearChildNodeSet("/root/main/ercensusinfo/patinfo");
  176. }
  177. model.removeNodeset("/root/main/ercensusinfo/erorddrlist");
  178. model.removeNodeset("/root/main/ercensusinfo/erorddrlist1");
  179. model.removeNodeset("/root/main/ercensusinfo/erorddrlist2");
  180. fButtonSettion("A");
  181. }
  182. model.refresh();
  183. }
  184. /**
  185. * @group :
  186. * @ver : 2007.06.07
  187. * @by : 양천덕
  188. * @---------------------------------------------------
  189. * @type : function
  190. * @access : public
  191. * @desc : SWITCH화면별 속성값 부여
  192. * @param :
  193. * @return :
  194. * @---------------------------------------------------
  195. */
  196. function fSeletedSrcTool(){
  197. //byCY
  198. //byCY
  199. model.removenode("/root/send");
  200. var rendcd=model.getValue("/root/main/cond/section");
  201. var chkdata=checkbox1.value;
  202. var rendcdlist=rendcd.split(" ");
  203. if (chkdata.substr(0,1) != "-") {
  204. if (rendcd.length>0) {
  205. for (var i=0; i<rendcdlist.length;i++) {
  206. rendcd=rendcd.replace(" ","','");
  207. }
  208. rendcd="('" + rendcd + "')";
  209. }
  210. } else {
  211. rendcd = "-";
  212. }
  213. //-----(20110427)
  214. // 구역정보를 선택하지 않으면 조회되지 않도록 한다.
  215. if (rendcd == "") {
  216. messageBox("구역정보를 선택하십시오.","E");
  217. model.setFocus("checkbox1");
  218. return;
  219. }
  220. //-----(20110427)
  221. var sSrchData = "";
  222. var sSrchHeader = "flag▦orddept▦orddrid▦section▦fromorddd▦orddd▦wardcd▦outdt▦srchinstcd▦settingrnid▩";
  223. var sSrchData = model.getValue("/root/main/cond/indschacptstat") +"▦"
  224. + model.getValue("/root/main/cond/orddeptcd") +"▦"
  225. + model.getValue("/root/main/cond/medispclid") +"▦"
  226. //+ model.getValue("/root/main/cond/section") +"▦" //20110224 이선경 경북대 : 멀티체크기능 추가
  227. + rendcd +"▦"
  228. + getDateCalc(getCurrentDate().substr(0,8), 3, "-")+"▦"
  229. + getCurrentDate().substr(0,8) +"▦"
  230. + model.getValue("/root/main/cond/wardcd") +"▦"
  231. + model.getValue("/root/main/cond/outdt") +"▦"
  232. + model.getValue("/root/main/cond/srchinstcd") +"▦"
  233. + model.getValue("/root/main/cond/settingrnid") +"▩";
  234. model.makeValue("/root/send/mainsearchinfo", sSrchHeader + sSrchData);
  235. sSrchToolStatus = model.getValue("/root/main/pageflag");
  236. //alert("tool : "+sSrchToolStatus);
  237. //혈액준비환자 & 입원대기 환자 조회
  238. submit("TRMNE00107", false);
  239. submit("TRMNE00108", false);
  240. submit("TRMNE00109", false); // 부적합 환자 조회 _ 손성훈.
  241. if(model.getValue("/root/main_om/cond/hopedd")==""){
  242. model.setValue("/root/main_om/cond/hopedd",'4');
  243. model.setValue("/root/main_om/cond/hopefmdd", '');
  244. model.setValue("/root/main_om/cond/hopetodd", '');
  245. }
  246. model.makeValue("/root/send/settingrnid", model.getValue("/root/main/cond/settingrnid"));
  247. switch(sSrchToolStatus){
  248. case "td":
  249. fInitNode(sSrchToolStatus);
  250. btn_todolistmv.selected = true;
  251. group8.visible = false;
  252. group9.visible = false;
  253. group10.visible = false;
  254. model.toggle("case2");
  255. break;
  256. case "om":
  257. fInitNode(sSrchToolStatus);
  258. btn_ordermngmv.selected = true;
  259. group8.visible = false;
  260. group9.visible = true;
  261. group10.visible = false;
  262. model.toggle("case3");
  263. model.setValue("/root/main_om/cond/pid", "등록번호");
  264. model.setValue("/root/main_om/cond/roomcd", "병실");
  265. model.setValue("/root/main_om/cond/sexage", "S/A");
  266. model.setValue("/root/main_om/cond/patnm", "환자명");
  267. fGetOMPatList("emc", gOrddd);
  268. break;
  269. case "ec":
  270. fInitNode(sSrchToolStatus);
  271. btn_ercensusmv.selected = true;
  272. group8.visible = false;
  273. group9.visible = false;
  274. group10.visible = false;
  275. model.toggle("case4");
  276. model.removeNodeset("/root/main/nursemainlist/nursemaininfo");
  277. model.makeNode("/root/send/reqcensus");
  278. if(model.getValue("/root/main/cond/pid") == ""){
  279. submit("TRMNE00103");
  280. fGetParamSetting();
  281. }else{
  282. //기간별 내원환자 pop_up
  283. btn_mainmv.disabled = true;
  284. btn_ordermngmv.disabled = true;
  285. cmb_Zone.disabled = true;
  286. cmb_OrdDept2.disabled = true;
  287. cmb_OrdDR.disabled = true;
  288. rdo_Flag.disabled = true;
  289. fSearchPatienInfo("p_ec");
  290. }
  291. model.refresh();
  292. break;
  293. case "prn":
  294. fInitNode(sSrchToolStatus);
  295. btn_ordermngmv.selected = true;
  296. group8.visible = false;
  297. group9.visible = true;
  298. group10.visible = false;
  299. model.toggle("case3");
  300. model.setValue("/root/main_om/cond/pid", "등록번호");
  301. model.setValue("/root/main_om/cond/roomcd", "병실");
  302. model.setValue("/root/main_om/cond/sexage", "S/A");
  303. model.setValue("/root/main_om/cond/patnm", "환자명");
  304. fSetPrnMode();
  305. fGetOMPatList("emc");
  306. break;
  307. default :
  308. fInitNode(sSrchToolStatus);
  309. btn_mainmv.selected = true;
  310. group8.visible = true;
  311. group9.visible = false;
  312. group10.visible = false;
  313. model.toggle("case1");
  314. //model.removeNodeset("/root/main/nursemainlist/nursemaininfo");
  315. model.makeNode("/root/send/reqdata");
  316. nursemaininfo.allstyle("all", "background-color") = "white";
  317. if(MemoUseYn == "Y"){
  318. nursemaininfo.colHidden(nursemaininfo.colRef("memoyn")) = false;
  319. }else{
  320. nursemaininfo.colHidden(nursemaininfo.colRef("memoyn")) = true;
  321. }
  322. //nursemaininfo.refresh();
  323. submit("TRMNE00101");
  324. var paminfo = getGlobalVariable("paminfo");
  325. if(paminfo.length > 0) { //원무 정보(기본 정보)가 있는 경우
  326. //설정된 상단정보를 불러옴
  327. model.removenode("/root/main/paminfo");
  328. model.makeNode("/root/main/paminfo");
  329. setCSVToNode("/root/main/paminfo", paminfo);
  330. var pid = model.getValue("/root/main/paminfo/list/pid");
  331. if (pid != "") {
  332. for(var i = nursemaininfo.fixedRows; i < nursemaininfo.rows; i++) {
  333. var main_pid = nursemaininfo.valueMatrix(i, nursemaininfo.colRef("pid"));
  334. if(pid ==main_pid ) {
  335. model.setFocus("nursemaininfo");
  336. nursemaininfo.row = i;
  337. break;
  338. }
  339. }
  340. }
  341. }
  342. //model.refresh();
  343. //byCY 4-6-24시간이상 체류환자 체크
  344. /*
  345. var count4 = 0; //4시간이상체류환자
  346. var count6 = 0; //6시간이상체류환자
  347. var count24 = 0; //24시간이상체류환자
  348. for(var i=0; i<nursemaininfo.rows;i++) {
  349. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck4") =="Y"
  350. && model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck") == "N"
  351. && model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck24") =="N")
  352. {
  353. //체류시간 4시간 이상 체류한 환자에 대해 셀 색상 지정
  354. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("stattmck")) = "#0099FF";
  355. count4++;
  356. }
  357. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck4") =="Y"
  358. && model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck") == "Y"
  359. && model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck24") =="N")
  360. {
  361. //체류시간 6시간 이상 체류한 환자에 대해 셀 색상 지정
  362. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("stattmck")) = "#deffde";
  363. count6++;
  364. }
  365. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck4") =="Y"
  366. && model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck") == "Y"
  367. && model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/stattmck24") =="Y")
  368. {
  369. //체류시간 24시간 이상 체류한 환자에 대해 셀 색상 지정
  370. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("stattmck")) = "#FFFF66";
  371. count24++;
  372. }
  373. }
  374. model.makeValue("/root/main/cntpat/count4","("+count4+")");
  375. model.makeValue("/root/main/cntpat/count6","("+count6+")");
  376. model.makeValue("/root/main/cntpat/count24","("+count24+")");
  377. */
  378. //byCY
  379. // 부적합검체 등록 환자 조회_손성훈
  380. /* var spcPatnm = "";
  381. if(getNodesetCount("/root/main/topunablspc/nursemainspclist") > 0) {
  382. for( var k = 1 ; k <= getNodesetCount("/root/main/topunablspc/nursemainspclist") ; k++){
  383. if(spcPatnm == ""){
  384. spcPatnm += model.getValue("/root/main/topunablspc/nursemainspclist["+k+"]/patnm");
  385. }else{
  386. spcPatnm += ", "+ model.getValue("/root/main/topunablspc/nursemainspclist["+k+"]/patnm");
  387. }
  388. }
  389. tar_unablspc.value = spcPatnm;
  390. }
  391. */
  392. //혈액준비 환자 리스트
  393. /*var blodlist ="";
  394. for( i = 0 ; i < getNodesetCount("/root/main/nursemainlist/nursemainblodlist") ; i ++){
  395. if(blodlist != ""){
  396. blodlist += ", ";
  397. }
  398. blodlist += model.getValue("/root/main/nursemainlist/nursemainblodlist["+(i+1)+"]/patnm");
  399. }
  400. tar_blodprep.value = blodlist;
  401. model.setFocus("nursemaininfo");*/
  402. var iRows = getNodesetCount("/root/main/nursemainlist/nursemaininfo");
  403. var nodePath = "/root/main/nursemainlist/nursemaininfo";
  404. //20120109_KNUH_Start 감염정보img추가
  405. for(var i = 1; i<=iRows; i++) {
  406. if (model.getValue(nodePath + "["+i+"]/disp1") == "Y") {
  407. nursemaininfo.cellstyle("background-image", i, nursemaininfo.colRef("disp1img")) = "../../../com/hismainweb/images/btn_top_infection0.gif";
  408. }else{
  409. nursemaininfo.cellstyle("background-image", i, nursemaininfo.colRef("disp1img")) = "";
  410. }
  411. if (model.getValue(nodePath + "["+i+"]/disp2") == "Y") {
  412. nursemaininfo.cellstyle("background-image", i, nursemaininfo.colRef("disp2img")) = "../../../com/hismainweb/images/btn_top_infection1.gif";
  413. }else{
  414. nursemaininfo.cellstyle("background-image", i, nursemaininfo.colRef("disp2img")) = "";
  415. }
  416. if (model.getValue(nodePath + "["+i+"]/disp3") == "Y") {
  417. nursemaininfo.cellstyle("background-image", i, nursemaininfo.colRef("disp3img")) = "../../../com/hismainweb/images/btn_top_infection2.gif";
  418. }else{
  419. nursemaininfo.cellstyle("background-image", i, nursemaininfo.colRef("disp3img")) = "";
  420. }
  421. }
  422. var iRow = nursemaininfo.rows;
  423. /*
  424. for(i= 1 ; i < iRow ; i ++ ){
  425. // 혈액준비환자 아이콘표시
  426. var blodprep = model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn");
  427. if (blodprep == "Y") {
  428. model.setValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn", "");
  429. nursemaininfo.cellstyle("background-image", i , 9) = "../../../emr/commonweb/images/blood.gif";
  430. } else {
  431. //model.setValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn", "");
  432. nursemaininfo.cellstyle("background-image", i , 9) = "";
  433. }
  434. }
  435. */
  436. /*
  437. for(i= 0 ; i < iRow ; i ++ ){
  438. if(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/stattmck") == "Y"){
  439. //체류시간 6시간 이상 체류한 환자에 대해 셀 색상 지정
  440. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("stattmck")) = "#deffde";
  441. }
  442. }
  443. for(i= 0 ; i < iRow ; i ++ ){
  444. if(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/censusck") == "Y"){
  445. //Census 미등록 환자
  446. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("stattmck")) = "#ffefd6";
  447. }
  448. }
  449. for(i = 0; i < iRow; i++) {
  450. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/recovwardcd") != "") {
  451. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("recovwardcd") , i, nursemaininfo.colRef("patnm")) = "#ff0000";
  452. }
  453. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/actsymp") == "Y") {
  454. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("bedposcnts") , i, nursemaininfo.colRef("bedposcnts")) = "#ff0000";
  455. }
  456. }
  457. */
  458. //병원별 적용 임시 하드코딩 부분(추후 환경설정 화면 적용 필요)
  459. if(ColorUseYn == "Y"){
  460. grup_help1.visible = true;
  461. for(i= 1 ; i < iRow ; i ++ ){
  462. /*+ 글자색 지정 */
  463. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/prcpcnt") == "0") {
  464. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("bedposcnts") , i, nursemaininfo.colRef("staytime")) = "#0033CC";
  465. }else{
  466. if( eval(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/staytime")) > 150 &&
  467. (model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/dschdclrtyn") == "N" &&
  468. model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/inreq") == "" )) {
  469. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("vipyn") , i, nursemaininfo.colRef("staytime")) = "#ff0000";
  470. }
  471. }
  472. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/recovwardcd") != "") {
  473. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("recovwardcd") , i, nursemaininfo.colRef("patnm")) = "#ff0000";
  474. }
  475. // 입원장 발행 의사가 타과 의사 지정을 할 경우 처리
  476. //20110617_KNUH_Start dark9258 입원장 빨간색 칠하는 부분 삭제.
  477. /*
  478. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/erdocyn") == "Y") {
  479. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("inreq") , i, nursemaininfo.colRef("inreq")) = "#ff0000";
  480. }
  481. */
  482. /*+ 배경색 지정 */
  483. if( eval(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/staytime")) >= 240 && eval(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/staytime")) < 360 ){
  484. //체류시간 4~6시간 체류한 환자에 대해 셀 색상 지정
  485. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#DDBBFF";
  486. }else if(eval(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/staytime")) >= 360 && eval(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/staytime")) < 1440 ){
  487. //체류시간 6~24시간 체류한 환자에 대해 셀 색상 지정
  488. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#deffde";
  489. }else if(eval(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/staytime")) >= 1440 ){
  490. //체류시간 24시간 이상 체류한 환자에 대해 셀 색상 지정
  491. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#99ccff";
  492. }
  493. //Census 미등록 환자
  494. if(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/censusck") == "Y"){
  495. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#ffefd6";
  496. }
  497. if(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/recovwardcd") != ""){
  498. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#ffff99";
  499. }
  500. //활력징후 대상자
  501. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/actsymp") == "Y") {
  502. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("bedposcnts") , i, nursemaininfo.colRef("bedposcnts")) = "#ff0000";
  503. }
  504. /*+ 기호표시 */
  505. // 혈액준비환자 아이콘표시
  506. var blodprep = model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn");
  507. if (blodprep == "Y") {
  508. model.setValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn", "");
  509. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("blodprepyn")) = "../../../emr/commonweb/images/blood.gif";
  510. } else {
  511. //model.setValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn", "");
  512. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("blodprepyn")) = "";
  513. }
  514. //메모기호 표시
  515. if(MemoUseYn == "Y"){
  516. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/memo") == "Y"){
  517. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("memoyn")) = "../../../com/commonweb/images/icon_list.gif";
  518. }else{
  519. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("memoyn")) = "";
  520. }
  521. }
  522. // 외래입원장 기로 표시를 함으로써 삭제 처리
  523. // 외래입원장표시
  524. //if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/outreq") == "Y") {
  525. //nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("patnm") , i, nursemaininfo.colRef("patnm")) = "#999999";
  526. //}
  527. // 부척합 검체 컬럼 색상 변경_손성훈.
  528. if (nursemaininfo.valueMatrix(i,nursemaininfo.colRef("unablspc")) == "[부]") {
  529. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("unablspc") , i, nursemaininfo.colRef("unablspc")) = "#ff9900";
  530. } else {
  531. if ( nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("unablspc") , i, nursemaininfo.colRef("unablspc")) == "#ff9900") {
  532. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("unablspc") , i, nursemaininfo.colRef("unablspc")) = "#ffffff"
  533. }
  534. }
  535. }
  536. }else{
  537. if ( instUseForJci == "Y" ){
  538. grup_help012.visible = true;
  539. } else {
  540. grup_help2.visible = true;
  541. }
  542. for(i= 1 ; i < iRow ; i ++ ){
  543. if ( instUseForJci == "Y" ){
  544. //체류시간 별 환자에 대해 셀 색상 지정
  545. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#"+ model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/color012");
  546. } else {
  547. if(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/stattmck") == "Y"){
  548. //체류시간 6시간 이상 체류한 환자에 대해 셀 색상 지정
  549. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#deffde";
  550. }
  551. }
  552. if(model.getValue("/root/main/nursemainlist/nursemaininfo["+i+"]/censusck") == "Y"){
  553. //Census 미등록 환자
  554. nursemaininfo.cellstyle("background-color", i, 0, i, nursemaininfo.colRef("nplan")) = "#ffefd6";
  555. }
  556. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/recovwardcd") != "") {
  557. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("recovwardcd") , i, nursemaininfo.colRef("patnm")) = "#ff0000";
  558. }
  559. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/actsymp") == "Y") {
  560. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("bedposcnts") , i, nursemaininfo.colRef("bedposcnts")) = "#ff0000";
  561. }
  562. // 입원장 발행 의사가 타과 의사 지정을 할 경우 처리
  563. //20110617_KNUH_Start dark9258 입원장 빨간색 칠하는 부분 삭제.
  564. /*
  565. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/erdocyn") == "Y") {
  566. nursemaininfo.cellstyle("color", i,nursemaininfo.colRef("inreq") , i, nursemaininfo.colRef("inreq")) = "#ff0000";
  567. }
  568. */
  569. // 혈액준비환자 아이콘표시
  570. var blodprep = model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn");
  571. if (blodprep == "Y") {
  572. model.setValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn", "");
  573. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("blodprepyn")) = "../../../emr/commonweb/images/blood.gif";
  574. } else {
  575. //model.setValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/blodprepyn", "");
  576. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("blodprepyn")) = "";
  577. }
  578. //메모기호 표시
  579. if(MemoUseYn == "Y"){
  580. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + i + "]/memo") == "Y"){
  581. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("memoyn")) = "../../../com/commonweb/images/icon_list.gif";
  582. }else{
  583. nursemaininfo.cellstyle("background-image", i , nursemaininfo.colRef("memoyn")) = "";
  584. }
  585. }
  586. // 부척합 검체 컬럼 색상 변경_손성훈.
  587. if (nursemaininfo.valueMatrix(i,nursemaininfo.colRef("unablspc")) == "[부]") {
  588. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("unablspc") , i, nursemaininfo.colRef("unablspc")) = "#ff9900";
  589. } else {
  590. if ( nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("unablspc") , i, nursemaininfo.colRef("unablspc")) == "#ff9900") {
  591. nursemaininfo.cellstyle("background-color", i,nursemaininfo.colRef("unablspc") , i, nursemaininfo.colRef("unablspc")) = "#ffffff"
  592. }
  593. }
  594. }
  595. }
  596. }
  597. //혈액준비환자 & 입원대기 환자 조회
  598. //submit("TRMNE00107");
  599. //submit("TRMNE00108");
  600. var patnm = "";
  601. if(getNodesetCount("/root/main/topinfolistblod/nursemainblodlist") > 0 ){
  602. for( i = 1 ; i <= getNodesetCount("/root/main/topinfolistblod/nursemainblodlist") ; i ++ ){
  603. if(patnm == ""){
  604. patnm += model.getValue("/root/main/topinfolistblod/nursemainblodlist["+i+"]/patnm");
  605. }else{
  606. patnm += ", " + model.getValue("/root/main/topinfolistblod/nursemainblodlist["+i+"]/patnm");
  607. }
  608. }
  609. tar_blodprep.value = patnm;
  610. }
  611. // 부적합검체 등록 환자 조회_손성훈
  612. var spcPatnm = "";
  613. if(getNodesetCount("/root/main/topunablspc/nursemainspclist") > 0) {
  614. for( var k = 1 ; k <= getNodesetCount("/root/main/topunablspc/nursemainspclist") ; k++){
  615. if(spcPatnm == ""){
  616. spcPatnm += model.getValue("/root/main/topunablspc/nursemainspclist["+k+"]/patnm");
  617. var patcnt = 1;
  618. }else{
  619. spcPatnm += ", "+ model.getValue("/root/main/topunablspc/nursemainspclist["+k+"]/patnm");
  620. patcnt += 1;
  621. }
  622. }
  623. cap_spcnt.text = "["+patcnt+"]";
  624. tar_unablspc.value = spcPatnm;
  625. } else {
  626. cap_spcnt.text = "";
  627. tar_unablspc.value = "";
  628. }
  629. //20110209 경북대
  630. setParameter("SMMNR00600_Param", model.getValue("/root/main/cond/section"));
  631. }
  632. /**
  633. * @group :
  634. * @ver : 2007.06.07
  635. * @by : 양천덕
  636. * @---------------------------------------------------
  637. * @type : function
  638. * @access : public
  639. * @desc : 화면상단정보설정
  640. * @param :
  641. * @return :
  642. * @---------------------------------------------------
  643. */
  644. function fSetParam(pFlag){
  645. if(pFlag == "nm"){
  646. // 입원환자 화면상단정보 설정
  647. if(nursemaininfo.row < 1){
  648. return;
  649. } else {
  650. var sindschacptstat = model.getValue("/root/main/cond/indschacptstat" ); // 재원구분
  651. var sOrdtype = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/ordtype" );
  652. var sPid = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/pid" );
  653. var sIndd = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/indd" );
  654. var sCretno = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/cretno" );
  655. var sInstcd = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/instcd" );
  656. var sSrchdd = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/dschdd" );
  657. var param = sOrdtype + "▦"
  658. + sPid + "▦"
  659. + sIndd + "▦"
  660. + sCretno + "▦"
  661. + sInstcd + "▦"
  662. + sSrchdd + "▦" ;
  663. setParameter("condparam", param);
  664. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  665. //-------------------------------------------------------------
  666. // 간호 일지 Type 2
  667. // 상단 정보 수정할때 간호 일지 정보도 같이 변경
  668. // 2009 09 15
  669. //-------------------------------------------------------------
  670. //-------------------------------------------
  671. var curNurType2Obj = getOpenWindow("SMMNR03400"); //간호 타입2 화면 object loading
  672. if(curNurType2Obj != null){ //간호 타입2 화면 refresh ;
  673. curNurType2Obj.javascript.fInitialize("init");
  674. } //간호 타입2 화면 refresh;
  675. var curNurOpCnfmObj = getOpenWindow("SMMNP00200");
  676. if(curNurOpCnfmObj != null){//준비확인이 열려있으면 상단 환자로 재조회2010.01.04 K.J.M
  677. curNurOpCnfmObj.javascript.fFormInit();
  678. }
  679. //부적합 검체 더블 클릭 시 검체확인 화면 _손성훈.
  680. if (nursemaininfo.valueMatrix(nursemaininfo.row,nursemaininfo.col) == "[부]"){
  681. setParameter("SMMNW00129_PARM_PID", model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/pid"));
  682. setParameter("SMMNW00129_PARM_INDD", model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/indd"));
  683. modal("SMMNW00129");
  684. fSeletedSrcTool()
  685. }
  686. }
  687. }else if(pFlag == "ec"){
  688. if(grd_patlist.row < 1){
  689. return;
  690. } else {
  691. var sOrdtype = model.getValue("/root/main/ercensuslist/erpatientlist["+grd_patlist.row+"]/ordtype" );
  692. var sPid = model.getValue("/root/main/ercensuslist/erpatientlist["+grd_patlist.row+"]/pid" );
  693. var sIndd = model.getValue("/root/main/ercensuslist/erpatientlist["+grd_patlist.row+"]/indd" );
  694. var sCretno = model.getValue("/root/main/ercensuslist/erpatientlist["+grd_patlist.row+"]/cretno" );
  695. var sInstcd = model.getValue("/root/main/ercensuslist/erpatientlist["+grd_patlist.row+"]/instcd" );
  696. var sSrchdd = model.getValue("/root/main/ercensuslist/erpatientlist["+grd_patlist.row+"]/dschdd" );
  697. var param = sOrdtype + "▦"
  698. + sPid + "▦"
  699. + sIndd + "▦"
  700. + sCretno + "▦"
  701. + sInstcd + "▦"
  702. + sSrchdd + "▦" ;
  703. setParameter("condparam", param);
  704. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  705. //-------------------------------------------------------------
  706. // 간호 일지 Type 2
  707. // 상단 정보 수정할때 간호 일지 정보도 같이 변경
  708. // 2009 09 15
  709. //-------------------------------------------------------------
  710. //-------------------------------------------
  711. var curNurType2Obj = getOpenWindow("SMMNR03400"); //간호 타입2 화면 object loading
  712. if(curNurType2Obj != null){ //간호 타입2 화면 refresh ;
  713. curNurType2Obj.javascript.fInitialize("init");
  714. } //간호 타입2 화면 refresh;
  715. var curNurOpCnfmObj = getOpenWindow("SMMNP00200");
  716. if(curNurOpCnfmObj != null){//준비확인이 열려있으면 상단 환자로 재조회2010.01.04 K.J.M
  717. curNurOpCnfmObj.javascript.fFormInit();
  718. }
  719. }
  720. }
  721. //20110905_KNUH_Start
  722. var curNurKadexObj = getOpenWindow("SMMNB00200");
  723. if(curNurKadexObj != null){//카덱스
  724. curNurKadexObj.javascript.fInitialize();
  725. }
  726. }
  727. /**
  728. * @group :
  729. * @ver : 2007.06.07
  730. * @by : 양천덕
  731. * @---------------------------------------------------
  732. * @type : function
  733. * @access : public
  734. * @desc : 속성 조회
  735. * @param : Census 그리드 클릭시 정보 조회
  736. * @return :
  737. * @---------------------------------------------------
  738. */
  739. function fSearchPatienInfo(pFlag){
  740. var xPathPationList = "/root/main/ercensuslist/erpatientlist";
  741. var iRow = grd_patlist.row;
  742. var sRow = grd_patlist.rows;
  743. if(pFlag == ""){
  744. pFlag = "ec";
  745. }
  746. // 의사호출
  747. if(pFlag == "refresh"){
  748. var sSrchData = "";
  749. var sSrchHeader = "pid▦indd▦cretno▩";
  750. var sSrchData = model.getValue("/root/main/ercensusinfo/patinfo/pid" )+"▦"
  751. + model.getValue("/root/main/ercensusinfo/patinfo/indd" )+"▦"
  752. + model.getValue("/root/main/ercensusinfo/patinfo/cretno")+"▩";
  753. model.removenode("/root/send");
  754. model.makeValue("/root/send/srchinfo",sSrchHeader+sSrchData );
  755. submit("TRMNE00104");
  756. var chosddck = model.getValue("/root/main/ercensusinfo/patinfo/chosdd") ;
  757. var bedinck = model.getValue("/root/main/ercensusinfo/patinfo/bedposflag");
  758. if(chosddck == "" && bedinck != "") {
  759. model.setValue("/root/main/ercensusinfo/patinfo/chosdd", model.getValue("/root/main/ercensusinfo/patinfo/indd") );
  760. model.setValue("/root/main/ercensusinfo/patinfo/chostm", model.getValue("/root/main/ercensusinfo/patinfo/intm") );
  761. }
  762. model.refresh();
  763. fButtonSettion("A");
  764. fInputRefresh();
  765. return;
  766. }
  767. // ER Census
  768. if(pFlag == "ec") {
  769. if(sRow == "1"){
  770. return;
  771. } else {
  772. var sSrchData = "";
  773. var sSrchHeader = "pid▦indd▦cretno▦instcd▩";
  774. var sSrchData = model.getValue(xPathPationList+"["+iRow+"]/pid" )+"▦"
  775. + model.getValue(xPathPationList+"["+iRow+"]/indd" )+"▦"
  776. + model.getValue(xPathPationList+"["+iRow+"]/cretno")+"▦"
  777. + model.getValue(xPathPationList+"["+iRow+"]/instcd")+"▩";
  778. model.removenode("/root/send");
  779. model.makeValue("/root/send/srchinfo",sSrchHeader+sSrchData );
  780. submit("TRMNE00104");
  781. var chosddck = model.getValue("/root/main/ercensusinfo/patinfo/chosdd") ;
  782. var bedinck = model.getValue("/root/main/ercensusinfo/patinfo/bedposflag");
  783. if(chosddck == "" && bedinck != "") {
  784. model.setValue("/root/main/ercensusinfo/patinfo/chosdd", model.getValue("/root/main/ercensusinfo/patinfo/indd") );
  785. model.setValue("/root/main/ercensusinfo/patinfo/chostm", model.getValue("/root/main/ercensusinfo/patinfo/intm") );
  786. }
  787. // 삭제된 경우는 삭제처리 보이도록
  788. opt_delyn.visible = false;
  789. var delyn = model.getValue("/root/main/ercensusinfo/patinfo/incncldtcheck"); // 삭제여부
  790. if (delyn == "Y") {
  791. opt_delyn.visible = true;
  792. }
  793. model.refresh();
  794. fButtonSettion("A");
  795. fInputRefresh();
  796. return;
  797. }
  798. // Nurse Main
  799. } else if (pFlag == "nm") {
  800. //alert("test N");
  801. } else if (pFlag == "p_ec") {
  802. var sSrchData = "";
  803. var sSrchHeader = "pid▦indd▦cretno▩";
  804. var sSrchData = model.getValue("/root/main/cond/pid" )+"▦"
  805. + model.getValue("/root/main/cond/indd" )+"▦"
  806. + model.getValue("/root/main/cond/cretno")+"▩";
  807. model.removenode("/root/send");
  808. model.makeValue("/root/send/srchinfo",sSrchHeader+sSrchData );
  809. submit("TRMNE00104");
  810. var chosddck = model.getValue("/root/main/ercensusinfo/patinfo/chosdd") ;
  811. var bedinck = model.getValue("/root/main/ercensusinfo/patinfo/bedposflag");
  812. if(chosddck == "" && bedinck != "") {
  813. model.setValue("/root/main/ercensusinfo/patinfo/chosdd", model.getValue("/root/main/ercensusinfo/patinfo/indd") );
  814. model.setValue("/root/main/ercensusinfo/patinfo/chostm", model.getValue("/root/main/ercensusinfo/patinfo/intm") );
  815. }
  816. // 삭제된 경우는 삭제처리 보이도록
  817. opt_delyn.visible = false;
  818. var delyn = model.getValue("/root/main/ercensusinfo/patinfo/incncldtcheck"); // 삭제여부
  819. if (delyn == "Y") {
  820. opt_delyn.visible = true;
  821. }
  822. model.refresh();
  823. fButtonSettion("A");
  824. fInputRefresh();
  825. return;
  826. }
  827. }
  828. /**
  829. * @group :
  830. * @ver : 2007.06.07
  831. * @by : 양천덕
  832. * @---------------------------------------------------
  833. * @type : function
  834. * @access : public
  835. * @desc : Census 화면 버튼,입력 창 컨트롤
  836. * @param :
  837. * @return :
  838. * @---------------------------------------------------
  839. */
  840. function fButtonSettion(pFlag){
  841. if( model.getValue("/root/main/cond/indschacptstat") == "4" ){
  842. btn_save.disabled = true; //상단 저장 버튼 비활성화
  843. //퇴실취소 버튼 비활성화
  844. btn_outrmcncl1.disabled = true;
  845. btn_outrmcncl2.disabled = true;
  846. btn_outrmcncl3.disabled = true;
  847. //재방방 체크박스 비활성화
  848. chk_revisit1.disabled = true;
  849. chk_revisit2.disabled = true;
  850. //방문일지 비활성화
  851. int_chosdd1.disabled = true;
  852. int_chostm1.disabled = true;
  853. btn_saverow1.disabled = true;
  854. btn_updtrow1.disabled = true;
  855. btn_callpop1.disabled = true;
  856. //방문일지 1차 재방문 비활성화
  857. int_chosdd2.disabled = true;
  858. int_chostm2.disabled = true;
  859. btn_saverow2.disabled = true;
  860. btn_updtrow2.disabled = true;
  861. btn_callpop2.disabled = true;
  862. //방문일지 2차 재방문 비활성화
  863. int_chosdd3.disabled = true;
  864. int_chostm3.disabled = true;
  865. btn_saverow3.disabled = true;
  866. btn_updtrow3.disabled = true;
  867. btn_callpop3.disabled = true;
  868. //의사 호출 부분 메인진료과 변경 부분 비활성화
  869. for(var i = 1 ; i <= grd_calldoc1.rows ; i ++){
  870. grd_calldoc1.isReadOnly(i, grd_calldoc1.colRef("mainyn")) = true;
  871. }
  872. for(var i = 1 ; i <= grd_calldoc2.rows ; i ++){
  873. grd_calldoc2.isReadOnly(i, grd_calldoc2.colRef("mainyn")) = true;
  874. }
  875. for(var i = 1 ; i <= grd_calldoc3.rows ; i ++){
  876. grd_calldoc3.isReadOnly(i, grd_calldoc3.colRef("mainyn")) = true;
  877. }
  878. }else{
  879. if(model.getValue("/root/main/ercensusinfo/patinfo/stattm") == ""){
  880. btn_updtrow1.visible = false;
  881. btn_saverow1.visible = true;
  882. }else{
  883. btn_updtrow1.visible = true;
  884. btn_saverow1.visible = false;
  885. }
  886. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit1stattm") == ""){
  887. btn_updtrow2.visible = false;
  888. btn_saverow2.visible = true;
  889. }else{
  890. btn_updtrow2.visible = true;
  891. btn_saverow2.visible = false;
  892. }
  893. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit2stattm") == ""){
  894. btn_updtrow3.visible = false;
  895. btn_saverow3.visible = true;
  896. }else{
  897. btn_updtrow3.visible = true;
  898. btn_saverow3.visible = false;
  899. }
  900. if(model.getValue("/root/main/ercensusinfo/patinfo/outrmdt") == ""){
  901. btn_outrmcncl1.disabled = true;
  902. chk_revisit1.disabled = true;
  903. }else{
  904. btn_outrmcncl1.disabled = false;
  905. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit1stattm") == ""){
  906. chk_revisit1.disabled = false;
  907. } else {
  908. chk_revisit1.disabled = true;
  909. }
  910. }
  911. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit1outrmdt") == ""){
  912. btn_outrmcncl2.disabled = true;
  913. chk_revisit2.disabled = true;
  914. }else{
  915. btn_outrmcncl2.disabled = false;
  916. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit2stattm") == ""){
  917. chk_revisit2.disabled = false;
  918. } else {
  919. chk_revisit2.disabled = true;
  920. }
  921. }
  922. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit2outrmdt") == ""){
  923. btn_outrmcncl3.disabled = true;
  924. }else{
  925. btn_outrmcncl3.disabled = false;
  926. }
  927. if(pFlag = "A"){
  928. if( model.getValue("/root/main/ercensusinfo/patinfo/bedposflag") == ""){
  929. int_chosdd1.disabled = true;
  930. int_chostm1.disabled = true;
  931. btn_addrow1.disabled = true;
  932. btn_delrow1.disabled = true;
  933. btn_introw1.disabled = true;
  934. btn_updtrow1.disabled = true;
  935. btn_saverow1.disabled = true;
  936. } else {
  937. int_chosdd1.disabled = false;
  938. int_chostm1.disabled = false;
  939. btn_addrow1.disabled = false;
  940. btn_delrow1.disabled = false;
  941. btn_introw1.disabled = false;
  942. btn_updtrow1.disabled = false;
  943. btn_saverow1.disabled = false;
  944. }
  945. if( model.getValue("/root/main/ercensusinfo/patinfo/revisit1") == "Y" ) {
  946. int_chosdd2.disabled = false;
  947. int_chostm2.disabled = false;
  948. btn_addrow2.disabled = false;
  949. btn_delrow2.disabled = false;
  950. btn_introw2.disabled = false;
  951. btn_updtrow2.disabled = false;
  952. btn_saverow2.disabled = false;
  953. btn_callpop2.disabled = false;
  954. } else {
  955. int_chosdd2.disabled = true;
  956. int_chostm2.disabled = true;
  957. btn_addrow2.disabled = true;
  958. btn_delrow2.disabled = true
  959. btn_introw2.disabled = true
  960. btn_updtrow2.disabled = true;
  961. btn_saverow2.disabled = true;
  962. btn_callpop2.disabled = true;
  963. }
  964. if( model.getValue("/root/main/ercensusinfo/patinfo/revisit2") == "Y" ) {
  965. int_chosdd3.disabled = false;
  966. int_chostm3.disabled = false;
  967. btn_introw3.disabled = false;
  968. btn_delrow3.disabled = false;
  969. btn_addrow3.disabled = false;
  970. btn_saverow3.disabled = false;
  971. btn_updtrow3.disabled = false;
  972. btn_callpop3.disabled = false;
  973. } else {
  974. int_chosdd3.disabled = true;
  975. int_chostm3.disabled = true;
  976. btn_introw3.disabled = true;
  977. btn_delrow3.disabled = true;
  978. btn_addrow3.disabled = true;
  979. btn_saverow3.disabled = true;
  980. btn_updtrow3.disabled = true;
  981. btn_callpop3.disabled = true;
  982. }
  983. }
  984. if(pFlag == "R1"){
  985. int_chosdd2.disabled = true;
  986. int_chostm2.disabled = true;
  987. int_chosdd3.disabled = true;
  988. int_chostm3.disabled = true;
  989. btn_addrow2.disabled = true;
  990. btn_delrow2.disabled = true;
  991. btn_introw2.disabled = true;
  992. btn_updtrow2.disabled = true;
  993. btn_saverow2.disabled = true;
  994. btn_introw3.disabled = true;
  995. btn_delrow3.disabled = true;
  996. btn_addrow3.disabled = true;
  997. btn_saverow3.disabled = true;
  998. btn_updtrow3.disabled = true;
  999. btn_callpop2.disabled = true;
  1000. btn_callpop3.disabled = true;
  1001. }
  1002. if(pFlag == "R2"){
  1003. int_chosdd3.disabled = true;
  1004. int_chostm3.disabled = true;
  1005. btn_introw3.disabled = true;
  1006. btn_delrow3.disabled = true;
  1007. btn_addrow3.disabled = true;
  1008. btn_saverow3.disabled = true;
  1009. btn_updtrow3.disabled = true;
  1010. btn_callpop2.disabled = true;
  1011. btn_callpop3.disabled = true;
  1012. }
  1013. }
  1014. }
  1015. /**
  1016. * @group :
  1017. * @ver : 2007.06.07
  1018. * @by : 양천덕
  1019. * @---------------------------------------------------
  1020. * @type : function
  1021. * @access : public
  1022. * @desc : Census 화면 입력창 Refresh 부분
  1023. * @param :
  1024. * @return :
  1025. * @---------------------------------------------------
  1026. */
  1027. function fInputRefresh(){
  1028. int_chosdd2.refresh();
  1029. int_chostm2.refresh();
  1030. int_chosdd3.refresh();
  1031. int_chostm3.refresh();
  1032. }
  1033. /**
  1034. * @group :
  1035. * @ver : 2007.06.07
  1036. * @by : 양천덕
  1037. * @---------------------------------------------------
  1038. * @type : function
  1039. * @access : public
  1040. * @desc : 왼쪽 마우스 클릭 메뉴
  1041. * @param :
  1042. * @return :
  1043. * @---------------------------------------------------
  1044. */
  1045. function fPopupMenuInfo(){
  1046. var sCol = nursemaininfo.mouseCol;
  1047. if(event.button == 3){
  1048. if(sCol == nursemaininfo.colRef("orddrid")){
  1049. if(nursemaininfo.isCell(event.target) && nursemaininfo.mouseRow >= nursemaininfo.fixedrows){
  1050. setPopupMenu("nursemaininfo", false, "/root/codedata/popupmenu/grid01/item", "name", "func");
  1051. }else{
  1052. window.setPopupMenu(false);
  1053. }
  1054. }else{
  1055. if(nursemaininfo.isCell(event.target) && nursemaininfo.mouseRow >= nursemaininfo.fixedrows){
  1056. setPopupMenu("nursemaininfo", false, "/root/codedata/popupmenu/grid02/item", "name", "func");
  1057. }else{
  1058. window.setPopupMenu(false);
  1059. }
  1060. }
  1061. }
  1062. }
  1063. /**
  1064. * @group :
  1065. * @ver : 2007.06.07
  1066. * @by : 양천덕
  1067. * @---------------------------------------------------
  1068. * @type : function
  1069. * @access : publicㅑㄹ
  1070. * @desc : Exel 저장
  1071. * @param :
  1072. * @return :
  1073. * @---------------------------------------------------
  1074. */
  1075. function fSaveExcel(){
  1076. var fileName = "";
  1077. var sIndschacptstat = model.getValue("/root/main/cond/indschacptstat");
  1078. if(sIndschacptstat == "1"){
  1079. fileName = window.fileDialog("save", ",", false, "EMC 메인(재원)_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  1080. }else if (sIndschacptstat == "2"){
  1081. fileName = window.fileDialog("save", ",", false, "EMC 메인(퇴원진행)_"+getCurrentDate(), "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  1082. }else if (sIndschacptstat == "3"){
  1083. fileName = window.fileDialog("save", ",", false, "EMC 메인(퇴원)_"+int_outdt.value, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  1084. }
  1085. if (fileName != "") {
  1086. nursemaininfo.saveExcel(fileName, "SheetName", true, true, "", "", false);
  1087. }
  1088. }
  1089. /**
  1090. * @group :
  1091. * @ver : 2007.06.07
  1092. * @by : 양천덕
  1093. * @---------------------------------------------------
  1094. * @type : function
  1095. * @access : public
  1096. * @desc : Bed 정보 선택 Popup
  1097. * @param :
  1098. * @return :
  1099. * @---------------------------------------------------
  1100. */
  1101. function fPopupBed(){
  1102. xOldPosflagcd = model.getValue("/root/main/ercensusinfo/patinfo/bedposflagcd");
  1103. xOldPosflag = model.getValue("/root/main/ercensusinfo/patinfo/bedposflag");
  1104. var vktas = model.getValue("/root/main/ercensusinfo/patinfo/ktas");
  1105. if(vktas != ""){
  1106. setParameter("ktas", model.getValue("/root/main/ercensusinfo/patinfo/ktas"));
  1107. }
  1108. window.load( "SMMNE03600_Bed위치.xrw", "modeless" , "test", "left:"+ event.screenX+"px; top:"+event.screenY+"px; width:600px; height:600px;");
  1109. }
  1110. /**
  1111. * @group :
  1112. * @ver : 2007.06.07
  1113. * @by : 양천덕
  1114. * @---------------------------------------------------
  1115. * @type : function
  1116. * @access : public
  1117. * @desc : Census 저장, 수정
  1118. * @param :
  1119. * @return :
  1120. * @---------------------------------------------------
  1121. */
  1122. function fSaveCensusInfo(pFlag){
  1123. // 키값 정의
  1124. var sPid = model.getValue("/root/main/ercensusinfo/patinfo/pid" ); // 등록번호
  1125. var sIndd = model.getValue("/root/main/ercensusinfo/patinfo/indd" ); // 입원일자
  1126. var sOrddd = model.getValue("/root/main/ercensusinfo/patinfo/orddd" ); // 진료일자
  1127. var sCretno = model.getValue("/root/main/ercensusinfo/patinfo/cretno"); // 생성번호
  1128. var sIntm = model.getValue("/root/main/ercensusinfo/patinfo/intm" ); // 입원시간
  1129. // 실제 입력값 설정
  1130. var sBedposflag = model.getValue("/root/main/ercensusinfo/patinfo/bedposflag" ); // Bed위치내용
  1131. var sOutcureyn = model.getValue("/root/main/ercensusinfo/patinfo/outcureyn" ); // 외래처치여부
  1132. var sCpryn = model.getValue("/root/main/ercensusinfo/patinfo/cpryn" ); // CPR여부
  1133. var sElbulbodpatnm = model.getValue("/root/main/ercensusinfo/patinfo/elbulbodpatnm" ); // 전광판용 환자명
  1134. var sElbulbodcccnts = model.getValue("/root/main/ercensusinfo/patinfo/elbulbodcccnts"); // 전광판용주호소
  1135. var sNurscccnts = model.getValue("/root/main/ercensusinfo/patinfo/nurscccnts" ); // 간호사 입력 주호소
  1136. var sInwaitresncnts = model.getValue("/root/main/ercensusinfo/patinfo/inwaitresncnts"); // 입원대기사유내용
  1137. var sSkilfact = model.getValue("/root/main/ercensusinfo/patinfo/skilfact" ); // remart
  1138. var sSpcltest = model.getValue("/root/main/ercensusinfo/patinfo/spcltest" ); // 특수검사
  1139. var sBedposflagcd = model.getValue("/root/main/ercensusinfo/patinfo/bedposflagcd" ); // Bed위치
  1140. var sBedcd = model.getValue("/root/main/ercensusinfo/patinfo/bedcd" ); // 원무bed위치내용
  1141. var sExtrecyn = model.getValue("/root/main/ercensusinfo/patinfo/extrecyn" ); // 외부 의무기록 여부 y,n _ 손성훈.
  1142. var sExtrecsaveyn = model.getValue("/root/main/ercensusinfo/patinfo/extrecsaveyn" ); // 외부 의무기록 저장 여부 y,n _ 손성훈.
  1143. var sExtrecrtnyn = model.getValue("/root/main/ercensusinfo/patinfo/extrecrtnyn" ); // 외부 의무기록 반환 여부 y,n _ 손성훈.
  1144. var sExtemryn = model.getValue("/root/main/ercensusinfo/patinfo/extemryn" ); // 외부 영상기록 여부 y,n _ 손성훈.
  1145. var sExtemrsaveyn = model.getValue("/root/main/ercensusinfo/patinfo/extemrsaveyn" ); // 외부 영상기록 저장 여부 y,n _ 손성훈.
  1146. var sExtemrrtnyn = model.getValue("/root/main/ercensusinfo/patinfo/extemrrtnyn" ); // 외부 영상기록 반환 여부 y,n _ 손성훈.
  1147. var sBedGrupcd = model.getValue("/root/main/ercensusinfo/patinfo/bedgrupcd" ); // bed그룹코드(응급입원실/EICU인 경우(I)와 응급실인 경우(E) 구분)_20110127_SMY
  1148. var sCprTims = model.getValue("/root/main/ercensusinfo/patinfo/cprtims" ); // CPR횟수
  1149. // 161020_ 칠곡 응급실 구역변경 관련 수정
  1150. var spamroomcd = model.getValue("/root/main/ercensusinfo/patinfo/pamroomcd" ); // 응급실 구역정보(roomcd)
  1151. var spambedcd = model.getValue("/root/main/ercensusinfo/patinfo/pambedcd" ); // 응급실 병상정보(bedcd)
  1152. var spamroomtypecd = model.getValue("/root/main/ercensusinfo/patinfo/pamroomtypecd" ); // 병실형태 코드
  1153. var spamroomgrdecd = model.getValue("/root/main/ercensusinfo/patinfo/pamroomgrdecd" ); // 병실등급 코드
  1154. var spamflag = model.getValue("/root/main/ercensusinfo/patinfo/pamflag" ); // 구역변경 flag
  1155. //alert("spamroomcd : " + spamroomcd + " / spambedcd : " + spambedcd + " / spamroomtypecd : " + spamroomtypecd + "/ spamroomgrdecd : " + spamroomgrdecd);
  1156. if(sPid == "" || sPid == null ) {
  1157. messageBox("환자가 선택되지", "E007");
  1158. model.setFocus("grd_patlist");
  1159. return;
  1160. }
  1161. if((sBedposflag == "" || sBedposflag == null) && (pFlag == "patinfoU" || pFlag == "patinfoI")) {
  1162. messageBox("Bed위치는", "I003");
  1163. model.setFocus("int_bedposflag");
  1164. return;
  1165. }
  1166. var cpryn = rdo_cpryn.value;
  1167. var cprtims = cmb_cprtims.value;
  1168. if(cpryn == "Y" && cprtims == 0) {
  1169. messageBox("CPR 횟수를 입력하세요", "I");
  1170. model.setFocus("cmb_cprtims");
  1171. return;
  1172. }
  1173. var sCensusInfoHeader1 = "stat▦pid▦orddd▦cretno▦indd▦intm▦elbulbodpatnm▦nurscccnts▦bedposflag▦outcureyn▦cpryn▦elbulbodcccnts▦inwaitresncnts▦skilfact▦spcltest▦bedposflagcd▦bedcd▦extrecyn▦extrecsaveyn▦extrecrtnyn▦extemryn▦extemrsaveyn▦extemrrtnyn▦bedgrupcd▦cprtims▦pamroomcd▦pambedcd▦pamroomtypecd▦pamroomgrdecd▦pamflag▩";
  1174. var sCensusInfoHeader = "stat▦pid▦orddd▦cretno▦indd▦intm▦elbulbodpatnm▦nurscccnts▦bedposflag▦outcureyn▦cpryn▦elbulbodcccnts▦inwaitresncnts▦skilfact▦spcltest▦bedposflagcd▦bedcd▦extrecyn▦extrecsaveyn▦extrecrtnyn▦extemryn▦extemrsaveyn▦extemrrtnyn▦bedgrupcd▦cprtims▩";
  1175. // census 수정
  1176. if(pFlag == "patinfoU" ){
  1177. var sInsertdata = "U▦" // 상태
  1178. + sPid +"▦" // 등록번호
  1179. + sOrddd +"▦" // 진료일자
  1180. + sCretno +"▦" // 생성번호
  1181. + sIndd +"▦" // 입원일자
  1182. + sIntm +"▦" // 입원시간
  1183. + sElbulbodpatnm +"▦" // 전광판용 환자명
  1184. + sNurscccnts +"▦" // 간호사 입력 주호소
  1185. + sBedposflag +"▦" // Bed 위치
  1186. + sOutcureyn +"▦" // 외래처치 여부
  1187. + sCpryn +"▦" // CPR 여부
  1188. + sElbulbodcccnts +"▦" // 전광판용 주호소
  1189. + sInwaitresncnts +"▦" // 입원지원사유내역
  1190. + sSkilfact +"▦" // remart
  1191. + sSpcltest +"▦" // 특수검사
  1192. + sBedposflagcd +"▦" // bed 위치코드
  1193. + sBedcd +"▦" // 원무병상코드
  1194. + sExtrecyn +"▦" // 외부 의무기록 지참여부
  1195. + sExtrecsaveyn +"▦" // 외부 의무기록 저장여부 확인
  1196. + sExtrecrtnyn +"▦" // 외부 의무기록 반환 여부
  1197. + sExtemryn +"▦" // 외부 영상자료 지참여부
  1198. + sExtemrsaveyn +"▦" // 외부 영상자료 저장여부 확인
  1199. + sExtemrrtnyn +"▦" // 외부 영상자료 반환 여부
  1200. + sBedGrupcd +"▦"
  1201. + sCprTims +"▦" // Bed그룹코드
  1202. + spamroomcd +"▦" // 응급실 구역정보
  1203. + spambedcd +"▦" // 응급실 병상정보
  1204. + spamroomtypecd +"▦" // 병실형태 코드
  1205. + spamroomgrdecd +"▦" // 병실등급 코드
  1206. + spamflag +"▩"; // 병실등급 코드
  1207. model.removenode("/root/send");
  1208. model.makeValue("/root/send/censusinfo",sCensusInfoHeader1 + sInsertdata );
  1209. }
  1210. // census 등록
  1211. if(pFlag == "patinfoI"){
  1212. var sInsertdata = "I▦" // 상태
  1213. + sPid +"▦" // 등록번호
  1214. + sOrddd +"▦" // 진료일자
  1215. + sCretno +"▦" // 생성번호
  1216. + sIndd +"▦" // 입원일자
  1217. + sIntm +"▦" // 입원시간
  1218. + sElbulbodpatnm +"▦" // 전광판용 환자명
  1219. + sNurscccnts +"▦" // 간호사 입력 주호소
  1220. + sBedposflag +"▦" // Bed 위치
  1221. + sOutcureyn +"▦" // 외래처치 여부
  1222. + sCpryn +"▦" // CPR 여부
  1223. + sElbulbodcccnts +"▦" // 전광판용 주호소
  1224. + sInwaitresncnts +"▦" // 입원지원사유내역
  1225. + sSkilfact +"▦" // remart
  1226. + sSpcltest +"▦" // 특수검사
  1227. + sBedposflagcd +"▦" // bed 위치코드
  1228. + sBedcd +"▦" // 원무병상코드
  1229. + sExtrecyn +"▦" // 외부 의무기록 지참여부
  1230. + sExtrecsaveyn +"▦" // 외부 의무기록 저장여부 확인
  1231. + sExtrecrtnyn +"▦" // 외부 의무기록 반환 여부
  1232. + sExtemryn +"▦" // 외부 영상자료 지참여부
  1233. + sExtemrsaveyn +"▦" // 외부 영상자료 저장여부 확인
  1234. + sExtemrrtnyn +"▦" // 외부 영상자료 반환 여부
  1235. + sBedGrupcd +"▦"
  1236. + sCprTims +"▦" // Bed그룹코드
  1237. + spamroomcd +"▦" // 응급실 구역정보
  1238. + spambedcd +"▦" // 응급실 병상정보
  1239. + spamroomtypecd +"▦" // 병실형태 코드
  1240. + spamroomgrdecd +"▦" // 병실등급 코드
  1241. + spamflag +"▩"; // 병실등급 코드
  1242. model.removenode("/root/send");
  1243. model.makeValue("/root/send/censusinfo",sCensusInfoHeader1 + sInsertdata );
  1244. var chosddck = model.getValue("/root/main/ercensusinfo/patinfo/chosdd") ;
  1245. // 내원일시
  1246. if(chosddck == "") {
  1247. model.setValue("/root/main/ercensusinfo/patinfo/chosdd", model.getValue("/root/main/ercensusinfo/patinfo/indd") );
  1248. model.setValue("/root/main/ercensusinfo/patinfo/chostm", model.getValue("/root/main/ercensusinfo/patinfo/intm") );
  1249. }
  1250. }
  1251. // Triage/census 삭제 2008.09.10
  1252. if(pFlag == "patinfoD" ){
  1253. var sInsertdata = "D▦" // 상태
  1254. + sPid +"▦" // 등록번호
  1255. + sOrddd +"▦" // 진료일자
  1256. + sCretno +"▦" // 생성번호
  1257. + sIndd +"▦" // 입원일자
  1258. + sIntm +"▦" // 입원시간
  1259. + sElbulbodpatnm +"▦" // 전광판용 환자명
  1260. + sNurscccnts +"▦" // 간호사 입력 주호소
  1261. + sBedposflag +"▦" // Bed 위치
  1262. + sOutcureyn +"▦" // 외래처치 여부
  1263. + sCpryn +"▦" // CPR 여부
  1264. + sElbulbodcccnts +"▦" // 전광판용 주호소
  1265. + sInwaitresncnts +"▦" // 입원지원사유내역
  1266. + sSkilfact +"▦" // remart
  1267. + sSpcltest +"▦" // 특수검사
  1268. + sBedposflagcd +"▦" // bed 위치코드
  1269. + sBedcd +"▦" // 원무병상코드
  1270. + sExtrecyn +"▦" // 외부 의무기록 지참여부
  1271. + sExtrecsaveyn +"▦" // 외부 의무기록 저장여부 확인
  1272. + sExtrecrtnyn +"▦" // 외부 의무기록 반환 여부
  1273. + sExtemryn +"▦" // 외부 영상자료 지참여부
  1274. + sExtemrsaveyn +"▦" // 외부 영상자료 저장여부 확인
  1275. + sExtemrrtnyn +"▦" // 외부 영상자료 반환 여부
  1276. + sBedGrupcd +"▦"
  1277. + sCprTims +"▩"; // Bed그룹코드
  1278. model.removenode("/root/send");
  1279. model.makeValue("/root/send/censusinfo",sCensusInfoHeader + sInsertdata );
  1280. }
  1281. // Triage/census 삭제취소 2008.09.10
  1282. if(pFlag == "patinfoC" ){
  1283. var sInsertdata = "C▦" // 상태
  1284. + sPid +"▦" // 등록번호
  1285. + sOrddd +"▦" // 진료일자
  1286. + sCretno +"▦" // 생성번호
  1287. + sIndd +"▦" // 입원일자
  1288. + sIntm +"▦" // 입원시간
  1289. + sElbulbodpatnm +"▦" // 전광판용 환자명
  1290. + sNurscccnts +"▦" // 간호사 입력 주호소
  1291. + sBedposflag +"▦" // Bed 위치
  1292. + sOutcureyn +"▦" // 외래처치 여부
  1293. + sCpryn +"▦" // CPR 여부
  1294. + sElbulbodcccnts +"▦" // 전광판용 주호소
  1295. + sInwaitresncnts +"▦" // 입원지원사유내역
  1296. + sSkilfact +"▦" // remart
  1297. + sSpcltest +"▦" // 특수검사
  1298. + sBedposflagcd +"▦" // bed 위치코드
  1299. + sBedcd +"▦" // 원무병상코드
  1300. + sExtrecyn +"▦" // 외부 의무기록 지참여부
  1301. + sExtrecsaveyn +"▦" // 외부 의무기록 저장여부 확인
  1302. + sExtrecrtnyn +"▦" // 외부 의무기록 반환 여부
  1303. + sExtemryn +"▦" // 외부 영상자료 지참여부
  1304. + sExtemrsaveyn +"▦" // 외부 영상자료 저장여부 확인
  1305. + sExtemrrtnyn +"▦" // 외부 영상자료 반환 여부
  1306. + sBedGrupcd +"▩"; // Bed그룹코드
  1307. model.removenode("/root/send");
  1308. model.makeValue("/root/send/censusinfo",sCensusInfoHeader + sInsertdata );
  1309. }
  1310. //20110225 이선경 경북대 : 응급실 구역 멀티체크
  1311. var rendcd=model.getValue("/root/main/cond/section");
  1312. var chkdata=checkbox1.value;
  1313. var rendcdlist=rendcd.split(" ");
  1314. if (chkdata.substr(0,1) != "-") {
  1315. if (rendcd.length>0) {
  1316. for (var i=0; i<rendcdlist.length;i++) {
  1317. rendcd=rendcd.replace(" ","','");
  1318. }
  1319. rendcd="('" + rendcd + "')";
  1320. }
  1321. } else {
  1322. rendcd = "-";
  1323. }
  1324. var sSrchData = "";
  1325. var sSrchHeader = "flag▦section▦orddept▦orddrid▩";
  1326. var sSrchData = model.getValue("/root/main/cond/indschacptstat" ) +"▦"
  1327. //+ model.getValue("/root/main/cond/section" ) +"▦"
  1328. + rendcd +"▦"
  1329. + model.getValue("/root/main/cond/orddeptcd" ) +"▦"
  1330. + model.getValue("/root/main/cond/medispclid" ) +"▩";
  1331. model.makeValue("/root/send/mainsearchinfo", sSrchHeader + sSrchData);
  1332. if(submit("TXMNE00101")== true){
  1333. fSaveCallDoc("/chosdd", "/chostm", "/stattm", "0", "R1");
  1334. }else{
  1335. return;
  1336. }
  1337. //---------------------------------------------------------------------------------
  1338. //ER-EICU간 구역 변경이 이루어졌을 경우 간호기록으로 남긴다. 2013.10.22 KJS
  1339. //xOldPosflagcd VS sBedposflagcd
  1340. var oldSupCD = xOldPosflagcd.substr(0, 3) ;
  1341. var newSupCD = sBedposflagcd.substr(0, 3) ;
  1342. var recdt = getCurrentDate() + getCurrentTime().substr(0, 4);
  1343. if ( xOldPosflagcd != "" && oldSupCD != newSupCD && (oldSupCD == "BDD" || newSupCD == "BDD" || oldSupCD == "BDE" || newSupCD == "BDE" || oldSupCD == "BDT" || newSupCD == "BDT") ) {
  1344. fSetNrRecord ("move", oldSupCD, newSupCD, recdt);
  1345. }
  1346. //---------------------------------------------------------------------------------
  1347. //alert(sSrchToolStatus);
  1348. // 저장후 재조회
  1349. //fSearchPatienInfo("ec");
  1350. fSeletedSrcTool();
  1351. fButtonSettion("A");
  1352. grd_patlist.refresh();
  1353. var iRow = grd_patlist.rows;
  1354. var cRow = "";
  1355. for( i = 1 ; i < iRow + 1 ; i++ ){
  1356. if ( model.getValue("/root/main/ercensuslist/erpatientlist["+ i +"]/pid" ) == sPid){
  1357. cRow = i;
  1358. }
  1359. }
  1360. if(cRow == "" ){
  1361. return;
  1362. }else{
  1363. grd_patlist.row = cRow;
  1364. grd_patlist.topRow = cRow;
  1365. }
  1366. }
  1367. /**
  1368. * @group :
  1369. * @ver : 2007.06.07
  1370. * @by : 양천덕
  1371. * @---------------------------------------------------
  1372. * @type : function
  1373. * @access : public
  1374. * @desc : 사용자 조회popup
  1375. * @param :
  1376. * @return :
  1377. * @---------------------------------------------------
  1378. */
  1379. function fUserEnter(pPath, pNodeID,pNodeNM, pNodeDept, pNodeDeptNM, pDOC, pFlag) {
  1380. var pParam = fUseridPopupData("TRMNE00105","SMMNE00101", pDOC, pFlag);
  1381. //var pParam = fUseridPopupData("TRMNE00105","SMMNE00101", pDOC);
  1382. fUserDataSet(pParam, pPath+pNodeID,pPath+pNodeNM, pPath+pNodeDept, pPath+pNodeDeptNM, pDOC);
  1383. }
  1384. function fUseridPopup(pPath, pNodeID, pNodeNM, pNodeDept, pNodeDeptNM, pDOC, pFlag) {
  1385. var pParam = fShowModal("SMMNE00101", pFlag);
  1386. fUserDataSet(pParam, pPath+pNodeID,pPath+pNodeNM, pPath+pNodeDept, pPath+pNodeDeptNM, pDOC);
  1387. }
  1388. function fUseridFlag(pFlag){
  1389. setParameter("SPMNE00101_Param", pFlag);
  1390. }
  1391. function fGetValue(node, row, element) {
  1392. var rtnValue = model.getValue(node + "[" + row + "]/" + element);
  1393. return rtnValue;
  1394. }
  1395. /**
  1396. * @group :
  1397. * @ver : 2007.06.07
  1398. * @by : 양천덕
  1399. * @---------------------------------------------------
  1400. * @type : function
  1401. * @access : public
  1402. * @desc : 사용자 조회popup
  1403. * @param :
  1404. * @return :
  1405. * @---------------------------------------------------
  1406. */
  1407. function fUseridPopupData(pMapID, pProgID, pData, pFlag) {
  1408. var iParam="";
  1409. if (pData == "") {
  1410. return iParam;
  1411. }
  1412. model.removenode("/root/send");
  1413. model.makeValue("/root/send/searchitem", pData);
  1414. model.makeValue("/root/send/flag" , "all");
  1415. model.makeValue("/root/send/srchflag" , pFlag);
  1416. submit(pMapID);
  1417. var NodeCnt = instance1.selectSingleNode(xPathUser).childNodes.length;
  1418. var iNode = xPathUser + "/userlist";
  1419. switch(NodeCnt) {
  1420. case 0 : messageBox(pData + "에 해당하는 자료가", "I004");
  1421. break;
  1422. case 1 : iParam = fGetValue(iNode, 1, "userid" ) + "|"
  1423. + fGetValue(iNode, 1, "usernm" ) + "|"
  1424. + fGetValue(iNode, 1, "posinstnm") + "|"
  1425. + fGetValue(iNode, 1, "posinstcd") + "|"
  1426. + fGetValue(iNode, 1, "posdeptnm") + "|"
  1427. + fGetValue(iNode, 1, "posdeptcd") ;
  1428. break;
  1429. default : iParam = fShowModal(pProgID, pFlag);
  1430. }
  1431. return iParam;
  1432. }
  1433. function fShowModal(pProgID, pFlag) {
  1434. var xpos = event.screenX-100;
  1435. var ypos = event.screenY-100;
  1436. fUseridFlag(pFlag);
  1437. modal(pProgID, 1, xpos, ypos,pProgID, xPathUser, xPathUserPop);
  1438. var iProperties = getParameter("SendData");
  1439. return iProperties
  1440. }
  1441. function fUserDataSet(pData, pNodeID,pNodeNM, pNodeDept, pNodeDeptNM, pDoc, pFlag) {
  1442. var iSplit_Value = pData.split("|");
  1443. if (pData == "") {
  1444. model.setValue(pNodeNM, iSplit_Value[1]);
  1445. model.setValue(pNodeDeptNM, iSplit_Value[4]);
  1446. return;
  1447. }
  1448. // iParam_userid 0 사용자ID
  1449. // iParam_usernm 1 사용자명
  1450. // iParam_posinstnm 2 소속기관명
  1451. // iParam_posinstcd 3 소속기관코드
  1452. // iParam_posdeptnm 4 소속부서명
  1453. // iParam_posdeptcd 5 소속부서코드
  1454. if (iSplit_Value.length > 0) {
  1455. model.setValue(pNodeID, iSplit_Value[0]); // 사용자ID
  1456. model.setValue(pNodeNM, iSplit_Value[1]); // 사용자명
  1457. if (pNodeDept !="") {
  1458. model.setValue(pNodeDeptNM, iSplit_Value[4]); // 소속부서명
  1459. model.setValue(pNodeDept , iSplit_Value[5]); // 소속부서코드
  1460. }
  1461. }
  1462. }
  1463. /**
  1464. * @group :
  1465. * @ver : 2007.07.03
  1466. * @by : 양천덕
  1467. * @---------------------------------------------------
  1468. * @type : function
  1469. * @access : public
  1470. * @desc : 조회조건 콤보 데이터 셋팅
  1471. * @param :
  1472. * @return :
  1473. * @---------------------------------------------------
  1474. */
  1475. function fSelctionOutRmCombo(){
  1476. model.removeNodeset("/root/hidden/item");
  1477. for(i=1; i <= getNodesetCount("/root/init/erbaselist/outrminfo");i++ ) {
  1478. model.makeValue("/root/hidden/item["+i+"]/label", model.getValue("/root/init/erbaselist/outrminfo["+i+"]/typenm") );
  1479. model.makeValue("/root/hidden/item["+i+"]/value", model.getValue("/root/init/erbaselist/outrminfo["+i+"]/basetypecd"));
  1480. }
  1481. }
  1482. /**
  1483. * @group :
  1484. * @ver : 2007.07.03
  1485. * @by : 양천덕
  1486. * @---------------------------------------------------
  1487. * @type : function
  1488. * @access : public
  1489. * @desc : 퇴원취소 부분
  1490. * @param :
  1491. * @return :
  1492. * @---------------------------------------------------
  1493. */
  1494. function fOutrmCancel(xCancelpath, fVisitno){
  1495. if(model.getValue("/root/main/cond/indschacptstat") == "3"){
  1496. messageBox("퇴원환자는 퇴실 취소를", "E001");
  1497. return;
  1498. }
  1499. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit1") == "Y" && fVisitno == "0"){
  1500. messageBox("Revisit1 내역이 있어 퇴실 취소를", "E001");
  1501. return;
  1502. }
  1503. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit2") == "Y" && fVisitno == "1"){
  1504. messageBox("Revisit2 내역이 있어 퇴실 취소를", "E001");
  1505. return;
  1506. }
  1507. var jPid = model.getValue("/root/main/ercensusinfo/patinfo/pid"); // 등록번호
  1508. var jIndd = model.getValue("/root/main/ercensusinfo/patinfo/indd"); // 입원일자
  1509. var jCretno = model.getValue("/root/main/ercensusinfo/patinfo/cretno"); // 생성번호
  1510. model.removenode("/root/send/judginfo");
  1511. model.makeValue("/root/send/judginfo/pid", jPid);
  1512. model.makeValue("/root/send/judginfo/indd", jIndd);
  1513. model.makeValue("/root/send/judginfo/cretno", jCretno);
  1514. submit("TRMNE00113");
  1515. var jJudginfo = model.getValue("/root/judginfo/dschjudgprcsstat");
  1516. if (jJudginfo != "A") {
  1517. messageBox(" 심사상태를 해제하고 퇴실취소를 진행하세요.\r\n\r\n" +
  1518. "※ 일과시간 중 - 심사실로 연락, 일과시간 외 - 응급수납으로 연락", "E999");
  1519. return;
  1520. }
  1521. if(model.getValue(xCancelpath) == "" ) {
  1522. messageBox("퇴원 내역이", "I004");
  1523. } else {
  1524. var vbYes = messageBox("퇴실취소를 ", "Q004");
  1525. if(vbYes == 6){
  1526. var sPid = model.getValue("/root/main/ercensusinfo/patinfo/pid"); // 등록번호
  1527. var sIndd = model.getValue("/root/main/ercensusinfo/patinfo/indd"); // 입원일자
  1528. var sCretno = model.getValue("/root/main/ercensusinfo/patinfo/cretno"); // 생성번호
  1529. var sVistno = fVisitno ; // visitno
  1530. //byCY revisit 여부체크
  1531. if(model.getValue("/root/main/ercensusinfo/patinfo/revisit1")=='Y' ||model.getValue("/root/main/ercensusinfo/patinfo/revisit2")=='Y' ) {
  1532. model.makeValue("/root/send/ourrmcancel/revisit","Y");
  1533. var sRevisit = model.getValue("/root/send/ourrmcancel/revisit");
  1534. }
  1535. //byCY
  1536. var sCensusInfoHeader = "pid▦indd▦cretno▦revisit▦visitno▩"
  1537. var sCancelData = sPid + "▦"
  1538. + sIndd + "▦"
  1539. + sCretno + "▦"
  1540. + sRevisit + "▦"
  1541. + sVistno + "▩";
  1542. model.removenode("/root/send");
  1543. model.makeValue("/root/send/ourrmcancel",sCensusInfoHeader + sCancelData );
  1544. messageBox("퇴실정리시 자동으로 기록된 간호기록이 존재하오니 삭제하여 주시기 바랍니다.", "I");
  1545. if(submit("TXMNE00103") == true){
  1546. model.removenode("/root/send");
  1547. //20110225 이선경 경북대 : 응급실 구역 멀티체크
  1548. var rendcd=model.getValue("/root/main/cond/section");
  1549. var chkdata=checkbox1.value;
  1550. var rendcdlist=rendcd.split(" ");
  1551. if (chkdata.substr(0,1) != "-") {
  1552. if (rendcd.length>0) {
  1553. for (var i=0; i<rendcdlist.length;i++) {
  1554. rendcd=rendcd.replace(" ","','");
  1555. }
  1556. rendcd="('" + rendcd + "')";
  1557. }
  1558. } else {
  1559. rendcd = "-";
  1560. }
  1561. var sSrchHeader = "flag▦orddept▦orddrid▦section▩";
  1562. var sSrchData = model.getValue("/root/main/cond/indschacptstat") +"▦"
  1563. + model.getValue("/root/main/cond/orddeptcd") +"▦"
  1564. + model.getValue("/root/main/cond/medispclid") +"▦"
  1565. //+ model.getValue("/root/main/cond/section") +"▩";
  1566. + rendcd + "▩";
  1567. model.makeValue("/root/send/mainsearchinfo", sSrchHeader + sSrchData);
  1568. fInitNode(sSrchToolStatus);
  1569. model.makeNode("/root/send/reqcensus");
  1570. submit("TRMNE00103");
  1571. fButtonSettion("A");
  1572. model.refresh();
  1573. }
  1574. } else {
  1575. return;
  1576. }
  1577. }
  1578. }
  1579. /**
  1580. * @group :
  1581. * @ver : 2007.07.03
  1582. * @by : 양천덕
  1583. * @---------------------------------------------------
  1584. * @type : function
  1585. * @access : public
  1586. * @desc : 호출의사 삭제 부분
  1587. * @param :
  1588. * @return :
  1589. * @---------------------------------------------------
  1590. */
  1591. function fDelCallDoc(xPathDelCallDoc, sDelCheckRow, sRows, sVisit, sBtnSet ){
  1592. if(model.getValue(xPathDelCallDoc+"["+sRows+"]/main") == "Y"){
  1593. messageBox("Main 진료과는 삭제할 수 없습니다.","E");
  1594. return;
  1595. }
  1596. if(sRows== "1"){
  1597. messageBox("삭제할 데이터가", "I004");
  1598. return;
  1599. } else {
  1600. if(model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/status") == "I"){
  1601. fDelGridRow(sVisit, sDelCheckRow );
  1602. return;
  1603. } else {
  1604. if ( sDelCheckRow != null || sDelCheckRow != "" ){
  1605. var vbYes = messageBox("데이터를 ", "Q001");
  1606. if (vbYes == 6) {
  1607. sPid = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/pid" );
  1608. sIndd = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/indd" );
  1609. sCretno = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/cretno" );
  1610. sVisitno = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/visitno" );
  1611. sInstcd = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/instcd" );
  1612. sErorddoctcd = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/erorddoctcd");
  1613. sCallno = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/callno" );
  1614. sRefseq = model.getValue(xPathDelCallDoc+"["+sDelCheckRow+"]/refseq" );
  1615. var sCallVisitSaveHeader = "status▦pid▦indd▦cretno▦visitno▦instcd▦erorddoctcd▦callno▦refseq▩";
  1616. var sCallVisitSaveData = "D▦"
  1617. + sPid +"▦" // 등록번호
  1618. + sIndd +"▦" // 입원일자
  1619. + sCretno +"▦"
  1620. + sVisitno +"▦"
  1621. + sInstcd +"▦"
  1622. + sErorddoctcd +"▦"
  1623. + sCallno +"▦"
  1624. + sRefseq +"▩";
  1625. model.removenode("/root/send");
  1626. model.makeValue("/root/send/calldocinfo", sCallVisitSaveHeader + sCallVisitSaveData);
  1627. model.makeValue("/root/send/cond",sCallVisitSaveHeader + sCallVisitSaveData );
  1628. if(sBtnSet != ""){
  1629. fButtonSettion(sBtnSet);
  1630. }
  1631. submit("TXMNE00102");
  1632. //model.refresh();
  1633. fInputRefresh();
  1634. //fDelGridRow(sVisit, sDelCheckRow );
  1635. } else {
  1636. return;
  1637. }
  1638. }
  1639. }
  1640. }
  1641. }
  1642. /**
  1643. * @group :
  1644. * @ver : 2007.07.03
  1645. * @by : 양천덕
  1646. * @---------------------------------------------------
  1647. * @type : function
  1648. * @access : public
  1649. * @desc : 호출의사 삭제 부분(선택 그리드 row삭제)
  1650. * @param :
  1651. * @return :
  1652. * @---------------------------------------------------
  1653. */
  1654. function fDelGridRow(pFlag, pRow){
  1655. if(pFlag == "0") {
  1656. grd_calldoc1.deleteRow(pRow);
  1657. } else if(pFlag == "1") {
  1658. grd_calldoc2.deleteRow(pRow);
  1659. } else if(pFlag == "2") {
  1660. grd_calldoc3.deleteRow(pRow);
  1661. }
  1662. }
  1663. /**
  1664. * @group :
  1665. * @ver : 2007.07.03
  1666. * @by : 양천덕
  1667. * @---------------------------------------------------
  1668. * @type : function
  1669. * @access : public
  1670. * @desc : 방문일지 수정 부분
  1671. * @param :
  1672. * @return :
  1673. * @---------------------------------------------------
  1674. */
  1675. function fSetCallDoc(sNode1, sNode2, sNode3, sVisit, sBtnSet){
  1676. xPathSetCallDoc = "/root/main/ercensusinfo/patinfo";
  1677. if ( model.getValue(xPathSetCallDoc + sNode3) == "" ){
  1678. messageBox("수정할 수 없습니다.", "E");
  1679. return;
  1680. }
  1681. if( sVisit == "0" &&
  1682. model.getValue(xPathSetCallDoc+ "/revisit1stattm") == "" &&
  1683. model.getValue(xPathSetCallDoc+ "/revisit1") =="Y" ){
  1684. messageBox("Revisit 저장을 먼저 실행하십시요","E");
  1685. return;
  1686. }
  1687. if ( sVisit == "1" &&
  1688. model.getValue(xPathSetCallDoc+ "/revisit2stattm") == "" &&
  1689. model.getValue(xPathSetCallDoc+ "/revisit2") =="Y" ){
  1690. messageBox("Revisit 저장을 먼저 실행하십시요","E");
  1691. return;
  1692. }
  1693. var sPid = model.getValue(xPathSetCallDoc+"/pid" );
  1694. var sIndd = model.getValue(xPathSetCallDoc+"/indd" );
  1695. var sCretno = model.getValue(xPathSetCallDoc+"/cretno");
  1696. var sVisitno = sVisit;
  1697. // 입력 필드(ER방문일지)
  1698. sChosdd = model.getValue(xPathSetCallDoc+sNode1);
  1699. sChostm = model.getValue(xPathSetCallDoc+sNode2);
  1700. var sCallVisitSaveHeader = "stat▦pid▦indd▦cretno▦visitno▦chosdd▦chostm▩";
  1701. var sCallVisitSaveData = "U▦"
  1702. + sPid +"▦" // 등록번호
  1703. + sIndd +"▦" // 입원일자
  1704. + sCretno +"▦"
  1705. + sVisitno +"▦"
  1706. + sChosdd +"▦"
  1707. + sChostm +"▩";
  1708. model.removenode("/root/send");
  1709. model.makeValue("/root/send/chosinfo", sCallVisitSaveHeader + sCallVisitSaveData);
  1710. //fGridUpdateSeleced(sVisit);
  1711. model.makeValue("/root/send/cond",sCallVisitSaveHeader + sCallVisitSaveData );
  1712. if(sBtnSet != ""){
  1713. fButtonSettion(sBtnSet);
  1714. }
  1715. submit("TXMNE00102");
  1716. fInputRefresh();
  1717. fGridRebuild(sVisit);
  1718. //---------------------------------------------------------------------------------
  1719. //최초 입실 기록이 없을 경우 간호기록을 발생시킨다. 2013.10.22 KJS
  1720. var sRecdt = sChosdd + sChostm.substr(0, 4);
  1721. model.removenode("/root/send/recinfo");
  1722. model.makeValue("/root/send/recinfo/pid", sPid);
  1723. model.makeValue("/root/send/recinfo/indd", sIndd);
  1724. model.makeValue("/root/send/recinfo/cretno", sCretno);
  1725. model.makeValue("/root/send/recinfo/recdt", sRecdt);
  1726. if (submit("TRMNE00112")) {
  1727. var reccnt = model.getValue("/root/init/recinfo/recinfo/reccnt");
  1728. var bedpos = model.getValue("/root/main/ercensusinfo/patinfo/bedposflagcd").substr(0, 3);
  1729. if (reccnt == 0) {
  1730. fSetNrRecord ("new", "", bedpos, sRecdt);
  1731. }
  1732. }
  1733. }
  1734. /**
  1735. * @group :
  1736. * @ver : 2007.07.03
  1737. * @by : 양천덕
  1738. * @---------------------------------------------------
  1739. * @type : function
  1740. * @access : public
  1741. * @desc : 방문일지 저장 부분
  1742. * @param :
  1743. * @return :
  1744. * @---------------------------------------------------
  1745. */
  1746. function fSaveCallDoc(sNode1, sNode2, sNode3, sVisit, sBtnSet){
  1747. xPathSaveCallDoc = "/root/main/ercensusinfo/patinfo";
  1748. if( sVisit == "0" &&
  1749. model.getValue(xPathSaveCallDoc+ "/revisit1stattm") == "" &&
  1750. model.getValue(xPathSaveCallDoc+ "/revisit1") =="Y" ){
  1751. messageBox("Revisit 저장을 먼저 실행하십시요","E");
  1752. return;
  1753. }
  1754. if ( sVisit == "1" &&
  1755. model.getValue(xPathSaveCallDoc+ "/revisit2stattm") == "" &&
  1756. model.getValue(xPathSaveCallDoc+ "/revisit2") =="Y" ){
  1757. messageBox("Revisit 저장을 먼저 실행하십시요","E");
  1758. return;
  1759. }
  1760. var sPid = model.getValue(xPathSaveCallDoc+"/pid" );
  1761. var sIndd = model.getValue(xPathSaveCallDoc+"/indd" );
  1762. var sCretno = model.getValue(xPathSaveCallDoc+"/cretno");
  1763. var sVisitno = sVisit;
  1764. // 입력 필드(ER방문일지)
  1765. sChosdd = model.getValue(xPathSaveCallDoc+sNode1);
  1766. sChostm = model.getValue(xPathSaveCallDoc+sNode2);
  1767. var sChosddCheck = model.getValue(xPathSaveCallDoc+sNode1);
  1768. if ( sChosddCheck == null || sChosddCheck == "" ){
  1769. messageBox("내원일시는", "I003");
  1770. if ( sVisitno == "0"){
  1771. model.setFocus("int_chosdd1");
  1772. }else if ( sVisitno == "1"){
  1773. model.setFocus("int_chosdd2");
  1774. }else if ( sVisitno == "2"){
  1775. model.setFocus("int_chosdd3");
  1776. }
  1777. return;
  1778. }
  1779. if(sVisit == "1"){
  1780. var outrmdt = model.getValue("/root/main/ercensusinfo/patinfo/outrmdt");
  1781. var rechosdt = model.getValue("/root/main/ercensusinfo/patinfo/revisit1chosdd")
  1782. + model.getValue("/root/main/ercensusinfo/patinfo/revisit1chostm") ;
  1783. if( outrmdt > rechosdt ){
  1784. messageBox("내원일시가 이전 방문 퇴실일시 보다 이전입니다. \n내원일시를 정확하게 입력하십시요","I");
  1785. model.setFocus("int_chosdd2");
  1786. return;
  1787. }
  1788. }
  1789. if(sVisit == "2"){
  1790. var outrmdt = model.getValue("/root/main/ercensusinfo/patinfo/revisit1outrmdt");
  1791. var rechosdt = model.getValue("/root/main/ercensusinfo/patinfo/revisit2chosdd")
  1792. + model.getValue("/root/main/ercensusinfo/patinfo/revisit2chostm") ;
  1793. if( outrmdt > rechosdt ){
  1794. messageBox("내원일시가 이전 방문 퇴실일시 보다 이전입니다. \n내원일시를 정확하게 입력하십시요","I");
  1795. model.setFocus("int_chosdd3");
  1796. return;
  1797. }
  1798. }
  1799. model.removenode("/root/send");
  1800. var sCallVisitSaveHeader = "stat▦pid▦indd▦cretno▦visitno▦chosdd▦chostm▩";
  1801. var sCallVisitSaveData = "I▦"
  1802. + sPid +"▦" // 등록번호
  1803. + sIndd +"▦" // 입원일자
  1804. + sCretno +"▦"
  1805. + sVisitno +"▦"
  1806. + sChosdd +"▦"
  1807. + sChostm +"▩";
  1808. if ( model.getValue(xPathSaveCallDoc+sNode1) != "" ) {
  1809. if(model.getValue(xPathSaveCallDoc+sNode3) == "" ) {
  1810. model.makeValue("/root/send/chosinfo", sCallVisitSaveHeader + sCallVisitSaveData);
  1811. }
  1812. }
  1813. //fGridUpdateSeleced(sVisit);
  1814. model.makeValue("/root/send/cond",sCallVisitSaveHeader + sCallVisitSaveData );
  1815. var chkStattm = model.getValue(xPathSaveCallDoc + sNode3);
  1816. if(submit("TXMNE00102") == true ){
  1817. // Revisit의 경우에 OLDOUTRMDD, TM을 Update해준다. 2012.07.27 KJS
  1818. if(sVisit != "0"){
  1819. submit("TXMNE00105");
  1820. }
  1821. if ( model.getValue("/root/main/cond/indschacptstat") == "2" && chkStattm == "" ){
  1822. //20110225 이선경 경북대 : 응급실 구역 멀티체크
  1823. var rendcd=model.getValue("/root/main/cond/section");
  1824. var chkdata=checkbox1.value;
  1825. var rendcdlist=rendcd.split(" ");
  1826. if (chkdata.substr(0,1) != "-") {
  1827. if (rendcd.length>0) {
  1828. for (var i=0; i<rendcdlist.length;i++) {
  1829. rendcd=rendcd.replace(" ","','");
  1830. }
  1831. rendcd="('" + rendcd + "')";
  1832. }
  1833. } else {
  1834. rendcd = "-";
  1835. }
  1836. var sSrchHeader = "flag▦orddept▦orddrid▦section▩";
  1837. var sSrchData = model.getValue("/root/main/cond/indschacptstat") +"▦"
  1838. + model.getValue("/root/main/cond/orddeptcd") +"▦"
  1839. + model.getValue("/root/main/cond/medispclid") +"▦"
  1840. //+ model.getValue("/root/main/cond/section") +"▩";
  1841. + rendcd + "▩";
  1842. fInitNode(sSrchToolStatus);
  1843. model.makeValue("/root/send/mainsearchinfo", sSrchHeader + sSrchData);
  1844. model.makeNode("/root/send/reqcensus");
  1845. submit("TRMNE00103");
  1846. }
  1847. }
  1848. if(sBtnSet != ""){
  1849. fButtonSettion(sBtnSet);
  1850. }
  1851. fInputRefresh();
  1852. fGridRebuild(sVisit);
  1853. //---------------------------------------------------------------------------------
  1854. //최초 입실 기록이 없을 경우 간호기록을 발생시킨다. 2013.10.22 KJS
  1855. var sRecdt = sChosdd + sChostm.substr(0, 4);
  1856. model.removenode("/root/send/recinfo");
  1857. model.makeValue("/root/send/recinfo/pid", sPid);
  1858. model.makeValue("/root/send/recinfo/indd", sIndd);
  1859. model.makeValue("/root/send/recinfo/cretno", sCretno);
  1860. model.makeValue("/root/send/recinfo/recdt", sRecdt);
  1861. if (submit("TRMNE00112")) {
  1862. var reccnt = model.getValue("/root/init/recinfo/recinfo/reccnt");
  1863. var bedpos = model.getValue("/root/main/ercensusinfo/patinfo/bedposflagcd").substr(0, 3);
  1864. if (reccnt == 0) {
  1865. fSetNrRecord ("new", "", bedpos, sRecdt);
  1866. }
  1867. }
  1868. }
  1869. /**
  1870. * @group :
  1871. * @ver : 2007.06.07
  1872. * @by : 양천덕
  1873. * @---------------------------------------------------
  1874. * @type : function
  1875. * @access : public
  1876. * @desc : 호출의사 수정 부분
  1877. * @param :
  1878. * @return :
  1879. * @---------------------------------------------------
  1880. */
  1881. function fGridUpdateSeleced(pFlag){
  1882. var checkvalue = "I";
  1883. if(pFlag == "0"){
  1884. var rRow1 = grd_calldoc1.rows;
  1885. for(i=1 ; i < rRow1 ; i ++ ) {
  1886. if(model.getValue("/root/main/ercensusinfo/erorddrlist["+ i +"]/status") == "S"){
  1887. checkvalue = "S";
  1888. }
  1889. }
  1890. if(checkvalue == "I"){
  1891. if(rRow1 != 1) {
  1892. for(i=1 ; i < rRow1 ; i++){
  1893. model.setValue("/root/main/ercensusinfo/erorddrlist["+ i +"]/refseq", i);
  1894. }
  1895. }
  1896. }
  1897. model.makeValue("/root/send/calldocinfo", grd_calldoc1.getUpdateDataAll("i"));
  1898. } else if(pFlag == "1"){
  1899. var rRow2 = grd_calldoc2.rows;
  1900. for(i=1 ; i < rRow2 ; i ++ ) {
  1901. if(model.getValue("/root/main/ercensusinfo/erorddrlist1["+ i +"]/status") == "S"){
  1902. checkvalue = "S";
  1903. }
  1904. }
  1905. if(checkvalue == "I"){
  1906. if(rRow2 != 1) {
  1907. for(i=1 ; i < rRow2 ; i++){
  1908. model.setValue("/root/main/ercensusinfo/erorddrlist1["+ i +"]/refseq", i);
  1909. }
  1910. }
  1911. }
  1912. model.makeValue("/root/send/calldocinfo", grd_calldoc2.getUpdateDataAll("i"));
  1913. } else if(pFlag == "2"){
  1914. var rRow3 = grd_calldoc3.rows;
  1915. for(i=1 ; i < rRow3 ; i ++ ) {
  1916. if(model.getValue("/root/main/ercensusinfo/erorddrlist2["+ i +"]/status") == "S"){
  1917. checkvalue = "S";
  1918. }
  1919. }
  1920. if(checkvalue == "I"){
  1921. if(rRow3 != 1) {
  1922. for(i=1 ; i < rRow3 ; i++){
  1923. model.setValue("/root/main/ercensusinfo/erorddrlist2["+ i +"]/refseq", i);
  1924. }
  1925. }
  1926. }
  1927. model.makeValue("/root/send/calldocinfo", grd_calldoc3.getUpdateDataAll("i"));
  1928. }
  1929. }
  1930. /**
  1931. * @group :
  1932. * @ver : 2007.06.07
  1933. * @by : 양천덕
  1934. * @---------------------------------------------------
  1935. * @type : function
  1936. * @access : public
  1937. * @desc : 호출의사 그리드 초기화
  1938. * @param :
  1939. * @return :
  1940. * @---------------------------------------------------
  1941. */
  1942. function fGridRebuild(pFlag){
  1943. if(pFlag == "0"){
  1944. grd_calldoc1.rebuild();
  1945. } else if(pFlag == "1"){
  1946. grd_calldoc2.rebuild();
  1947. } else if(pFlag == "2"){
  1948. grd_calldoc3.rebuild();
  1949. }
  1950. }
  1951. /**
  1952. * @group :
  1953. * @ver : 2007.07.03
  1954. * @by : 양천덕
  1955. * @---------------------------------------------------
  1956. * @type : function
  1957. * @access : public
  1958. * @desc : Revisit 설정 부분 처리
  1959. * @param :
  1960. * @return :
  1961. * @---------------------------------------------------
  1962. */
  1963. function fRevisitSeting(sPath1, sNode1, sNode2, sVisit){
  1964. model.removeNodeset("/root/temp/calldoclist/calldocinfo");
  1965. xPathRevisitSeting = "/root/main/ercensusinfo/patinfo";
  1966. if(model.getValue("/root/main/cond/indschacptstat") == "3"){
  1967. messageBox("퇴원환자는 Revisit 처리를", "E001");
  1968. model.setValue(xPathRevisitSeting+sNode2, "N");
  1969. if(sVisit == "1"){
  1970. chk_revisit1.refresh();
  1971. }else if (sVisit == "2"){
  1972. chk_revisit2.refresh();
  1973. }
  1974. return;
  1975. }
  1976. var sPid = model.getValue(xPathRevisitSeting+"/pid" ); // 등록번호
  1977. var sIndd = model.getValue(xPathRevisitSeting+"/indd" ); // 입원일자
  1978. var sCretno = model.getValue(xPathRevisitSeting+"/cretno"); // 생성번호
  1979. var sVistno = sVisit;
  1980. var sOutrmdt = model.getValue(xPathRevisitSeting+sNode1);
  1981. var sCensusInfoHeader = "pid▦indd▦cretno▦visitno▦outrmdt▩"
  1982. var sCancelData = sPid + "▦"
  1983. + sIndd + "▦"
  1984. + sCretno + "▦"
  1985. + sVistno + "▦"
  1986. + sOutrmdt + "▩";
  1987. //byCY Revisit환자 처리시 당일로 Blocking
  1988. var sRevisitdd = getCurrentDate(); //현재일자
  1989. var sOutrmdd = sOutrmdt.substr(0,8); //퇴원일자
  1990. if(sRevisitdd != sOutrmdd) {
  1991. chk_revisit1.value = 'N';
  1992. chk_revisit1.refresh();
  1993. messageBox("퇴원일이 당일인 경우만 REVISIT처리 가능합니다.", "I");
  1994. return;
  1995. }
  1996. //byCY
  1997. if( model.getValue(xPathRevisitSeting + sNode2) == "Y" ) {
  1998. var vbYes = messageBox("Revisit 처리를 ", "Q004");
  1999. if(vbYes == 6){
  2000. model.removenode("/root/send");
  2001. model.makeValue("/root/send/serchcalldoc",sCensusInfoHeader + sCancelData );
  2002. if(submit("TRMNE00106") == true ){
  2003. for(i=0 ; i < getNodesetCount("/root/temp/calldoclist/calldocinfo") ; i++){
  2004. model.makeNode(sPath1+"["+(i+1)+"]");
  2005. model.copyNode(sPath1+"["+(i+1)+"]","/root/temp/calldoclist/calldocinfo["+(i+1)+"]");
  2006. }
  2007. model.refresh();
  2008. if(sVisit == "1"){
  2009. int_chosdd2.value = getCurrentDate();
  2010. int_chostm2.value = getCurrentTime().substr(0,4) ;
  2011. int_chosdd2.disabled = false;
  2012. int_chostm2.disabled = false;
  2013. btn_addrow2.disabled = false;
  2014. btn_delrow2.disabled = false;
  2015. btn_introw2.disabled = false;
  2016. btn_updtrow2.disabled = false;
  2017. btn_saverow2.disabled = false;
  2018. } else if (sVisit == "2"){
  2019. int_chosdd3.value = getCurrentDate();
  2020. int_chostm3.value = getCurrentTime().substr(0,4) ;
  2021. int_chosdd3.disabled = false;
  2022. int_chostm3.disabled = false;
  2023. btn_introw3.disabled = false;
  2024. btn_delrow3.disabled = false;
  2025. btn_addrow3.disabled = false;
  2026. btn_saverow3.disabled = false;
  2027. btn_updtrow3.disabled = false;
  2028. }
  2029. } else {
  2030. model.setValue(xPathRevisitSeting+sNode2, "N");
  2031. if(sVisit == "1"){
  2032. chk_revisit1.refresh();
  2033. }else if (sVisit == "2"){
  2034. chk_revisit2.refresh();
  2035. }
  2036. return;
  2037. }
  2038. } else {
  2039. model.setValue(xPathRevisitSeting+sNode2, "N");
  2040. if(sVisit == "1"){
  2041. chk_revisit1.refresh();
  2042. }else if (sVisit == "2"){
  2043. chk_revisit2.refresh();
  2044. }
  2045. return;
  2046. }
  2047. } else {
  2048. if( (sVisit == "1" && model.getValue("/root/main/ercensusinfo/patinfo/revisit1stattm") != "") ||
  2049. (sVisit == "2" && model.getValue("/root/main/ercensusinfo/patinfo/revisit2stattm") != "") ){
  2050. messageBox("Revisit 취소 처리를", "E001");
  2051. return;
  2052. }
  2053. var vbYes = messageBox("Revisit 취소 처리를 ", "Q004");
  2054. if(vbYes == 6){
  2055. model.removenode(sPath1);
  2056. if(sVisit == "1"){
  2057. int_chosdd2.value = "";
  2058. int_chostm2.value = "";
  2059. int_chosdd2.disabled = true;
  2060. int_chostm2.disabled = true;
  2061. btn_addrow2.disabled = true;
  2062. btn_delrow2.disabled = true;
  2063. btn_introw2.disabled = true;
  2064. btn_updtrow2.disabled = true;
  2065. btn_saverow2.disabled = true;
  2066. }
  2067. if (sVisit == "2"){
  2068. int_chosdd3.value = "";
  2069. int_chostm3.value = "";
  2070. int_chosdd3.disabled = true;
  2071. int_chostm3.disabled = true;
  2072. btn_introw3.disabled = true;
  2073. btn_delrow3.disabled = true;
  2074. btn_addrow3.disabled = true;
  2075. btn_saverow3.disabled = true;
  2076. btn_updtrow3.disabled = true;
  2077. }
  2078. } else {
  2079. model.setValue(xPathRevisitSeting + sNode2, "Y");
  2080. if(sVisit == "1"){
  2081. chk_revisit1.refresh();
  2082. }else if (sVisit == "2"){
  2083. chk_revisit2.refresh();
  2084. }
  2085. return;
  2086. }
  2087. }
  2088. }
  2089. /**
  2090. * @group :
  2091. * @ver : 2007.07.03
  2092. * @by : 양천덕
  2093. * @---------------------------------------------------
  2094. * @type : function
  2095. * @access : public
  2096. * @desc : 호출의사 Call, Visit Time 제한
  2097. * @param :
  2098. * @return :
  2099. * @---------------------------------------------------
  2100. */
  2101. function fCallVisitTimeSet(pPath, pNode, pRow){
  2102. var crtDate = getCurrentDate();
  2103. var chkop = "D";
  2104. var chkDate = model.getValue(pPath + "["+pRow+"]" + pNode).substr(0,8) ;
  2105. var chkTime = model.getValue(pPath + "["+pRow+"]" + pNode).substr(8,4) ;
  2106. if(isValidDateTime(chkDate, "YYYYMMDD") == false){
  2107. chkop = "C";
  2108. model.setValue(pPath + "["+pRow+"]" + pNode, crtDate +""+ chkTime);
  2109. messageBox("기록 일자가 유효하지","E007");
  2110. }
  2111. if(isValidDateTime(chkTime, "hhmm") == false){
  2112. if(chkop== "C"){
  2113. model.setValue(pPath + "["+pRow+"]" + pNode, crtDate + "" + getCurrentTime.substr(0,4));
  2114. }else{
  2115. model.setValue(pPath + "["+pRow+"]" + pNode, chkDate + "" + getCurrentTime.substr(0,4));
  2116. }
  2117. messageBox("기록 시간이 유효하지","E007");
  2118. }
  2119. }
  2120. /**
  2121. * @group :
  2122. * @ver : 2007.07.03
  2123. * @by : 양천덕
  2124. * @---------------------------------------------------
  2125. * @type : function
  2126. * @access : public
  2127. * @desc : 주진료과 변경 부분
  2128. * @param :
  2129. * @return :
  2130. * @---------------------------------------------------
  2131. */
  2132. function fChangMainOdrdept(xPathChangeRow, pRow, pVisitno){
  2133. var chgrow = "";
  2134. j =0;
  2135. if( (pVisitno == "0" && model.getValue("/root/main/ercensusinfo/patinfo/stattm" ) == "" ) ||
  2136. (pVisitno == "1" && model.getValue("/root/main/ercensusinfo/patinfo/revisit1stattm") == "" ) ||
  2137. (pVisitno == "2" && model.getValue("/root/main/ercensusinfo/patinfo/revisit2stattm") == "" ) ){
  2138. messageBox("내원 일시를 먼저 저장하십시요","E");
  2139. return;
  2140. }
  2141. if(getNodesetCount(xPathChangeRow) == 1){
  2142. messageBox("메인 진료과 취소를 할 수 없습니다.","E");
  2143. model.setValue(xPathChangeRow+"["+ pRow +"]/mainyn", "M");
  2144. return;
  2145. }
  2146. for(i=1 ; i <= getNodesetCount(xPathChangeRow) ; i++){
  2147. if(model.getValue(xPathChangeRow+"["+i+"]/mainyn") == "M" ){
  2148. j = j + 1;
  2149. }
  2150. }
  2151. if(j == 0){
  2152. messageBox("메인 진료과는 반드시 존재해야 합니다.","E");
  2153. model.setValue(xPathChangeRow+"["+ pRow +"]/mainyn", "M");
  2154. return;
  2155. }
  2156. //진료 변경 부분
  2157. if( j > 1){
  2158. var vbYes = messageBox("메인 진료과 변경을 ", "Q004");
  2159. if(vbYes == 6){
  2160. for(i=1 ; i <= getNodesetCount(xPathChangeRow) ; i++){
  2161. if(model.getValue(xPathChangeRow+"["+i+"]/mainyn") == "M" && i != pRow){
  2162. chgrow = i;
  2163. model.setValue(xPathChangeRow+"["+i+"]/mainyn","S");
  2164. }
  2165. }
  2166. model.setValue(xPathChangeRow+"["+pRow+"]/mainyn" , "M" );
  2167. }else{
  2168. model.setValue(xPathChangeRow+"["+pRow+"]/mainyn" , "S" );
  2169. return;
  2170. }
  2171. }
  2172. //수정 전 주진료과 상태 변경
  2173. if(chgrow != ""){
  2174. var sStatus = "";
  2175. var sStatus = model.getValue(xPathChangeRow+"["+chgrow+"]/status");
  2176. if( sStatus == "S" ){
  2177. model.setValue(xPathChangeRow+"["+chgrow+"]/status", "U");
  2178. }
  2179. }
  2180. //수정 후 주진료과 상태 변경
  2181. var sStatus = "";
  2182. var sStatus = model.getValue(xPathChangeRow+"["+pRow+"]/status");
  2183. if( sStatus == "S" ){
  2184. model.setValue(xPathChangeRow+"["+pRow+"]/status", "U");
  2185. }
  2186. if(pVisitno == "0"){
  2187. model.makeValue("/root/send/calldocinfo", grd_calldoc1.getUpdateDataAll("i"));
  2188. }
  2189. if(pVisitno == "1"){
  2190. model.makeValue("/root/send/calldocinfo", grd_calldoc2.getUpdateDataAll("i"));
  2191. }
  2192. if(pVisitno == "2"){
  2193. model.makeValue("/root/send/calldocinfo", grd_calldoc3.getUpdateDataAll("i"));
  2194. }
  2195. if( submit("TXMNE00104") ){
  2196. fSearchPatienInfo("refresh");
  2197. }
  2198. }
  2199. /**
  2200. * @group :
  2201. * @ver : 2007.06.07
  2202. * @by : 양천덕
  2203. * @---------------------------------------------------
  2204. * @type : function
  2205. * @access : public
  2206. * @desc : 호출의사 그리드 상태 변경
  2207. * @param :
  2208. * @return :
  2209. * @---------------------------------------------------
  2210. */
  2211. function fChangeStatus(xPathChangeRow, pRow){
  2212. //수정 후 주진료과 상태 변경
  2213. var sStatus = "";
  2214. var sStatus = model.getValue(xPathChangeRow+"["+pRow+"]/status");
  2215. if( sStatus == "S" ){
  2216. model.setValue(xPathChangeRow+"["+pRow+"]/status", "U");
  2217. }
  2218. }
  2219. /**
  2220. * @group :
  2221. * @ver : 2007.06.07
  2222. * @by : 양천덕
  2223. * @---------------------------------------------------
  2224. * @type : function
  2225. * @access : public
  2226. * @desc : 상단 정보 이용 환자 선택
  2227. * @param :
  2228. * @return :
  2229. * @---------------------------------------------------
  2230. */
  2231. function fGetParamSetting(){
  2232. var chkPid = getPatientInfo("pid");
  2233. var iTgPatRow = 0;
  2234. if(chkPid != ""){
  2235. var iRow = grd_patlist.rows;
  2236. if(iRow == "1"){
  2237. return;
  2238. }else{
  2239. for( i =0 ; i < iRow ; i++ ){
  2240. iTgPatRow = grd_patlist.findRow(chkPid ,1,1,true,true);
  2241. }
  2242. }
  2243. }
  2244. if(iTgPatRow > 0){
  2245. grd_patlist.row = iTgPatRow;
  2246. grd_patlist.topRow = iTgPatRow;
  2247. fSearchPatienInfo(sSrchToolStatus);
  2248. }
  2249. }
  2250. /**
  2251. * @group :
  2252. * @ver : 2007.06.07
  2253. * @by : 양천덕
  2254. * @---------------------------------------------------
  2255. * @type : function
  2256. * @access : public
  2257. * @desc : 내원일자 체크
  2258. * @param :
  2259. * @return :
  2260. * @---------------------------------------------------
  2261. */
  2262. function fChosdtChk(pFlag, pData){
  2263. var crtDate = getCurrentDate();
  2264. var crtTime = getCurrentTime().substr(0,4);
  2265. var sChkEndData = "";
  2266. if(pFlag =="D"){
  2267. if(isValidDateTime(pData, "YYYYMMDD") == false){
  2268. sChkEndData = crtDate;
  2269. messageBox("입력한 내원 일자가 유효하지","E007");
  2270. }else{
  2271. sChkEndData = pData;
  2272. }
  2273. }
  2274. if(pFlag =="T"){
  2275. if(isValidDateTime(pData, "hhmm") == false){
  2276. sChkEndData = crtTime;
  2277. messageBox("입력한 내원 시간이 유효하지","E007");
  2278. }else{
  2279. sChkEndData = pData;
  2280. }
  2281. }
  2282. return sChkEndData;
  2283. }
  2284. /**
  2285. * @group :
  2286. * @ver : 2007.06.07
  2287. * @by : 양천덕
  2288. * @---------------------------------------------------
  2289. * @type : function
  2290. * @access : public
  2291. * @desc : 담당의 부분 팝업 설정
  2292. * @param :
  2293. * @return :
  2294. * @---------------------------------------------------
  2295. */
  2296. function fShowPopupMenu(gridID, menuPath)
  2297. {
  2298. var gridObj = document.controls.item(gridID);
  2299. if(event.button == 3) {
  2300. if(gridObj.isCell(event.target) && gridObj.mouseRow >= gridObj.fixedrows){
  2301. window.setPopupMenu(true, menuPath, "name", "func", false);
  2302. }else{
  2303. window.setPopupMenu(false);
  2304. }
  2305. }
  2306. }
  2307. /* ------------------------------------------------- */
  2308. /* desc : 선택 NODE 하위의 내용을 CLEAR한다. */
  2309. /* return : */
  2310. /* -------------------------------------------------- */
  2311. function fClearChildNodeSet(pNode){
  2312. var nLen = instance1.selectSingleNode(pNode).childNodes.length;
  2313. var xNode = instance1.selectSingleNode(pNode);
  2314. for (var i=0;i<nLen; i++){
  2315. xNode.childNodes(i).text = '';
  2316. }
  2317. }
  2318. /**
  2319. * @group :
  2320. * @ver : 2008.01.17
  2321. * @by : 양천덕
  2322. * @---------------------------------------------------
  2323. * @type : function
  2324. * @access : public
  2325. * @desc : 투약기록 팝업 설정
  2326. * @param :
  2327. * @return :
  2328. * @---------------------------------------------------
  2329. */
  2330. function fDrugRecPopup(){
  2331. if(btn_ordermngmv.selected == true) {
  2332. fSetPatInfo();
  2333. }else{
  2334. fSetParam("nm");
  2335. }
  2336. open("SMMNR00600","1","15","128");
  2337. }
  2338. /**
  2339. * @group :
  2340. * @ver : 2008.01.17
  2341. * @by : 양천덕
  2342. * @---------------------------------------------------
  2343. * @type : function
  2344. * @access : public
  2345. * @desc : 응급실 퇴실정리 화면 팝업 설정
  2346. * @param :
  2347. * @return :
  2348. * @---------------------------------------------------
  2349. */
  2350. function fEROutPopup(){
  2351. if(btn_ordermngmv.selected == true) {
  2352. fSetPatInfo();
  2353. }else{
  2354. fSetParam("nm");
  2355. }
  2356. open("SMMNE00200","1","15","128");
  2357. }
  2358. /**
  2359. * @group :
  2360. * @ver : 2008.01.17
  2361. * @by : 양천덕
  2362. * @---------------------------------------------------
  2363. * @type : function
  2364. * @access : public
  2365. * @desc : 차트대출신청 화면 팝업 설정
  2366. * @param :
  2367. * @return :
  2368. * @---------------------------------------------------
  2369. */
  2370. function fChartPopup(){
  2371. if(btn_ordermngmv.selected == true) {
  2372. fSetPatInfo();
  2373. }else{
  2374. fSetParam("nm");
  2375. }
  2376. //open("SPMRC01500","1","15","128");
  2377. open("SMMRC00300","1","15","128");
  2378. }
  2379. /**
  2380. * @group :
  2381. * @ver : 2008.01.17
  2382. * @by : 양천덕
  2383. * @---------------------------------------------------
  2384. * @type : function
  2385. * @access : public
  2386. * @desc : 통합검사결과조회 화면 팝업 설정
  2387. * @param :
  2388. * @return :
  2389. * @---------------------------------------------------
  2390. */
  2391. function fTestResultPopup(){
  2392. if(btn_ordermngmv.selected == true) {
  2393. fSetPatInfo();
  2394. }else{
  2395. fSetParam("nm");
  2396. }
  2397. open("SMAER00800","1","15","128");
  2398. }
  2399. /**
  2400. * @group :
  2401. * @ver : 2008.01.17
  2402. * @by : 양천덕
  2403. * @---------------------------------------------------
  2404. * @type : function
  2405. * @access : public
  2406. * @desc : 간호처방 화면 팝업 설정
  2407. * @param :
  2408. * @return :
  2409. * @---------------------------------------------------
  2410. */
  2411. function fNursPrcpPopup(){
  2412. if(btn_ordermngmv.selected == true) {
  2413. fSetPatInfo();
  2414. }else{
  2415. fSetParam("nm");
  2416. }
  2417. open("SMMNW10900","1","15","128"); // 차후 결정
  2418. //open("SMMNW01000","1","15","128");
  2419. }
  2420. /**
  2421. * @group :
  2422. * @ver : 2008.01.17
  2423. * @by : 양천덕
  2424. * @---------------------------------------------------
  2425. * @type : function
  2426. * @access : public
  2427. * @desc : 병동채혈관리 화면 팝업 설정
  2428. * @param :
  2429. * @return :
  2430. * @---------------------------------------------------
  2431. */
  2432. function fInBCollMngtPopup(){
  2433. if(btn_ordermngmv.selected == true) {
  2434. fSetPatInfo();
  2435. }else{
  2436. fSetParam("nm");
  2437. }
  2438. open("SMLLC00200","1","15","128");
  2439. }
  2440. /**
  2441. * @group :
  2442. * @ver : 2008.01.17
  2443. * @by : 양천덕
  2444. * @---------------------------------------------------
  2445. * @type : function
  2446. * @access : public
  2447. * @desc : Name Label출력 화면 팝업 설정
  2448. * @param :
  2449. * @return :
  2450. * @---------------------------------------------------
  2451. */
  2452. function fNameLabelPopup(){
  2453. if(btn_ordermngmv.selected == true) {
  2454. fSetPatInfo();
  2455. }else{
  2456. fSetParam("nm");
  2457. }
  2458. open("SMAER00800","1","15","128");
  2459. }
  2460. /**
  2461. * @group :
  2462. * @ver : 2008.01.17
  2463. * @by : 양천덕
  2464. * @---------------------------------------------------
  2465. * @type : function
  2466. * @access : public
  2467. * @desc : 담당의 프로필보기 화면 팝업 설정
  2468. * @param :
  2469. * @return :
  2470. * @---------------------------------------------------
  2471. */
  2472. function fAtdoctlist(){
  2473. setParameter("atdoctid",model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/atdocid"));
  2474. setParameter("orddd",model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/indd"));
  2475. var left = event.screenX;
  2476. var top = event.screenY;
  2477. modal("SPMNW11300",1,left,top);
  2478. }
  2479. /**
  2480. * @group :
  2481. * @ver : 2008.01.17
  2482. * @by : 양천덕
  2483. * @---------------------------------------------------
  2484. * @type : function
  2485. * @access : public
  2486. * @desc : 메세지 보내기 설정
  2487. * @param :
  2488. * @return :
  2489. * @---------------------------------------------------
  2490. */
  2491. function fSendMessage(){
  2492. model.removeNodeset("/root/main_om/temp/atdoctlist");
  2493. model.removenode("/root/send");
  2494. model.makeValue("/root/send/atdoctid", model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/atdocid"));
  2495. model.makeValue("/root/send/orddd", getCurrentDate());
  2496. model.makeValue("/root/send/deptcd", model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/deptcd"));
  2497. submit("TRMNW00202");
  2498. var nodecnts = getNodesetCount("/root/main_om/temp/atdoctlist") ;
  2499. if( nodecnts < 1){
  2500. messageBox('담당의 정보가 ', 'I004');
  2501. return;
  2502. }
  2503. model.setValue("/root/main_om/temp/atdoctlist/calltype","msg");
  2504. model.setValue("/root/main_om/temp/atdoctlist/msgcnts","응급의료센터 호출");
  2505. zmifOpenUserMessagePopup("/root/main_om/temp/atdoctlist", event.ScreenX, event.ScreenY);
  2506. }
  2507. /**
  2508. * @group :
  2509. * @ver : 2008.01.17
  2510. * @by : 양천덕
  2511. * @---------------------------------------------------
  2512. * @type : function
  2513. * @access : public
  2514. * @desc : 호출 설정
  2515. * @param :
  2516. * @return :
  2517. * @---------------------------------------------------
  2518. */
  2519. function fSendCall(){
  2520. model.removeNodeset("/root/main_om/temp/atdoctlist");
  2521. model.removenode("/root/send");
  2522. model.makeValue("/root/send/atdoctid", model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/atdocid"));
  2523. model.makeValue("/root/send/orddd", getCurrentDate());
  2524. model.makeValue("/root/send/deptcd", model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/deptcd"));
  2525. submit("TRMNW00202");
  2526. if(getNodesetCount("/root/main_om/temp/atdoctlist") < 1){
  2527. messageBox('담당의 정보가 ', 'I004');
  2528. return;
  2529. }
  2530. model.setValue("/root/main_om/temp/atdoctlist/calltype","call");
  2531. model.setValue("/root/main_om/temp/atdoctlist/msgcnts","응급의료센터 호출");
  2532. zmifOpenUserMessagePopup("/root/main_om/temp/atdoctlist", event.ScreenX, event.ScreenY);
  2533. }
  2534. /**
  2535. * @group :
  2536. * @ver : 2008.01.17
  2537. * @by : 양천덕
  2538. * @---------------------------------------------------
  2539. * @type : function
  2540. * @access : public
  2541. * @desc : 환자 라벨 출력
  2542. * @param :
  2543. * @return :
  2544. * @---------------------------------------------------
  2545. */
  2546. function fOpenLabelPrint(){
  2547. /* 20090116(ByJA)
  2548. pid = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/pid");
  2549. patnm = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/patnm");
  2550. sexage = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/grdrage");
  2551. rgstno = model.getValue("/root/main/nursemainlist/nursemaininfo["+nursemaininfo.row+"]/rgstno");
  2552. orddd = getCurrentDate();
  2553. */
  2554. model.setValue("/root/printcnt", LabelPntCnt);
  2555. /* 20090116(ByJA)
  2556. scrnid = "SMMNR00600";
  2557. // barcdRef = "/root/barcdprntsetup/prntsetupinfo/setupinfo"; // 원본_20090106(ByJA)
  2558. barcdRef = "/root/main/barcdprntsetup/prntsetupinfo/setupinfo"; // 수정_20090106(ByJA)
  2559. */
  2560. //group10.attribute("left") = event.ScreenX - 30;
  2561. //group10.attribute("top") = event.ScreenY - 290;
  2562. model.setFocus("ipt_patcntctel");
  2563. model.refresh();
  2564. group10.visible = true;
  2565. }
  2566. /**
  2567. * @group :
  2568. * @ver : 2009.07.15
  2569. * @by : 김양수
  2570. * @---------------------------------------------------
  2571. * @type : function
  2572. * @access : public
  2573. * @desc : 임상관찰기록
  2574. * @param :
  2575. * @return :
  2576. * @---------------------------------------------------
  2577. */
  2578. function fClinicObserRec(){
  2579. if(btn_ordermngmv.selected == true) {
  2580. fSetPatInfo();
  2581. }else{
  2582. fSetParam("nm");
  2583. }
  2584. open("SMMNR00900","1","15","128");
  2585. }
  2586. /**
  2587. * @group :
  2588. * @ver : 2009.07.15
  2589. * @by : 김양수
  2590. * @---------------------------------------------------
  2591. * @type : function
  2592. * @access : public
  2593. * @desc : 환자진료정보조회
  2594. * @param :
  2595. * @return :
  2596. * @---------------------------------------------------
  2597. */
  2598. function fOpenPrcpSpec(){
  2599. if(btn_ordermngmv.selected == true) {
  2600. fSetPatInfo();
  2601. }else{
  2602. fSetParam("nm");
  2603. }
  2604. open("SMMMO02500","1","15","128");
  2605. }
  2606. /**
  2607. * @group :
  2608. * @ver : 2009.08.17
  2609. * @by : 양천덕
  2610. * @---------------------------------------------------
  2611. * @type : function
  2612. * @access : public
  2613. * @desc : 응급실 환자 메모 삽입
  2614. * @param :
  2615. * @return :
  2616. * @---------------------------------------------------
  2617. */
  2618. function fErPatInsmemo(){
  2619. var insMemoRow = nursemaininfo.row;
  2620. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/censusck") == "Y"){
  2621. messageBox("입실저장을 하지 않은 환자는 Memo를 저장 및 수정을 할 수 없습니다.","I");
  2622. return;
  2623. }
  2624. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/memo") == "Y"){
  2625. messageBox("Memo가 이미 등록되어 있습니다.","I");
  2626. return;
  2627. }
  2628. var insMemoPid = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/pid" );
  2629. var insMemoIndd = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/indd" );
  2630. var insMemoCretno = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/cretno" );
  2631. var insMemoVisitno = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/visitno" );
  2632. var insMemoStatus = "U";
  2633. setParameter("pid" , insMemoPid );
  2634. setParameter("indd" , insMemoIndd );
  2635. setParameter("cretno" , insMemoCretno );
  2636. setParameter("visitno" , insMemoVisitno );
  2637. setParameter("status" , insMemoStatus );
  2638. modal("SPMNE07600", 1, 200, 100);
  2639. }
  2640. /**
  2641. * @group :
  2642. * @ver : 2009.08.17
  2643. * @by : 양천덕
  2644. * @---------------------------------------------------
  2645. * @type : function
  2646. * @access : public
  2647. * @desc : 응급실 환자 메모 편집
  2648. * @param :
  2649. * @return :
  2650. * @---------------------------------------------------
  2651. */
  2652. function fErPatSetmemo(){
  2653. var insMemoRow = nursemaininfo.row;
  2654. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/censusck") == "Y"){
  2655. messageBox("입실저장을 하지 않은 환자는 Memo를 저장 및 수정을 할 수 없습니다.","I");
  2656. return;
  2657. }
  2658. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/memo") != "Y"){
  2659. messageBox("등록된 Memo가 없습니다.","I");
  2660. return;
  2661. }
  2662. var insMemoPid = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/pid" );
  2663. var insMemoIndd = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/indd" );
  2664. var insMemoCretno = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/cretno" );
  2665. var insMemoVisitno = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/visitno" );
  2666. var insMemoStatus = "U";
  2667. setParameter("pid" , insMemoPid );
  2668. setParameter("indd" , insMemoIndd );
  2669. setParameter("cretno" , insMemoCretno );
  2670. setParameter("visitno" , insMemoVisitno );
  2671. setParameter("status" , insMemoStatus );
  2672. modal("SPMNE07600", 1, 200, 100);
  2673. }
  2674. /**
  2675. * @group :
  2676. * @ver : 2009.08.17
  2677. * @by : 양천덕
  2678. * @---------------------------------------------------
  2679. * @type : function
  2680. * @access : public
  2681. * @desc : 응급실 환자 메모 삭제
  2682. * @param :
  2683. * @return :
  2684. * @---------------------------------------------------
  2685. */
  2686. function fErPatDelmemo(){
  2687. var insMemoRow = nursemaininfo.row;
  2688. if(model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/memo") != "Y"){
  2689. messageBox("등록된 Memo가 없습니다.","I");
  2690. return;
  2691. }
  2692. var insMemoPid = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/pid" );
  2693. var insMemoIndd = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/indd" );
  2694. var insMemoCretno = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/cretno" );
  2695. var insMemoVisitno = model.getValue("/root/main/nursemainlist/nursemaininfo[" + insMemoRow + "]/visitno" );
  2696. var insMemoStatus = "D";
  2697. model.removenode("/root/send");
  2698. model.makeValue("/root/send/pid" , insMemoPid );
  2699. model.makeValue("/root/send/indd" , insMemoIndd );
  2700. model.makeValue("/root/send/cretno" , insMemoCretno );
  2701. model.makeValue("/root/send/visitno" , insMemoVisitno );
  2702. model.makeValue("/root/send/status" , insMemoStatus );
  2703. submit("TXMNE07601", false);
  2704. fSeletedSrcTool();
  2705. }
  2706. function ErreqOrderInfoOfCol(scrnid, grdid, compscd){
  2707. model.removeNodeset("/root/send/reqdata");
  2708. model.makeValue("/root/send/reqdata/scrnid" , scrnid);
  2709. model.makeValue("/root/send/reqdata/compscd" , compscd);
  2710. if(submit("TRMNB02401", false)){
  2711. var refdata = model.getValue("/root/init/userscrnenvinfo/gridseq/compsrefcnts");
  2712. var sizedata = model.getValue("/root/init/userscrnenvinfo/gridseq/compssizecnts");
  2713. if(refdata != "" || sizedata != ""){
  2714. ErsetOrderInfoOfCol(grdid , refdata, sizedata);
  2715. }
  2716. }
  2717. }
  2718. function ErsetOrderInfoOfCol(grdID, refdata, sizedata){
  2719. var grdObj = document.controls.item(grdID);
  2720. var refArray = refdata.split("^");
  2721. var sizeArray = sizedata.split("^");
  2722. for(var i = 0; i < refArray.length; i++){
  2723. var colcnt = grdObj.colref("" + refArray[i] + "");
  2724. if (colcnt <0 ) colcnt = 0;
  2725. // 이동 컬럼과 대상컬럼의 인덱스가 같지 않은 경우만 이동.
  2726. if (colcnt != i) {
  2727. grdObj.colMove(i, colcnt, "before", false);
  2728. }
  2729. var size = sizeArray[i];
  2730. if(size == 0){ // size of column 0 -> hidden
  2731. grdObj.colHidden(i) = true;
  2732. }else{
  2733. grdObj.colHidden(i) = false;
  2734. }
  2735. grdObj.colWidth(i) = eval(size);
  2736. }
  2737. model.refresh();
  2738. }
  2739. //-----------------(20101018) 경북대
  2740. //카덱스 오픈
  2741. function fOpenCardex()
  2742. {
  2743. //fSetPatInfo();
  2744. if(btn_ordermngmv.selected == true) {
  2745. fSetPatInfo();
  2746. }else{
  2747. fSetParam("ec");
  2748. }
  2749. fSearchPatienInfo(sSrchToolStatus);
  2750. open("SMMNB00200","1","20","128");
  2751. }
  2752. //20110208_KNUH_Start
  2753. function fPrtVital() {
  2754. if(nursemaininfo.rows < 1) {
  2755. messageBox("Vital Sign을 출력할 정보가 존재하지 않습니다.", "E");
  2756. return;
  2757. } else {
  2758. model.makeValue("/root/main/cond/wardnm", getUserInfo("dutplcenm"));
  2759. exeReportPreview("RPMNE00130", "XMLSTR", "", "","true","","","","","true");
  2760. }
  2761. }
  2762. //20111125_환자메모_응급실 허광자 선생님 요청.
  2763. function fPatMemo() {
  2764. var pid = "";
  2765. var hngnm = "";
  2766. var orddeptcd = "" ;
  2767. if(btn_ordermngmv.selected == true) {
  2768. pid = grd_ompatlist.valueMatrix(grd_ompatlist.row,grd_ompatlist.colRef("pid"));
  2769. hngnm = grd_ompatlist.valueMatrix(grd_ompatlist.row,grd_ompatlist.colRef("patnm"));
  2770. orddeptcd = grd_ompatlist.valueMatrix(grd_ompatlist.row,grd_ompatlist.colRef("orddeptcd"));
  2771. }else{
  2772. pid = nursemaininfo.valueMatrix(nursemaininfo.row,nursemaininfo.colRef("pid"));
  2773. hngnm = nursemaininfo.valueMatrix(nursemaininfo.row,nursemaininfo.colRef("patnm"));
  2774. orddeptcd = nursemaininfo.valueMatrix(nursemaininfo.row,nursemaininfo.colRef("deptcd"));
  2775. }
  2776. setParameter("SPMNO02300_PARM", pid + "▦" + hngnm + "▦" + orddeptcd);
  2777. modal("../../../emr/outcareweb/xrw/SPMNO02300", "","", "", "SPMNO02300", "", "");
  2778. }
  2779. //병동간호의 상단올리는 기능이나 응급간호의 상단올리는 기능으로 사용
  2780. //Nurse Main /Order Manage에서 상단환자정보세팅하기
  2781. // function fSetPatInfo()
  2782. // {
  2783. // // 상단 세팅을 위한 파라미터
  2784. // if(btn_om.selected == true) {
  2785. // if (model.getValue("/root/main_om/cond/unitflag") == "emc") {
  2786. // var param = "E▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  2787. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  2788. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  2789. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  2790. // + "▦" ;
  2791. // setParameter("condparam", param);
  2792. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2793. // } else if (model.getValue("/root/main_om/cond/unitflag") == "dsc") {
  2794. // //------------(20071114)
  2795. // if (model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oprsrvno") != "") {
  2796. // var param = "T" + "▦" // 01 O:외래, I:입원구분, T:수술예약
  2797. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid") + "▦" // 02 등록번호
  2798. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/opcnfmdd") + "▦" // 03 수술시작일자
  2799. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno") + "▦" // 04 cretno(없는 경우 ""로 처리)
  2800. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd") + "▦" // 05 기관코드
  2801. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdeptcd") + "▦" // 06 집도과부서
  2802. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdrid") + "▦" // 07 집도의ID
  2803. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oppatflagcd") + "▦"
  2804. // + "F" + "▦"
  2805. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oprsrvno") + "▦"
  2806. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/ophistno") + "▦"
  2807. // + model.getValue("/root/main/cond/orddd")+ "▦" ;
  2808. // } else {
  2809. // var param = "I" + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  2810. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  2811. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  2812. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  2813. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  2814. // }
  2815. // //------------
  2816. // setParameter("condparam", param);
  2817. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2818. //
  2819. // } else if (model.getValue("/root/main_om/cond/unitflag") == "chemo") {
  2820. // //------------(20071114)
  2821. // condparam = "I"+ "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  2822. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  2823. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  2824. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  2825. // + "▦" + model.getValue("/root/main/cond/orddd");
  2826. // //------------
  2827. // setParameter("condparam", condparam);
  2828. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2829. // } else if (model.getValue("/root/main_om/cond/unitflag") == "op") {
  2830. // var param = "T" + "▦" // 01 O:외래, I:입원구분, T:수술예약
  2831. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid") + "▦" // 02 등록번호
  2832. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/opcnfmdd") + "▦" // 03 수술시작일자
  2833. // + "▦" // 04 cretno(없는 경우 ""로 처리)
  2834. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd") + "▦" // 05 기관코드
  2835. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdeptcd") + "▦" // 06 집도과부서
  2836. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdrid") + "▦" // 07 집도의ID
  2837. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oppatflagcd") + "▦"
  2838. // + "F" + "▦"
  2839. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oprsrvno") + "▦"
  2840. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/ophistno") + "▦"
  2841. // + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/opcnfmdd") + "▦" ;
  2842. //
  2843. // setParameter("condparam", param);
  2844. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2845. // } else if (model.getValue("/root/main_om/cond/unitflag") == "apu") {
  2846. // condparam = "I"+ "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  2847. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  2848. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  2849. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  2850. // + "▦" + model.getValue("/root/main/cond/orddd");
  2851. // setParameter("condparam", condparam);
  2852. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2853. //
  2854. // } else {
  2855. // condparam = "I"+ "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  2856. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  2857. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  2858. // + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  2859. // + "▦" + model.getValue("/root/main/cond/orddd");
  2860. //
  2861. // setParameter("condparam", condparam);
  2862. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2863. // }
  2864. // } else {
  2865. // condparam = "I"+ "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/pid")
  2866. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/indd")
  2867. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/cretno")
  2868. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/instcd")
  2869. // + "▦" + model.getValue("/root/main/cond/orddd");
  2870. //
  2871. // setParameter("condparam", condparam);
  2872. //
  2873. // //상단 세팅 화면 사이즈 작게 띄움
  2874. // modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  2875. // /*
  2876. // var indschacptstat = model.getValue("/root/main/cond/indschacptstat");
  2877. // if(indschacptstat == "1" || indschacptstat == "3"){ // 조회조건이 재원,퇴원진행 일 경우
  2878. // condparam = "I"+ "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/pid")
  2879. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/indd")
  2880. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/cretno")
  2881. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/instcd")
  2882. // + "▦" + getCurrentDate();
  2883. // }else{
  2884. // condparam = "I"+ "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/pid")
  2885. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/indd")
  2886. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/cretno")
  2887. // + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/instcd")
  2888. // + "▦" + model.getValue("/root/main/cond/orddd");
  2889. // }
  2890. // */
  2891. //
  2892. // }
  2893. // }
  2894. //
  2895. //-----------------(20101018) 경북대
  2896. //--------------(20101226) 경북대
  2897. //환자이름표출력
  2898. function fOpenNamePrint(){
  2899. if(btn_ordermngmv.selected == true) { // OrderManage 에서 호출
  2900. group23.visible = true;
  2901. } else {
  2902. group5.visible = true;
  2903. }
  2904. }
  2905. //정보호출
  2906. function fGetPatName() {
  2907. var instcd = getUserInfo("dutplceinstcd");
  2908. if(btn_ordermngmv.selected == true) { // OrderManage 에서 호출
  2909. var row_om = grd_ompatlist.row;
  2910. if (row_om >= 1) {
  2911. var pid = model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+row_om+"]/pid");
  2912. var wardcd = model.getValue("/root/main/cond/wardcd");
  2913. model.removenode("/root/send");
  2914. model.makeValue("/root/send/patnameinfo/pid", pid);
  2915. model.makeValue("/root/send/patnameinfo/wardcd", wardcd);
  2916. submit("TRMNE00110");
  2917. model.removeNodeset("/root/send");
  2918. model.makeNode("/root/send/temp2");
  2919. model.makeNode("/root/send/temp2/patnamelist");
  2920. model.makeNode("/root/send/temp2/patnamelist/method");
  2921. model.copyNode("/root/send/temp2/patnamelist", "/root/main_nm/temp2/patnamelist");
  2922. model.makeNode("/root/send/temp2/patnamelist/method");
  2923. model.setValue("/root/send/temp2/patnamelist/method", model.getValue("/root/main_om/method"));
  2924. if(instcd == '031') {
  2925. exeReportPreview("RPMNE00111", "XMLSTR"); //미리보기출력(본원)
  2926. } else {
  2927. exeReportPreview("RPMNE00110", "XMLSTR"); //미리보기출력(칠곡)
  2928. }
  2929. //exeReportPreview("RPMNR06302", "XMLSTR", "/root/main/prtinfo", "", "true", "", "", "", "", "", "", "grp_report"); //미리보기 없이 출력
  2930. }
  2931. }else { // NurseMain 에서 호출
  2932. var row_nr = nursemaininfo.row;
  2933. if (row_nr >= 1) {
  2934. var pid = model.getValue("/root/main/nursemainlist/nursemaininfo["+row_nr+"]/pid");
  2935. var wardcd = model.getValue("/root/main/cond/wardcd");
  2936. model.removenode("/root/send");
  2937. model.makeValue("/root/send/patnameinfo/pid", pid);
  2938. model.makeValue("/root/send/patnameinfo/wardcd", wardcd);
  2939. submit("TRMNE00110");
  2940. model.removeNodeset("/root/send");
  2941. model.makeNode("/root/send/temp2");
  2942. model.makeNode("/root/send/temp2/patnamelist");
  2943. model.makeNode("/root/send/temp2/patnamelist/method");
  2944. model.copyNode("/root/send/temp2/patnamelist", "/root/main_nm/temp2/patnamelist");
  2945. model.makeNode("/root/send/temp2/patnamelist/method");
  2946. model.setValue("/root/send/temp2/patnamelist/method", model.getValue("/root/main/cond/method"));
  2947. if(instcd == '031') {
  2948. exeReportPreview("RPMNE00111", "XMLSTR"); //미리보기출력(본원)
  2949. } else {
  2950. exeReportPreview("RPMNE00110", "XMLSTR"); //미리보기출력(칠곡)
  2951. }
  2952. //exeReportPreview("RPMNR06302", "XMLSTR", "/root/main/prtinfo", "", "true", "", "", "", "", "", "", "grp_report"); //미리보기 없이 출력
  2953. }
  2954. }
  2955. }
  2956. function fChangeHopeBed () {
  2957. //희망 병실 등급 변경
  2958. if(btn_ordermngmv.selected == true) { // OrderManage 에서 호출
  2959. var row_om = grd_ompatlist.row;
  2960. if (row_om >= 1) {
  2961. var pid = model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+row_om+"]/pid");
  2962. var indd = model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+row_om+"]/indd");
  2963. var cretno = model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+row_om+"]/cretno");
  2964. var instcd = model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+row_om+"]/instcd");
  2965. model.removenode("/root/send");
  2966. model.makeValue("/root/send/patadrvinfo/pid", pid);
  2967. model.makeValue("/root/send/patadrvinfo/indd", indd);
  2968. model.makeValue("/root/send/patadrvinfo/cretno", cretno);
  2969. var param = pid + "▦"
  2970. + indd + "▦"
  2971. + cretno + "▦"
  2972. + instcd +"▦" ;
  2973. setParameter("condparam", param);
  2974. modal("SMMNE00102", 1, "", "", "", "", "", "left:100; right:0; width:0; height:0; min:hidden;");
  2975. }
  2976. }else{
  2977. var row = nursemaininfo.row;
  2978. if (row >= 1) {
  2979. var pid = model.getValue("/root/main/nursemainlist/nursemaininfo["+row+"]/pid");
  2980. var indd = model.getValue("/root/main/nursemainlist/nursemaininfo["+row+"]/indd");
  2981. var cretno = model.getValue("/root/main/nursemainlist/nursemaininfo["+row+"]/cretno");
  2982. var instcd = model.getValue("/root/main/nursemainlist/nursemaininfo["+row+"]/instcd");
  2983. model.removenode("/root/send");
  2984. model.makeValue("/root/send/patadrvinfo/pid", pid);
  2985. model.makeValue("/root/send/patadrvinfo/indd", indd);
  2986. model.makeValue("/root/send/patadrvinfo/cretno", cretno);
  2987. var param = pid + "▦"
  2988. + indd + "▦"
  2989. + cretno + "▦"
  2990. + instcd +"▦" ;
  2991. setParameter("condparam", param);
  2992. modal("SMMNE00102", 1, "", "", "", "", "", "left:100; right:0; width:0; height:0; min:hidden;");
  2993. }
  2994. }
  2995. }
  2996. //Nurse Main /Order Manage에서 상단환자정보세팅하기
  2997. function fSetPatInfo()
  2998. {
  2999. // 상단 세팅을 위한 파라미터
  3000. if(btn_ordermngmv.selected == true) {
  3001. if (model.getValue("/root/main_om/cond/unitflag") == "emc") {
  3002. var param = "E▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  3003. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  3004. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  3005. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  3006. + "▦" ;
  3007. setParameter("condparam", param);
  3008. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3009. } else if (model.getValue("/root/main_om/cond/unitflag") == "dsc") {
  3010. //------------(20071114)
  3011. if (model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oprsrvno") != "") {
  3012. var param = "T" + "▦" // 01 O:외래, I:입원구분, T:수술예약
  3013. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid") + "▦" // 02 등록번호
  3014. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/opcnfmdd") + "▦" // 03 수술시작일자
  3015. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno") + "▦" // 04 cretno(없는 경우 ""로 처리)
  3016. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd") + "▦" // 05 기관코드
  3017. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdeptcd") + "▦" // 06 집도과부서
  3018. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdrid") + "▦" // 07 집도의ID
  3019. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oppatflagcd") + "▦"
  3020. + "F" + "▦"
  3021. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oprsrvno") + "▦"
  3022. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/ophistno") + "▦"
  3023. + model.getValue("/root/main/cond/orddd")+ "▦" ;
  3024. } else {
  3025. var param = "I" + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  3026. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  3027. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  3028. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  3029. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  3030. }
  3031. //------------
  3032. setParameter("condparam", param);
  3033. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3034. } else if (model.getValue("/root/main_om/cond/unitflag") == "chemo") {
  3035. //------------(20071114)
  3036. condparam = "I"+ "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  3037. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  3038. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  3039. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  3040. + "▦" + model.getValue("/root/main/cond/orddd");
  3041. //------------
  3042. setParameter("condparam", condparam);
  3043. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3044. } else if (model.getValue("/root/main_om/cond/unitflag") == "op") {
  3045. var param = "T" + "▦" // 01 O:외래, I:입원구분, T:수술예약
  3046. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid") + "▦" // 02 등록번호
  3047. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/opcnfmdd") + "▦" // 03 수술시작일자
  3048. + "▦" // 04 cretno(없는 경우 ""로 처리)
  3049. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd") + "▦" // 05 기관코드
  3050. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdeptcd") + "▦" // 06 집도과부서
  3051. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/perfdrid") + "▦" // 07 집도의ID
  3052. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oppatflagcd") + "▦"
  3053. + "F" + "▦"
  3054. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/oprsrvno") + "▦"
  3055. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/ophistno") + "▦"
  3056. + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/opcnfmdd") + "▦" ;
  3057. setParameter("condparam", param);
  3058. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3059. } else if (model.getValue("/root/main_om/cond/unitflag") == "apu") {
  3060. condparam = "I"+ "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  3061. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  3062. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  3063. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  3064. + "▦" + model.getValue("/root/main/cond/orddd");
  3065. setParameter("condparam", condparam);
  3066. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3067. } else {
  3068. condparam = "I"+ "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/pid")
  3069. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/indd")
  3070. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/cretno")
  3071. + "▦" + model.getValue("/root/main_om/ominfo/ompatinfo/ompatlist["+grd_ompatlist.row+"]/instcd")
  3072. + "▦" + model.getValue("/root/main/cond/orddd");
  3073. setParameter("condparam", condparam);
  3074. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3075. }
  3076. } else {
  3077. condparam = "I"+ "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/pid")
  3078. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/indd")
  3079. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/cretno")
  3080. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/instcd")
  3081. + "▦" + model.getValue("/root/main/cond/orddd");
  3082. setParameter("condparam", condparam);
  3083. //상단 세팅 화면 사이즈 작게 띄움
  3084. modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  3085. /*
  3086. var indschacptstat = model.getValue("/root/main/cond/indschacptstat");
  3087. if(indschacptstat == "1" || indschacptstat == "3"){ // 조회조건이 재원,퇴원진행 일 경우
  3088. condparam = "I"+ "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/pid")
  3089. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/indd")
  3090. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/cretno")
  3091. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/instcd")
  3092. + "▦" + getCurrentDate();
  3093. }else{
  3094. condparam = "I"+ "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/pid")
  3095. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/indd")
  3096. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/cretno")
  3097. + "▦" + model.getValue("/root/main_nm/wardpatinfo/wardpatlist["+grd_wardpatlist.row+"]/instcd")
  3098. + "▦" + model.getValue("/root/main/cond/orddd");
  3099. }
  3100. */
  3101. }
  3102. //20110901_KNUH_End
  3103. }
  3104. //--------------(20101226) 경북대
  3105. function fSetNrRecord (flag, oldSupCD, newSupCD, recdt) {
  3106. var oldBedPos, newBedPos;
  3107. if (oldSupCD == "BDD") {
  3108. oldBedPos = "EICU";
  3109. } else if (oldSupCD == "BDE") {
  3110. oldBedPos = "응급입원실";
  3111. } else if (oldSupCD == "BDT") {
  3112. oldBedPos = "[TR]외상소생구역";
  3113. } else {
  3114. oldBedPos = "응급실";
  3115. }
  3116. if (newSupCD == "BDD") {
  3117. newBedPos = "EICU";
  3118. } else if (newSupCD == "BDE") {
  3119. newBedPos = "응급입원실";
  3120. } else if (newSupCD == "BDT") {
  3121. newBedPos = "[TR]외상소생구역";
  3122. } else {
  3123. newBedPos = "응급실";
  3124. }
  3125. if (flag == "new") {
  3126. TextStmtInfo = newBedPos + " 입실함.";
  3127. } else {
  3128. TextStmtInfo = oldBedPos + " 퇴실, " + newBedPos + " 입실함.";
  3129. }
  3130. var sPid = model.getValue("/root/main/ercensusinfo/patinfo/pid");
  3131. var sIndd = model.getValue("/root/main/ercensusinfo/patinfo/indd");
  3132. var sCretno = model.getValue("/root/main/ercensusinfo/patinfo/cretno");
  3133. var sInstcd = getUserInfo("dutplceinstcd");
  3134. var sRecdt = recdt;
  3135. setParameter("SMMNR03400_ParamBase", "recflag▦dutplaccd▦reclnkkey▩E▦010▦"+ sPid + "," + sIndd + "," + sCretno + "," + sInstcd+"▩");
  3136. setParameter("SMMNR03400_ParamSaveText", "S▦A▦"+sRecdt+"▦"+TextStmtInfo+"▩");
  3137. modal("SMMNR03400");
  3138. }
  3139. function fPatQi(){
  3140. var pid = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/pid");
  3141. var hngnm = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/patnm");
  3142. var orddeptcd = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/deptcd");
  3143. var medispclid = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/juorddrid2");
  3144. var diagnm = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/diagnm");
  3145. var diagcd = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/diagcd");
  3146. var sexagestr = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/grdrage").split("/");
  3147. if( sexagestr[0] == "F" ) { var sex = "여자"; }
  3148. if( sexagestr[0] == "M" ){ var sex = "남자"; }
  3149. var age = sexagestr[1];
  3150. var wardcd = model.getValue("/root/main/cond/wardcd");
  3151. var roomcd = "ERBD";
  3152. var ioflag = model.getValue("/root/main/nursemainlist/nursemaininfo[" + nursemaininfo.row + "]/ordtype");
  3153. setParameter("SMMQR00100_PARAM", pid + "▦" + hngnm + "▦" + orddeptcd + "▦" + medispclid + "▦" + diagnm + "▦" + diagcd + "▦" + sex + "▦" + age + "▦" + wardcd + "▦" + roomcd + "▦" + ioflag);
  3154. modal("../../../emr/qiweb/xrw/SMMQR00100", "","", "", "SMMQR00100", "", "");
  3155. }