SMMRD00400.js 141 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135
  1. /**
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 의료정보 - 퇴원분석관리 ( SMMRD00400_퇴원분석관리.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - Author : 박종훈 수정->이창록
  7. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  8. **/
  9. var xDschAnalyListPath = "/root/main/dschanalyhist/dschanalyinfo";
  10. var xPatBaseInfoListPath = "/root/temp/patinfo/patbaseinfo";
  11. var xDschDDListPath = "/root/temp/patinfo/dschddlist";
  12. var xICUTotListPath = "/root/main/dschanalyhist/icutotlist/icudept";
  13. /**
  14. * @ver : 2007-12-05
  15. * @desc : 화면초기화
  16. * @
  17. * @by : 박종훈
  18. * @param :
  19. * @return :
  20. * @---------------------------------------------------
  21. */
  22. function fInitialize()
  23. {
  24. //2010/01/06 hkjoo 추가
  25. //입원취소 환자 처리 시 데이터 복원을 위해 빈노드를 카피해 놓는다.
  26. model.copyNode("/root/temp/dschanalyhist", "/root/main/dschanalyhist");
  27. //btn_icuinfo.selected ="true";
  28. //btn_addrow3.visible = false;
  29. //btn_delrow3.visible = false;
  30. // 공통코드 목록 가져오기/root/init/opclrsinfo2
  31. //체킹번호 true -> false 변경
  32. chk_cretchknum.value = "false";
  33. zbcfGetCodeList(new Array("M0149", "M0070", "M0151", "M0153",
  34. "M0155","M0152","M0157","M0156",
  35. "M0158","M0159","M0086","M0167",
  36. "M0165","M0013","P0006","M0417",
  37. "A0130","P0008","M0413","M0484",
  38. "A0145","M0414","M0415","M0416",
  39. "M0543"
  40. ),
  41. new Array("/root/init/jobList", "/root/init/relignList", "/root/init/maryStatList", "/root/init/inPathList",
  42. "/root/init/dethTypeList","/root/init/cureRsltList" ,"/root/init/DschTypeList","/root/init/chosProgList",
  43. "/root/init/reInResnList","/root/init/reOpResnList","/root/init/partrtntypeList","/root/init/brthtypeList",
  44. "/root/init/womntypeList","/root/init/optypeList","/root/init/mskindList","/root/init/unprepstatlist",
  45. "/root/init/infdisflaglist","/root/init/insukindList","/root/init/opDethTypeList","/root/init/infccaselist",
  46. "/root/init/infdcpartlist","/root/init/cmpllist","/root/init/wundcasclslist","/root/init/disposstatlist",
  47. "/root/init/nbabyList"
  48. )
  49. , true);
  50. // 진료과
  51. /* var instcd = getUserInfo("dutplceinstcd");
  52. var standard_yn = "orduseyn";
  53. var ord_deptflag = 'D';
  54. var rslt_ref = "/root/init/deptlist";
  55. var sort_method = "depthngnm";
  56. zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref, sort_method);*/
  57. model.removeNodeset("/root/main/dschanalyhist/oplist");
  58. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  59. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  60. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  61. model.removeNodeset("/root/main/dschanalyhist/iculist");
  62. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  63. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  64. if(checkOpener()){
  65. var parampid = opener.javascript.getParameter("SMMRD00400_param_pid");
  66. if(parampid != "")
  67. {
  68. ipt_pid.value = parampid;
  69. chk_cretchknum.value = "false";
  70. fPidKeyPress("init"); //등록번호로 환자 정보조회
  71. }
  72. }
  73. model.refresh();
  74. }
  75. /**
  76. * @desc : 이중번호 체크
  77. * @id :
  78. * @event : onkeypress
  79. * @return : void
  80. * @authur : 박성호 추가
  81. */
  82. function fDoublePidChk()
  83. {
  84. model.resetInstanceNode("/root/main/patinfo");
  85. model.makeNode("/root/main/patinfo");
  86. if(submit("TRPMC02500")){
  87. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  88. if( getNodesetCount("/root/main/patinfo/patinfolist") > 0 ){
  89. //* 2009.04.07. 이중번호 메세지 ( 14257937 박용석 -> 13275912 신옥순 )
  90. var sBindPid = model.getValue("/root/main/patinfo/patinfolist/bindpid");
  91. //alert(sBindPid);
  92. if( sBindPid != '-' && sBindPid != '' && sBindPid != ' ' ){
  93. //합번된 등록번호 메세지 처리
  94. var sPid = model.getValue("/root/main/patinfo/patinfolist/pid");
  95. var sHngnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
  96. var retValue = messageBox(sPid + " (" + sHngnm + ") 환자의 등록번호가 [ " + sBindPid + " ] 로 합번 되었습니다. 합번된 등록번호로 재조회 하시겠습니까?", "Q999", "");
  97. if( retValue == '6' ){
  98. /* 이벤트 다시 처리해서 재조회 처리함..
  99. model.makeValue(iptObj.attribute("ref"), sBindPid);
  100. iptObj.refresh();
  101. fCheckPid(iptObj, refPnm, refRrgstno);
  102. return "";
  103. //*/
  104. //model.makeValue(ipt_pid.attribute("ref"), sBindPid);
  105. model.setValue("/root/main/dschanalyhist/dschanalyinfo/pid", sBindPid);
  106. model.makeValue("/root/send/pid", sBindPid);
  107. ipt_pid.refresh();
  108. return true;
  109. }
  110. return false;
  111. }
  112. return true;
  113. //*/
  114. } else {
  115. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  116. messageBox("없는 환자 번호 입니다.", "E999", "");
  117. model.refresh();
  118. return false;
  119. }
  120. }
  121. return true;
  122. }
  123. /**
  124. * @desc : 환자번호 정보조회
  125. * @id :
  126. * @event : onkeypress
  127. * @return : void
  128. * @authur : 박종훈 추가->이창록
  129. */
  130. function fPidKeyPress(pFlag)
  131. {
  132. cpt_patdethinfo.visible = false;
  133. var fromtime = getCurrentDateTime();
  134. model.removeNodeset("/root/send");
  135. var paramdschdd = "";
  136. model.makeValue("/root/send/srchcond", "1");
  137. if(model.getValue("/root/init/checknum/value") == "true"){
  138. model.makeValue("/root/send/pid", getCretCheckNo(ipt_pid.currentText, getUserInfo("dutplceinstcd")));
  139. model.makeValue("/root/main/dschanalyhist/dschanalyinfo/pid", model.getValue("/root/send/pid"));
  140. } else {
  141. model.makeValue("/root/send/pid", ipt_pid.currentText);
  142. }
  143. // 이중번호 체크 관련
  144. //model.setValue("/root/send/srchcond", "1");
  145. //model.setValue("/root/send/pid", ipt_pid.currentText);
  146. //환자등록번호 체크
  147. if(ipt_pid.currentText.length >= 1 ){
  148. model.resetInstanceNode("/root/main/patinfo");
  149. model.makeNode("/root/main/patinfo");
  150. //if(submit("TRPMC02500"))
  151. var pidchk = fDoublePidChk();
  152. //alert(pidchk);
  153. if ( pidchk == true )
  154. {
  155. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  156. if(submit("TRMRD00401", false)){
  157. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  158. if( getNodesetCnt(model, xPatBaseInfoListPath) > 0 ){
  159. model.resetInstanceNode(xDschAnalyListPath);
  160. model.setValue(xDschAnalyListPath+"/pid" ,model.getValue(xPatBaseInfoListPath+"/pid"));
  161. model.setValue(xDschAnalyListPath+"/hngnm" ,model.getValue(xPatBaseInfoListPath+"/hngnm"));
  162. model.setValue(xDschAnalyListPath+"/rrgstno1" ,model.getValue(xPatBaseInfoListPath+"/rrgstno1"));
  163. model.setValue(xDschAnalyListPath+"/rrgstno2" ,model.getValue(xPatBaseInfoListPath+"/rrgstno2"));
  164. model.setValue(xDschAnalyListPath+"/age" ,model.getValue(xPatBaseInfoListPath+"/age"));
  165. model.setValue(xDschAnalyListPath+"/sexflag" ,model.getValue(xPatBaseInfoListPath+"/sex"));
  166. model.setValue(xDschAnalyListPath+"/btype" ,model.getValue(xPatBaseInfoListPath+"/btype"));
  167. model.setValue(xDschAnalyListPath+"/rh" ,model.getValue(xPatBaseInfoListPath+"/rh"));
  168. model.setValue(xDschAnalyListPath+"/forgeryn" ,model.getValue(xPatBaseInfoListPath+"/forgeryn"));
  169. model.setValue(xDschAnalyListPath+"/telno" ,model.getValue(xPatBaseInfoListPath+"/hometel"));
  170. model.setValue(xDschAnalyListPath+"/mpphontel",model.getValue(xPatBaseInfoListPath+"/mpphontel"));
  171. model.setValue(xDschAnalyListPath+"/zipcd1" ,model.getValue(xPatBaseInfoListPath+"/zipcd1"));
  172. model.setValue(xDschAnalyListPath+"/zipcd2" ,model.getValue(xPatBaseInfoListPath+"/zipcd2"));
  173. model.setValue(xDschAnalyListPath+"/addr" ,model.getValue(xPatBaseInfoListPath+"/addr"));
  174. model.setValue(xDschAnalyListPath+"/detladdr" ,model.getValue(xPatBaseInfoListPath+"/detladdr"));
  175. model.removeNodeset("/root/main/dschanalyhist/oplist");
  176. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  177. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  178. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  179. model.removeNodeset("/root/main/dschanalyhist/iculist");
  180. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  181. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  182. model.setValue("/root/main/cond/statcnts","");
  183. if( (getNodesetCnt(model,"/root/temp/patinfo/chgdschddlist") > 0)
  184. ||(getNodesetCnt(model,"/root/temp/patinfo/dschddlist") > 0)){
  185. if(pFlag == "init"){
  186. if(checkOpener()){
  187. paramdschdd = opener.javascript.getParameter("SMMRD00400_param_dschdd");
  188. }
  189. if(paramdschdd != ""){
  190. model.setValue(xDschAnalyListPath+"/dschdd", paramdschdd);
  191. }else{
  192. model.setValue(xDschAnalyListPath+"/dschdd" , model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  193. }
  194. }else{
  195. model.setValue(xDschAnalyListPath+"/dschdd", model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  196. }
  197. // 20081218 수정
  198. //cmb_dschdd.refresh();
  199. fGetDschAnalyInfo();
  200. model.setValue(xDschAnalyListPath+"/orgdschdd", model.getValue("/root/temp/patinfo/dschddlist[1]/dschdd"));
  201. // 20081218 수정
  202. //cmb_orgdschdd.refresh();
  203. }
  204. // 2013.09.23 CYW START ---------------------------------------------------------------
  205. var pid = model.getValue(xPatBaseInfoListPath+"/pid");
  206. model.makeValue("/root/send/dethinfo/pid" , pid );
  207. model.makeValue("/root/send/dethinfo/instdcd" , getUserInfo("dutplceinstcd") );
  208. if( submit("TRMRD00418") ){
  209. var patdethcnt = getNodesetCount("/root/main/patdethinfo/patdethlist");
  210. if( patdethcnt > 0 ){
  211. cpt_patdethinfo.visible = true;
  212. }else{
  213. cpt_patdethinfo.visible = false;
  214. }
  215. }
  216. // 2013.09.23 CYW END ------------------------------------------------------------------
  217. }else{
  218. messageBox("없는 환자 번호 입니다.", "E999", "");
  219. }
  220. }
  221. model.refresh();
  222. }
  223. else
  224. {
  225. model.setFocus("ipt_pid");
  226. model.refresh();
  227. }
  228. /*
  229. if(submit("TRMRD00401", false)){
  230. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  231. if( getNodesetCnt(model, xPatBaseInfoListPath) > 0 ){
  232. model.resetInstanceNode(xDschAnalyListPath);
  233. model.setValue(xDschAnalyListPath+"/pid" ,model.getValue(xPatBaseInfoListPath+"/pid"));
  234. model.setValue(xDschAnalyListPath+"/hngnm" ,model.getValue(xPatBaseInfoListPath+"/hngnm"));
  235. model.setValue(xDschAnalyListPath+"/rrgstno1" ,model.getValue(xPatBaseInfoListPath+"/rrgstno1"));
  236. model.setValue(xDschAnalyListPath+"/rrgstno2" ,model.getValue(xPatBaseInfoListPath+"/rrgstno2"));
  237. model.setValue(xDschAnalyListPath+"/age" ,model.getValue(xPatBaseInfoListPath+"/age"));
  238. model.setValue(xDschAnalyListPath+"/sexflag" ,model.getValue(xPatBaseInfoListPath+"/sex"));
  239. model.setValue(xDschAnalyListPath+"/btype" ,model.getValue(xPatBaseInfoListPath+"/btype"));
  240. model.setValue(xDschAnalyListPath+"/rh" ,model.getValue(xPatBaseInfoListPath+"/rh"));
  241. model.setValue(xDschAnalyListPath+"/forgeryn" ,model.getValue(xPatBaseInfoListPath+"/forgeryn"));
  242. model.setValue(xDschAnalyListPath+"/telno" ,model.getValue(xPatBaseInfoListPath+"/hometel"));
  243. model.setValue(xDschAnalyListPath+"/mpphontel",model.getValue(xPatBaseInfoListPath+"/mpphontel"));
  244. model.setValue(xDschAnalyListPath+"/zipcd1" ,model.getValue(xPatBaseInfoListPath+"/zipcd1"));
  245. model.setValue(xDschAnalyListPath+"/zipcd2" ,model.getValue(xPatBaseInfoListPath+"/zipcd2"));
  246. model.setValue(xDschAnalyListPath+"/addr" ,model.getValue(xPatBaseInfoListPath+"/addr"));
  247. model.setValue(xDschAnalyListPath+"/detladdr" ,model.getValue(xPatBaseInfoListPath+"/detladdr"));
  248. model.removeNodeset("/root/main/dschanalyhist/oplist");
  249. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  250. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  251. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  252. model.removeNodeset("/root/main/dschanalyhist/iculist");
  253. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  254. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  255. model.setValue("/root/main/cond/statcnts","");
  256. if( getNodesetCnt(model,"/root/temp/patinfo/dschddlist") > 0){
  257. if(pFlag == "init"){
  258. if(checkOpener()){
  259. paramdschdd = opener.javascript.getParameter("SMMRD00400_param_dschdd");
  260. }
  261. if(paramdschdd != ""){
  262. model.setValue(xDschAnalyListPath+"/dschdd", paramdschdd);
  263. }else{
  264. model.setValue(xDschAnalyListPath+"/dschdd" , model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  265. }
  266. }else{
  267. model.setValue(xDschAnalyListPath+"/dschdd", model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  268. }
  269. // 20081218 수정
  270. //cmb_dschdd.refresh();
  271. fGetDschAnalyInfo();
  272. model.setValue(xDschAnalyListPath+"/orgdschdd", model.getValue("/root/temp/patinfo/dschddlist[1]/dschdd"));
  273. // 20081218 수정
  274. //cmb_orgdschdd.refresh();
  275. }
  276. }else{
  277. messageBox("없는 환자 번호 입니다.", "E999", "");
  278. }
  279. }
  280. model.refresh();
  281. */
  282. }else{
  283. messageBox("환자등록번호를 정확히", "C001");
  284. }
  285. var totime = getCurrentDateTime();
  286. //alert("from: " + fromtime + " to:" + totime);
  287. }
  288. /**
  289. * @desc : 퇴원분석 정보 조회
  290. * @id :
  291. * @event : xforms-select
  292. * @return : void
  293. * @authur :
  294. */
  295. function fGetDschAnalyInfo(){
  296. var sDschDD = model.getValue(xDschAnalyListPath+"/dschdd");
  297. var sInDD = model.getValue("/root/temp/patinfo/chgdschddlist[dschdd='"+sDschDD+"']/indd");
  298. //2010.03.31. 이은영 : 퇴원일자 기준으로 분과정보 가져옴. (서울성모만 - 외과분과 때문에 퇴원일 기준으로 분과코드를 가져옴.)
  299. if (getUserInfo("dutplceinstcd") == "000") {
  300. model.makeValue("/root/send/gsdeptcd", "");
  301. model.makeValue("/root/send/stndd", sDschDD);
  302. submit("TRMRD00417");
  303. copyNodeset("/root/temp/patinfo/clrsdeptinfo/opclrsdeptlist" , "/root/init/gsclrsinfo/gsclrsdeptlist");
  304. copyNodeset("/root/temp/patinfo/clrsdeptinfo/chngclrsdeptlist", "/root/init/gsclrsinfo/gsclrsdeptlist");
  305. copyNodeset("/root/temp/patinfo/clrsdeptinfo/cnsclrsdeptlist1", "/root/init/gsclrsinfo/gsclrsdeptlist");
  306. copyNodeset("/root/temp/patinfo/clrsdeptinfo/cnsclrsdeptlist2", "/root/init/gsclrsinfo/gsclrsdeptlist");
  307. copyNodeset("/root/temp/patinfo/clrsdeptinfo/icuclrsdeptlist" , "/root/init/gsclrsinfo/gsclrsdeptlist");
  308. }
  309. // 퇴원당시 진료과전체
  310. model.removeNodeset("/root/init/dschdeptlist/dept");
  311. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/init/dschdeptlist", "depthngnm", "asc", sDschDD);
  312. model.removeNodeset("/root/send");
  313. model.makeValue("/root/send/stntodd", sDschDD);
  314. //증환자실 기준일자 변경(퇴원일자 -> 입원,퇴원일자로변경 (20090408))
  315. model.makeValue("/root/send/stnfromdd", sInDD);
  316. // 중환자실 코드 조회
  317. if(submit("TRMRD00404", false)){
  318. copyNodesetType("/root/init/icudeptlist/icudept","/root/temp/initlist/icudept","replace", model, model);
  319. }
  320. //2009-05-15 오전 9:40:22 강지훈 수정 : 퇴원일자 기준으로 지표관리 항목을 보여준다.
  321. model.removeNodeset("/root/init/indxlist/indx");
  322. chk_indxlist.refresh();
  323. submit("TRMRD00407");
  324. chk_indxlist.refresh();
  325. model.removeNodeset("/root/send");
  326. var sIndx = cmb_dschdd.focusIndex+1;
  327. model.makeValue("/root/send/pid", model.getValue(xDschAnalyListPath+"/pid"));
  328. model.makeValue("/root/send/indd", model.getValue(xDschDDListPath+"["+sIndx+"]/indd"));
  329. model.makeValue("/root/send/careinrmtm", model.getValue(xDschDDListPath+"["+sIndx+"]/careinrmtm")); //2010.01.11, hkjoo 추가
  330. model.makeValue("/root/send/cretno", model.getValue(xDschDDListPath+"["+sIndx+"]/cretno"));
  331. model.makeValue("/root/send/dschdd", sDschDD);
  332. model.makeValue("/root/send/dschtm", model.getValue(xDschDDListPath+"["+sIndx+"]/dschtm"));//2010.01.11, hkjoo 추가
  333. if(submit("TRMRD00402", false)){
  334. var pid = model.getValue(xDschAnalyListPath+"/pid");
  335. if ( pid != "" )
  336. {
  337. var sIndd = model.getValue(xDschAnalyListPath+"/indd");
  338. // 2008-10-21 나종천 수정 실제 입원일자로 재원일수를 구함
  339. var sInroomdd = model.getValue(xDschAnalyListPath+"/inrmdd");
  340. var sDschdd = model.getValue(xDschAnalyListPath+"/dschdd");
  341. var code = model.getValue(xDschAnalyListPath+"/infccascd");
  342. //입원당시 진료과전체
  343. model.removeNodeset("/root/init/indeptlist/dept");
  344. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/init/indeptlist", "depthngnm", "asc", sInroomdd);
  345. fInDschClrsDeptSearch("dsch");//퇴원과분과
  346. fInDschClrsDeptSearch("indd");//입원과분과
  347. fGetInFcCas(code);//감염종류 체크
  348. // 입력 여부 체크
  349. fCheckItemInputYN();
  350. // ER내원일시, 체류시간 체크
  351. var sInPathCd = model.getValue(xDschAnalyListPath+"/inpathcd");
  352. if(sInPathCd == "02"){
  353. ipt_erchosdt.disabled = false;
  354. ipt_erstaytm.disabled = false;
  355. }else{
  356. ipt_erchosdt.disabled = true;
  357. ipt_erstaytm.disabled = true;
  358. }
  359. // 중환자실 전체 재원일수
  360. model.removeNodeset("/root/main/dschanalyhist/icutotlist");
  361. if(grd_iculist.rows > grd_iculist.fixedrows){
  362. var sTotInHospDayNo = 0;
  363. var iRow = 0;
  364. var iICUTotRow = 0;
  365. var sICUCd = "";
  366. for(var iStndRow = grd_iculist.fixedrows; iStndRow<=(grd_iculist.rows-grd_iculist.fixedrows); iStndRow++){
  367. sICUCd = model.getValue("/root/main/dschanalyhist/iculist["+iStndRow+"]/icucd");
  368. iICUTotRow = grd_icutotlist.findRow(sICUCd, grd_icutotlist.fixedrows, 1);
  369. sTotInHospDayNo = 0;
  370. if(iICUTotRow < 1){
  371. for(var iRow = grd_iculist.fixedrows; iRow <= (grd_iculist.rows-grd_iculist.fixedrows); iRow++){
  372. if(model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/icucd") == sICUCd){
  373. sInHospDayNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/inhospdayno");
  374. if(sInHospDayNo == "") sInHospDayNo = 0;
  375. sTotInHospDayNo += eval(sInHospDayNo);
  376. }
  377. }
  378. grd_icutotlist.addRow();
  379. iRow = grd_icutotlist.rows - grd_icutotlist.fixedrows;
  380. model.setValue(xICUTotListPath+"["+iRow+"]/deptcd",sICUCd);
  381. model.setValue(xICUTotListPath+"["+iRow+"]/totinhospdayno", sTotInHospDayNo);
  382. }
  383. }
  384. }
  385. if(model.getValue(xDschAnalyListPath+"/status") == "i"){ // 신규
  386. // 총 재원일수 계산
  387. if(sInroomdd != "" && sDschdd != ""){ /* if(sIndd != "" && sDschdd != ""){ 2008-10-21 나종천 수정 실제 재원일수를 구함 */
  388. var totinhospdayno = getDateInterval(sInroomdd,sDschdd); /* 2008-10-21 나종천 수정 실제 재원일수를 구함 var totinhospdayno = getDateInterval(sIndd,sDschdd); */
  389. // //이윤주수정(20131121) - 시작
  390. // var erdays = model.getValue(xDschAnalyListPath+"/erdays");
  391. // totinhospdayno -= eval(erdays);
  392. // //이윤주수정(20131121) - 종료
  393. if(totinhospdayno < 1) totinhospdayno = 1;
  394. model.setValue(xDschAnalyListPath+"/totinhospdayno", totinhospdayno);
  395. }
  396. // 회차
  397. /* var indg = cmb_dschdd.length-cmb_dschdd.focusIndex;
  398. model.setValue(xDschAnalyListPath+"/indg",indg);
  399. if(indg == 1){
  400. ipt_reinresn.disabled = true;
  401. cmb_reinresncd.disabled = true;
  402. ipt_reinyncd.disabled = true;
  403. cmb_reinyn.disabled = true;
  404. }*/
  405. var bfindg = model.getValue(xDschAnalyListPath+"/bfindg");
  406. if(bfindg==""){
  407. model.setValue(xDschAnalyListPath+"/indg",1);
  408. ipt_reinresn.disabled = true;
  409. cmb_reinresncd.disabled = true;
  410. ipt_reinyncd.disabled = true;
  411. cmb_reinyn.disabled = true;
  412. }else{
  413. model.setValue(xDschAnalyListPath+"/indg",parseInt(bfindg)+1);
  414. }
  415. //재입원 일수
  416. var bfdschdd = model.getValue(xDschAnalyListPath+"/bfdschdd");
  417. var totbfdayno = getDateInterval(bfdschdd,sInroomdd);
  418. if(bfdschdd!=""){
  419. if((totbfdayno >=0)&&(totbfdayno <= 30)){
  420. model.setValue("/root/main/dschanalyhist/dschanalyinfo/reinyn","01");
  421. model.setValue(xDschAnalyListPath+"/reinyncd", model.getValue(xDschAnalyListPath+"/reinyn"));
  422. // 20081218 수정
  423. //ipt_reinyncd.refresh();
  424. fCheckItemInputYN("reinyn");
  425. }else{
  426. model.setValue("/root/main/dschanalyhist/dschanalyinfo/reinyn","02");
  427. model.setValue(xDschAnalyListPath+"/reinyncd", model.getValue(xDschAnalyListPath+"/reinyn"));
  428. // 20081218 수정
  429. //ipt_reinyncd.refresh();
  430. ipt_reinresn.disabled = false;
  431. cmb_reinresncd.disabled = false;
  432. }
  433. }else{
  434. model.setValue("/root/main/dschanalyhist/dschanalyinfo/reinyn","02");
  435. model.setValue(xDschAnalyListPath+"/reinyncd", model.getValue(xDschAnalyListPath+"/reinyn"));
  436. // 20081218 수정
  437. //ipt_reinyncd.refresh();
  438. }
  439. model.setValue(xDschAnalyListPath+"/orgdschdd", model.getValue(xDschAnalyListPath+"/dschdd"));
  440. //2013/01/08 Start
  441. fnbabychk();
  442. //2013/01/08 End
  443. model.setValue("/root/main/cond/statcnts","퇴원분석이 이루어지지 않았습니다.");
  444. model.makeValue("/root/main/detldeptcdsaveyn", "Y");
  445. // 20081218 수정
  446. //model.refresh();
  447. // 수술내역
  448. for(var iRow = grd_oplist.fixedrows; iRow <= grd_oplist.rows-grd_oplist.fixedrows; iRow++){
  449. grd_oplist.rowStatus(iRow) = 1;
  450. }
  451. // 협의진단
  452. for(var iRow = grd_cnstlist.fixedrows; iRow <= grd_cnstlist.rows-grd_cnstlist.fixedrows; iRow++){
  453. grd_cnstlist.rowStatus(iRow) = 1;
  454. }
  455. for(var iRow = grd_wnmblist.fixedrows; iRow <= grd_wnmblist.rows-grd_wnmblist.fixedrows+1; iRow++){
  456. grd_wnmblist.rowStatus(iRow) = 1;
  457. }
  458. // 전과정보
  459. for(var iRow = grd_chngdeptlist.fixedrows; iRow <= grd_chngdeptlist.rows-grd_chngdeptlist.fixedrows; iRow++){
  460. grd_chngdeptlist.rowStatus(iRow) = 1;
  461. }
  462. // 중환자실
  463. for(var iRow = grd_iculist.fixedrows; iRow <= grd_iculist.rows-grd_iculist.fixedrows; iRow++){
  464. grd_iculist.rowStatus(iRow) = 1;
  465. }
  466. // 전염병2008-11-23 사용자 요구에 따라 막음(이창록)
  467. /*for(var iRow = grd_infdislist.fixedrows; iRow <= grd_infdislist.rows-grd_infdislist.fixedrows; iRow++){
  468. grd_infdislist.rowStatus(iRow) = 1;
  469. }*/
  470. }else{
  471. dPid = model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid");
  472. dDschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  473. sDschDD = dDschdd.substr(0,4)+"/"+dDschdd.substr(4,2)+"/"+dDschdd.substr(6,2);
  474. //2013/01/08 Start
  475. fnbabychk();
  476. //2013/01/08 End
  477. model.setValue("/root/main/cond/statcnts",dPid+"환자의"+sDschDD+"의 퇴원분석이 되어 있습니다.");
  478. // 20081218 수정
  479. //model.refresh();
  480. messageBox(dPid + "환자의" + sDschDD +"의 퇴원분석이 되어","I010");
  481. model.makeValue("/root/main/detldeptcdsaveyn", "N");
  482. }
  483. // 산모/신생아
  484. grd_wnmblist.mergeCells = "bycol";
  485. /*
  486. grd_wnmblist.mergeCol(6) = false;
  487. grd_wnmblist.mergeCol(7) = false;
  488. grd_wnmblist.mergeCol(8) = false;
  489. grd_wnmblist.mergeCol(9) = false;
  490. grd_wnmblist.mergeCol(10) = false;
  491. grd_wnmblist.mergeCol(11) = false;
  492. */
  493. grd_wnmblist.mergeCol(grd_wnmblist.colRef("partrtneprccd")) = false;
  494. grd_wnmblist.mergeCol(grd_wnmblist.colRef("nbabyflag")) = false;
  495. grd_wnmblist.mergeCol(grd_wnmblist.colRef("partrtnkindcd")) = false;
  496. grd_wnmblist.mergeCol(grd_wnmblist.colRef("prgweekcnt")) = false;
  497. grd_wnmblist.mergeCol(grd_wnmblist.colRef("prgdayno")) = false;
  498. grd_wnmblist.mergeCol(grd_wnmblist.colRef("nbabybdwtqty")) = false;
  499. grd_wnmblist.mergeCol(grd_wnmblist.colRef("womnid")) = false;
  500. model.copyNode("/root/temp/dschanalyhist", "/root/main/dschanalyhist");
  501. }
  502. else //2010/01/06 hkjoo 추가
  503. {
  504. messageBox("입원취소 된 건","I009");
  505. model.copyNode("/root/main/dschanalyhist", "/root/temp/dschanalyhist");
  506. model.resetInstanceNode("/root/main/dschanalyhist");
  507. model.setValue(xDschAnalyListPath + "/dschdd", sDschDD);
  508. model.setValue(xDschAnalyListPath + "/pid", model.getValue("/root/send/pid"));
  509. }
  510. }
  511. // 20081218 수정
  512. //model.refresh();
  513. chk_indxlist.refresh();
  514. }
  515. /**
  516. * @desc : 초기화
  517. * @id :
  518. * @event : xforms-select
  519. * @return : void
  520. * @authur :
  521. */
  522. function fClearDschInfo(){
  523. model.resetInstanceNode(xDschAnalyListPath);
  524. model.removeNodeset("/root/main/dschanalyhist/oplist");
  525. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  526. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  527. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  528. model.removeNodeset("/root/main/dschanalyhist/iculist");
  529. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  530. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  531. model.removeNodeset("/root/main/dschanalyhist/icutotlist");
  532. // 입원병실정보
  533. model.removeNodeset("/root/init/inroomlist/room");
  534. // 퇴원병실정보
  535. model.removeNodeset("/root/init/dschroomlist/room");
  536. //감염종류2
  537. model.removeNodeset("/root/init/infdcpartinfo/infdcpartlist");
  538. model.refresh();
  539. }
  540. /**
  541. * @desc : 병동 정보 조회
  542. * @id :
  543. * @event : xforms-select
  544. * @return : void
  545. * @authur :
  546. */
  547. function fGetWardInfo(ref, pFlag, pCtrlID){
  548. var resultRef = "/root/temp/wardinfo";
  549. model.removenode(resultRef);
  550. model.removenode(ref);
  551. model.makeNode(resultRef);
  552. var sCtrlID = document.controls(pCtrlID);
  553. var roomcd = sCtrlID.currentText;
  554. model.makeValue(ref+"/roomcd",roomcd);
  555. model.makeValue(ref+"/stnddd", model.getValue(xDschAnalyListPath+"/dschdd"));
  556. if(submit("TRMRD00403", "false", ref, resultRef)==true){
  557. if(getNodesetCnt(model, resultRef+"/ward") > 0){
  558. if(pFlag == "in"){
  559. model.setValue(xDschAnalyListPath+"/inwardcd", model.getValue(resultRef+"/ward/wardcd"));
  560. model.setValue(xDschAnalyListPath+"/inwardnm", model.getValue(resultRef+"/ward/wardnm"));
  561. model.setValue(xDschAnalyListPath+"/inroomcd",roomcd);
  562. }else if(pFlag == "dsch"){
  563. model.setValue(xDschAnalyListPath+"/dschwardcd", model.getValue(resultRef+"/ward/wardcd"));
  564. model.setValue(xDschAnalyListPath+"/dschwardnm", model.getValue(resultRef+"/ward/wardnm"));
  565. model.setValue(xDschAnalyListPath+"/dschroomcd",roomcd);
  566. }
  567. }else{
  568. if(pFlag == "in"){
  569. model.setValue(xDschAnalyListPath+"/inwardcd","");
  570. model.setValue(xDschAnalyListPath+"/inwardnm","");
  571. model.setValue(xDschAnalyListPath+"/inroomcd","");
  572. }else if(pFlag == "dsch"){
  573. model.setValue(xDschAnalyListPath+"/dschwardcd","");
  574. model.setValue(xDschAnalyListPath+"/dschwardnm","");
  575. model.setValue(xDschAnalyListPath+"/dschroomcd","");
  576. }
  577. }
  578. }
  579. model.refresh();
  580. }
  581. /**
  582. * @desc : 줄 추가
  583. * @id :
  584. * @event : xforms-select
  585. * @return : void
  586. * @authur :
  587. */
  588. function fAddGridRow(pGrid){
  589. var sPid = model.getValue(xDschAnalyListPath+"/pid");
  590. var sDschDD = model.getValue(xDschAnalyListPath+"/dschdd");
  591. if(sPid == "" && sDschDD == ""){
  592. messageBox("퇴원일자를 입력 후에 추가","I006");
  593. return;
  594. }
  595. var sGridID = document.controls(pGrid);
  596. var ref = sGridID.attribute("nodeset");
  597. sGridID.addRow();
  598. var iRow = sGridID.rows - sGridID.fixedrows;
  599. model.setValue(ref+"["+iRow+"]/pid", sPid);
  600. model.setValue(ref+"["+iRow+"]/dschdd", sDschDD.split('-').join("")); //'-'문자가 들어가 있는 숫자일 경우 '-'문자를 분할(split())한 다음에 다시 결합(join)
  601. }
  602. /**
  603. * @desc : 줄 삭제
  604. * @id :
  605. * @event : xforms-select
  606. * @return : void
  607. * @authur :
  608. */
  609. function fDelGridRow(pGrid){
  610. var sGridID = document.controls(pGrid);
  611. var ref = sGridID.attribute("nodeset");
  612. var iRow = sGridID.row;
  613. if(iRow < 1) return;
  614. var iStatus = sGridID.rowStatus(iRow);
  615. if(iStatus == 1 || iStatus == 3){
  616. sGridID.deleteRow(iRow);
  617. }else{
  618. sGridID.rowStatus(iRow) = 4;
  619. sGridID.deleteRow(iRow);
  620. }
  621. }
  622. /**
  623. * @desc : 항목별 입력 여부 체크
  624. * @id :
  625. * @event : xforms-select
  626. * @return : void
  627. * @authur :
  628. */
  629. function fCheckItemInputYN(pFlag){
  630. // 치료결과 체크
  631. if(pFlag == "curerslt" || pFlag == null){
  632. var sCureRsltCD = model.getValue(xDschAnalyListPath+"/curersltcd");
  633. if(sCureRsltCD == "07" || sCureRsltCD == "08"){
  634. ipt_dethtype.disabled = false;
  635. cmb_dethtypecd.disabled = false;
  636. ipt_opdethtype.disabled = false;
  637. cmb_opdethtypecd.disabled = false;
  638. }else{
  639. ipt_dethtype.disabled = true;
  640. cmb_dethtypecd.disabled = true;
  641. ipt_opdethtype.disabled = true;
  642. cmb_opdethtypecd.disabled = true;
  643. model.makeValue(xDschAnalyListPath+"/dethtype","");
  644. model.makeValue(xDschAnalyListPath+"/dethtypecd","");
  645. // 20081218 수정
  646. //ipt_dethtype.refresh();
  647. //cmb_dethtypecd.refresh();
  648. //ipt_opdethtype.refresh();
  649. //cmb_opdethtypecd.refresh();
  650. }
  651. }
  652. // 입원경로 체크
  653. if(pFlag == "inpath"){
  654. var sInPathCd = model.getValue(xDschAnalyListPath+"/inpathcd");
  655. if(sInPathCd == "02"){
  656. ipt_erchosdt.disabled = false;
  657. ipt_erstaytm.disabled = false;
  658. }else{
  659. ipt_erchosdt.disabled = true;
  660. ipt_erstaytm.disabled = true;
  661. model.setValue(xDschAnalyListPath+"/erchosdt","");
  662. model.setValue(xDschAnalyListPath+"/erstaytm","");
  663. // 20081218 수정
  664. //ipt_erchosdt.refresh();
  665. //ipt_erstaytm.refresh();
  666. }
  667. }
  668. // 재입원(Unplan) 체크
  669. if(pFlag == "reinresn" || pFlag == null){
  670. var sReInResnCd = model.getValue(xDschAnalyListPath+"/reinresncd");
  671. if(sReInResnCd != ""){
  672. model.setValue(xDschAnalyListPath+"/reinyncd","");
  673. model.setValue(xDschAnalyListPath+"/reinyn","");
  674. ipt_reinyncd.disabled = true;
  675. cmb_reinyn.disabled = true;
  676. // 20081218 수정
  677. //ipt_reinyncd.refresh();
  678. //cmb_reinyn.refresh();
  679. }else{
  680. ipt_reinyncd.disabled = false;
  681. cmb_reinyn.disabled = false;
  682. }
  683. }
  684. // 재입원(plan) 체크
  685. if(pFlag == "reinyn" || pFlag == null){
  686. var sReInYN = model.getValue(xDschAnalyListPath+"/reinyn");
  687. if(sReInYN != ""){
  688. model.setValue(xDschAnalyListPath+"/reinresncd","");
  689. model.setValue(xDschAnalyListPath+"/reinresn","");
  690. ipt_reinresn.disabled = true;
  691. cmb_reinresncd.disabled = true;
  692. // 20081218 수정
  693. //ipt_reinresn.refresh();
  694. //cmb_reinresncd.refresh();
  695. }else{
  696. ipt_reinresn.disabled = false;
  697. cmb_reinresncd.disabled = false;
  698. }
  699. }
  700. }
  701. /**
  702. * @desc : 저장
  703. * @id :
  704. * @event : xforms-select
  705. * @return : void
  706. * @authur :
  707. */
  708. function fSave()
  709. {
  710. //등록번호
  711. if(model.getValue(xDschAnalyListPath+"/pid") == ""){
  712. messageBox("등록번호는", "I003");
  713. model.setFocus("ipt_pid");
  714. return;
  715. }
  716. // 종교
  717. if(model.getValue(xDschAnalyListPath+"/religncd") == ""){
  718. messageBox("종교는", "I003");
  719. model.setFocus("cmb_religncd");
  720. return;
  721. }
  722. // 결혼상태
  723. if(model.getValue(xDschAnalyListPath+"/marystatcd") == ""){
  724. messageBox("결혼상태는", "I003");
  725. model.setFocus("cmb_marystatcd");
  726. return;
  727. }
  728. // 직업
  729. if(model.getValue(xDschAnalyListPath+"/jobcd") == ""){
  730. messageBox("직업은", "I003");
  731. model.setFocus("cmb_jobcd");
  732. return;
  733. }
  734. // 치료결과
  735. if(model.getValue(xDschAnalyListPath+"/curersltcd") == ""){
  736. messageBox("치료결과는", "I003");
  737. model.setFocus("cmb_curersltcd");
  738. return;
  739. }
  740. // 퇴원형태
  741. if(model.getValue(xDschAnalyListPath+"/dschtypecd") == ""){
  742. messageBox("퇴원형태는", "I003");
  743. model.setFocus("cmb_dschtypecd");
  744. return;
  745. }
  746. // 내원경위
  747. if(model.getValue(xDschAnalyListPath+"/chosprogcd") == ""){
  748. messageBox("내원경위는", "I003");
  749. model.setFocus("cmb_chosprogcd");
  750. return;
  751. }
  752. // 입원경로
  753. if(model.getValue(xDschAnalyListPath+"/inpathcd") == ""){
  754. messageBox("입원경로는", "I003");
  755. model.setFocus("cmb_inpathcd");
  756. return;
  757. }
  758. mmbfGetHardCodeInfoNm("/root/send/hardcode","/root/hidden/deptchklist", 4001);
  759. // 2009.06.06 박성호
  760. // 입원,퇴원과에 해당하는 분과를 선택 여부 체크
  761. var DeptList = findNodeset(model, "/root/hidden/deptchklist/hardcd");
  762. for(var idx = 0; idx < DeptList.length; idx++)
  763. {
  764. var DeptNode = model.getValue("/root/hidden/deptchklist/hardcd[" + (idx+1) + "]/hardcd");
  765. var ChkYN = model.getValue("/root/hidden/deptchklist/hardcd[" + (idx+1) + "]/hardcdnm");
  766. var indeptcd = model.getValue(xDschAnalyListPath+"/indeptcd");
  767. var dschdeptcd = model.getValue(xDschAnalyListPath+"/dschdeptcd");
  768. //alert("과:" + DeptNode + " :||| 체크여부:" + ChkYN);
  769. if (indeptcd == DeptNode)
  770. {
  771. if (ChkYN == "Y")
  772. {
  773. if(cmb_inclrsdeptcd.label==""){
  774. messageBox(caption12.attribute("text")+" 분과를","C002");
  775. model.setFocus("cmb_inclrsdeptcd");
  776. return;
  777. }
  778. }
  779. }
  780. if (dschdeptcd == DeptNode)
  781. {
  782. if (ChkYN == "Y")
  783. {
  784. if(cmb_dschclrsdeptcd.label==""){
  785. messageBox(caption23.attribute("text")+" 분과를","C002");
  786. model.setFocus("cmb_dschclrsdeptcd");
  787. return;
  788. }
  789. }
  790. }
  791. }
  792. /*
  793. //입원,퇴원과에 해당하는 분과를 선택 여부 체크
  794. var indeptcd = model.getValue(xDschAnalyListPath+"/indeptcd");
  795. var dschdeptcd = model.getValue(xDschAnalyListPath+"/dschdeptcd");
  796. if((indeptcd=="2010000000")||(indeptcd=="2040000000")||(indeptcd=="2100000000")||(indeptcd=="2110000000")){
  797. if(cmb_inclrsdeptcd.label==""){
  798. messageBox(caption12.attribute("text")+" 분과를","C002");
  799. model.setFocus("cmb_inclrsdeptcd");
  800. return;
  801. }
  802. }
  803. if((dschdeptcd=="2010000000")||(dschdeptcd=="2040000000")||(dschdeptcd=="2100000000")||(dschdeptcd=="2110000000")){
  804. if(cmb_dschclrsdeptcd.label==""){
  805. messageBox(caption23.attribute("text")+" 분과를","C002");
  806. model.setFocus("cmb_dschclrsdeptcd");
  807. return;
  808. }
  809. }
  810. */
  811. //수술정보에서 마취방법 체크 여부
  812. var anstmthdcd1 = model.getValue("/root/main/dschanalyhist/oplist["+grd_oplist.rows-grd_oplist.fixedrows+"]/anstmthdcd1");
  813. var gnrlanstcnt = model.getValue("/root/main/dschanalyhist/dschanalyinfo/gnrlanstcnt");
  814. var prtanstcnt = model.getValue("/root/main/dschanalyhist/dschanalyinfo/prtanstcnt");
  815. var tpclanstcnt = model.getValue("/root/main/dschanalyhist/dschanalyinfo/tpclanstcnt");
  816. if(getNodesetCnt(model,"/root/main/dschanalyhist/oplist")>0){
  817. if(grd_oplist.valueMatrix(grd_oplist.rows-grd_oplist.fixedrows,grd_oplist.colRef("anstmthdcd1"))==""){
  818. messageBox("수술정보에 마취방법은 ","I003");
  819. return;
  820. }
  821. if(((gnrlanstcnt=="0")||(gnrlanstcnt==""))&&((prtanstcnt=="0")||(prtanstcnt==""))&&((tpclanstcnt=="0")||(tpclanstcnt==""))){
  822. messageBox("수술정보에 전신,부분,국소 건수를 ","C001");
  823. return;
  824. }
  825. }
  826. //치료결과에 48이전(후)(07,08)사망시 퇴원형태가 사망퇴원(06)인지 체크,반대도 동일
  827. var curersltcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/curersltcd");
  828. var dschtypecd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschtypecd");
  829. if((curersltcd=="07")||(curersltcd=="08")){
  830. if(dschtypecd!="06"){
  831. messageBox("사망환자일 경우에 퇴원형태를 ","I007");
  832. model.setFocus("cmb_dschtypecd");
  833. return;
  834. }
  835. }else if((curersltcd!="07")||(curersltcd!="08")){
  836. if(dschtypecd=="06"){
  837. messageBox(cmb_dschtypecd.label+" 환자일 경우에 치료결과를 ","I007");
  838. model.setFocus("cmb_curersltcd");
  839. return;
  840. }
  841. }
  842. // 입원분과나 퇴원분과든 산과일때 산모/신생아정보가 없을시 체크
  843. var inclrsdeptcd = model.getValue(xDschAnalyListPath+"/inclrsdeptcd");
  844. var dschclrsdeptcd = model.getValue(xDschAnalyListPath+"/dschclrsdeptcd");
  845. if((inclrsdeptcd =="2100600000")||(dschclrsdeptcd =="2100600000")){
  846. if(getNodesetCnt(model,"/root/main/dschanalyhist/wnmblist")< 1){
  847. messageBox("산모 / 신생아정보를 ","C001");
  848. return;
  849. }
  850. }
  851. // 입원분과나 퇴원분과든 산과일때 산모/신생아정보에 산모형테 미입력시 체크
  852. if((inclrsdeptcd =="2100600000")||(dschclrsdeptcd =="2100600000")){
  853. if(grd_wnmblist.valueMatrix(grd_wnmblist.rows-grd_wnmblist.fixedrows+1,grd_wnmblist.colRef("womntypecd"))==""){
  854. messageBox("산모 / 신생아정보에 산모형태를 ","C001");
  855. return;
  856. }
  857. }
  858. // 조회한 등록번호랑 저장할 등록번호 일치 여부
  859. if(model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid")!=(model.getValue(xPatBaseInfoListPath+"/pid"))){
  860. messageBox("조회한 등록번호랑 저장할 등록번호가 ","E004");
  861. model.setFocus("ipt_pid");
  862. return;
  863. }
  864. var inrmdd= model.getValue(xDschAnalyListPath+"/inrmdd");
  865. var inrmDD = inrmdd.replace("-","") ;
  866. model.setValue(xDschAnalyListPath+"/inrmdd",inrmDD);
  867. var dschdd= model.getValue(xDschAnalyListPath+"/dschdd");
  868. if(dschdd.indexOf("-")> 0){
  869. model.makeValue(xDschAnalyListPath+"/dschdd",dschdd.split('-').join(""));
  870. }
  871. // 2012/10/17 Start
  872. var rows = grd_cnstlist.rows-grd_cnstlist.fixedRows;
  873. // 협력의뢰의 의뢰과가 소아청소년과 또는 산부인과일 경우 의뢰분과를 필수로 입력토록 수정
  874. for(var i=1; i<=rows; i++){
  875. var reqdept = model.getValue("/root/main/dschanalyhist/cnstlist[" + i + "]/reqdeptcd");
  876. if(reqdept=="2110000000" || reqdept=="2100000000"){
  877. if(model.getValue("/root/main/dschanalyhist/cnstlist[" + i + "]/reqclrsdeptcd")==""){
  878. messageBox("의뢰과가 소아청소년과 또는 산부인과일 경우 의뢰분과는", "I003");
  879. return;
  880. }
  881. }
  882. // 협력의뢰의 회신과과 소아청소년과 또는 산부인과일 경우 회신분과를 필수로 입력토록 수정
  883. var ansdept = model.getValue("/root/main/dschanalyhist/cnstlist[" + i + "]/execdeptcd");
  884. if(ansdept=="2110000000" || ansdept=="2100000000"){
  885. if(model.getValue("/root/main/dschanalyhist/cnstlist[" + i + "]/execlrsdeptcd")==""){
  886. messageBox("회신과가 소아청소년과 또는 산부인과일 경우 회신분과는", "I003");
  887. return;
  888. }
  889. }
  890. }
  891. // 퇴원형태가 사망퇴원인 경우 사망형태는 필수로 입력토록 수정
  892. if(model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschtypecd")=="06"){
  893. if(model.getValue("/root/main/dschanalyhist/dschanalyinfo/dethtypecd")==""){
  894. messageBox("퇴원형태가 사망퇴원인 경우 사망형태는", "I003");
  895. return;
  896. }
  897. }
  898. // 2012/10/17 End
  899. // 2013/01/07 Start
  900. var rows = grd_oplist.rows-grd_oplist.fixedRows;
  901. // 수술정보의 수술과가 소아청소년과 또는 산부인과 일 경우 수술분과는 필수로 입력토록 수정
  902. for(var i=1; i<=rows; i++){
  903. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist[" + i + "]/perfdeptcd");
  904. if(perfdeptcd=="2110000000" || perfdeptcd=="2100000000"){
  905. if(model.getValue("/root/main/dschanalyhist/oplist[" + i + "]/opclrsdeptcd")==""){
  906. messageBox("수술과가 소아청소년과 또는 산부인과일 경우 수술분과는", "I003");
  907. return;
  908. }
  909. }
  910. }
  911. var inpath=model.getValue("/root/main/dschanalyhist/dschanalyinfo/inpath");
  912. if(inpath=="01"){ // 입원경로가 외래일경우
  913. var erchosdt=model.getValue("/root/main/dschanalyhist/dschanalyinfo/erchosdt"); //ER내원일시
  914. var erstaytm=model.getValue("/root/main/dschanalyhist/dschanalyinfo/erstaytm"); //ER체류시간
  915. if(erchosdt!="" || erstaytm!=""){
  916. messageBox("입원경로가 외래인 경우 ER내원일시 또는 ER체류시간은\n 입력할 수", "I004");
  917. return;
  918. }
  919. }else if(inpath=="02"){ // 입원경로가 응급실일경우
  920. var erchosdt=model.getValue("/root/main/dschanalyhist/dschanalyinfo/erchosdt"); //ER내원일시
  921. var erstaytm=model.getValue("/root/main/dschanalyhist/dschanalyinfo/erstaytm"); //ER체류시간
  922. if(erchosdt==""){
  923. messageBox("입원경로가 응급실인 경우 ER내원일시는", "I003");
  924. return;
  925. }
  926. }
  927. // 2013/01/07 End
  928. // 2013/01/08 Start
  929. var deptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  930. var clrsdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd");
  931. var womnid=model.getValue("/root/main/dschanalyhist/wnmblist/womnid");
  932. var nbabyflag=model.getValue("/root/main/dschanalyhist/wnmblist/nbabyflag");
  933. if(deptcd=="2110000000" && clrsdeptcd!=""){ // 소아청소년과이면서 분과가 존재할 시에
  934. var nodecnt = getNodesetCount("/root/main/dschanalyhist/wnmblist");
  935. var womnid=model.getValue("/root/main/dschanalyhist/wnmblist/womnid");
  936. if(nodecnt > 0 && womnid!="" && nbabyflag==""){ // 산모번호가 존재시
  937. messageBox("산모/신생아 정보를 확인 후", "C003");
  938. return;
  939. }else if(nodecnt > 0 && womnid=="" && nbabyflag!="" && nbabyflag!="-"){// 산모번호가 존재하지 않을시
  940. messageBox("산모/신생아 정보를 확인 후", "C003");
  941. return;
  942. }
  943. }
  944. // 2013/01/08 End
  945. var dethdd = model.getValue("/root/main/patdethinfo/patdethlist/dethdd");
  946. var dethtm = model.getValue("/root/main/patdethinfo/patdethlist/dethtm");
  947. dethtm = dethtm.substr(0,4);
  948. var dschtm = model.getValue("/root/send/dschtm");
  949. if(dethtm == " "){
  950. dethtm = "";
  951. }
  952. if(dschtm == " "){
  953. dschtm = "";
  954. }
  955. var dethddtm = dethdd + dethtm;
  956. var dschddtm = dschdd + dschtm;
  957. // 2013.09.23 CYW START
  958. var patdethcnt = getNodesetCount("/root/main/patdethinfo/patdethlist");
  959. if( patdethcnt > 0 ){
  960. var dethdd = model.getValue("/root/main/patdethinfo/patdethlist/dethdd");
  961. // 사망일자가 퇴원일 이후인 경우 제외
  962. //if( dschdd >= dethdd ){
  963. if( dschddtm >= dethddtm ){
  964. if(dschtypecd!="06"){
  965. messageBox("사망등록된 환자입니다! 퇴원형태를 ","I007");
  966. model.setFocus("cmb_dschtypecd");
  967. return;
  968. }
  969. if( curersltcd != "07" && curersltcd != "08"){
  970. messageBox("사망등록된 환자입니다! 치료결과를 ","I007");
  971. model.setFocus("cmb_curersltcd");
  972. return;
  973. }
  974. }
  975. }
  976. // 사망등록된 환자입니다! 치료결과/퇴원형태 재확인 바랍니다.
  977. // 2013.09.23 END
  978. ////////////////////////////////////////////////////////////////////////
  979. // 퇴원분석 미비분과 설정
  980. fSetUnPrepDetlDeptInfo();
  981. ////////////////////////////////////////////////////////////////////////
  982. model.removeNodeset("/root/send");
  983. model.makeNode("/root/send/dschanalyinfo");
  984. model.copyNode("/root/send/dschanalyinfo", xDschAnalyListPath);
  985. model.makeValue("/root/send/oplist", grd_oplist.getUpdateData()); // 수술내역
  986. model.makeValue("/root/send/cnstlist", grd_cnstlist.getUpdateData()); // 협의진단
  987. model.makeValue("/root/send/wnmblist", grd_wnmblist.getUpdateData()); // 산모/신생아
  988. model.makeValue("/root/send/chngdeptlist", grd_chngdeptlist.getUpdateData()); // 전과정보
  989. model.makeValue("/root/send/iculist", grd_iculist.getUpdateData()); // 중환자실
  990. model.makeValue("/root/send/detldeptcdinfo", grd_detldeptlist.getUpdateData()); // 미비분과정보
  991. // model.makeValue("/root/send/infdislist", grd_infdislist.getUpdateData()); // 전염병2008-11-23 사용자 요구에 따라 막음(이창록)
  992. var sIndxInfo = model.getValue(xDschAnalyListPath+"/indxinfo").getTrim().split(" ");
  993. var sSaveData = "status▦kpicd▦dsqino▦pid▦dschdd▩";
  994. var indxCnt = 0;
  995. var kpicd = "";
  996. if(sIndxInfo.length > 0){
  997. for(var i=0; i<sIndxInfo.length; i++){
  998. if( sIndxInfo[i] != ""){
  999. if(model.getValue("/root/main/dschanalyhist/indxlist[kpicd = '"+sIndxInfo[i]+"']/dsqino") == ""){
  1000. sSaveData += "i▦"
  1001. + sIndxInfo[i]+"▦"
  1002. + "▦"
  1003. + model.getValue(xDschAnalyListPath+"/pid")+"▦"
  1004. + model.getValue(xDschAnalyListPath+"/dschdd")+"▩";
  1005. }
  1006. }
  1007. }
  1008. }
  1009. indxCnt = getNodesetCnt(model, "/root/main/dschanalyhist/indxlist");
  1010. if(indxCnt > 0){
  1011. for(var iRow=1; iRow <= indxCnt; iRow++){
  1012. kpicd = model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/kpicd");
  1013. if(model.getValue(xDschAnalyListPath+"/indxinfo").indexOf(kpicd) == -1){
  1014. sSaveData += "d▦"
  1015. + kpicd+"▦"
  1016. + model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/dsqino")+"▦"
  1017. + model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/pid")+"▦"
  1018. + model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/dschdd")+"▩";
  1019. }
  1020. }
  1021. }
  1022. model.makeValue("/root/send/indxlist", sSaveData); // 전염병
  1023. if(submit("TXMRD00401")){
  1024. messageBox("저장","I002");
  1025. // 입력 여부 체크
  1026. fCheckItemInputYN();
  1027. //model.refresh();
  1028. // 중환자실 전체 재원일수
  1029. model.removeNodeset("/root/main/dschanalyhist/icutotlist");
  1030. grd_icutotlist.refresh();
  1031. if(grd_iculist.rows > grd_iculist.fixedrows){
  1032. var sTotInHospDayNo = 0;
  1033. var iRow = 0;
  1034. var iICUTotRow = 0;
  1035. var sICUCd = "";
  1036. for(var iStndRow = grd_iculist.fixedrows; iStndRow<=(grd_iculist.rows-grd_iculist.fixedrows); iStndRow++){
  1037. sICUCd = model.getValue("/root/main/dschanalyhist/iculist["+iStndRow+"]/icucd");
  1038. iICUTotRow = grd_icutotlist.findRow(sICUCd, grd_icutotlist.fixedrows, 1);
  1039. sTotInHospDayNo = 0;
  1040. if(iICUTotRow < 1){
  1041. for(var iRow = grd_iculist.fixedrows; iRow <= (grd_iculist.rows-grd_iculist.fixedrows); iRow++){
  1042. if(model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/icucd") == sICUCd){
  1043. sInHospDayNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/inhospdayno");
  1044. if(sInHospDayNo == "") sInHospDayNo = 0;
  1045. sTotInHospDayNo += eval(sInHospDayNo);
  1046. }
  1047. }
  1048. grd_icutotlist.addRow();
  1049. iRow = grd_icutotlist.rows - grd_icutotlist.fixedrows;
  1050. model.setValue(xICUTotListPath+"["+iRow+"]/deptcd",sICUCd);
  1051. model.setValue(xICUTotListPath+"["+iRow+"]/totinhospdayno", sTotInHospDayNo);
  1052. }
  1053. }
  1054. }
  1055. if(model.getValue(xDschAnalyListPath+"/status") == "u"){
  1056. dPid = model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid");
  1057. dDschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  1058. sDschDD = dDschdd.substr(0,4)+"/"+dDschdd.substr(4,2)+"/"+dDschdd.substr(6,2)
  1059. model.setValue("/root/main/cond/statcnts",dPid+"환자의"+sDschDD+"의 퇴원분석이 되어 있습니다.");
  1060. model.makeValue("/root/main/detldeptcdsaveyn", "N");
  1061. // model.refresh();
  1062. }
  1063. model.copyNode("/root/temp/dschanalyhist", "/root/main/dschanalyhist");
  1064. model.setValue("/root/main/dschanalyhist/dschanalyinfo/pid", "");
  1065. model.setFocus("ipt_pid");
  1066. }
  1067. model.refresh();
  1068. }
  1069. /**
  1070. * @desc : 진단 검색 팝업
  1071. * @id :
  1072. * @event : xforms-select
  1073. * @return : void
  1074. * @authur :
  1075. */
  1076. function fPopUpDiag(pGrid, srchCol, rsltCol){
  1077. var sGridID = document.controls(pGrid);
  1078. var ref = sGridID.attribute("nodeset");
  1079. var iRow = sGridID.row;
  1080. var sRtnMsg = "";
  1081. model.setFocus(pGrid);
  1082. if(sGridID.valueMatrix(iRow,srchCol) == "") return;
  1083. setParameter ( "SPMMO00800_cond1" , "1" );
  1084. setParameter ( "SPMMO00800_cond2" , "1" );
  1085. setParameter ( "SPMMO00800_cond3" , "H" );
  1086. setParameter ( "SPMMO00800_cond4" , model.getValue(xDschAnalyListPath+"/dschdd"));
  1087. setParameter ( "SPMMO00800_cond5" , sGridID.valueMatrix(iRow,srchCol));
  1088. modal("SPMMO00800");
  1089. sRtnMsg = getParameter("SPMMO00800_rtn");
  1090. if(sRtnMsg != ""){
  1091. sGridID.valueMatrix(iRow,srchCol) = getArrayData(sRtnMsg,1,1,"▩","▦");
  1092. sGridID.valueMatrix(iRow,rsltCol) = getArrayData(sRtnMsg,1,2,"▩","▦");
  1093. }
  1094. }
  1095. /**
  1096. * @desc : 사용자 검색 팝업
  1097. * @id :
  1098. * @event : xforms-select
  1099. * @return : void
  1100. * @authur : 수정 ->이창록 2008-10-10 12:29오전
  1101. */
  1102. function fPopUpUserInfo(pGrid,srchCol,rsltCol){
  1103. var sGridID = document.controls(pGrid);
  1104. var ref = sGridID.attribute("nodeset");
  1105. var iRow = sGridID.row;
  1106. var sKeyNo = 0; // 각 그리드의 key
  1107. var opdd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdd"); //수술일자
  1108. var reqdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdd");//의뢰일
  1109. var execdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdd");//시행일
  1110. var chngdeptdd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdd");//전출일
  1111. model.setFocus(pGrid);
  1112. setParameter("reqflag", "usernm");
  1113. setParameter("usernm", sGridID.valueMatrix(iRow,srchCol));
  1114. if(pGrid=="grd_oplist"){
  1115. setParameter("stnddd", opdd);
  1116. }else if(("grd_cnstlist")&&(srchCol==5)){
  1117. setParameter("stnddd", reqdd);
  1118. }else if(("grd_cnstlist")&&(srchCol==11)){
  1119. setParameter("stnddd", execdd);
  1120. }else if(pGrid=="grd_chngdeptlist"){
  1121. setParameter("stnddd", chngdeptdd);
  1122. }
  1123. setParameter("autortnyn","Y");
  1124. model.resetInstanceNode("/root/temp/userinfo");
  1125. modal("SPMRF03200");
  1126. sGridID.valueMatrix(iRow,rsltCol) = model.getValue("/root/temp/userinfo/userid");
  1127. sGridID.valueMatrix(iRow,srchCol) = model.getValue("/root/temp/userinfo/usernm");
  1128. if(model.getValue("/root/temp/userinfo/userid") == "") return false;
  1129. else return true;
  1130. }
  1131. /**
  1132. * @desc : 사용자 정보 얻기
  1133. * @id :
  1134. * @event : xforms-select
  1135. * @return : void
  1136. * @authur :
  1137. */
  1138. function fGetUserInfo(userid,usernm,deptcd ,instcd){
  1139. model.setValue("/root/temp/userinfo/userid", userid);
  1140. model.setValue("/root/temp/userinfo/usernm", usernm.getTrim());
  1141. model.setValue("/root/temp/userinfo/deptcd", deptcd);
  1142. model.setValue("/root/temp/userinfo/instcd", instcd);
  1143. }
  1144. /**
  1145. * @ver : 2008-08-25
  1146. * @desc : 감염종류1의 감염종류2의 하부항목들 조회
  1147. * @by : 이창록
  1148. * @param :
  1149. * @return :
  1150. * @---------------------------------------------------
  1151. */
  1152. function fGetInFcCas(code){
  1153. switch(code){
  1154. case "01":
  1155. zbcfGetCodeList(new Array("M0485"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1156. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0485");
  1157. break;
  1158. case "02":
  1159. zbcfGetCodeList(new Array("M0486"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1160. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0486");
  1161. break;
  1162. case "03":
  1163. zbcfGetCodeList(new Array("M0487"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1164. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0487");
  1165. break;
  1166. case "04":
  1167. zbcfGetCodeList(new Array("M0488"),new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1168. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0488");
  1169. break;
  1170. case "05":
  1171. zbcfGetCodeList(new Array("M0489"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1172. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0489");
  1173. break;
  1174. case "06":
  1175. zbcfGetCodeList(new Array("M0490"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1176. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0490");
  1177. break;
  1178. case "07":
  1179. zbcfGetCodeList(new Array("M0491"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1180. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0491");
  1181. break;
  1182. case "08":
  1183. zbcfGetCodeList(new Array("M0492"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1184. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0492");
  1185. break;
  1186. case "09":
  1187. zbcfGetCodeList(new Array("M0493"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1188. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0493");
  1189. break;
  1190. case "10":
  1191. zbcfGetCodeList(new Array("M0494"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1192. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0494");
  1193. break;
  1194. case "11":
  1195. zbcfGetCodeList(new Array("M0495"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1196. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0495");
  1197. break;
  1198. case "12":
  1199. zbcfGetCodeList(new Array("M0496"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1200. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0496");
  1201. break;
  1202. case "13":
  1203. zbcfGetCodeList(new Array("M0497"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  1204. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0497");
  1205. break;
  1206. }
  1207. // 20081218 수정
  1208. //model.refresh();
  1209. model.removeNodeset("/root/hidden/infdcpartinfo/infdcpartlist");
  1210. model.makeNode("/root/hidden/infdcpartinfo/infdcpartlist");
  1211. }
  1212. /**
  1213. * @ver : 2008-10-30
  1214. * @desc : 입원과 및 퇴원과 분과 조회
  1215. * @by : 이창록
  1216. * @param :
  1217. * @return :
  1218. * @---------------------------------------------------
  1219. */
  1220. function fInDschClrsDeptSearch(flag)
  1221. {
  1222. var sDschDD = model.getValue(xDschAnalyListPath+"/dschdd");
  1223. var sInDD = model.getValue("/root/temp/patinfo/chgdschddlist[dschdd='"+sDschDD+"']/indd");
  1224. if(flag=="dsch"){
  1225. model.removeNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist");
  1226. model.makeNode("/root/hidden/dschclrsinfo/dschclrsdeptlist");
  1227. var deptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1228. switch(deptcd){
  1229. case "2010000000":
  1230. zbcfGetCodeList(new Array("M0500"), new Array("/root/tmp/hidden/dschclrsdeptlist"));
  1231. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0500");
  1232. break;
  1233. case "2040000000":
  1234. //2010.03.31. 이은영 : 퇴원일자 기준으로 분과정보 가져옴. (서울성모만 - 외과분과 때문에 퇴원일 기준으로 분과코드를 가져옴.)
  1235. if (getUserInfo("dutplceinstcd") == "000") {
  1236. model.makeValue("/root/send/gsdeptcd", "2040000000");
  1237. model.makeValue("/root/send/stndd", sDschDD);
  1238. submit("TRMRD00417");
  1239. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/init/gsclrsinfo/gsclrsdeptlist");
  1240. } else {
  1241. zbcfGetCodeList(new Array("M0501"), new Array("/root/tmp/hidden/dschclrsdeptlist"));
  1242. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0501");
  1243. }
  1244. break;
  1245. case "2100000000":
  1246. zbcfGetCodeList(new Array("M0502"), new Array("/root/tmp/hidden/dschclrsdeptlist"));
  1247. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0502");
  1248. break;
  1249. case "2110000000":
  1250. zbcfGetCodeList(new Array("M0503"),new Array("/root/tmp/hidden/dschclrsdeptlist"));
  1251. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0503");
  1252. break;
  1253. }
  1254. model.removeNodeset("/root/tmp/hidden/dschclrsdeptlist");
  1255. model.makeNode("/root/tmp/hidden/dschclrsdeptlist");
  1256. }else if(flag=="indd"){
  1257. model.removeNodeset("/root/hidden/inclrsinfo/inclrsdeptlist");
  1258. model.makeNode("/root/hidden/inclrsinfo/inclrsdeptlist");
  1259. var deptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1260. switch(deptcd){
  1261. case "2010000000":
  1262. zbcfGetCodeList(new Array("M0500"), new Array("/root/tmp/hidden/inclrsdeptlist"));
  1263. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0500");
  1264. break;
  1265. case "2040000000":
  1266. //2010.03.31. 이은영 : 퇴원일자 기준으로 분과정보 가져옴. (서울성모만 - 외과분과 때문에 퇴원일 기준으로 분과코드를 가져옴.)
  1267. if (getUserInfo("dutplceinstcd") == "000") {
  1268. model.makeValue("/root/send/gsdeptcd", "2040000000");
  1269. model.makeValue("/root/send/stndd", sInDD);
  1270. submit("TRMRD00417");
  1271. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/init/gsclrsinfo/gsclrsdeptlist");
  1272. } else {
  1273. zbcfGetCodeList(new Array("M0501"), new Array("/root/tmp/hidden/inclrsdeptlist"));
  1274. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0501");
  1275. }
  1276. break;
  1277. case "2100000000":
  1278. zbcfGetCodeList(new Array("M0502"), new Array("/root/tmp/hidden/inclrsdeptlist"));
  1279. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0502");
  1280. break;
  1281. case "2110000000":
  1282. zbcfGetCodeList(new Array("M0503"),new Array("/root/tmp/hidden/inclrsdeptlist"));
  1283. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0503");
  1284. break;
  1285. }
  1286. model.removeNodeset("/root/tmp/hidden/inclrsdeptlist");
  1287. model.makeNode("/root/tmp/hidden/inclrsdeptlist");
  1288. }
  1289. // 20081218 수정
  1290. //model.refresh();
  1291. }
  1292. function fOpGridStatusChg()
  1293. {
  1294. var iRow = grd_oplist.row;
  1295. var iCol = grd_oplist.col;
  1296. var iStatus = grd_oplist.rowStatus(iRow);
  1297. var sDsopNo = "";
  1298. if(iCol != 7 && iStatus == 2){
  1299. sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1300. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno='"+sDsopNo+"']").xml){
  1301. grd_oplist.rowStatus(iRow) = 0;
  1302. }
  1303. }
  1304. }
  1305. /**
  1306. * @ver : 2008-12-07
  1307. * @desc : 입원과 및 퇴원과 분과 선택시 그리드 분과 변경
  1308. * @by : 이창록
  1309. * @param :
  1310. * @return :
  1311. * @---------------------------------------------------
  1312. */
  1313. function fClrsDeptSelected(flag)
  1314. {
  1315. if(flag =="dsch"){
  1316. // 수술내역
  1317. for(var iRow = grd_oplist.fixedrows; iRow <= grd_oplist.rows-grd_oplist.fixedrows; iRow++){
  1318. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd");
  1319. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1320. var iStatus = grd_oplist.rowStatus(iRow);
  1321. if(dschdeptcd==perfdeptcd){
  1322. if((perfdeptcd=="2010000000")||(perfdeptcd=="2040000000")||(perfdeptcd=="2100000000")||(perfdeptcd=="2110000000")){
  1323. model.makeValue("/root/main/dschanalyhist/oplist["+iRow+"]/opclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1324. if(iStatus == 0){
  1325. grd_oplist.rowStatus(iRow) = 2;
  1326. }else if(iStatus == 2){
  1327. var sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1328. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno='"+sDsopNo+"']").xml){
  1329. grd_oplist.rowStatus(iRow) = 0;
  1330. }
  1331. }
  1332. }
  1333. }
  1334. }
  1335. // 20081218 수정
  1336. //grd_oplist.refresh();
  1337. // 협의진단
  1338. for(var iRow = grd_cnstlist.fixedrows; iRow <= grd_cnstlist.rows-grd_cnstlist.fixedrows; iRow++){
  1339. var reqdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd");
  1340. var execdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd");
  1341. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1342. var iStatus = grd_cnstlist.rowStatus(iRow);
  1343. if(dschdeptcd==reqdeptcd){
  1344. if((reqdeptcd=="2010000000")||(reqdeptcd=="2040000000")||(reqdeptcd=="2100000000")||(reqdeptcd=="2110000000")){
  1345. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1346. if(iStatus == 0){
  1347. grd_cnstlist.rowStatus(iRow) = 2;
  1348. }else if(iStatus == 2){
  1349. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1350. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1351. grd_cnstlist.rowStatus(iRow) = 0;
  1352. }
  1353. }
  1354. }
  1355. }
  1356. if(dschdeptcd==execdeptcd){
  1357. if((execdeptcd=="2010000000")||(execdeptcd=="2040000000")||(execdeptcd=="2100000000")||(execdeptcd=="2110000000")){
  1358. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execlrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1359. if(iStatus == 0){
  1360. grd_cnstlist.rowStatus(iRow) = 2;
  1361. }else if(iStatus == 2){
  1362. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1363. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1364. grd_cnstlist.rowStatus(iRow) = 0;
  1365. }
  1366. }
  1367. }
  1368. }
  1369. }
  1370. // 20081218 수정
  1371. //grd_cnstlist.refresh();
  1372. // 전과정보
  1373. for(var iRow = grd_chngdeptlist.fixedrows; iRow <= grd_chngdeptlist.rows-grd_chngdeptlist.fixedrows; iRow++){
  1374. var chngdeptcd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd");
  1375. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1376. var iStatus = grd_chngdeptlist.rowStatus(iRow);
  1377. if(dschdeptcd==chngdeptcd){
  1378. if((chngdeptcd=="2010000000")||(chngdeptcd=="2040000000")||(chngdeptcd=="2100000000")||(chngdeptcd=="2110000000")){
  1379. model.makeValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1380. if(iStatus == 0){
  1381. grd_chngdeptlist.rowStatus(iRow) = 2;
  1382. }else if(iStatus == 2){
  1383. var sDscdNo = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/dscdno");
  1384. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno='"+sDscdNo+"']").xml){
  1385. grd_chngdeptlist.rowStatus(iRow) = 0;
  1386. }
  1387. }
  1388. }
  1389. }
  1390. }
  1391. // 20081218 수정
  1392. //grd_chngdeptlist.refresh();
  1393. // 중환자실
  1394. for(var iRow = grd_iculist.fixedrows; iRow <= grd_iculist.rows-grd_iculist.fixedrows; iRow++){
  1395. var orddeptcd = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/orddeptcd");
  1396. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1397. var iStatus = grd_iculist.rowStatus(iRow);
  1398. if(dschdeptcd==orddeptcd){
  1399. if((orddeptcd=="2010000000")||(orddeptcd=="2040000000")||(orddeptcd=="2100000000")||(orddeptcd=="2110000000")){
  1400. model.makeValue("/root/main/dschanalyhist/iculist["+iRow+"]/ordclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1401. if(iStatus == 0){
  1402. grd_iculist.rowStatus(iRow) = 2;
  1403. }else if(iStatus == 2){
  1404. var sDsicuNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/dsicuno");
  1405. if(instance1.selectSingleNode("/root/main/dschanalyhist/iculist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/iculist[dsicuno='"+sDsicuNo+"']").xml){
  1406. grd_iculist.rowStatus(iRow) = 0;
  1407. }
  1408. }
  1409. }
  1410. }
  1411. }
  1412. // 20081218 수정
  1413. //grd_iculist.refresh();
  1414. }else if(flag =="in"){
  1415. // 수술내역
  1416. for(var iRow = grd_oplist.fixedrows; iRow <= grd_oplist.rows-grd_oplist.fixedrows; iRow++){
  1417. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd");
  1418. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1419. var iStatus = grd_oplist.rowStatus(iRow);
  1420. if(indeptcd==perfdeptcd){
  1421. if((perfdeptcd=="2010000000")||(perfdeptcd=="2040000000")||(perfdeptcd=="2100000000")||(perfdeptcd=="2110000000")){
  1422. model.makeValue("/root/main/dschanalyhist/oplist["+iRow+"]/opclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1423. if(iStatus == 0){
  1424. grd_oplist.rowStatus(iRow) = 2;
  1425. }else if(iStatus == 2){
  1426. var sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1427. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno='"+sDsopNo+"']").xml){
  1428. grd_oplist.rowStatus(iRow) = 0;
  1429. }
  1430. }
  1431. }
  1432. }
  1433. }
  1434. // 20081218 수정
  1435. //grd_oplist.refresh();
  1436. // 협의진단
  1437. for(var iRow = grd_cnstlist.fixedrows; iRow <= grd_cnstlist.rows-grd_cnstlist.fixedrows; iRow++){
  1438. var reqdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd");
  1439. var execdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd");
  1440. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1441. var iStatus = grd_cnstlist.rowStatus(iRow);
  1442. if(indeptcd==reqdeptcd){
  1443. if((reqdeptcd=="2010000000")||(reqdeptcd=="2040000000")||(reqdeptcd=="2100000000")||(reqdeptcd=="2110000000")){
  1444. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1445. if(iStatus == 0){
  1446. grd_cnstlist.rowStatus(iRow) = 2;
  1447. }else if(iStatus == 2){
  1448. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1449. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1450. grd_cnstlist.rowStatus(iRow) = 0;
  1451. }
  1452. }
  1453. }
  1454. }
  1455. if(indeptcd==execdeptcd){
  1456. if((execdeptcd=="2010000000")||(execdeptcd=="2040000000")||(execdeptcd=="2100000000")||(execdeptcd=="2110000000")){
  1457. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execlrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1458. if(iStatus == 0){
  1459. grd_cnstlist.rowStatus(iRow) = 2;
  1460. }else if(iStatus == 2){
  1461. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1462. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1463. grd_cnstlist.rowStatus(iRow) = 0;
  1464. }
  1465. }
  1466. }
  1467. }
  1468. }
  1469. // 20081218 수정
  1470. //grd_cnstlist.refresh();
  1471. // 전과정보
  1472. for(var iRow = grd_chngdeptlist.fixedrows; iRow <= grd_chngdeptlist.rows-grd_chngdeptlist.fixedrows; iRow++){
  1473. var chngdeptcd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd");
  1474. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1475. var iStatus = grd_chngdeptlist.rowStatus(iRow);
  1476. if(indeptcd==chngdeptcd){
  1477. if((chngdeptcd=="2010000000")||(chngdeptcd=="2040000000")||(chngdeptcd=="2100000000")||(chngdeptcd=="2110000000")){
  1478. model.makeValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1479. if(iStatus == 0){
  1480. grd_chngdeptlist.rowStatus(iRow) = 2;
  1481. }else if(iStatus == 2){
  1482. var sDscdNo = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/dscdno");
  1483. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno='"+sDscdNo+"']").xml){
  1484. grd_chngdeptlist.rowStatus(iRow) = 0;
  1485. }
  1486. }
  1487. }
  1488. }
  1489. }
  1490. // 20081218 수정
  1491. //grd_chngdeptlist.refresh();
  1492. // 중환자실
  1493. for(var iRow = grd_iculist.fixedrows; iRow <= grd_iculist.rows-grd_iculist.fixedrows; iRow++){
  1494. var orddeptcd = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/orddeptcd");
  1495. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1496. var iStatus = grd_iculist.rowStatus(iRow);
  1497. if(indeptcd==orddeptcd){
  1498. if((orddeptcd=="2010000000")||(orddeptcd=="2040000000")||(orddeptcd=="2100000000")||(orddeptcd=="2110000000")){
  1499. model.makeValue("/root/main/dschanalyhist/iculist["+iRow+"]/ordclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1500. if(iStatus == 0){
  1501. grd_iculist.rowStatus(iRow) = 2;
  1502. }else if(iStatus == 2){
  1503. var sDsicuNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/dsicuno");
  1504. if(instance1.selectSingleNode("/root/main/dschanalyhist/iculist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/iculist[dsicuno='"+sDsicuNo+"']").xml){
  1505. grd_iculist.rowStatus(iRow) = 0;
  1506. }
  1507. }
  1508. }
  1509. }
  1510. }
  1511. // 20081218 수정
  1512. //grd_iculist.refresh();
  1513. }
  1514. //2013/01/08 Start
  1515. fnbabychk();
  1516. //2013/01/08 End
  1517. }
  1518. /**
  1519. * @ver : 2008-12-09
  1520. * @desc : 각 그리드정보의 의사 정보 조회
  1521. * @by : 이창록
  1522. * @param :
  1523. * @return :
  1524. * @---------------------------------------------------
  1525. */
  1526. function fGridGetDeptUserInfo(pGrid)
  1527. {
  1528. if(pGrid =="grd_oplist"){//수술정보
  1529. var iRow = grd_oplist.row - grd_oplist.fixedRows + 1;
  1530. var opdd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdd");
  1531. var iStatus = grd_oplist.rowStatus(iRow);
  1532. var opdeptengabbr = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdeptengabbr");
  1533. var perfdrnm = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm");
  1534. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd");
  1535. var opdepthngnm = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdepthngnm");
  1536. var perfdrid = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid");
  1537. var sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1538. if(event.keyCode == 13){
  1539. if(opdd==""){
  1540. messageBox("수술일자를 먼저","C001");
  1541. return;
  1542. }
  1543. if(grd_oplist.col==3){
  1544. if(opdeptengabbr==""){
  1545. return;
  1546. }
  1547. model.makeValue("root/send/stnddd" ,opdd);
  1548. model.makeValue("root/send/deptengabbr" ,opdeptengabbr);
  1549. if(submit("TRMRD00405", false)){
  1550. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1551. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdepthngnm" ,model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1552. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd" ,model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1553. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdeptengabbr ",model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1554. }else{
  1555. messageBox("입력하신 해당과가","I004");
  1556. return;
  1557. }
  1558. }
  1559. model.removeNodeset("/root/send");
  1560. }else if(grd_oplist.col==7){
  1561. if(perfdeptcd==""){
  1562. messageBox("해당수술과를 먼저","C001");
  1563. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm","");
  1564. return;
  1565. }
  1566. if(perfdrnm==""){
  1567. return;
  1568. }
  1569. model.makeValue("root/send/stndd" ,opdd);
  1570. model.makeValue("root/send/usernm" ,perfdrnm);
  1571. model.makeValue("root/send/stndeptcd" ,perfdeptcd);
  1572. if(submit("TRMRD00406", false)){
  1573. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1574. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1575. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1576. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1577. var sRtnMsg = fPopUpUserInfo("grd_oplist", 7, 19);
  1578. if(sRtnMsg == false && iStatus == 2){
  1579. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm", model.getValue("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']/perfdrnm"));
  1580. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid", model.getValue("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']/perfdrid"));
  1581. }
  1582. }else{
  1583. messageBox(opdepthngnm+"에는 입력하신 의사정보가","I004");
  1584. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm","");
  1585. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid","");
  1586. return;
  1587. }
  1588. if(iStatus == 2){
  1589. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']").xml ){
  1590. grd_oplist.rowStatus(iRow) = 0;
  1591. }
  1592. }else if(iStatus == 0){
  1593. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']").xml ){
  1594. grd_oplist.rowStatus(iRow) = 2;
  1595. }
  1596. }
  1597. }
  1598. model.removeNodeset("/root/send");
  1599. }
  1600. }
  1601. // 20081218 수정
  1602. //grd_oplist.refresh();
  1603. }else if(pGrid =="grd_cnstlist"){//협의정보
  1604. var iRow = grd_cnstlist.row - grd_cnstlist.fixedRows + 1;
  1605. var reqdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdd");
  1606. var reqdrnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm");
  1607. var reqdeptengabbr = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptengabbr");
  1608. var reqdepthngnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdepthngnm");
  1609. var reqdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd");
  1610. var execdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdd");
  1611. var execdrnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm");
  1612. var execdeptengabbr = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptengabbr");
  1613. var execdepthngnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdepthngnm");
  1614. var execdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd");
  1615. var iStatus = grd_cnstlist.rowStatus(iRow);
  1616. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1617. if(event.keyCode == 13){
  1618. if(grd_cnstlist.col==1){
  1619. if(reqdeptengabbr==""){
  1620. return;
  1621. }
  1622. if(reqdd==""){
  1623. messageBox("의뢰일을 먼저","C001");
  1624. return;
  1625. }
  1626. model.makeValue("root/send/stnddd" ,reqdd);
  1627. model.makeValue("root/send/deptengabbr" ,reqdeptengabbr);
  1628. if(submit("TRMRD00405", false)){
  1629. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1630. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdepthngnm" ,model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1631. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd" ,model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1632. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptengabbr" ,model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1633. }else{
  1634. messageBox("입력하신 해당과가","I004");
  1635. return;
  1636. }
  1637. }
  1638. model.removeNodeset("/root/send");
  1639. }else if(grd_cnstlist.col==7){
  1640. if(execdeptengabbr==""){
  1641. return;
  1642. }
  1643. if(execdd==""){
  1644. messageBox("회신일을 먼저","C001");
  1645. return;
  1646. }
  1647. model.makeValue("root/send/stnddd",execdd);
  1648. model.makeValue("root/send/deptengabbr",execdeptengabbr);
  1649. if(submit("TRMRD00405", false)){
  1650. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1651. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdepthngnm" ,model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1652. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd" ,model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1653. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptengabbr",model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1654. }else{
  1655. messageBox("입력하신 해당과가","I004");
  1656. return;
  1657. }
  1658. }
  1659. model.removeNodeset("/root/send");
  1660. }else if(grd_cnstlist.col==5){
  1661. if(reqdeptcd==""){
  1662. messageBox("해당의뢰과를 먼저","C001");
  1663. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm","");
  1664. return;
  1665. }
  1666. if(reqdrnm==""){
  1667. return;
  1668. }
  1669. model.makeValue("root/send/stndd" ,reqdd);
  1670. model.makeValue("root/send/usernm" ,reqdrnm);
  1671. model.makeValue("root/send/stndeptcd" ,reqdeptcd);
  1672. if(submit("TRMRD00406", false)){
  1673. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1674. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1675. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1676. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1677. var sRtnMsg = fPopUpUserInfo("grd_cnstlist", 5, 18);
  1678. if(sRtnMsg == false && iStatus == 2){
  1679. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/reqdrnm"));
  1680. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrid", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/reqdrid"));
  1681. }
  1682. }else{
  1683. messageBox(reqdepthngnm+"에는 입력하신 의사정보가","I004");
  1684. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm","");
  1685. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrid","");
  1686. return;
  1687. }
  1688. if(iStatus == 2){
  1689. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1690. grd_cnstlist.rowStatus(iRow) = 0;
  1691. }
  1692. }else if(iStatus == 0){
  1693. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1694. grd_cnstlist.rowStatus(iRow) = 2;
  1695. }
  1696. }
  1697. }
  1698. model.removeNodeset("/root/send");
  1699. }else if(grd_cnstlist.col==11){
  1700. if(execdeptcd==""){
  1701. messageBox("해당회신과를 먼저","C001");
  1702. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm","");
  1703. return;
  1704. }
  1705. if(execdrnm==""){
  1706. return;
  1707. }
  1708. model.makeValue("root/send/stndd" ,execdd);
  1709. model.makeValue("root/send/usernm" ,execdrnm);
  1710. model.makeValue("root/send/stndeptcd" ,execdeptcd);
  1711. if(submit("TRMRD00406", false)){
  1712. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1713. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1714. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1715. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1716. var sRtnMsg = fPopUpUserInfo("grd_cnstlist", 11, 19);
  1717. if(sRtnMsg == false && iStatus == 2){
  1718. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/execdrnm"));
  1719. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrid", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/execdrid"));
  1720. }
  1721. }else{
  1722. messageBox(execdepthngnm+"에는 입력하신 의사정보가","I004");
  1723. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm","");
  1724. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrid","");
  1725. return;
  1726. }
  1727. if(iStatus == 2){
  1728. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1729. grd_cnstlist.rowStatus(iRow) = 0;
  1730. }
  1731. }else if(iStatus == 0){
  1732. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1733. grd_cnstlist.rowStatus(iRow) = 2;
  1734. }
  1735. }
  1736. }
  1737. model.removeNodeset("/root/send");
  1738. }
  1739. }
  1740. // 20081218 수정
  1741. //grd_cnstlist.refresh();
  1742. }else if(pGrid =="grd_chngdeptlist"){//전과정보
  1743. if(event.keyCode == 13){
  1744. var iRow = grd_chngdeptlist.row - grd_chngdeptlist.fixedRows + 1;
  1745. var chngdeptdd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdd");
  1746. var chngdeptengabbr = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptengabbr");
  1747. var chngdeptdrnm = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm");
  1748. var chngdeptcd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd");
  1749. var chngdepthngnm = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdepthngnm");
  1750. var iStatus = grd_chngdeptlist.rowStatus(iRow);
  1751. var sDscdNo = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/dscdno");
  1752. if(grd_chngdeptlist.col==2){
  1753. if(chngdeptengabbr==""){
  1754. return;
  1755. }
  1756. if(chngdeptdd==""){
  1757. messageBox("전출일자를 먼저","C001");
  1758. return;
  1759. }
  1760. model.makeValue("root/send/stnddd" ,chngdeptdd);
  1761. model.makeValue("root/send/deptengabbr" ,chngdeptengabbr);
  1762. if(submit("TRMRD00405", false)){
  1763. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1764. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdepthngnm",model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1765. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd",model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1766. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptengabbr",model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1767. }else{
  1768. messageBox("입력하신 해당과가","I004");
  1769. return;
  1770. }
  1771. }
  1772. model.removeNodeset("/root/send");
  1773. }else if(grd_chngdeptlist.col==6){
  1774. if(chngdeptcd==""){
  1775. messageBox("해당전출과를 먼저","C001");
  1776. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm","");
  1777. return;
  1778. }
  1779. if(chngdeptdrnm==""){
  1780. return;
  1781. }
  1782. model.makeValue("root/send/stndd" ,chngdeptdd);
  1783. model.makeValue("root/send/usernm" ,chngdeptdrnm);
  1784. model.makeValue("root/send/stndeptcd" ,chngdeptcd);
  1785. if(submit("TRMRD00406", false)){
  1786. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1787. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1788. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1789. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1790. var sRtnMsg = fPopUpUserInfo("grd_chngdeptlist", 6, 14);
  1791. if(sRtnMsg == false && iStatus == 2){
  1792. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm", model.getValue("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']/chngdeptdrnm"));
  1793. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrid", model.getValue("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']/chngdeptdrid"));
  1794. }
  1795. }else{
  1796. messageBox(chngdepthngnm+"에는 입력하신 의사정보가","I004");
  1797. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm","");
  1798. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrid","");
  1799. return;
  1800. }
  1801. if(iStatus == 2){
  1802. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']").xml ){
  1803. grd_chngdeptlist.rowStatus(iRow) = 0;
  1804. }
  1805. }else if(iStatus == 0){
  1806. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']").xml ){
  1807. grd_chngdeptlist.rowStatus(iRow) = 2;
  1808. }
  1809. }
  1810. }
  1811. model.removeNodeset("/root/send");
  1812. }
  1813. // 20081218 수정
  1814. //grd_chngdeptlist.refresh();
  1815. }
  1816. }else if(pGrid =="grd_iculist"){//중환자실정보
  1817. var iRow = grd_iculist.row - grd_iculist.fixedRows + 1;
  1818. var inrmdd = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/inrmdd");
  1819. var orddeptengabbr = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/orddeptengabbr");
  1820. if(event.keyCode == 13){
  1821. if(grd_iculist.col==2){
  1822. if(grd_iculist.valueMatrix(iRow,2)==""){
  1823. return;
  1824. }
  1825. if(inrmdd==""){
  1826. messageBox("입실일자를 먼저","C001");
  1827. return;
  1828. }
  1829. model.makeValue("root/send/stnddd",inrmdd);
  1830. model.makeValue("root/send/deptengabbr",grd_iculist.valueMatrix(iRow,2));
  1831. if(submit("TRMRD00405", false)){
  1832. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1833. var depthngnm = model.getValue("/root/temp/stndeptlist/stndept/depthngnm")
  1834. var deptcd = model.getValue("/root/temp/stndeptlist/stndept/deptcd")
  1835. var deptengabbr =model.getValue("/root/temp/stndeptlist/stndept/deptengabbr")
  1836. grd_iculist.valueMatrix(iRow,2)=deptengabbr;
  1837. grd_iculist.valueMatrix(iRow,3)=depthngnm;
  1838. grd_iculist.valueMatrix(iRow,4)=deptcd;
  1839. }else{
  1840. messageBox("입력하신 해당과가","I004");
  1841. return;
  1842. }
  1843. }
  1844. model.removeNodeset("/root/send");
  1845. }
  1846. }
  1847. // 20081218 수정
  1848. //grd_iculist.refresh();
  1849. }
  1850. }
  1851. /**
  1852. * @ver : 2008-12-09
  1853. * @desc : 각 input정보의 의사 정보 조회
  1854. * @by : 이창록
  1855. * @param :
  1856. * @return :
  1857. * @---------------------------------------------------
  1858. */
  1859. function fIptGetDeptUserInfo(flag)
  1860. {
  1861. var inrmdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/inrmdd");
  1862. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1863. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1864. var dschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  1865. if(flag =="ipt_indrid"){
  1866. if(event.keyCode == 13){
  1867. model.makeValue("root/send/stndd" ,inrmdd);
  1868. model.makeValue("root/send/userid" ,ipt_indrid.currentText);
  1869. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1870. if(submit("TRMRD00406", false)){
  1871. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1872. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1873. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1874. // 20081218 수정
  1875. //ipt_indrid.refresh();
  1876. //ipt_indrnm.refresh();
  1877. model.refresh();
  1878. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1879. clearParameter("reqflag");
  1880. clearParameter("usernm");
  1881. clearParameter("stnddd");
  1882. clearParameter("autortnyn");
  1883. setParameter("reqflag", "userid");
  1884. setParameter("userid", ipt_indrid.currentText);
  1885. setParameter("stnddd", inrmdd);
  1886. setParameter("autortnyn","Y");
  1887. model.resetInstanceNode("/root/temp/userinfo");
  1888. modal("SPMRF03200");
  1889. var userid = model.getValue("/root/temp/userinfo/userid")
  1890. if(userid!=""){
  1891. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/userinfo/userid"));
  1892. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/userinfo/usernm"));
  1893. // 20081218 수정
  1894. //ipt_indrid.refresh();
  1895. //ipt_indrnm.refresh();
  1896. model.refresh();
  1897. }else{
  1898. return;
  1899. }
  1900. }else{
  1901. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1902. // 20081218 수정
  1903. //ipt_indrid.refresh();
  1904. //ipt_indrnm.refresh();
  1905. model.refresh();
  1906. return;
  1907. }
  1908. }
  1909. }
  1910. }else if(flag =="ipt_indrnm"){
  1911. if(event.keyCode == 13){
  1912. model.makeValue("root/send/stndd" ,inrmdd);
  1913. model.makeValue("root/send/usernm" ,ipt_indrnm.currentText);
  1914. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1915. if(submit("TRMRD00406", false)){
  1916. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1917. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1918. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1919. // 20081218 수정
  1920. //ipt_indrid.refresh();
  1921. //ipt_indrnm.refresh();
  1922. model.refresh();
  1923. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1924. clearParameter("reqflag");
  1925. clearParameter("usernm");
  1926. clearParameter("stnddd");
  1927. clearParameter("autortnyn");
  1928. setParameter("reqflag", "usernm");
  1929. setParameter("userid", ipt_indrnm.currentText);
  1930. setParameter("stnddd", inrmdd);
  1931. setParameter("autortnyn","Y");
  1932. model.resetInstanceNode("/root/temp/userinfo");
  1933. modal("SPMRF03200");
  1934. var userid = model.getValue("/root/temp/userinfo/userid")
  1935. if(userid!=""){
  1936. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/userinfo/userid"));
  1937. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/userinfo/usernm"));
  1938. // 20081218 수정
  1939. //ipt_indrid.refresh();
  1940. //ipt_indrnm.refresh();
  1941. model.refresh();
  1942. }else{
  1943. return;
  1944. }
  1945. }else{
  1946. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1947. // 20081218 수정
  1948. //ipt_indrid.refresh();
  1949. //ipt_indrnm.refresh();
  1950. model.refresh();
  1951. return;
  1952. }
  1953. }
  1954. }
  1955. }else if(flag =="ipt_inapprtcdrid"){
  1956. if(event.keyCode == 13){
  1957. model.makeValue("root/send/stndd" ,inrmdd);
  1958. model.makeValue("root/send/userid" ,ipt_inapprtcdrid.currentText);
  1959. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1960. if(submit("TRMRD00406", false)){
  1961. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1962. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1963. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1964. // 20081218 수정
  1965. //ipt_inapprtcdrid.refresh();
  1966. //ipt_inapprtcdrnm.refresh();
  1967. model.refresh();
  1968. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1969. clearParameter("reqflag");
  1970. clearParameter("usernm");
  1971. clearParameter("stnddd");
  1972. clearParameter("autortnyn");
  1973. setParameter("reqflag", "userid");
  1974. setParameter("userid", ipt_inapprtcdrid.currentText);
  1975. setParameter("stnddd", inrmdd);
  1976. setParameter("autortnyn","Y");
  1977. model.resetInstanceNode("/root/temp/userinfo");
  1978. modal("SPMRF03200");
  1979. var userid = model.getValue("/root/temp/userinfo/userid")
  1980. if(userid!=""){
  1981. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  1982. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1983. // 20081218 수정
  1984. //ipt_inapprtcdrid.refresh();
  1985. //ipt_inapprtcdrnm.refresh();
  1986. model.refresh();
  1987. }else{
  1988. return;
  1989. }
  1990. }else{
  1991. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1992. // 20081218 수정
  1993. //ipt_inapprtcdrid.refresh();
  1994. //ipt_inapprtcdrnm.refresh();
  1995. model.refresh();
  1996. return;
  1997. }
  1998. }
  1999. }
  2000. }else if(flag =="ipt_inapprtcdrnm"){
  2001. if(event.keyCode == 13){
  2002. model.makeValue("root/send/stndd" ,inrmdd);
  2003. model.makeValue("root/send/usernm" ,ipt_inapprtcdrnm.currentText);
  2004. model.makeValue("root/send/stndeptcd" ,indeptcd);
  2005. if(submit("TRMRD00406", false)){
  2006. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  2007. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  2008. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  2009. // 20081218 수정
  2010. //ipt_inapprtcdrid.refresh();
  2011. //ipt_inapprtcdrnm.refresh();
  2012. model.refresh();
  2013. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  2014. clearParameter("reqflag");
  2015. clearParameter("usernm");
  2016. clearParameter("stnddd");
  2017. clearParameter("autortnyn");
  2018. setParameter("reqflag", "usernm");
  2019. setParameter("userid", ipt_inapprtcdrnm.currentText);
  2020. setParameter("stnddd", inrmdd);
  2021. setParameter("autortnyn","Y");
  2022. model.resetInstanceNode("/root/temp/userinfo");
  2023. modal("SPMRF03200");
  2024. var userid = model.getValue("/root/temp/userinfo/userid")
  2025. if(userid!=""){
  2026. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  2027. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  2028. // 20081218 수정
  2029. //ipt_inapprtcdrid.refresh();
  2030. //ipt_inapprtcdrnm.refresh();
  2031. model.refresh();
  2032. }else{
  2033. return;
  2034. }
  2035. }else{
  2036. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  2037. // 20081218 수정
  2038. //ipt_inapprtcdrid.refresh();
  2039. //ipt_inapprtcdrnm.refresh();
  2040. model.refresh();
  2041. return;
  2042. }
  2043. }
  2044. }
  2045. }else if(flag =="ipt_dschdrid"){
  2046. if(event.keyCode == 13){
  2047. model.makeValue("root/send/stndd" ,dschdd);
  2048. model.makeValue("root/send/userid" ,ipt_dschdrid.currentText);
  2049. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  2050. if(submit("TRMRD00406", false)){
  2051. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  2052. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  2053. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  2054. // 20081218 수정
  2055. //ipt_dschdrid.refresh();
  2056. //ipt_dschdrnm.refresh();
  2057. model.refresh();
  2058. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  2059. clearParameter("reqflag");
  2060. clearParameter("usernm");
  2061. clearParameter("stnddd");
  2062. clearParameter("autortnyn");
  2063. setParameter("reqflag", "userid");
  2064. setParameter("userid", ipt_dschdrid.currentText);
  2065. setParameter("stnddd", dschdd);
  2066. setParameter("autortnyn","Y");
  2067. model.resetInstanceNode("/root/temp/userinfo");
  2068. modal("SPMRF03200");
  2069. var userid = model.getValue("/root/temp/userinfo/userid")
  2070. if(userid!=""){
  2071. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/userinfo/userid"));
  2072. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/userinfo/usernm"));
  2073. // 20081218 수정
  2074. //ipt_dschdrid.refresh();
  2075. //ipt_dschdrnm.refresh();
  2076. model.refresh();
  2077. }else{
  2078. return;
  2079. }
  2080. }else{
  2081. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  2082. // 20081218 수정
  2083. //ipt_dschdrid.refresh();
  2084. //ipt_dschdrnm.refresh();
  2085. model.refresh();
  2086. return;
  2087. }
  2088. }
  2089. }
  2090. }else if(flag =="ipt_dschdrnm"){
  2091. if(event.keyCode == 13){
  2092. model.makeValue("root/send/stndd" ,dschdd);
  2093. model.makeValue("root/send/usernm" ,ipt_dschdrnm.currentText);
  2094. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  2095. if(submit("TRMRD00406", false)){
  2096. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  2097. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  2098. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  2099. // 20081218 수정
  2100. //ipt_dschdrid.refresh();
  2101. //ipt_dschdrnm.refresh();
  2102. model.refresh();
  2103. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  2104. clearParameter("reqflag");
  2105. clearParameter("usernm");
  2106. clearParameter("stnddd");
  2107. clearParameter("autortnyn");
  2108. setParameter("reqflag", "usernm");
  2109. setParameter("userid", ipt_dschdrnm.currentText);
  2110. setParameter("stnddd", dschdd);
  2111. setParameter("autortnyn","Y");
  2112. model.resetInstanceNode("/root/temp/userinfo");
  2113. modal("SPMRF03200");
  2114. var userid = model.getValue("/root/temp/userinfo/userid")
  2115. if(userid!=""){
  2116. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/userinfo/userid"));
  2117. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/userinfo/usernm"));
  2118. // 20081218 수정
  2119. //ipt_dschdrid.refresh();
  2120. //ipt_dschdrnm.refresh();
  2121. model.refresh();
  2122. }else{
  2123. return;
  2124. }
  2125. }else{
  2126. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  2127. // 20081218 수정
  2128. //ipt_dschdrid.refresh();
  2129. //ipt_dschdrnm.refresh();
  2130. model.refresh();
  2131. return;
  2132. }
  2133. }
  2134. }
  2135. }else if(flag =="ipt_dschapprtcdrid"){
  2136. if(event.keyCode == 13){
  2137. model.makeValue("root/send/stndd" ,dschdd);
  2138. model.makeValue("root/send/userid" ,ipt_dschapprtcdrid.currentText);
  2139. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  2140. if(submit("TRMRD00406", false)){
  2141. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  2142. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  2143. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  2144. // 20081218 수정
  2145. //ipt_dschapprtcdrid.refresh();
  2146. //ipt_dschapprtcdrnm.refresh();
  2147. model.refresh();
  2148. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  2149. clearParameter("reqflag");
  2150. clearParameter("usernm");
  2151. clearParameter("stnddd");
  2152. clearParameter("autortnyn");
  2153. setParameter("reqflag", "userid");
  2154. setParameter("userid", ipt_dschapprtcdrid.currentText);
  2155. setParameter("stnddd", dschdd);
  2156. setParameter("autortnyn","Y");
  2157. model.resetInstanceNode("/root/temp/userinfo");
  2158. modal("SPMRF03200");
  2159. var userid = model.getValue("/root/temp/userinfo/userid")
  2160. if(userid!=""){
  2161. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  2162. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  2163. // 20081218 수정
  2164. //ipt_dschapprtcdrid.refresh();
  2165. //ipt_dschapprtcdrnm.refresh();
  2166. model.refresh();
  2167. }else{
  2168. return;
  2169. }
  2170. }else{
  2171. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  2172. // 20081218 수정
  2173. //ipt_dschapprtcdrid.refresh();
  2174. //ipt_dschapprtcdrnm.refresh();
  2175. model.refresh();
  2176. return;
  2177. }
  2178. }
  2179. }
  2180. }else if(flag =="ipt_dschapprtcdrnm"){
  2181. if(event.keyCode == 13){
  2182. model.makeValue("root/send/stndd" ,dschdd);
  2183. model.makeValue("root/send/usernm" ,ipt_dschapprtcdrnm.currentText);
  2184. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  2185. if(submit("TRMRD00406",false)){
  2186. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  2187. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  2188. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  2189. // 20081218 수정
  2190. //ipt_dschapprtcdrid.refresh();
  2191. //ipt_dschapprtcdrnm.refresh();
  2192. model.refresh();
  2193. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  2194. clearParameter("reqflag");
  2195. clearParameter("usernm");
  2196. clearParameter("stnddd");
  2197. clearParameter("autortnyn");
  2198. setParameter("reqflag", "usernm");
  2199. setParameter("usernm", ipt_dschapprtcdrnm.currentText);
  2200. setParameter("stnddd", dschdd);
  2201. setParameter("autortnyn","Y");
  2202. model.resetInstanceNode("/root/temp/userinfo");
  2203. modal("SPMRF03200");
  2204. var userid = model.getValue("/root/temp/userinfo/userid")
  2205. if(userid!=""){
  2206. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  2207. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  2208. // 20081218 수정
  2209. //ipt_dschapprtcdrid.refresh();
  2210. //ipt_dschapprtcdrnm.refresh();
  2211. model.refresh();
  2212. }else{
  2213. return;
  2214. }
  2215. }else{
  2216. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  2217. // 20081218 수정
  2218. //ipt_dschapprtcdrid.refresh();
  2219. //ipt_dschapprtcdrnm.refresh();
  2220. model.refresh();
  2221. return;
  2222. }
  2223. }
  2224. }
  2225. }
  2226. model.removeNodeset("/root/send");
  2227. }
  2228. function fSetUnPrepDetlDeptInfo()
  2229. {
  2230. try
  2231. {
  2232. var saveyn = model.getValue("/root/main/detldeptcdsaveyn");
  2233. var adapt = model.getValue("/root/hidden/adaptdetldeptcd/hardcd/hardcd"); // 하드코드 테이블 미비분과 적용 병원에만 동작하도록 함.
  2234. if(adapt == "Y")
  2235. {
  2236. if(saveyn != "N")
  2237. {
  2238. /////////////////////////////////////////////////////////////////////////
  2239. // 미비기록관리 미비분과 설정
  2240. // 2009.09.21 이경희
  2241. model.removeNodeset("/root/main/dschanalyhist/detldeptcdinfo");
  2242. model.makeNode("/root/main/dschanalyhist/detldeptcdinfo");
  2243. var detldeptcd = "";
  2244. var indxCnt = 0;
  2245. var detldeptcdinfoCnt = 0;
  2246. var upmrindd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/inrmdd");
  2247. var upmrdschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  2248. var upmrpid = model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid");
  2249. var upmrindd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indd");
  2250. var upmrcretno = model.getValue("/root/main/dschanalyhist/dschanalyinfo/cretno");
  2251. ////////////////////////////////////////////////////////////////////////////
  2252. // 1) 재원기간중 수술 시행한 경우 수술정보 내 수술분과 연동
  2253. indxCnt = getNodesetCnt(model, "/root/main/dschanalyhist/oplist");
  2254. if(indxCnt > 0)
  2255. {
  2256. var upmropdd = ""; // 수술일자
  2257. var upmrperfdrid = "";// 집도의
  2258. var upmrperfdeptcd = "";// 수술과
  2259. var upmropclrsdeptcd = ""; // 수술분과
  2260. var OpDeptList = findNodeset(model, "/root/main/dschanalyhist/oplist");
  2261. var OpDeptNode = "";
  2262. for(var idx = 0; idx < OpDeptList.length; idx++)
  2263. {
  2264. OpDeptNode = OpDeptList.item(idx);
  2265. upmropdd = OpDeptNode.selectSingleNode("opdd").text;
  2266. upmrperfdeptcd = OpDeptNode.selectSingleNode("perfdeptcd").text;
  2267. upmrperfdrid = OpDeptNode.selectSingleNode("perfdrid").text;
  2268. upmropclrsdeptcd = OpDeptNode.selectSingleNode("opclrsdeptcd").text;
  2269. if(upmropclrsdeptcd == "") // 미비분과가 설정되어 있지 않은 경우 미비과로 동일하게 적용함.
  2270. upmropclrsdeptcd = upmrperfdeptcd;
  2271. grd_detldeptlist.addItem();
  2272. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2273. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "OP"); // gubun: N(일반), OP(수술)
  2274. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2275. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2276. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", upmropdd); // 수술일자
  2277. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", ""); // 전출 시작일자
  2278. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", "");
  2279. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrperfdeptcd); // 수술과
  2280. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmropclrsdeptcd); // 수술분과
  2281. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2282. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2283. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2284. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", upmrperfdrid); // 집도의ID
  2285. //detldeptcdinfoCnt++;
  2286. }
  2287. }
  2288. ////////////////////////////////////////////////////////////////////////////
  2289. // 2) 전과내역 없이 입퇴원과가 동일한 경우 퇴원분과를 기준으로 연동함.
  2290. // 전과정보 확인 (grd_chngdeptlist)
  2291. indxCnt = getNodesetCnt(model, "/root/main/dschanalyhist/chngdeptlist");
  2292. if(indxCnt == 0) // 2-1)전과내역이 없는 경우
  2293. {
  2294. var upmrindeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd"); // 입원과
  2295. var upmrinclrsdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"); // 입원분과
  2296. var upmrdschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd"); // 퇴원과
  2297. var upmrdschclrsdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"); // 퇴원분과
  2298. ////////////////////////////////////////////////////////////////////////////
  2299. // 퇴원과가 미비분과인지 확인
  2300. var InDeptList = getNodesetCnt(model, "/root/hidden/indeptchklist/hardcd[hardcd = '" + upmrdschdeptcd + "']");
  2301. if(InDeptList > 0)
  2302. {
  2303. upmrdschclrsdeptcd = upmrdschdeptcd; // 미비분과 코드를 적용
  2304. }
  2305. ////////////////////////////////////////////////////////////////////////////
  2306. // 퇴원과가 미비분과 적용과가 아닌 경우
  2307. if(upmrdschclrsdeptcd == "") // 미비분과가 없을 경우 상위과와 동일하게 처리함.
  2308. upmrdschclrsdeptcd = upmrdschdeptcd;
  2309. ////////////////////////////////////////////////////////////////////////////
  2310. // 1-1) 입원과, 퇴원과가 같은 경우 퇴원과 미비분과를 기준으로 반영
  2311. //
  2312. if(upmrindeptcd == upmrdschdeptcd)
  2313. {
  2314. grd_detldeptlist.addItem();
  2315. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2316. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/status", 1); // 상태
  2317. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "N"); // gubun: N(일반), OP(수술)
  2318. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2319. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2320. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", ""); // 수술일자
  2321. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", ""); // 전출 시작일자
  2322. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", "");
  2323. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrdschdeptcd); // 퇴원과
  2324. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmrdschclrsdeptcd); // 퇴원분과
  2325. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2326. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2327. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2328. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", ""); // 집도의ID
  2329. }
  2330. }
  2331. else // 2-2)전과 내역이 있는 경우
  2332. {
  2333. // 1회 전과한 경우
  2334. // - 입원일부터 전출일까지 전출분과를 분과적용
  2335. // - 전출일 다음날부터 퇴원일까지 퇴원분과로 적용
  2336. // 2회 이상 전과한 경우
  2337. // - 입원일부터 1회 전출일까지 1회 전출분과 적용
  2338. // - 1회 전출일부터 2회 전출일까지 2회 전출분과 적용
  2339. // (여러번 전과한 경우도 동일한 기준으로 적용)
  2340. // 전과정보 내 전출분과가 없을 경우 분과에 해당되지 않는 상위과와 세부과가 동일하다는 의미로 미비분과 컬럼에 미비과와 동일하게 처리함.
  2341. // 전과정보가 있을 경우
  2342. // 전과정보의 과와 미비내역의 미비과를 조회하여 비교한 후,
  2343. // 전과정보의 과와 미비내역의 미비과가 다른 경우 미비내역의 미비과를 그대로 두고,
  2344. // 전과정보의 과와 미비내역의 미비과가 같은 경우 전과정보를 따라감.
  2345. var upmrchdd = ""; // 전출일자
  2346. var upmrchbefrdd = "" // 전출일 전날짜
  2347. var upmrchnextdd = ""; // 전출일 다음날자
  2348. var upmrchdeptcd = "";// 전출과
  2349. var upmrchdetldeptcd = ""; // 전출분과
  2350. var chDeptList = findNodeset(model, "/root/main/dschanalyhist/chngdeptlist");
  2351. var chDeptNode = ""; // 전과정보
  2352. var chNextDeptNode = ""; // 다음 전과정보
  2353. var bfupmrchdd = "";
  2354. if(chDeptList.length == 1) // 전출과 정보가 1건인 경우
  2355. {
  2356. chDeptNode = chDeptList.item(0);
  2357. upmrchdd = chDeptNode.selectSingleNode("chngdeptdd").text; // 전출일자
  2358. upmrchdeptcd = chDeptNode.selectSingleNode("chngdeptcd").text;
  2359. upmrchdetldeptcd = chDeptNode.selectSingleNode("chngclrsdeptcd").text;
  2360. if(upmrchdetldeptcd == "") // 미비분과가 공란인 경우 미비과와 동일하게 적용함.
  2361. upmrchdetldeptcd = upmrchdeptcd;
  2362. ////////////////////////////////////////////////////////////////////////////
  2363. //// 1. 전출일자에 해당하는 미비분과를 저장 - Start
  2364. // 전출일자에 해당하는 미비내역을 조회해서 전출일자에 해당 하는 미비분과를 저장한다.
  2365. fGetUnPrepRecListByDay(upmrchdd);
  2366. // 미비내역의 미비과와 전출과를 비교한다.
  2367. var UnPrepRecListCnt = getNodesetCnt(model, "/root/main/unpreprecinfo/unprepreclist");
  2368. var UnPrepRecList = findNodeset(model, "/root/main/unpreprecinfo/unprepreclist");
  2369. var UnPrepItem = "";
  2370. for(var unidx = 0; unidx < UnPrepRecListCnt; unidx++)
  2371. {
  2372. UnPrepItem = UnPrepRecList.item(unidx);
  2373. var unPrepDeptcd = UnPrepItem.selectSingleNode("orddeptcd").text; // 미비과
  2374. var upmrchdetldeptcdnm = UnPrepItem.selectSingleNode("detldeptnm").text; // 미비분과
  2375. if(unPrepDeptcd == upmrchdeptcd) // 전출과와 미비과가 같은 경우에만 미비분과를 적용
  2376. {
  2377. model.makeValue("/root/main/unpreprecinfo/unprepreclist[" + (unidx+1) + "]/status", "l");
  2378. model.makeValue("/root/main/unpreprecinfo/unprepreclist[" + (unidx+1) + "]/detldeptcd", upmrchdetldeptcd);
  2379. /*
  2380. grd_unprepreclist.isselected(unidx+1) = true;
  2381. grd_unprepreclist.valueMatrix(grd_unprepreclist.selectedRow(unidx), grd_unprepreclist.colRef("status")) = "l";
  2382. grd_unprepreclist.valueMatrix(grd_unprepreclist.selectedRow(unidx), grd_unprepreclist.colRef("detldeptcd")) = upmrchdetldeptcd;
  2383. */
  2384. }
  2385. }
  2386. var savenodelist = model.instances(0).selectNodes("/root/main/unpreprecinfo/unprepreclist[status!='']");
  2387. if(savenodelist.length > 0)
  2388. {
  2389. var srchflag = model.getValue("/root/main/cond/srchflag");
  2390. if(srchflag == "pat")
  2391. {
  2392. var srchnodelist = model.instances(0).selectNodes("/root/main/cond/unpreppatbase");
  2393. }
  2394. else
  2395. {
  2396. var srchnodelist = model.instances(0).selectNodes("/root/main/cond/unprepdrbase");
  2397. }
  2398. var savedata = getNodeListCSV(savenodelist);
  2399. var srchdata = getNodeListCSV(srchnodelist);
  2400. model.removeNodeset("/root/send/savedata");
  2401. model.makeNode("/root/send/savedata");
  2402. model.makeValue("/root/send/savedata", savedata);
  2403. model.makeValue("/root/send/srchdata", srchdata);
  2404. submit("TXMRI02101"); // 전출일자에 해당하는 미비분과 업데이트
  2405. }
  2406. //// 전출일자에 해당하는 미비분과를 저장 - End
  2407. ////////////////////////////////////////////////////////////////////////////
  2408. ////////////////////////////////////////////////////////////////////////////
  2409. //// 2 .퇴원과가 내과 세부과인지 확인
  2410. var InDeptList = getNodesetCnt(model, "/root/hidden/indeptchklist/hardcd[hardcd = '" + upmrchdeptcd + "']");
  2411. if(InDeptList > 0)
  2412. {
  2413. upmrchdetldeptcd = upmrchdeptcd;
  2414. }
  2415. ////////////////////////////////////////////////////////////////////////////
  2416. if(upmrchdetldeptcd == "") // 미비분과가 없을 경우 상위과와 동일하게 처리함.
  2417. upmrchdetldeptcd = upmrchdeptcd;
  2418. /////////////////////////////////////////////////////////////////////////////////
  2419. //// 3. 입원일부터 전출일까지 설정
  2420. grd_detldeptlist.addItem();
  2421. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2422. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "CH"); // gubun: N(일반), OP(수술), CH(전출)
  2423. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2424. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2425. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", ""); // 수술일자
  2426. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", upmrindd); // 전출 시작일자
  2427. upmrchbefrdd = upmrchdd.toDate("YYYYMMDD").getAddDate(-1, "D").getDateFormat("YYYYMMDD"); // 전출일자 전날.
  2428. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", upmrchbefrdd);
  2429. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrchdeptcd); // 전출과
  2430. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmrchdetldeptcd); // 전출분과
  2431. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2432. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2433. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2434. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", ""); // 집도의ID
  2435. bfupmrchdd = upmrchdd;
  2436. upmrchnextdd = bfupmrchdd.toDate("YYYYMMDD").getAddDate(1, "D").getDateFormat("YYYYMMDD"); // 전출일자 다음날.
  2437. ////
  2438. ////////////////////////////////////////////////////////////////////////////
  2439. ////////////////////////////////////////////////////////////////////////////
  2440. //// 4. 마지막 전출일부터 퇴원일까지 설정
  2441. grd_detldeptlist.addItem();
  2442. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2443. // 퇴원미비분과를 가져옴.
  2444. var upmrdschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd"); // 퇴원과
  2445. var upmrdschclrsdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"); // 퇴원분과
  2446. ////////////////////////////////////////////////////////////////////////////
  2447. // 퇴원과가 내과 세부과인지 확인
  2448. var InDeptList = getNodesetCnt(model, "/root/hidden/indeptchklist/hardcd[hardcd = '" + upmrdschdeptcd + "']");
  2449. if(InDeptList > 0)
  2450. {
  2451. upmrdschclrsdeptcd = upmrdschdeptcd;
  2452. }
  2453. ////////////////////////////////////////////////////////////////////////////
  2454. if(upmrdschclrsdeptcd == "") // 미비분과가 없을 경우 상위과와 동일하게 처리함.
  2455. upmrdschclrsdeptcd = upmrdschdeptcd;
  2456. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "CH"); // gubun: N(일반), OP(수술), CH(전출)
  2457. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2458. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2459. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", ""); // 수술일자
  2460. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", upmrchnextdd); // 전출 시작일자
  2461. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", upmrdschdd);
  2462. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrdschdeptcd); // 퇴원과
  2463. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmrdschclrsdeptcd); // 퇴원미비분과
  2464. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2465. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2466. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2467. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", ""); // 집도의ID
  2468. }
  2469. if(chDeptList.length > 1) // 전출과 정보가 여러 건인 경우
  2470. {
  2471. // 입원일부터 전출일까지 설정
  2472. var chidx = 0; // 전과정보 인덱스
  2473. chDeptNode = chDeptList.item(chidx);
  2474. upmrchdd = chDeptNode.selectSingleNode("chngdeptdd").text;
  2475. upmrchdeptcd = chDeptNode.selectSingleNode("chngdeptcd").text;
  2476. upmrchdetldeptcd = chDeptNode.selectSingleNode("chngclrsdeptcd").text;
  2477. if(upmrchdetldeptcd == "") // 미비분과가 공란인 경우 미비과와 동일하게 적용함.
  2478. upmrchdetldeptcd = upmrchdeptcd;
  2479. ////////////////////////////////////////////////////////////////////////////
  2480. // 전출일자가 중복된게 여러건인 조회 - Start
  2481. // 여러 건인 경우 마지막 전출일자의 미비과, 미비분과를 얻어옴.
  2482. for(var cidx = chidx; cidx < chDeptList.length; cidx++)
  2483. {
  2484. chDeptNode = chDeptList.item(cidx);
  2485. chNextDeptNode = chDeptList.item(cidx+1);
  2486. // 다음 노드가 null 인지 확인(즉, 현재 노드가 마지막노드인지..)
  2487. if(chDeptNode == null || chNextDeptNode == null)
  2488. {
  2489. chidx = cidx;
  2490. break;
  2491. }
  2492. // 전과정보 날짜 비교
  2493. // 동일 날짜에 2번 이상 전과한 경우는 최종 분과내용으로 반영되게 함.
  2494. var bfchdeptday = chDeptNode.selectSingleNode("chngdeptdd").text;
  2495. var nxchdeptday = chNextDeptNode.selectSingleNode("chngdeptdd").text;
  2496. if(bfchdeptday == nxchdeptday)
  2497. {
  2498. upmrchdeptcd = chNextDeptNode.selectSingleNode("chngdeptcd").text;
  2499. upmrchdetldeptcd = chNextDeptNode.selectSingleNode("chngclrsdeptcd").text;
  2500. continue;
  2501. }
  2502. else
  2503. {
  2504. chidx = cidx;
  2505. break;
  2506. }
  2507. }
  2508. // 전출일자가 중복된게 여러건인 조회 - End
  2509. ////////////////////////////////////////////////////////////////////////////
  2510. ////////////////////////////////////////////////////////////////////////////
  2511. //// 전출일자에 해당하는 미비분과를 저장 - Start
  2512. // 전출일자에 해당하는 미비내역을 조회해서 전출일자에 해당 하는 미비분과를 저장한다.
  2513. for(var x = 0; x < chDeptList.length; x++)
  2514. {
  2515. var tmpNode = chDeptList.item(x);
  2516. var tmpNextNode = chDeptList.item(x+1);
  2517. if(tmpNode != null)
  2518. var tmpupmrchdd = tmpNode.selectSingleNode("chngdeptdd").text;
  2519. if(tmpNextNode != null)
  2520. var tmpupmrchNextdd = tmpNextNode.selectSingleNode("chngdeptdd").text;
  2521. else
  2522. tmpupmrchNextdd = "";
  2523. if(tmpupmrchdd == tmpupmrchNextdd)
  2524. continue;
  2525. var tmpupmrchdeptcd = tmpNode.selectSingleNode("chngdeptcd").text;
  2526. var tmpupmrchdetldeptcd = tmpNode.selectSingleNode("chngclrsdeptcd").text;
  2527. if(tmpupmrchdetldeptcd == "")
  2528. tmpupmrchdetldeptcd = tmpupmrchdeptcd;
  2529. fGetUnPrepRecListByDay(tmpupmrchdd);
  2530. // 미비내역의 미비과와 전출과를 비교한다.
  2531. var UnPrepRecListCnt = getNodesetCnt(model, "/root/main/unpreprecinfo/unprepreclist");
  2532. var UnPrepRecList = findNodeset(model, "/root/main/unpreprecinfo/unprepreclist");
  2533. var UnPrepItem = "";
  2534. for(var unidx = 0; unidx < UnPrepRecListCnt; unidx++)
  2535. {
  2536. UnPrepItem = UnPrepRecList.item(unidx);
  2537. var unPrepDeptcd = UnPrepItem.selectSingleNode("orddeptcd").text; // 미비과
  2538. var upmrchdetldeptcdnm = UnPrepItem.selectSingleNode("detldeptnm").text; // 미비분과
  2539. if(unPrepDeptcd == tmpupmrchdeptcd) // 전출과와 미비과가 같은 경우에만 미비분과를 적용
  2540. {
  2541. model.makeValue("/root/main/unpreprecinfo/unprepreclist[" + (unidx+1) + "]/status", "l");
  2542. model.makeValue("/root/main/unpreprecinfo/unprepreclist[" + (unidx+1) + "]/detldeptcd", tmpupmrchdetldeptcd);
  2543. /*
  2544. grd_unprepreclist.isselected(unidx+1) = true;
  2545. grd_unprepreclist.valueMatrix(grd_unprepreclist.selectedRow(unidx), grd_unprepreclist.colRef("status")) = "l";
  2546. grd_unprepreclist.valueMatrix(grd_unprepreclist.selectedRow(unidx), grd_unprepreclist.colRef("detldeptcd")) = upmrchdetldeptcd;
  2547. */
  2548. }
  2549. }
  2550. var savenodelist = model.instances(0).selectNodes("/root/main/unpreprecinfo/unprepreclist[status!='']");
  2551. if(savenodelist.length > 0)
  2552. {
  2553. var srchflag = model.getValue("/root/main/cond/srchflag");
  2554. if(srchflag == "pat")
  2555. {
  2556. var srchnodelist = model.instances(0).selectNodes("/root/main/cond/unpreppatbase");
  2557. }
  2558. else
  2559. {
  2560. var srchnodelist = model.instances(0).selectNodes("/root/main/cond/unprepdrbase");
  2561. }
  2562. var savedata = getNodeListCSV(savenodelist);
  2563. var srchdata = getNodeListCSV(srchnodelist);
  2564. model.removeNodeset("/root/send/savedata");
  2565. model.makeNode("/root/send/savedata");
  2566. model.makeValue("/root/send/savedata", savedata);
  2567. model.makeValue("/root/send/srchdata", srchdata);
  2568. submit("TXMRI02101"); // 전출일자에 해당하는 미비분과 업데이트
  2569. }
  2570. }
  2571. //// 전출일자에 해당하는 미비분과를 저장 - End
  2572. ////////////////////////////////////////////////////////////////////////////
  2573. ////////////////////////////////////////////////////////////////////////////
  2574. // 퇴원과가 내과 세부과인지 확인
  2575. var InDeptList = getNodesetCnt(model, "/root/hidden/indeptchklist/hardcd[hardcd = '" + upmrchdeptcd + "']");
  2576. if(InDeptList > 0)
  2577. {
  2578. upmrchdetldeptcd = upmrchdeptcd;
  2579. }
  2580. ////////////////////////////////////////////////////////////////////////////
  2581. if(upmrchdetldeptcd == "") // 미비분과가 없을 경우 상위과와 동일하게 처리함.
  2582. upmrchdetldeptcd = upmrchdeptcd;
  2583. // 입원일자부터 전출일 전날까지 미비분과를 설정
  2584. grd_detldeptlist.addItem();
  2585. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2586. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "CH"); // gubun: N(일반), OP(수술), CH(전출)
  2587. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2588. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2589. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", ""); // 수술일자
  2590. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", upmrindd); // 전출 시작일자
  2591. upmrchbefrdd = upmrchdd.toDate("YYYYMMDD").getAddDate(-1, "D").getDateFormat("YYYYMMDD"); // 전출일자 전날.
  2592. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", upmrchbefrdd);
  2593. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrchdeptcd); // 전출과
  2594. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmrchdetldeptcd); // 전출분과
  2595. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2596. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2597. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2598. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", ""); // 집도의ID
  2599. ////////////////////////////////////////////////////////////////////////////////
  2600. // 전출일 다음날부터 마지막 전출일까지 loop - Start
  2601. // 입원일부터 첫번째 전출일까지가 1회 전출분과 적용이므로,
  2602. // loop 구문은 첫번째 전출일 다음날부터 두번째 전출일 전날까지 두번째 전출과를 적용
  2603. var upmrchtommorow = ""; // 현재노드 전출일자 다음날
  2604. var upmrchyesterday = ""; // 다음노드 전출일자 전날
  2605. var tmpCurupmrcddd = "";
  2606. for(var midx= chidx; midx < chDeptList.length; midx++)
  2607. {
  2608. //bfupmrchdd = upmrchdd;
  2609. //upmrchnextdd = bfupmrchdd.toDate("YYYYMMDD").getAddDate(1, "D").getDateFormat("YYYYMMDD"); // 전출일자 다음날.
  2610. chDeptNode = chDeptList.item(midx);
  2611. chNextDeptNode = chDeptList.item(midx+1);
  2612. if(chDeptNode == null || chNextDeptNode == null)
  2613. {
  2614. chidx = midx;
  2615. break;
  2616. }
  2617. var cur_upmrchdd = chDeptNode.selectSingleNode("chngdeptdd").text;
  2618. var nex_upmrchdd = chNextDeptNode.selectSingleNode("chngdeptdd").text;
  2619. upmrchtommorow = cur_upmrchdd.toDate("YYYYMMDD").getAddDate(1, "D").getDateFormat("YYYYMMDD"); // 현재노드 전출일자 다음날.
  2620. upmrchyesterday = nex_upmrchdd.toDate("YYYYMMDD").getAddDate(-1, "D").getDateFormat("YYYYMMDD"); // 다음노드 전출일자 전날.
  2621. tmpCurupmrcddd = cur_upmrchdd;
  2622. // 현재 노드 전출일의 다음날이
  2623. // 다음 노드 전출일과 동일한 경우 현재노드는 넘어가고 다음 노드가 현재노드가 되도록 처리
  2624. // 3/9 GS-PSN <-- 현재노드
  2625. // 3/10 GS-THS
  2626. // 3/12 PD-NR
  2627. if(upmrchtommorow == nex_upmrchdd)
  2628. continue;
  2629. // 전출일자가 중복된게 여러건인 조회
  2630. // 3/9 GS-PSN <-- 현재노드
  2631. // 3/9 GS-THS
  2632. // 3/12 PD-NR
  2633. // 중복된 전출일자가 여러건인 경우 마지막 전출일자의 미비과, 미비분과를 얻어옴.
  2634. for(var cidx = midx; cidx < chDeptList.length; cidx++)
  2635. {
  2636. var chDeptNode = chDeptList.item(cidx);
  2637. var chNextDeptNode = chDeptList.item(cidx+1);
  2638. // 다음 노드가 null 인지 확인(즉, 현재 노드가 마지막노드인지..)
  2639. if(chDeptNode == null || chNextDeptNode == null)
  2640. {
  2641. //midx = cidx + 1;
  2642. break;
  2643. }
  2644. // 전과정보 날짜 비교
  2645. // 동일 날짜에 2번 이상 전과한 경우는 최종 분과내용으로 반영되게 함.
  2646. var bfchdeptday = chDeptNode.selectSingleNode("chngdeptdd").text;
  2647. var nxchdeptday = chNextDeptNode.selectSingleNode("chngdeptdd").text;
  2648. if(bfchdeptday == nxchdeptday) // 다음 전출정보도 전출일자가 동일함.
  2649. {
  2650. upmrchdeptcd = chDeptNode.selectSingleNode("chngdeptcd").text;
  2651. upmrchdetldeptcd = chNextDeptNode.selectSingleNode("chngclrsdeptcd").text;
  2652. continue;
  2653. }
  2654. else // 다음 전출정보의 전출일자가 동일하지 않음.
  2655. {
  2656. //midx = cidx + 1;
  2657. break;
  2658. }
  2659. }
  2660. //upmrchdeptcd = chDeptNode.selectSingleNode("chngdeptcd").text;
  2661. //upmrchdetldeptcd = chDeptNode.selectSingleNode("chngclrsdeptcd").text;
  2662. upmrchdeptcd = chNextDeptNode.selectSingleNode("chngdeptcd").text;
  2663. upmrchdetldeptcd = chNextDeptNode.selectSingleNode("chngclrsdeptcd").text;
  2664. ////////////////////////////////////////////////////////////////////////////
  2665. // 퇴원과가 내과 세부과인지 확인
  2666. var InDeptList = getNodesetCnt(model, "/root/hidden/indeptchklist/hardcd[hardcd = '" + upmrchdeptcd + "']");
  2667. if(InDeptList > 0)
  2668. {
  2669. upmrchdetldeptcd = upmrchdeptcd;
  2670. }
  2671. ////////////////////////////////////////////////////////////////////////////
  2672. if(upmrchdetldeptcd == "") // 미비분과가 없을 경우 상위과와 동일하게 처리함.
  2673. upmrchdetldeptcd = upmrchdeptcd;
  2674. grd_detldeptlist.addItem();
  2675. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2676. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "CH"); // gubun: N(일반), OP(수술), CH(전출)
  2677. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2678. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2679. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", ""); // 수술일자
  2680. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", upmrchtommorow); // 전출 시작일자
  2681. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", upmrchyesterday); // 전출 종료일자
  2682. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrchdeptcd); // 전출과
  2683. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmrchdetldeptcd); // 전출분과
  2684. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2685. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2686. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2687. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", ""); // 집도의ID
  2688. }
  2689. // 전출일 다음날부터 마지막 전출일까지 loop - End
  2690. ////////////////////////////////////////////////////////////////////////////////
  2691. // 전출일부터 퇴원일까지 설정
  2692. grd_detldeptlist.addItem();
  2693. detldeptcdinfoCnt = grd_detldeptlist.rows - grd_detldeptlist.fixedrows;
  2694. chDeptNode = chDeptList.item(chidx);
  2695. upmrchdd = chDeptNode.selectSingleNode("chngdeptdd").text;
  2696. bfupmrchdd = upmrchdd;
  2697. upmrchnextdd = bfupmrchdd.toDate("YYYYMMDD").getAddDate(1, "D").getDateFormat("YYYYMMDD"); // 전출일자 다음날.
  2698. // 퇴원미비분과를 가져옴.
  2699. var upmrdschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd"); // 퇴원과
  2700. var upmrdschclrsdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"); // 퇴원분과
  2701. ////////////////////////////////////////////////////////////////////////////
  2702. // 퇴원과가 내과 세부과인지 확인
  2703. var InDeptList = getNodesetCnt(model, "/root/hidden/indeptchklist/hardcd[hardcd = '" + upmrdschdeptcd + "']");
  2704. if(InDeptList > 0)
  2705. {
  2706. upmrdschclrsdeptcd = upmrdschdeptcd;
  2707. }
  2708. ////////////////////////////////////////////////////////////////////////////
  2709. if(upmrdschclrsdeptcd == "") // 미비분과가 없을 경우 상위과와 동일하게 처리함.
  2710. upmrdschclrsdeptcd = upmrdschdeptcd;
  2711. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/gubun", "CH"); // gubun: N(일반), OP(수술), CH(전출)
  2712. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2713. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdschdd", upmrdschdd); // 퇴원일자
  2714. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmropdd", ""); // 수술일자
  2715. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrchst", upmrchnextdd); // 전출 시작일자
  2716. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrched", upmrdschdd);
  2717. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrordeptcd", upmrdschdeptcd); // 퇴원과
  2718. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrdetldeptcd", upmrdschclrsdeptcd); // 퇴원분과
  2719. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrpid", upmrpid); // 환자번호
  2720. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrindd", upmrindd); // 입원일자
  2721. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/upmrcretno", upmrcretno); // cretno
  2722. model.makeValue("/root/main/dschanalyhist/detldeptcdinfo[" + detldeptcdinfoCnt + "]/perfdrid", ""); // 집도의ID
  2723. }
  2724. }
  2725. grd_detldeptlist.refresh();
  2726. grd_detldeptlist.rebuild();
  2727. for(var gidx = 1; gidx < grd_detldeptlist.rows; gidx++)
  2728. {
  2729. if(grd_detldeptlist.valueMatrix(gidx, 1) != "")
  2730. grd_detldeptlist.addStatus(gidx, "insert");
  2731. }
  2732. }
  2733. }
  2734. }
  2735. catch(e)
  2736. {
  2737. return false;
  2738. }
  2739. return true;
  2740. }
  2741. // 전출일자에 잡힌 미비내역을 조회한다.
  2742. function fGetUnPrepRecListByDay(upmrchdd)
  2743. {
  2744. // 전출일자에 해당하는 미비내역을 조회한다.
  2745. model.removeNodeset("/root/send");
  2746. model.makeNode("/root/send/reqdata");
  2747. model.makeNode("/root/send/dschanalyinfo");
  2748. model.makeValue("/root/main/cond/unpreppatbase/pid" , model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid") );
  2749. model.makeValue("/root/main/cond/unpreppatbase/indd" , model.getValue("/root/main/dschanalyhist/dschanalyinfo/indd") );
  2750. model.makeValue("/root/main/cond/unpreppatbase/cretno", model.getValue("/root/main/dschanalyhist/dschanalyinfo/cretno") );
  2751. model.makeValue("/root/main/cond/unpreppatbase/upmrchdd", upmrchdd );
  2752. model.makeValue("/root/main/cond/srchflag", "pat");
  2753. model.makeValue("/root/main/cond/unpreppatbase/scrnflag", "dschunpreppatbase"); // 퇴원분석에서 조회
  2754. model.copyNode("/root/send/reqdata", "/root/main/cond/unpreppatbase");
  2755. submit("TRMRI02106");
  2756. }
  2757. //퇴원분석 한 환자를 삭제한다.
  2758. function fDelete(){
  2759. var sPid = model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid");
  2760. var sHngnm;
  2761. var retValue;
  2762. if(sPid==""){
  2763. return;
  2764. }else{
  2765. sHngnm = model.getValue("/root/main/dschanalyhist/dschanalyinfo/hngnm");
  2766. retValue= messageBox(sHngnm + "님의 퇴원 분석된 데이터를 삭제하시겠습니까?", "Q999", "");
  2767. if(retValue=="6"){
  2768. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid"));
  2769. model.makeValue("/root/send/reqdata/dschdd", model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd"));
  2770. if(submit("TXMRD00480")){
  2771. messageBox("삭제 ", "I001");
  2772. model.resetInstanceNode("/root/main");
  2773. model.resetInstanceNode("/root/send");
  2774. //model.resetInstanceNode("/root/init");
  2775. model.resetInstanceNode("/root/temp");
  2776. model.resetInstanceNode("/root/hidden");
  2777. model.resetInstanceNode("/root/tmp");
  2778. model.refresh();
  2779. }
  2780. }
  2781. }
  2782. }
  2783. //2013/01/08 Start
  2784. /*
  2785. * 1. 퇴원과가 소아청소년과
  2786. * 2. 퇴원분과가 PD(환자) 또는 NR(정상)
  2787. * 3. 산모/신생아 정보가 존재하면서 신생아의 산모번호가 존재
  2788. * 4. 신생아의 구분이 자동으로 퇴원과의 분과와 동일하게 세팅(경대병원에서 신생아 낳은 경우)
  2789. * 5. (2번까지 동일) 산모/신생아 정보가 존재하면서 산모번호가 존재하지 않음
  2790. * 6. 신생아의 구분이 존재할 경우 블록킹(타병원에서 이송되어 온 환자임)
  2791. */
  2792. function fnbabychk(){
  2793. var deptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  2794. var clrsdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd");
  2795. /*
  2796. // NR : 2110500000(정상) PD : 2110000000(환아)
  2797. if(deptcd=="2110000000" && clrsdeptcd!=""){ // 소아청소년과이면서 분과가 존재할 시에
  2798. var nodecnt = getNodesetCount("/root/main/dschanalyhist/wnmblist");
  2799. var womnid=model.getValue("/root/main/dschanalyhist/wnmblist/womnid");
  2800. if(nodecnt > 0 && womnid!=""){ // 산모번호가 존재시
  2801. if(clrsdeptcd=="2110500000"){ //NR(정상아)
  2802. model.setValue("/root/main/dschanalyhist/wnmblist/nbabyflag", 1);
  2803. }else if(clrsdeptcd=="2110000000"){ //PD(환아)
  2804. model.setValue("/root/main/dschanalyhist/wnmblist/nbabyflag", 2);
  2805. }
  2806. }else if(nodecnt > 0 && womnid==""){// 산모번호가 존재하지 않을시
  2807. model.setValue("/root/main/dschanalyhist/wnmblist/nbabyflag", "");
  2808. grd_wnmblist.colDisabled(grd_wnmblist.colRef("nbabyflag"))=true;
  2809. }
  2810. }else if(deptcd!="2100000000"){ //입원과가 소아청소년과가 아닌데 산모번호가 존재시에 무조건 SB(환아)로 세팅(산부인과는 제외)
  2811. var nodecnt = getNodesetCount("/root/main/dschanalyhist/wnmblist");
  2812. var womnid=model.getValue("/root/main/dschanalyhist/wnmblist/womnid");
  2813. if(nodecnt > 0 && womnid!=""){ // 산모번호가 존재시
  2814. model.setValue("/root/main/dschanalyhist/wnmblist/nbabyflag", 2);
  2815. }
  2816. }
  2817. */
  2818. model.refresh();
  2819. }
  2820. // 원무 전과전실 승인정보
  2821. function fPamTranInfo() {
  2822. model.makeValue("/root/main/dschanalyhist/dschanalyinfo/histstat","N");
  2823. modal("SPMRD02300", 1, 810, 340, "SPMRD02300", "/root/main/dschanalyhist", "/root/main/dschanalyhist");
  2824. }