SMMRD01400.js 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058
  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. //btn_icuinfo.selected ="true";
  25. //btn_addrow3.visible = false;
  26. //btn_delrow3.visible = false;
  27. // 공통코드 목록 가져오기/root/init/opclrsinfo2
  28. //체킹번호 true -> false 변경
  29. chk_cretchknum.value = "false";
  30. zbcfGetCodeList(new Array("M0149", "M0070", "M0151", "M0153",
  31. "M0155","M0152","M0157","M0156",
  32. "M0158","M0159","M0086","M0167",
  33. "M0165","M0013","P0006","M0417",
  34. "A0130","P0008","M0413","M0484",
  35. "A0145","M0414","M0415","M0416"),
  36. new Array("/root/init/jobList", "/root/init/relignList", "/root/init/maryStatList", "/root/init/inPathList",
  37. "/root/init/dethTypeList","/root/init/cureRsltList" ,"/root/init/DschTypeList","/root/init/chosProgList",
  38. "/root/init/reInResnList","/root/init/reOpResnList","/root/init/partrtntypeList","/root/init/brthtypeList",
  39. "/root/init/womntypeList","/root/init/optypeList","/root/init/mskindList","/root/init/unprepstatlist",
  40. "/root/init/infdisflaglist","/root/init/insukindList","/root/init/opDethTypeList","/root/init/infccaselist",
  41. "/root/init/infdcpartlist","/root/init/cmpllist","/root/init/wundcasclslist","/root/init/disposstatlist")
  42. , true);
  43. // 진료과
  44. /* var instcd = getUserInfo("dutplceinstcd");
  45. var standard_yn = "orduseyn";
  46. var ord_deptflag = 'D';
  47. var rslt_ref = "/root/init/deptlist";
  48. var sort_method = "depthngnm";
  49. zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref, sort_method);*/
  50. model.removeNodeset("/root/main/dschanalyhist/oplist");
  51. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  52. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  53. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  54. model.removeNodeset("/root/main/dschanalyhist/iculist");
  55. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  56. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  57. if(checkOpener()){
  58. var parampid = opener.javascript.getParameter("SMMRD00400_param_pid");
  59. if(parampid != "")
  60. {
  61. ipt_pid.value = parampid;
  62. chk_cretchknum.value = "false";
  63. fPidKeyPress("init"); //등록번호로 환자 정보조회
  64. }
  65. }
  66. model.refresh();
  67. }
  68. /**
  69. * @desc : 환자번호 정보조회
  70. * @id :
  71. * @event : onkeypress
  72. * @return : void
  73. * @authur : 박종훈 추가->이창록
  74. */
  75. function fPidKeyPress(pFlag)
  76. {
  77. var fromtime = getCurrentDateTime();
  78. model.removeNodeset("/root/send");
  79. var paramdschdd = "";
  80. model.makeValue("/root/send/srchcond", "1");
  81. if(model.getValue("/root/init/checknum/value") == "true"){
  82. model.makeValue("/root/send/pid", getCretCheckNo(ipt_pid.currentText, getUserInfo("dutplceinstcd")));
  83. model.makeValue("/root/main/dschanalyhist/dschanalyinfo/pid", model.getValue("/root/send/pid"));
  84. } else {
  85. model.makeValue("/root/send/pid", ipt_pid.currentText);
  86. }
  87. // 이중번호 체크 관련
  88. //model.setValue("/root/send/srchcond", "1");
  89. //model.setValue("/root/send/pid", ipt_pid.currentText);
  90. //환자등록번호 체크
  91. if(ipt_pid.currentText.length >= 1 ){
  92. model.resetInstanceNode("/root/main/patinfo");
  93. model.makeNode("/root/main/patinfo");
  94. if(submit("TRPMC02500"))
  95. {
  96. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  97. if(submit("TRMRD00401", false)){
  98. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  99. if( getNodesetCnt(model, xPatBaseInfoListPath) > 0 ){
  100. model.resetInstanceNode(xDschAnalyListPath);
  101. model.setValue(xDschAnalyListPath+"/pid" ,model.getValue(xPatBaseInfoListPath+"/pid"));
  102. model.setValue(xDschAnalyListPath+"/hngnm" ,model.getValue(xPatBaseInfoListPath+"/hngnm"));
  103. model.setValue(xDschAnalyListPath+"/rrgstno1" ,model.getValue(xPatBaseInfoListPath+"/rrgstno1"));
  104. model.setValue(xDschAnalyListPath+"/rrgstno2" ,model.getValue(xPatBaseInfoListPath+"/rrgstno2"));
  105. model.setValue(xDschAnalyListPath+"/age" ,model.getValue(xPatBaseInfoListPath+"/age"));
  106. model.setValue(xDschAnalyListPath+"/sexflag" ,model.getValue(xPatBaseInfoListPath+"/sex"));
  107. model.setValue(xDschAnalyListPath+"/btype" ,model.getValue(xPatBaseInfoListPath+"/btype"));
  108. model.setValue(xDschAnalyListPath+"/rh" ,model.getValue(xPatBaseInfoListPath+"/rh"));
  109. model.setValue(xDschAnalyListPath+"/forgeryn" ,model.getValue(xPatBaseInfoListPath+"/forgeryn"));
  110. model.setValue(xDschAnalyListPath+"/telno" ,model.getValue(xPatBaseInfoListPath+"/hometel"));
  111. model.setValue(xDschAnalyListPath+"/mpphontel",model.getValue(xPatBaseInfoListPath+"/mpphontel"));
  112. model.setValue(xDschAnalyListPath+"/zipcd1" ,model.getValue(xPatBaseInfoListPath+"/zipcd1"));
  113. model.setValue(xDschAnalyListPath+"/zipcd2" ,model.getValue(xPatBaseInfoListPath+"/zipcd2"));
  114. model.setValue(xDschAnalyListPath+"/addr" ,model.getValue(xPatBaseInfoListPath+"/addr"));
  115. model.setValue(xDschAnalyListPath+"/detladdr" ,model.getValue(xPatBaseInfoListPath+"/detladdr"));
  116. model.removeNodeset("/root/main/dschanalyhist/oplist");
  117. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  118. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  119. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  120. model.removeNodeset("/root/main/dschanalyhist/iculist");
  121. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  122. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  123. model.setValue("/root/main/cond/statcnts","");
  124. if( getNodesetCnt(model,"/root/temp/patinfo/dschddlist") > 0){
  125. if(pFlag == "init"){
  126. if(checkOpener()){
  127. paramdschdd = opener.javascript.getParameter("SMMRD00400_param_dschdd");
  128. }
  129. if(paramdschdd != ""){
  130. model.setValue(xDschAnalyListPath+"/dschdd", paramdschdd);
  131. }else{
  132. model.setValue(xDschAnalyListPath+"/dschdd" , model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  133. }
  134. }else{
  135. model.setValue(xDschAnalyListPath+"/dschdd", model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  136. }
  137. // 20081218 수정
  138. //cmb_dschdd.refresh();
  139. fGetDschAnalyInfo();
  140. model.setValue(xDschAnalyListPath+"/orgdschdd", model.getValue("/root/temp/patinfo/dschddlist[1]/dschdd"));
  141. // 20081218 수정
  142. //cmb_orgdschdd.refresh();
  143. }
  144. }else{
  145. messageBox("없는 환자 번호 입니다.", "E999", "");
  146. }
  147. }
  148. model.refresh();
  149. }
  150. else
  151. {
  152. model.setFocus("ipt_pid");
  153. model.refresh();
  154. }
  155. /*
  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/dschddlist") > 0){
  184. if(pFlag == "init"){
  185. if(checkOpener()){
  186. paramdschdd = opener.javascript.getParameter("SMMRD00400_param_dschdd");
  187. }
  188. if(paramdschdd != ""){
  189. model.setValue(xDschAnalyListPath+"/dschdd", paramdschdd);
  190. }else{
  191. model.setValue(xDschAnalyListPath+"/dschdd" , model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  192. }
  193. }else{
  194. model.setValue(xDschAnalyListPath+"/dschdd", model.getValue("/root/temp/patinfo/chgdschddlist[1]/dschdd"));
  195. }
  196. // 20081218 수정
  197. //cmb_dschdd.refresh();
  198. fGetDschAnalyInfo();
  199. model.setValue(xDschAnalyListPath+"/orgdschdd", model.getValue("/root/temp/patinfo/dschddlist[1]/dschdd"));
  200. // 20081218 수정
  201. //cmb_orgdschdd.refresh();
  202. }
  203. }else{
  204. messageBox("없는 환자 번호 입니다.", "E999", "");
  205. }
  206. }
  207. model.refresh();
  208. */
  209. }else{
  210. messageBox("환자등록번호를 정확히", "C001");
  211. }
  212. var totime = getCurrentDateTime();
  213. //alert("from: " + fromtime + " to:" + totime);
  214. }
  215. /**
  216. * @desc : 퇴원분석 정보 조회
  217. * @id :
  218. * @event : xforms-select
  219. * @return : void
  220. * @authur :
  221. */
  222. function fGetDschAnalyInfo(){
  223. var sDschDD = model.getValue(xDschAnalyListPath+"/dschdd");
  224. // 퇴원당시 진료과전체
  225. model.removeNodeset("/root/init/dschdeptlist/dept");
  226. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/init/dschdeptlist", "depthngnm", "asc", sDschDD);
  227. model.removeNodeset("/root/send");
  228. model.makeValue("/root/send/stnddd", sDschDD);
  229. // 중환자실 코드 조회
  230. if(submit("TRMRD00404", false)){
  231. copyNodesetType("/root/init/icudeptlist/icudept","/root/temp/initlist/icudept","replace", model, model);
  232. }
  233. model.removeNodeset("/root/send");
  234. var sIndx = cmb_dschdd.focusIndex+1;
  235. model.makeValue("/root/send/pid", model.getValue(xDschAnalyListPath+"/pid"));
  236. model.makeValue("/root/send/indd", model.getValue(xDschDDListPath+"["+sIndx+"]/indd"));
  237. model.makeValue("/root/send/cretno", model.getValue(xDschDDListPath+"["+sIndx+"]/cretno"));
  238. model.makeValue("/root/send/dschdd", sDschDD);
  239. if(submit("TRMRD00402", false)){
  240. var sIndd = model.getValue(xDschAnalyListPath+"/indd");
  241. // 2008-10-21 나종천 수정 실제 입원일자로 재원일수를 구함
  242. var sInroomdd = model.getValue(xDschAnalyListPath+"/inrmdd");
  243. var sDschdd = model.getValue(xDschAnalyListPath+"/dschdd");
  244. var code = model.getValue(xDschAnalyListPath+"/infccascd");
  245. //입원당시 진료과전체
  246. model.removeNodeset("/root/init/indeptlist/dept");
  247. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/init/indeptlist", "depthngnm", "asc", sInroomdd);
  248. fInDschClrsDeptSearch("dsch");//퇴원과분과
  249. fInDschClrsDeptSearch("indd");//입원과분과
  250. fGetInFcCas(code);//감염종류 체크
  251. // 입력 여부 체크
  252. fCheckItemInputYN();
  253. // ER내원일시, 체류시간 체크
  254. var sInPathCd = model.getValue(xDschAnalyListPath+"/inpathcd");
  255. if(sInPathCd == "02"){
  256. ipt_erchosdt.disabled = false;
  257. ipt_erstaytm.disabled = false;
  258. }else{
  259. ipt_erchosdt.disabled = true;
  260. ipt_erstaytm.disabled = true;
  261. }
  262. // 중환자실 전체 재원일수
  263. model.removeNodeset("/root/main/dschanalyhist/icutotlist");
  264. if(grd_iculist.rows > grd_iculist.fixedrows){
  265. var sTotInHospDayNo = 0;
  266. var iRow = 0;
  267. var iICUTotRow = 0;
  268. var sICUCd = "";
  269. for(var iStndRow = grd_iculist.fixedrows; iStndRow<=(grd_iculist.rows-grd_iculist.fixedrows); iStndRow++){
  270. sICUCd = model.getValue("/root/main/dschanalyhist/iculist["+iStndRow+"]/icucd");
  271. iICUTotRow = grd_icutotlist.findRow(sICUCd, grd_icutotlist.fixedrows, 1);
  272. sTotInHospDayNo = 0;
  273. if(iICUTotRow < 1){
  274. for(var iRow = grd_iculist.fixedrows; iRow <= (grd_iculist.rows-grd_iculist.fixedrows); iRow++){
  275. if(model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/icucd") == sICUCd){
  276. sInHospDayNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/inhospdayno");
  277. if(sInHospDayNo == "") sInHospDayNo = 0;
  278. sTotInHospDayNo += eval(sInHospDayNo);
  279. }
  280. }
  281. grd_icutotlist.addRow();
  282. iRow = grd_icutotlist.rows - grd_icutotlist.fixedrows;
  283. model.setValue(xICUTotListPath+"["+iRow+"]/deptcd",sICUCd);
  284. model.setValue(xICUTotListPath+"["+iRow+"]/totinhospdayno", sTotInHospDayNo);
  285. }
  286. }
  287. }
  288. if(model.getValue(xDschAnalyListPath+"/status") == "i"){ // 신규
  289. // 총 재원일수 계산
  290. if(sInroomdd != "" && sDschdd != ""){ /* if(sIndd != "" && sDschdd != ""){ 2008-10-21 나종천 수정 실제 재원일수를 구함 */
  291. var totinhospdayno = getDateInterval(sInroomdd,sDschdd); /* 2008-10-21 나종천 수정 실제 재원일수를 구함 var totinhospdayno = getDateInterval(sIndd,sDschdd); */
  292. if(totinhospdayno < 1) totinhospdayno = 1;
  293. model.setValue(xDschAnalyListPath+"/totinhospdayno", totinhospdayno);
  294. }
  295. // 회차
  296. /* var indg = cmb_dschdd.length-cmb_dschdd.focusIndex;
  297. model.setValue(xDschAnalyListPath+"/indg",indg);
  298. if(indg == 1){
  299. ipt_reinresn.disabled = true;
  300. cmb_reinresncd.disabled = true;
  301. ipt_reinyncd.disabled = true;
  302. cmb_reinyn.disabled = true;
  303. }*/
  304. var bfindg = model.getValue(xDschAnalyListPath+"/bfindg");
  305. if(bfindg==""){
  306. model.setValue(xDschAnalyListPath+"/indg",1);
  307. ipt_reinresn.disabled = true;
  308. cmb_reinresncd.disabled = true;
  309. ipt_reinyncd.disabled = true;
  310. cmb_reinyn.disabled = true;
  311. }else{
  312. model.setValue(xDschAnalyListPath+"/indg",parseInt(bfindg)+1);
  313. }
  314. //재입원 일수
  315. var bfdschdd = model.getValue(xDschAnalyListPath+"/bfdschdd");
  316. var totbfdayno = getDateInterval(bfdschdd,sInroomdd);
  317. if(bfdschdd!=""){
  318. if((totbfdayno >0)&&(totbfdayno <= 30)){
  319. model.setValue("/root/main/dschanalyhist/dschanalyinfo/reinyn","01");
  320. model.setValue(xDschAnalyListPath+"/reinyncd", model.getValue(xDschAnalyListPath+"/reinyn"));
  321. // 20081218 수정
  322. //ipt_reinyncd.refresh();
  323. fCheckItemInputYN("reinyn");
  324. }else{
  325. model.setValue("/root/main/dschanalyhist/dschanalyinfo/reinyn","02");
  326. model.setValue(xDschAnalyListPath+"/reinyncd", model.getValue(xDschAnalyListPath+"/reinyn"));
  327. // 20081218 수정
  328. //ipt_reinyncd.refresh();
  329. ipt_reinresn.disabled = false;
  330. cmb_reinresncd.disabled = false;
  331. }
  332. }else{
  333. model.setValue("/root/main/dschanalyhist/dschanalyinfo/reinyn","02");
  334. model.setValue(xDschAnalyListPath+"/reinyncd", model.getValue(xDschAnalyListPath+"/reinyn"));
  335. // 20081218 수정
  336. //ipt_reinyncd.refresh();
  337. }
  338. model.setValue(xDschAnalyListPath+"/orgdschdd", model.getValue(xDschAnalyListPath+"/dschdd"));
  339. model.setValue("/root/main/cond/statcnts","퇴원분석이 이루어지지 않았습니다.");
  340. // 20081218 수정
  341. //model.refresh();
  342. // 수술내역
  343. for(var iRow = grd_oplist.fixedrows; iRow <= grd_oplist.rows-grd_oplist.fixedrows; iRow++){
  344. grd_oplist.rowStatus(iRow) = 1;
  345. }
  346. // 협의진단
  347. for(var iRow = grd_cnstlist.fixedrows; iRow <= grd_cnstlist.rows-grd_cnstlist.fixedrows; iRow++){
  348. grd_cnstlist.rowStatus(iRow) = 1;
  349. }
  350. for(var iRow = grd_wnmblist.fixedrows; iRow <= grd_wnmblist.rows-grd_wnmblist.fixedrows+1; iRow++){
  351. grd_wnmblist.rowStatus(iRow) = 1;
  352. }
  353. // 전과정보
  354. for(var iRow = grd_chngdeptlist.fixedrows; iRow <= grd_chngdeptlist.rows-grd_chngdeptlist.fixedrows; iRow++){
  355. grd_chngdeptlist.rowStatus(iRow) = 1;
  356. }
  357. // 중환자실
  358. for(var iRow = grd_iculist.fixedrows; iRow <= grd_iculist.rows-grd_iculist.fixedrows; iRow++){
  359. grd_iculist.rowStatus(iRow) = 1;
  360. }
  361. // 전염병2008-11-23 사용자 요구에 따라 막음(이창록)
  362. /*for(var iRow = grd_infdislist.fixedrows; iRow <= grd_infdislist.rows-grd_infdislist.fixedrows; iRow++){
  363. grd_infdislist.rowStatus(iRow) = 1;
  364. }*/
  365. }else{
  366. dPid = model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid");
  367. dDschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  368. sDschDD = dDschdd.substr(0,4)+"/"+dDschdd.substr(4,2)+"/"+dDschdd.substr(6,2)
  369. model.setValue("/root/main/cond/statcnts",dPid+"환자의"+sDschDD+"의 퇴원분석이 되어 있습니다.");
  370. // 20081218 수정
  371. //model.refresh();
  372. messageBox(dPid + "환자의" + sDschDD +"의 퇴원분석이 되어","I010");
  373. }
  374. // 산모/신생아
  375. grd_wnmblist.mergeCells = "bycol";
  376. grd_wnmblist.mergeCol(6) = false;
  377. grd_wnmblist.mergeCol(7) = false;
  378. grd_wnmblist.mergeCol(8) = false;
  379. grd_wnmblist.mergeCol(9) = false;
  380. grd_wnmblist.mergeCol(10) = false;
  381. grd_wnmblist.mergeCol(11) = false;
  382. model.copyNode("/root/temp/dschanalyhist", "/root/main/dschanalyhist");
  383. }
  384. // 20081218 수정
  385. //model.refresh();
  386. }
  387. /**
  388. * @desc : 초기화
  389. * @id :
  390. * @event : xforms-select
  391. * @return : void
  392. * @authur :
  393. */
  394. function fClearDschInfo(){
  395. model.resetInstanceNode(xDschAnalyListPath);
  396. model.removeNodeset("/root/main/dschanalyhist/oplist");
  397. model.removeNodeset("/root/main/dschanalyhist/cnstlist");
  398. model.removeNodeset("/root/main/dschanalyhist/wnmblist");
  399. model.removeNodeset("/root/main/dschanalyhist/chngdeptlist");
  400. model.removeNodeset("/root/main/dschanalyhist/iculist");
  401. model.removeNodeset("/root/main/dschanalyhist/infdislist");
  402. model.removeNodeset("/root/main/dschanalyhist/indxlist");
  403. model.removeNodeset("/root/main/dschanalyhist/icutotlist");
  404. // 입원병실정보
  405. model.removeNodeset("/root/init/inroomlist/room");
  406. // 퇴원병실정보
  407. model.removeNodeset("/root/init/dschroomlist/room");
  408. //감염종류2
  409. model.removeNodeset("/root/init/infdcpartinfo/infdcpartlist");
  410. model.refresh();
  411. }
  412. /**
  413. * @desc : 병동 정보 조회
  414. * @id :
  415. * @event : xforms-select
  416. * @return : void
  417. * @authur :
  418. */
  419. function fGetWardInfo(ref, pFlag, pCtrlID){
  420. var resultRef = "/root/temp/wardinfo";
  421. model.removenode(resultRef);
  422. model.removenode(ref);
  423. model.makeNode(resultRef);
  424. var sCtrlID = document.controls(pCtrlID);
  425. var roomcd = sCtrlID.currentText;
  426. model.makeValue(ref+"/roomcd",roomcd);
  427. model.makeValue(ref+"/stnddd", model.getValue(xDschAnalyListPath+"/dschdd"));
  428. if(submit("TRMRD00403", "false", ref, resultRef)==true){
  429. if(getNodesetCnt(model, resultRef+"/ward") > 0){
  430. if(pFlag == "in"){
  431. model.setValue(xDschAnalyListPath+"/inwardcd", model.getValue(resultRef+"/ward/wardcd"));
  432. model.setValue(xDschAnalyListPath+"/inwardnm", model.getValue(resultRef+"/ward/wardnm"));
  433. model.setValue(xDschAnalyListPath+"/inroomcd",roomcd);
  434. }else if(pFlag == "dsch"){
  435. model.setValue(xDschAnalyListPath+"/dschwardcd", model.getValue(resultRef+"/ward/wardcd"));
  436. model.setValue(xDschAnalyListPath+"/dschwardnm", model.getValue(resultRef+"/ward/wardnm"));
  437. model.setValue(xDschAnalyListPath+"/dschroomcd",roomcd);
  438. }
  439. }else{
  440. if(pFlag == "in"){
  441. model.setValue(xDschAnalyListPath+"/inwardcd","");
  442. model.setValue(xDschAnalyListPath+"/inwardnm","");
  443. model.setValue(xDschAnalyListPath+"/inroomcd","");
  444. }else if(pFlag == "dsch"){
  445. model.setValue(xDschAnalyListPath+"/dschwardcd","");
  446. model.setValue(xDschAnalyListPath+"/dschwardnm","");
  447. model.setValue(xDschAnalyListPath+"/dschroomcd","");
  448. }
  449. }
  450. }
  451. model.refresh();
  452. }
  453. /**
  454. * @desc : 줄 추가
  455. * @id :
  456. * @event : xforms-select
  457. * @return : void
  458. * @authur :
  459. */
  460. function fAddGridRow(pGrid){
  461. var sPid = model.getValue(xDschAnalyListPath+"/pid");
  462. var sDschDD = model.getValue(xDschAnalyListPath+"/dschdd");
  463. if(sPid == "" && sDschDD == ""){
  464. messageBox("퇴원일자를 입력 후에 추가","I006");
  465. return;
  466. }
  467. var sGridID = document.controls(pGrid);
  468. var ref = sGridID.attribute("nodeset");
  469. sGridID.addRow();
  470. var iRow = sGridID.rows - sGridID.fixedrows;
  471. model.setValue(ref+"["+iRow+"]/pid", sPid);
  472. model.setValue(ref+"["+iRow+"]/dschdd", sDschDD.split('-').join("")); //'-'문자가 들어가 있는 숫자일 경우 '-'문자를 분할(split())한 다음에 다시 결합(join)
  473. }
  474. /**
  475. * @desc : 줄 삭제
  476. * @id :
  477. * @event : xforms-select
  478. * @return : void
  479. * @authur :
  480. */
  481. function fDelGridRow(pGrid){
  482. var sGridID = document.controls(pGrid);
  483. var ref = sGridID.attribute("nodeset");
  484. var iRow = sGridID.row;
  485. if(iRow < 1) return;
  486. var iStatus = sGridID.rowStatus(iRow);
  487. if(iStatus == 1 || iStatus == 3){
  488. sGridID.deleteRow(iRow);
  489. }else{
  490. sGridID.rowStatus(iRow) = 4;
  491. sGridID.deleteRow(iRow);
  492. }
  493. }
  494. /**
  495. * @desc : 항목별 입력 여부 체크
  496. * @id :
  497. * @event : xforms-select
  498. * @return : void
  499. * @authur :
  500. */
  501. function fCheckItemInputYN(pFlag){
  502. // 치료결과 체크
  503. if(pFlag == "curerslt" || pFlag == null){
  504. var sCureRsltCD = model.getValue(xDschAnalyListPath+"/curersltcd");
  505. if(sCureRsltCD == "07" || sCureRsltCD == "08"){
  506. ipt_dethtype.disabled = false;
  507. cmb_dethtypecd.disabled = false;
  508. ipt_opdethtype.disabled = false;
  509. cmb_opdethtypecd.disabled = false;
  510. }else{
  511. ipt_dethtype.disabled = true;
  512. cmb_dethtypecd.disabled = true;
  513. ipt_opdethtype.disabled = true;
  514. cmb_opdethtypecd.disabled = true;
  515. model.makeValue(xDschAnalyListPath+"/dethtype","");
  516. model.makeValue(xDschAnalyListPath+"/dethtypecd","");
  517. // 20081218 수정
  518. //ipt_dethtype.refresh();
  519. //cmb_dethtypecd.refresh();
  520. //ipt_opdethtype.refresh();
  521. //cmb_opdethtypecd.refresh();
  522. }
  523. }
  524. // 입원경로 체크
  525. if(pFlag == "inpath"){
  526. var sInPathCd = model.getValue(xDschAnalyListPath+"/inpathcd");
  527. if(sInPathCd == "02"){
  528. ipt_erchosdt.disabled = false;
  529. ipt_erstaytm.disabled = false;
  530. }else{
  531. ipt_erchosdt.disabled = true;
  532. ipt_erstaytm.disabled = true;
  533. model.setValue(xDschAnalyListPath+"/erchosdt","");
  534. model.setValue(xDschAnalyListPath+"/erstaytm","");
  535. // 20081218 수정
  536. //ipt_erchosdt.refresh();
  537. //ipt_erstaytm.refresh();
  538. }
  539. }
  540. // 재입원(Unplan) 체크
  541. if(pFlag == "reinresn" || pFlag == null){
  542. var sReInResnCd = model.getValue(xDschAnalyListPath+"/reinresncd");
  543. if(sReInResnCd != ""){
  544. model.setValue(xDschAnalyListPath+"/reinyncd","");
  545. model.setValue(xDschAnalyListPath+"/reinyn","");
  546. ipt_reinyncd.disabled = true;
  547. cmb_reinyn.disabled = true;
  548. // 20081218 수정
  549. //ipt_reinyncd.refresh();
  550. //cmb_reinyn.refresh();
  551. }else{
  552. ipt_reinyncd.disabled = false;
  553. cmb_reinyn.disabled = false;
  554. }
  555. }
  556. // 재입원(plan) 체크
  557. if(pFlag = "reinyn" || pFlag == null){
  558. var sReInYN = model.getValue(xDschAnalyListPath+"/reinyn");
  559. if(sReInYN != ""){
  560. model.setValue(xDschAnalyListPath+"/reinresncd","");
  561. model.setValue(xDschAnalyListPath+"/reinresn","");
  562. ipt_reinresn.disabled = true;
  563. cmb_reinresncd.disabled = true;
  564. // 20081218 수정
  565. //ipt_reinresn.refresh();
  566. //cmb_reinresncd.refresh();
  567. }else{
  568. ipt_reinresn.disabled = false;
  569. cmb_reinresncd.disabled = false;
  570. }
  571. }
  572. }
  573. /**
  574. * @desc : 저장
  575. * @id :
  576. * @event : xforms-select
  577. * @return : void
  578. * @authur :
  579. */
  580. function fSave()
  581. {
  582. //등록번호
  583. if(model.getValue(xDschAnalyListPath+"/pid") == ""){
  584. messageBox("등록번호는", "I003");
  585. model.setFocus("ipt_pid");
  586. return;
  587. }
  588. // 종교
  589. if(model.getValue(xDschAnalyListPath+"/religncd") == ""){
  590. messageBox("종교는", "I003");
  591. model.setFocus("cmb_religncd");
  592. return;
  593. }
  594. // 결혼상태
  595. if(model.getValue(xDschAnalyListPath+"/marystatcd") == ""){
  596. messageBox("결혼상태는", "I003");
  597. model.setFocus("cmb_marystatcd");
  598. return;
  599. }
  600. // 직업
  601. if(model.getValue(xDschAnalyListPath+"/jobcd") == ""){
  602. messageBox("직업은", "I003");
  603. model.setFocus("cmb_jobcd");
  604. return;
  605. }
  606. // 치료결과
  607. if(model.getValue(xDschAnalyListPath+"/curersltcd") == ""){
  608. messageBox("치료결과는", "I003");
  609. model.setFocus("cmb_curersltcd");
  610. return;
  611. }
  612. // 퇴원형태
  613. if(model.getValue(xDschAnalyListPath+"/dschtypecd") == ""){
  614. messageBox("퇴원형태는", "I003");
  615. model.setFocus("cmb_dschtypecd");
  616. return;
  617. }
  618. // 내원경위
  619. if(model.getValue(xDschAnalyListPath+"/chosprogcd") == ""){
  620. messageBox("내원경위는", "I003");
  621. model.setFocus("cmb_chosprogcd");
  622. return;
  623. }
  624. // 입원경로
  625. if(model.getValue(xDschAnalyListPath+"/inpathcd") == ""){
  626. messageBox("입원경로는", "I003");
  627. model.setFocus("cmb_inpathcd");
  628. return;
  629. }
  630. //입원,퇴원과에 해당하는 분과를 선택 여부 체크
  631. var indeptcd = model.getValue(xDschAnalyListPath+"/indeptcd");
  632. var dschdeptcd = model.getValue(xDschAnalyListPath+"/dschdeptcd");
  633. if((indeptcd=="2010000000")||(indeptcd=="2040000000")||(indeptcd=="2100000000")||(indeptcd=="2110000000")){
  634. if(cmb_inclrsdeptcd.label==""){
  635. messageBox(caption12.attribute("text")+" 분과를","C002");
  636. model.setFocus("cmb_inclrsdeptcd");
  637. return;
  638. }
  639. }
  640. if((dschdeptcd=="2010000000")||(dschdeptcd=="2040000000")||(dschdeptcd=="2100000000")||(dschdeptcd=="2110000000")){
  641. if(cmb_dschclrsdeptcd.label==""){
  642. messageBox(caption23.attribute("text")+" 분과를","C002");
  643. model.setFocus("cmb_dschclrsdeptcd");
  644. return;
  645. }
  646. }
  647. //수술정보에서 마취방법 체크 여부
  648. var anstmthdcd1 = model.getValue("/root/main/dschanalyhist/oplist["+grd_oplist.rows-grd_oplist.fixedrows+"]/anstmthdcd1");
  649. var gnrlanstcnt = model.getValue("/root/main/dschanalyhist/dschanalyinfo/gnrlanstcnt");
  650. var prtanstcnt = model.getValue("/root/main/dschanalyhist/dschanalyinfo/prtanstcnt");
  651. var tpclanstcnt = model.getValue("/root/main/dschanalyhist/dschanalyinfo/tpclanstcnt");
  652. if(getNodesetCnt(model,"/root/main/dschanalyhist/oplist")>0){
  653. if(grd_oplist.valueMatrix(grd_oplist.rows-grd_oplist.fixedrows,grd_oplist.colRef("anstmthdcd1"))==""){
  654. messageBox("수술정보에 마취방법은 ","I003");
  655. return;
  656. }
  657. if(((gnrlanstcnt=="0")||(gnrlanstcnt==""))&&((prtanstcnt=="0")||(prtanstcnt==""))&&((tpclanstcnt=="0")||(tpclanstcnt==""))){
  658. messageBox("수술정보에 전신,부분,국소 건수를 ","C001");
  659. return;
  660. }
  661. }
  662. //치료결과에 48이전(후)(07,08)사망시 퇴원형태가 사망퇴원(06)인지 체크,반대도 동일
  663. var curersltcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/curersltcd");
  664. var dschtypecd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschtypecd");
  665. if((curersltcd=="07")||(curersltcd=="08")){
  666. if(dschtypecd!="06"){
  667. messageBox("사망환자일 경우에 퇴원형태를 ","I007");
  668. model.setFocus("cmb_dschtypecd");
  669. return;
  670. }
  671. }else if((curersltcd!="07")||(curersltcd!="08")){
  672. if(dschtypecd=="06"){
  673. messageBox(cmb_dschtypecd.label+" 환자일 경우에 치료결과를 ","I007");
  674. model.setFocus("cmb_curersltcd");
  675. return;
  676. }
  677. }
  678. // 입원분과나 퇴원분과든 산과일때 산모/신생아정보가 없을시 체크
  679. var inclrsdeptcd = model.getValue(xDschAnalyListPath+"/inclrsdeptcd");
  680. var dschclrsdeptcd = model.getValue(xDschAnalyListPath+"/dschclrsdeptcd");
  681. if((inclrsdeptcd =="2100600000")||(dschclrsdeptcd =="2100600000")){
  682. if(getNodesetCnt(model,"/root/main/dschanalyhist/wnmblist")< 1){
  683. messageBox("산모 / 신생아정보를 ","C001");
  684. return;
  685. }
  686. }
  687. // 입원분과나 퇴원분과든 산과일때 산모/신생아정보에 산모형테 미입력시 체크
  688. if((inclrsdeptcd =="2100600000")||(dschclrsdeptcd =="2100600000")){
  689. if(grd_wnmblist.valueMatrix(grd_wnmblist.rows-grd_wnmblist.fixedrows+1,grd_wnmblist.colRef("womntypecd"))==""){
  690. messageBox("산모 / 신생아정보에 산모형태를 ","C001");
  691. return;
  692. }
  693. }
  694. // 조회한 등록번호랑 저장할 등록번호 일치 여부
  695. if(model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid")!=(model.getValue(xPatBaseInfoListPath+"/pid"))){
  696. messageBox("조회한 등록번호랑 저장할 등록번호가 ","E004");
  697. model.setFocus("ipt_pid");
  698. return;
  699. }
  700. var inrmdd= model.getValue(xDschAnalyListPath+"/inrmdd");
  701. var inrmDD = inrmdd.replace("-","") ;
  702. model.setValue(xDschAnalyListPath+"/inrmdd",inrmDD);
  703. var dschdd= model.getValue(xDschAnalyListPath+"/dschdd");
  704. if(dschdd.indexOf("-")> 0){
  705. model.makeValue(xDschAnalyListPath+"/dschdd",dschdd.split('-').join(""));
  706. }
  707. model.removeNodeset("/root/send");
  708. model.makeNode("/root/send/dschanalyinfo");
  709. model.copyNode("/root/send/dschanalyinfo", xDschAnalyListPath);
  710. model.makeValue("/root/send/oplist", grd_oplist.getUpdateData()); // 수술내역
  711. model.makeValue("/root/send/cnstlist", grd_cnstlist.getUpdateData()); // 협의진단
  712. model.makeValue("/root/send/wnmblist", grd_wnmblist.getUpdateData()); // 산모/신생아
  713. model.makeValue("/root/send/chngdeptlist", grd_chngdeptlist.getUpdateData()); // 전과정보
  714. model.makeValue("/root/send/iculist", grd_iculist.getUpdateData()); // 중환자실
  715. // model.makeValue("/root/send/infdislist", grd_infdislist.getUpdateData()); // 전염병2008-11-23 사용자 요구에 따라 막음(이창록)
  716. var sIndxInfo = model.getValue(xDschAnalyListPath+"/indxinfo").getTrim().split(" ");
  717. var sSaveData = "status▦kpicd▦dsqino▦pid▦dschdd▩";
  718. var indxCnt = 0;
  719. var kpicd = "";
  720. if(sIndxInfo.length > 0){
  721. for(var i=0; i<sIndxInfo.length; i++){
  722. if( sIndxInfo[i] != ""){
  723. if(model.getValue("/root/main/dschanalyhist/indxlist[kpicd = '"+sIndxInfo[i]+"']/dsqino") == ""){
  724. sSaveData += "i▦"
  725. + sIndxInfo[i]+"▦"
  726. + "▦"
  727. + model.getValue(xDschAnalyListPath+"/pid")+"▦"
  728. + model.getValue(xDschAnalyListPath+"/dschdd")+"▩";
  729. }
  730. }
  731. }
  732. }
  733. indxCnt = getNodesetCnt(model, "/root/main/dschanalyhist/indxlist");
  734. if(indxCnt > 0){
  735. for(var iRow=0; iRow < indxCnt; iRow++){
  736. kpicd = model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/kpicd");
  737. if(model.getValue(xDschAnalyListPath+"/indxinfo").indexOf(kpicd) == -1){
  738. sSaveData += "d▦"
  739. + kpicd+"▦"
  740. + model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/dsqino")+"▦"
  741. + model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/pid")+"▦"
  742. + model.getValue("/root/main/dschanalyhist/indxlist["+iRow+"]/dschdd")+"▩";
  743. }
  744. }
  745. }
  746. model.makeValue("/root/send/indxlist", sSaveData); // 전염병
  747. if(submit("TXMRD00401")){
  748. messageBox("저장","I002");
  749. // 입력 여부 체크
  750. fCheckItemInputYN();
  751. //model.refresh();
  752. // 중환자실 전체 재원일수
  753. model.removeNodeset("/root/main/dschanalyhist/icutotlist");
  754. grd_icutotlist.refresh();
  755. if(grd_iculist.rows > grd_iculist.fixedrows){
  756. var sTotInHospDayNo = 0;
  757. var iRow = 0;
  758. var iICUTotRow = 0;
  759. var sICUCd = "";
  760. for(var iStndRow = grd_iculist.fixedrows; iStndRow<=(grd_iculist.rows-grd_iculist.fixedrows); iStndRow++){
  761. sICUCd = model.getValue("/root/main/dschanalyhist/iculist["+iStndRow+"]/icucd");
  762. iICUTotRow = grd_icutotlist.findRow(sICUCd, grd_icutotlist.fixedrows, 1);
  763. sTotInHospDayNo = 0;
  764. if(iICUTotRow < 1){
  765. for(var iRow = grd_iculist.fixedrows; iRow <= (grd_iculist.rows-grd_iculist.fixedrows); iRow++){
  766. if(model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/icucd") == sICUCd){
  767. sInHospDayNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/inhospdayno");
  768. if(sInHospDayNo == "") sInHospDayNo = 0;
  769. sTotInHospDayNo += eval(sInHospDayNo);
  770. }
  771. }
  772. grd_icutotlist.addRow();
  773. iRow = grd_icutotlist.rows - grd_icutotlist.fixedrows;
  774. model.setValue(xICUTotListPath+"["+iRow+"]/deptcd",sICUCd);
  775. model.setValue(xICUTotListPath+"["+iRow+"]/totinhospdayno", sTotInHospDayNo);
  776. }
  777. }
  778. }
  779. if(model.getValue(xDschAnalyListPath+"/status") == "u"){
  780. dPid = model.getValue("/root/main/dschanalyhist/dschanalyinfo/pid");
  781. dDschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  782. sDschDD = dDschdd.substr(0,4)+"/"+dDschdd.substr(4,2)+"/"+dDschdd.substr(6,2)
  783. model.setValue("/root/main/cond/statcnts",dPid+"환자의"+sDschDD+"의 퇴원분석이 되어 있습니다.");
  784. // model.refresh();
  785. }
  786. model.copyNode("/root/temp/dschanalyhist", "/root/main/dschanalyhist");
  787. model.setValue("/root/main/dschanalyhist/dschanalyinfo/pid", "");
  788. model.setFocus("ipt_pid");
  789. }
  790. model.refresh();
  791. }
  792. /**
  793. * @desc : 진단 검색 팝업
  794. * @id :
  795. * @event : xforms-select
  796. * @return : void
  797. * @authur :
  798. */
  799. function fPopUpDiag(pGrid, srchCol, rsltCol){
  800. var sGridID = document.controls(pGrid);
  801. var ref = sGridID.attribute("nodeset");
  802. var iRow = sGridID.row;
  803. var sRtnMsg = "";
  804. model.setFocus(pGrid);
  805. if(sGridID.valueMatrix(iRow,srchCol) == "") return;
  806. setParameter ( "SPMMO00800_cond1" , "1" );
  807. setParameter ( "SPMMO00800_cond2" , "1" );
  808. setParameter ( "SPMMO00800_cond3" , "H" );
  809. setParameter ( "SPMMO00800_cond4" , model.getValue(xDschAnalyListPath+"/dschdd"));
  810. setParameter ( "SPMMO00800_cond5" , sGridID.valueMatrix(iRow,srchCol));
  811. modal("SPMMO00800");
  812. sRtnMsg = getParameter("SPMMO00800_rtn");
  813. if(sRtnMsg != ""){
  814. sGridID.valueMatrix(iRow,srchCol) = getArrayData(sRtnMsg,1,1,"▩","▦");
  815. sGridID.valueMatrix(iRow,rsltCol) = getArrayData(sRtnMsg,1,2,"▩","▦");
  816. }
  817. }
  818. /**
  819. * @desc : 사용자 검색 팝업
  820. * @id :
  821. * @event : xforms-select
  822. * @return : void
  823. * @authur : 수정 ->이창록 2008-10-10 12:29오전
  824. */
  825. function fPopUpUserInfo(pGrid,srchCol,rsltCol){
  826. var sGridID = document.controls(pGrid);
  827. var ref = sGridID.attribute("nodeset");
  828. var iRow = sGridID.row;
  829. var sKeyNo = 0; // 각 그리드의 key
  830. var opdd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdd"); //수술일자
  831. var reqdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdd");//의뢰일
  832. var execdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdd");//시행일
  833. var chngdeptdd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdd");//전출일
  834. model.setFocus(pGrid);
  835. setParameter("reqflag", "usernm");
  836. setParameter("usernm", sGridID.valueMatrix(iRow,srchCol));
  837. if(pGrid=="grd_oplist"){
  838. setParameter("stnddd", opdd);
  839. }else if(("grd_cnstlist")&&(srchCol==5)){
  840. setParameter("stnddd", reqdd);
  841. }else if(("grd_cnstlist")&&(srchCol==11)){
  842. setParameter("stnddd", execdd);
  843. }else if(pGrid=="grd_chngdeptlist"){
  844. setParameter("stnddd", chngdeptdd);
  845. }
  846. setParameter("autortnyn","Y");
  847. model.resetInstanceNode("/root/temp/userinfo");
  848. modal("SPMRF03200");
  849. sGridID.valueMatrix(iRow,rsltCol) = model.getValue("/root/temp/userinfo/userid");
  850. sGridID.valueMatrix(iRow,srchCol) = model.getValue("/root/temp/userinfo/usernm");
  851. if(model.getValue("/root/temp/userinfo/userid") == "") return false;
  852. else return true;
  853. }
  854. /**
  855. * @desc : 사용자 정보 얻기
  856. * @id :
  857. * @event : xforms-select
  858. * @return : void
  859. * @authur :
  860. */
  861. function fGetUserInfo(userid,usernm,deptcd ,instcd){
  862. model.setValue("/root/temp/userinfo/userid", userid);
  863. model.setValue("/root/temp/userinfo/usernm", usernm.getTrim());
  864. model.setValue("/root/temp/userinfo/deptcd", deptcd);
  865. model.setValue("/root/temp/userinfo/instcd", instcd);
  866. }
  867. /**
  868. * @ver : 2008-08-25
  869. * @desc : 감염종류1의 감염종류2의 하부항목들 조회
  870. * @by : 이창록
  871. * @param :
  872. * @return :
  873. * @---------------------------------------------------
  874. */
  875. function fGetInFcCas(code){
  876. switch(code){
  877. case "01":
  878. zbcfGetCodeList(new Array("M0485"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  879. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0485");
  880. break;
  881. case "02":
  882. zbcfGetCodeList(new Array("M0486"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  883. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0486");
  884. break;
  885. case "03":
  886. zbcfGetCodeList(new Array("M0487"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  887. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0487");
  888. break;
  889. case "04":
  890. zbcfGetCodeList(new Array("M0488"),new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  891. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0488");
  892. break;
  893. case "05":
  894. zbcfGetCodeList(new Array("M0489"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  895. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0489");
  896. break;
  897. case "06":
  898. zbcfGetCodeList(new Array("M0490"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  899. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0490");
  900. break;
  901. case "07":
  902. zbcfGetCodeList(new Array("M0491"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  903. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0491");
  904. break;
  905. case "08":
  906. zbcfGetCodeList(new Array("M0492"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  907. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0492");
  908. break;
  909. case "09":
  910. zbcfGetCodeList(new Array("M0493"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  911. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0493");
  912. break;
  913. case "10":
  914. zbcfGetCodeList(new Array("M0494"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  915. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0494");
  916. break;
  917. case "11":
  918. zbcfGetCodeList(new Array("M0495"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  919. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0495");
  920. break;
  921. case "12":
  922. zbcfGetCodeList(new Array("M0496"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  923. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0496");
  924. break;
  925. case "13":
  926. zbcfGetCodeList(new Array("M0497"), new Array("/root/hidden/infdcpartinfo/infdcpartlist"));
  927. copyNodeset("/root/init/infdcpartinfo/infdcpartlist", "/root/hidden/infdcpartinfo/infdcpartlist/M0497");
  928. break;
  929. }
  930. // 20081218 수정
  931. //model.refresh();
  932. model.removeNodeset("/root/hidden/infdcpartinfo/infdcpartlist");
  933. model.makeNode("/root/hidden/infdcpartinfo/infdcpartlist");
  934. }
  935. /**
  936. * @ver : 2008-10-30
  937. * @desc : 입원과 및 퇴원과 분과 조회
  938. * @by : 이창록
  939. * @param : 20090317 수정 분과공통코드를 분과유형코드로 변경
  940. * @return :
  941. * @---------------------------------------------------
  942. */
  943. function fInDschClrsDeptSearch(flag)
  944. {
  945. var inrmdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/inrmdd");
  946. if(flag=="dsch"){
  947. model.removeNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist");
  948. model.makeNode("/root/hidden/dschclrsinfo/dschclrsdeptlist");
  949. var deptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  950. switch(deptcd){
  951. case "2010000000":
  952. zbcfGetKindCodeList(new Array("M0030"),new Array("M0500"),new Array("/root/tmp/hidden/dschclrsdeptlist"),true
  953. ,new Array("dispseq"), new Array("asc"));
  954. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0030M0500");
  955. break;
  956. case "2040000000":
  957. if(inrmdd < "20090323"){
  958. zbcfGetKindCodeList(new Array("M0031"),new Array("M0501"),new Array("/root/tmp/hidden/dschclrsdeptlist"),true
  959. ,new Array("dispseq"), new Array("asc"));
  960. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0031M0501");
  961. }else{
  962. zbcfGetKindCodeList(new Array("M0034"),new Array("M0531"),new Array("/root/tmp/hidden/dschclrsdeptlist"),true
  963. ,new Array("dispseq"), new Array("asc"));
  964. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0034M0531");
  965. }
  966. break;
  967. case "2100000000":
  968. zbcfGetKindCodeList(new Array("M0032"),new Array("M0502"),new Array("/root/tmp/hidden/dschclrsdeptlist"),true
  969. ,new Array("dispseq"), new Array("asc"));
  970. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0032M0502");
  971. break;
  972. case "2110000000":
  973. zbcfGetKindCodeList(new Array("M0033"),new Array("M0503"),new Array("/root/tmp/hidden/dschclrsdeptlist"),true
  974. ,new Array("dispseq"), new Array("asc"));
  975. copyNodeset("/root/hidden/dschclrsinfo/dschclrsdeptlist", "/root/tmp/hidden/dschclrsdeptlist/M0033M0503");
  976. break;
  977. }
  978. model.removeNodeset("/root/tmp/hidden/dschclrsdeptlist");
  979. model.makeNode("/root/tmp/hidden/dschclrsdeptlist");
  980. }else if(flag=="indd"){
  981. model.removeNodeset("/root/hidden/inclrsinfo/inclrsdeptlist");
  982. model.makeNode("/root/hidden/inclrsinfo/inclrsdeptlist");
  983. var deptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  984. switch(deptcd){
  985. case "2010000000":
  986. zbcfGetKindCodeList(new Array("M0030"),new Array("M0500"),new Array("/root/tmp/hidden/inclrsdeptlist"),true
  987. ,new Array("dispseq"), new Array("asc"));
  988. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0030M0500");
  989. break;
  990. case "2040000000":
  991. if(inrmdd < "20090323"){
  992. zbcfGetKindCodeList(new Array("M0031"),new Array("M0501"),new Array("/root/tmp/hidden/inclrsdeptlist"),true
  993. ,new Array("dispseq"), new Array("asc"));
  994. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0031M0501");
  995. break;
  996. }else{
  997. zbcfGetKindCodeList(new Array("M0034"),new Array("M0531"),new Array("/root/tmp/hidden/inclrsdeptlist"),true
  998. ,new Array("dispseq"), new Array("asc"));
  999. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0034M0531");
  1000. break;
  1001. }
  1002. case "2100000000":
  1003. zbcfGetKindCodeList(new Array("M0032"),new Array("M0502"),new Array("/root/tmp/hidden/inclrsdeptlist"),true
  1004. ,new Array("dispseq"), new Array("asc"));
  1005. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0032M0502");
  1006. break;
  1007. case "2110000000":
  1008. zbcfGetKindCodeList(new Array("M0033"),new Array("M0503"),new Array("/root/tmp/hidden/inclrsdeptlist"),true
  1009. ,new Array("dispseq"), new Array("asc"));
  1010. copyNodeset("/root/hidden/inclrsinfo/inclrsdeptlist", "/root/tmp/hidden/inclrsdeptlist/M0033M0503");
  1011. break;
  1012. }
  1013. model.removeNodeset("/root/tmp/hidden/inclrsdeptlist");
  1014. model.makeNode("/root/tmp/hidden/inclrsdeptlist");
  1015. }
  1016. }
  1017. function fOpGridStatusChg()
  1018. {
  1019. var iRow = grd_oplist.row;
  1020. var iCol = grd_oplist.col;
  1021. var iStatus = grd_oplist.rowStatus(iRow);
  1022. var sDsopNo = "";
  1023. if(iCol != 7 && iStatus == 2){
  1024. sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1025. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno='"+sDsopNo+"']").xml){
  1026. grd_oplist.rowStatus(iRow) = 0;
  1027. }
  1028. }
  1029. }
  1030. /**
  1031. * @ver : 2008-12-07
  1032. * @desc : 입원과 및 퇴원과 분과 선택시 그리드 분과 변경
  1033. * @by : 이창록
  1034. * @param :
  1035. * @return :
  1036. * @---------------------------------------------------
  1037. */
  1038. function fClrsDeptSelected(flag)
  1039. {
  1040. if(flag =="dsch"){
  1041. // 수술내역
  1042. for(var iRow = grd_oplist.fixedrows; iRow <= grd_oplist.rows-grd_oplist.fixedrows; iRow++){
  1043. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd");
  1044. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1045. var iStatus = grd_oplist.rowStatus(iRow);
  1046. if(dschdeptcd==perfdeptcd){
  1047. if((perfdeptcd=="2010000000")||(perfdeptcd=="2040000000")||(perfdeptcd=="2100000000")||(perfdeptcd=="2110000000")){
  1048. model.makeValue("/root/main/dschanalyhist/oplist["+iRow+"]/opclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1049. if(iStatus == 0){
  1050. grd_oplist.rowStatus(iRow) = 2;
  1051. }else if(iStatus == 2){
  1052. var sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1053. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno='"+sDsopNo+"']").xml){
  1054. grd_oplist.rowStatus(iRow) = 0;
  1055. }
  1056. }
  1057. }
  1058. }
  1059. }
  1060. // 20081218 수정
  1061. //grd_oplist.refresh();
  1062. // 협의진단
  1063. for(var iRow = grd_cnstlist.fixedrows; iRow <= grd_cnstlist.rows-grd_cnstlist.fixedrows; iRow++){
  1064. var reqdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd");
  1065. var execdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd");
  1066. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1067. var iStatus = grd_cnstlist.rowStatus(iRow);
  1068. if(dschdeptcd==reqdeptcd){
  1069. if((reqdeptcd=="2010000000")||(reqdeptcd=="2040000000")||(reqdeptcd=="2100000000")||(reqdeptcd=="2110000000")){
  1070. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1071. if(iStatus == 0){
  1072. grd_cnstlist.rowStatus(iRow) = 2;
  1073. }else if(iStatus == 2){
  1074. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1075. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1076. grd_cnstlist.rowStatus(iRow) = 0;
  1077. }
  1078. }
  1079. }
  1080. }
  1081. if(dschdeptcd==execdeptcd){
  1082. if((execdeptcd=="2010000000")||(execdeptcd=="2040000000")||(execdeptcd=="2100000000")||(execdeptcd=="2110000000")){
  1083. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execlrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1084. if(iStatus == 0){
  1085. grd_cnstlist.rowStatus(iRow) = 2;
  1086. }else if(iStatus == 2){
  1087. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1088. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1089. grd_cnstlist.rowStatus(iRow) = 0;
  1090. }
  1091. }
  1092. }
  1093. }
  1094. }
  1095. // 20081218 수정
  1096. //grd_cnstlist.refresh();
  1097. // 전과정보
  1098. for(var iRow = grd_chngdeptlist.fixedrows; iRow <= grd_chngdeptlist.rows-grd_chngdeptlist.fixedrows; iRow++){
  1099. var chngdeptcd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd");
  1100. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1101. var iStatus = grd_chngdeptlist.rowStatus(iRow);
  1102. if(dschdeptcd==chngdeptcd){
  1103. if((chngdeptcd=="2010000000")||(chngdeptcd=="2040000000")||(chngdeptcd=="2100000000")||(chngdeptcd=="2110000000")){
  1104. model.makeValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1105. if(iStatus == 0){
  1106. grd_chngdeptlist.rowStatus(iRow) = 2;
  1107. }else if(iStatus == 2){
  1108. var sDscdNo = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/dscdno");
  1109. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno='"+sDscdNo+"']").xml){
  1110. grd_chngdeptlist.rowStatus(iRow) = 0;
  1111. }
  1112. }
  1113. }
  1114. }
  1115. }
  1116. // 20081218 수정
  1117. //grd_chngdeptlist.refresh();
  1118. // 중환자실
  1119. for(var iRow = grd_iculist.fixedrows; iRow <= grd_iculist.rows-grd_iculist.fixedrows; iRow++){
  1120. var orddeptcd = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/orddeptcd");
  1121. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1122. var iStatus = grd_iculist.rowStatus(iRow);
  1123. if(dschdeptcd==orddeptcd){
  1124. if((orddeptcd=="2010000000")||(orddeptcd=="2040000000")||(orddeptcd=="2100000000")||(orddeptcd=="2110000000")){
  1125. model.makeValue("/root/main/dschanalyhist/iculist["+iRow+"]/ordclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschclrsdeptcd"));
  1126. if(iStatus == 0){
  1127. grd_iculist.rowStatus(iRow) = 2;
  1128. }else if(iStatus == 2){
  1129. var sDsicuNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/dsicuno");
  1130. if(instance1.selectSingleNode("/root/main/dschanalyhist/iculist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/iculist[dsicuno='"+sDsicuNo+"']").xml){
  1131. grd_iculist.rowStatus(iRow) = 0;
  1132. }
  1133. }
  1134. }
  1135. }
  1136. }
  1137. // 20081218 수정
  1138. //grd_iculist.refresh();
  1139. }else if(flag =="in"){
  1140. // 수술내역
  1141. for(var iRow = grd_oplist.fixedrows; iRow <= grd_oplist.rows-grd_oplist.fixedrows; iRow++){
  1142. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd");
  1143. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1144. var iStatus = grd_oplist.rowStatus(iRow);
  1145. if(indeptcd==perfdeptcd){
  1146. if((perfdeptcd=="2010000000")||(perfdeptcd=="2040000000")||(perfdeptcd=="2100000000")||(perfdeptcd=="2110000000")){
  1147. model.makeValue("/root/main/dschanalyhist/oplist["+iRow+"]/opclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1148. if(iStatus == 0){
  1149. grd_oplist.rowStatus(iRow) = 2;
  1150. }else if(iStatus == 2){
  1151. var sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1152. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno='"+sDsopNo+"']").xml){
  1153. grd_oplist.rowStatus(iRow) = 0;
  1154. }
  1155. }
  1156. }
  1157. }
  1158. }
  1159. // 20081218 수정
  1160. //grd_oplist.refresh();
  1161. // 협의진단
  1162. for(var iRow = grd_cnstlist.fixedrows; iRow <= grd_cnstlist.rows-grd_cnstlist.fixedrows; iRow++){
  1163. var reqdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd");
  1164. var execdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd");
  1165. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1166. var iStatus = grd_cnstlist.rowStatus(iRow);
  1167. if(indeptcd==reqdeptcd){
  1168. if((reqdeptcd=="2010000000")||(reqdeptcd=="2040000000")||(reqdeptcd=="2100000000")||(reqdeptcd=="2110000000")){
  1169. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1170. if(iStatus == 0){
  1171. grd_cnstlist.rowStatus(iRow) = 2;
  1172. }else if(iStatus == 2){
  1173. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1174. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1175. grd_cnstlist.rowStatus(iRow) = 0;
  1176. }
  1177. }
  1178. }
  1179. }
  1180. if(indeptcd==execdeptcd){
  1181. if((execdeptcd=="2010000000")||(execdeptcd=="2040000000")||(execdeptcd=="2100000000")||(execdeptcd=="2110000000")){
  1182. model.makeValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execlrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1183. if(iStatus == 0){
  1184. grd_cnstlist.rowStatus(iRow) = 2;
  1185. }else if(iStatus == 2){
  1186. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1187. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno='"+sDscnstNo+"']").xml){
  1188. grd_cnstlist.rowStatus(iRow) = 0;
  1189. }
  1190. }
  1191. }
  1192. }
  1193. }
  1194. // 20081218 수정
  1195. //grd_cnstlist.refresh();
  1196. // 전과정보
  1197. for(var iRow = grd_chngdeptlist.fixedrows; iRow <= grd_chngdeptlist.rows-grd_chngdeptlist.fixedrows; iRow++){
  1198. var chngdeptcd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd");
  1199. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1200. var iStatus = grd_chngdeptlist.rowStatus(iRow);
  1201. if(indeptcd==chngdeptcd){
  1202. if((chngdeptcd=="2010000000")||(chngdeptcd=="2040000000")||(chngdeptcd=="2100000000")||(chngdeptcd=="2110000000")){
  1203. model.makeValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1204. if(iStatus == 0){
  1205. grd_chngdeptlist.rowStatus(iRow) = 2;
  1206. }else if(iStatus == 2){
  1207. var sDscdNo = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/dscdno");
  1208. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno='"+sDscdNo+"']").xml){
  1209. grd_chngdeptlist.rowStatus(iRow) = 0;
  1210. }
  1211. }
  1212. }
  1213. }
  1214. }
  1215. // 20081218 수정
  1216. //grd_chngdeptlist.refresh();
  1217. // 중환자실
  1218. for(var iRow = grd_iculist.fixedrows; iRow <= grd_iculist.rows-grd_iculist.fixedrows; iRow++){
  1219. var orddeptcd = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/orddeptcd");
  1220. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1221. var iStatus = grd_iculist.rowStatus(iRow);
  1222. if(indeptcd==orddeptcd){
  1223. if((orddeptcd=="2010000000")||(orddeptcd=="2040000000")||(orddeptcd=="2100000000")||(orddeptcd=="2110000000")){
  1224. model.makeValue("/root/main/dschanalyhist/iculist["+iRow+"]/ordclrsdeptcd",model.getValue("/root/main/dschanalyhist/dschanalyinfo/inclrsdeptcd"));
  1225. if(iStatus == 0){
  1226. grd_iculist.rowStatus(iRow) = 2;
  1227. }else if(iStatus == 2){
  1228. var sDsicuNo = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/dsicuno");
  1229. if(instance1.selectSingleNode("/root/main/dschanalyhist/iculist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/iculist[dsicuno='"+sDsicuNo+"']").xml){
  1230. grd_iculist.rowStatus(iRow) = 0;
  1231. }
  1232. }
  1233. }
  1234. }
  1235. }
  1236. // 20081218 수정
  1237. //grd_iculist.refresh();
  1238. }
  1239. }
  1240. /**
  1241. * @ver : 2008-12-09
  1242. * @desc : 각 그리드정보의 의사 정보 조회
  1243. * @by : 이창록
  1244. * @param :
  1245. * @return :
  1246. * @---------------------------------------------------
  1247. */
  1248. function fGridGetDeptUserInfo(pGrid)
  1249. {
  1250. if(pGrid =="grd_oplist"){//수술정보
  1251. var iRow = grd_oplist.row - grd_oplist.fixedRows + 1;
  1252. var opdd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdd");
  1253. var iStatus = grd_oplist.rowStatus(iRow);
  1254. var opdeptengabbr = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdeptengabbr");
  1255. var perfdrnm = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm");
  1256. var perfdeptcd = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd");
  1257. var opdepthngnm = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdepthngnm");
  1258. var perfdrid = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid");
  1259. var sDsopNo = model.getValue("/root/main/dschanalyhist/oplist["+iRow+"]/dsopno");
  1260. if(event.keyCode == 13){
  1261. if(opdd==""){
  1262. messageBox("수술일자를 먼저","C001");
  1263. return;
  1264. }
  1265. if(grd_oplist.col==3){
  1266. if(opdeptengabbr==""){
  1267. return;
  1268. }
  1269. model.makeValue("root/send/stnddd" ,opdd);
  1270. model.makeValue("root/send/deptengabbr" ,opdeptengabbr);
  1271. if(submit("TRMRD00405", false)){
  1272. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1273. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdepthngnm" ,model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1274. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdeptcd" ,model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1275. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/opdeptengabbr ",model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1276. }else{
  1277. messageBox("입력하신 해당과가","I004");
  1278. return;
  1279. }
  1280. }
  1281. model.removeNodeset("/root/send");
  1282. }else if(grd_oplist.col==7){
  1283. if(perfdeptcd==""){
  1284. messageBox("해당수술과를 먼저","C001");
  1285. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm","");
  1286. return;
  1287. }
  1288. if(perfdrnm==""){
  1289. return;
  1290. }
  1291. model.makeValue("root/send/stndd" ,opdd);
  1292. model.makeValue("root/send/usernm" ,perfdrnm);
  1293. model.makeValue("root/send/stndeptcd" ,perfdeptcd);
  1294. if(submit("TRMRD00406", false)){
  1295. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1296. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1297. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1298. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1299. var sRtnMsg = fPopUpUserInfo("grd_oplist", 7, 19);
  1300. if(sRtnMsg == false && iStatus == 2){
  1301. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm", model.getValue("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']/perfdrnm"));
  1302. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid", model.getValue("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']/perfdrid"));
  1303. }
  1304. }else{
  1305. messageBox(opdepthngnm+"에는 입력하신 의사정보가","I004");
  1306. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrnm","");
  1307. model.setValue("/root/main/dschanalyhist/oplist["+iRow+"]/perfdrid","");
  1308. return;
  1309. }
  1310. if(iStatus == 2){
  1311. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']").xml ){
  1312. grd_oplist.rowStatus(iRow) = 0;
  1313. }
  1314. }else if(iStatus == 0){
  1315. if(instance1.selectSingleNode("/root/main/dschanalyhist/oplist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/oplist[dsopno ='"+sDsopNo+"']").xml ){
  1316. grd_oplist.rowStatus(iRow) = 2;
  1317. }
  1318. }
  1319. }
  1320. model.removeNodeset("/root/send");
  1321. }
  1322. }
  1323. // 20081218 수정
  1324. //grd_oplist.refresh();
  1325. }else if(pGrid =="grd_cnstlist"){//협의정보
  1326. var iRow = grd_cnstlist.row - grd_cnstlist.fixedRows + 1;
  1327. var reqdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdd");
  1328. var reqdrnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm");
  1329. var reqdeptengabbr = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptengabbr");
  1330. var reqdepthngnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdepthngnm");
  1331. var reqdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd");
  1332. var execdd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdd");
  1333. var execdrnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm");
  1334. var execdeptengabbr = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptengabbr");
  1335. var execdepthngnm = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdepthngnm");
  1336. var execdeptcd = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd");
  1337. var iStatus = grd_cnstlist.rowStatus(iRow);
  1338. var sDscnstNo = model.getValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/dscnstno");
  1339. if(event.keyCode == 13){
  1340. if(grd_cnstlist.col==1){
  1341. if(reqdeptengabbr==""){
  1342. return;
  1343. }
  1344. if(reqdd==""){
  1345. messageBox("의뢰일을 먼저","C001");
  1346. return;
  1347. }
  1348. model.makeValue("root/send/stnddd" ,reqdd);
  1349. model.makeValue("root/send/deptengabbr" ,reqdeptengabbr);
  1350. if(submit("TRMRD00405", false)){
  1351. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1352. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdepthngnm" ,model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1353. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptcd" ,model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1354. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdeptengabbr" ,model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1355. }else{
  1356. messageBox("입력하신 해당과가","I004");
  1357. return;
  1358. }
  1359. }
  1360. model.removeNodeset("/root/send");
  1361. }else if(grd_cnstlist.col==7){
  1362. if(execdeptengabbr==""){
  1363. return;
  1364. }
  1365. if(execdd==""){
  1366. messageBox("회신일을 먼저","C001");
  1367. return;
  1368. }
  1369. model.makeValue("root/send/stnddd",execdd);
  1370. model.makeValue("root/send/deptengabbr",execdeptengabbr);
  1371. if(submit("TRMRD00405", false)){
  1372. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1373. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdepthngnm" ,model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1374. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptcd" ,model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1375. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdeptengabbr",model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1376. }else{
  1377. messageBox("입력하신 해당과가","I004");
  1378. return;
  1379. }
  1380. }
  1381. model.removeNodeset("/root/send");
  1382. }else if(grd_cnstlist.col==5){
  1383. if(reqdeptcd==""){
  1384. messageBox("해당의뢰과를 먼저","C001");
  1385. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm","");
  1386. return;
  1387. }
  1388. if(reqdrnm==""){
  1389. return;
  1390. }
  1391. model.makeValue("root/send/stndd" ,reqdd);
  1392. model.makeValue("root/send/usernm" ,reqdrnm);
  1393. model.makeValue("root/send/stndeptcd" ,reqdeptcd);
  1394. if(submit("TRMRD00406", false)){
  1395. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1396. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1397. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1398. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1399. var sRtnMsg = fPopUpUserInfo("grd_cnstlist", 5, 18);
  1400. if(sRtnMsg == false && iStatus == 2){
  1401. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/reqdrnm"));
  1402. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrid", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/reqdrid"));
  1403. }
  1404. }else{
  1405. messageBox(reqdepthngnm+"에는 입력하신 의사정보가","I004");
  1406. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrnm","");
  1407. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/reqdrid","");
  1408. return;
  1409. }
  1410. if(iStatus == 2){
  1411. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1412. grd_cnstlist.rowStatus(iRow) = 0;
  1413. }
  1414. }else if(iStatus == 0){
  1415. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1416. grd_cnstlist.rowStatus(iRow) = 2;
  1417. }
  1418. }
  1419. }
  1420. model.removeNodeset("/root/send");
  1421. }else if(grd_cnstlist.col==11){
  1422. if(execdeptcd==""){
  1423. messageBox("해당회신과를 먼저","C001");
  1424. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm","");
  1425. return;
  1426. }
  1427. if(execdrnm==""){
  1428. return;
  1429. }
  1430. model.makeValue("root/send/stndd" ,execdd);
  1431. model.makeValue("root/send/usernm" ,execdrnm);
  1432. model.makeValue("root/send/stndeptcd" ,execdeptcd);
  1433. if(submit("TRMRD00406", false)){
  1434. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1435. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1436. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1437. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1438. var sRtnMsg = fPopUpUserInfo("grd_cnstlist", 11, 19);
  1439. if(sRtnMsg == false && iStatus == 2){
  1440. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/execdrnm"));
  1441. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrid", model.getValue("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']/execdrid"));
  1442. }
  1443. }else{
  1444. messageBox(execdepthngnm+"에는 입력하신 의사정보가","I004");
  1445. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrnm","");
  1446. model.setValue("/root/main/dschanalyhist/cnstlist["+iRow+"]/execdrid","");
  1447. return;
  1448. }
  1449. if(iStatus == 2){
  1450. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1451. grd_cnstlist.rowStatus(iRow) = 0;
  1452. }
  1453. }else if(iStatus == 0){
  1454. if(instance1.selectSingleNode("/root/main/dschanalyhist/cnstlist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/cnstlist[dscnstno ='"+sDscnstNo+"']").xml ){
  1455. grd_cnstlist.rowStatus(iRow) = 2;
  1456. }
  1457. }
  1458. }
  1459. model.removeNodeset("/root/send");
  1460. }
  1461. }
  1462. // 20081218 수정
  1463. //grd_cnstlist.refresh();
  1464. }else if(pGrid =="grd_chngdeptlist"){//전과정보
  1465. if(event.keyCode == 13){
  1466. var iRow = grd_chngdeptlist.row - grd_chngdeptlist.fixedRows + 1;
  1467. var chngdeptdd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdd");
  1468. var chngdeptengabbr = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptengabbr");
  1469. var chngdeptdrnm = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm");
  1470. var chngdeptcd = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd");
  1471. var chngdepthngnm = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdepthngnm");
  1472. var iStatus = grd_chngdeptlist.rowStatus(iRow);
  1473. var sDscdNo = model.getValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/dscdno");
  1474. if(grd_chngdeptlist.col==2){
  1475. if(chngdeptengabbr==""){
  1476. return;
  1477. }
  1478. if(chngdeptdd==""){
  1479. messageBox("전출일자를 먼저","C001");
  1480. return;
  1481. }
  1482. model.makeValue("root/send/stnddd" ,chngdeptdd);
  1483. model.makeValue("root/send/deptengabbr" ,chngdeptengabbr);
  1484. if(submit("TRMRD00405", false)){
  1485. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1486. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdepthngnm",model.getValue("/root/temp/stndeptlist/stndept/depthngnm"));
  1487. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptcd",model.getValue("/root/temp/stndeptlist/stndept/deptcd"));
  1488. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptengabbr",model.getValue("/root/temp/stndeptlist/stndept/deptengabbr"));
  1489. }else{
  1490. messageBox("입력하신 해당과가","I004");
  1491. return;
  1492. }
  1493. }
  1494. model.removeNodeset("/root/send");
  1495. }else if(grd_chngdeptlist.col==6){
  1496. if(chngdeptcd==""){
  1497. messageBox("해당전출과를 먼저","C001");
  1498. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm","");
  1499. return;
  1500. }
  1501. if(chngdeptdrnm==""){
  1502. return;
  1503. }
  1504. model.makeValue("root/send/stndd" ,chngdeptdd);
  1505. model.makeValue("root/send/usernm" ,chngdeptdrnm);
  1506. model.makeValue("root/send/stndeptcd" ,chngdeptcd);
  1507. if(submit("TRMRD00406", false)){
  1508. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1509. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1510. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrid" ,model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1511. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1512. var sRtnMsg = fPopUpUserInfo("grd_chngdeptlist", 6, 14);
  1513. if(sRtnMsg == false && iStatus == 2){
  1514. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm", model.getValue("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']/chngdeptdrnm"));
  1515. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrid", model.getValue("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']/chngdeptdrid"));
  1516. }
  1517. }else{
  1518. messageBox(chngdepthngnm+"에는 입력하신 의사정보가","I004");
  1519. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrnm","");
  1520. model.setValue("/root/main/dschanalyhist/chngdeptlist["+iRow+"]/chngdeptdrid","");
  1521. return;
  1522. }
  1523. if(iStatus == 2){
  1524. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml == instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']").xml ){
  1525. grd_chngdeptlist.rowStatus(iRow) = 0;
  1526. }
  1527. }else if(iStatus == 0){
  1528. if(instance1.selectSingleNode("/root/main/dschanalyhist/chngdeptlist["+iRow+"]").xml != instance1.selectSingleNode("/root/temp/dschanalyhist/chngdeptlist[dscdno ='"+sDscdNo+"']").xml ){
  1529. grd_chngdeptlist.rowStatus(iRow) = 2;
  1530. }
  1531. }
  1532. }
  1533. model.removeNodeset("/root/send");
  1534. }
  1535. // 20081218 수정
  1536. //grd_chngdeptlist.refresh();
  1537. }
  1538. }else if(pGrid =="grd_iculist"){//중환자실정보
  1539. var iRow = grd_iculist.row - grd_iculist.fixedRows + 1;
  1540. var inrmdd = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/inrmdd");
  1541. var orddeptengabbr = model.getValue("/root/main/dschanalyhist/iculist["+iRow+"]/orddeptengabbr");
  1542. if(event.keyCode == 13){
  1543. if(grd_iculist.col==2){
  1544. if(grd_iculist.valueMatrix(iRow,2)==""){
  1545. return;
  1546. }
  1547. if(inrmdd==""){
  1548. messageBox("입실일자를 먼저","C001");
  1549. return;
  1550. }
  1551. model.makeValue("root/send/stnddd",inrmdd);
  1552. model.makeValue("root/send/deptengabbr",grd_iculist.valueMatrix(iRow,2));
  1553. if(submit("TRMRD00405", false)){
  1554. if(getNodesetCnt(model,"/root/temp/stndeptlist/stndept")>0){
  1555. var depthngnm = model.getValue("/root/temp/stndeptlist/stndept/depthngnm")
  1556. var deptcd = model.getValue("/root/temp/stndeptlist/stndept/deptcd")
  1557. var deptengabbr =model.getValue("/root/temp/stndeptlist/stndept/deptengabbr")
  1558. grd_iculist.valueMatrix(iRow,2)=deptengabbr;
  1559. grd_iculist.valueMatrix(iRow,3)=depthngnm;
  1560. grd_iculist.valueMatrix(iRow,4)=deptcd;
  1561. }else{
  1562. messageBox("입력하신 해당과가","I004");
  1563. return;
  1564. }
  1565. }
  1566. model.removeNodeset("/root/send");
  1567. }
  1568. }
  1569. // 20081218 수정
  1570. //grd_iculist.refresh();
  1571. }
  1572. }
  1573. /**
  1574. * @ver : 2008-12-09
  1575. * @desc : 각 input정보의 의사 정보 조회
  1576. * @by : 이창록
  1577. * @param :
  1578. * @return :
  1579. * @---------------------------------------------------
  1580. */
  1581. function fIptGetDeptUserInfo(flag)
  1582. {
  1583. var inrmdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/inrmdd");
  1584. var indeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/indeptcd");
  1585. var dschdeptcd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdeptcd");
  1586. var dschdd = model.getValue("/root/main/dschanalyhist/dschanalyinfo/dschdd");
  1587. if(flag =="ipt_indrid"){
  1588. if(event.keyCode == 13){
  1589. model.makeValue("root/send/stndd" ,inrmdd);
  1590. model.makeValue("root/send/userid" ,ipt_indrid.currentText);
  1591. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1592. if(submit("TRMRD00406", false)){
  1593. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1594. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1595. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1596. // 20081218 수정
  1597. //ipt_indrid.refresh();
  1598. //ipt_indrnm.refresh();
  1599. model.refresh();
  1600. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1601. clearParameter("reqflag");
  1602. clearParameter("usernm");
  1603. clearParameter("stnddd");
  1604. clearParameter("autortnyn");
  1605. setParameter("reqflag", "userid");
  1606. setParameter("userid", ipt_indrid.currentText);
  1607. setParameter("stnddd", inrmdd);
  1608. setParameter("autortnyn","Y");
  1609. model.resetInstanceNode("/root/temp/userinfo");
  1610. modal("SPMRF03200");
  1611. var userid = model.getValue("/root/temp/userinfo/userid")
  1612. if(userid!=""){
  1613. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/userinfo/userid"));
  1614. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/userinfo/usernm"));
  1615. // 20081218 수정
  1616. //ipt_indrid.refresh();
  1617. //ipt_indrnm.refresh();
  1618. model.refresh();
  1619. }else{
  1620. return;
  1621. }
  1622. }else{
  1623. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1624. // 20081218 수정
  1625. //ipt_indrid.refresh();
  1626. //ipt_indrnm.refresh();
  1627. model.refresh();
  1628. return;
  1629. }
  1630. }
  1631. }
  1632. }else if(flag =="ipt_indrnm"){
  1633. if(event.keyCode == 13){
  1634. model.makeValue("root/send/stndd" ,inrmdd);
  1635. model.makeValue("root/send/usernm" ,ipt_indrnm.currentText);
  1636. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1637. if(submit("TRMRD00406", false)){
  1638. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1639. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1640. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1641. // 20081218 수정
  1642. //ipt_indrid.refresh();
  1643. //ipt_indrnm.refresh();
  1644. model.refresh();
  1645. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1646. clearParameter("reqflag");
  1647. clearParameter("usernm");
  1648. clearParameter("stnddd");
  1649. clearParameter("autortnyn");
  1650. setParameter("reqflag", "usernm");
  1651. setParameter("userid", ipt_indrnm.currentText);
  1652. setParameter("stnddd", inrmdd);
  1653. setParameter("autortnyn","Y");
  1654. model.resetInstanceNode("/root/temp/userinfo");
  1655. modal("SPMRF03200");
  1656. var userid = model.getValue("/root/temp/userinfo/userid")
  1657. if(userid!=""){
  1658. model.setValue(xDschAnalyListPath+"/indrid", model.getValue("/root/temp/userinfo/userid"));
  1659. model.setValue(xDschAnalyListPath+"/indrnm", model.getValue("/root/temp/userinfo/usernm"));
  1660. // 20081218 수정
  1661. //ipt_indrid.refresh();
  1662. //ipt_indrnm.refresh();
  1663. model.refresh();
  1664. }else{
  1665. return;
  1666. }
  1667. }else{
  1668. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1669. // 20081218 수정
  1670. //ipt_indrid.refresh();
  1671. //ipt_indrnm.refresh();
  1672. model.refresh();
  1673. return;
  1674. }
  1675. }
  1676. }
  1677. }else if(flag =="ipt_inapprtcdrid"){
  1678. if(event.keyCode == 13){
  1679. model.makeValue("root/send/stndd" ,inrmdd);
  1680. model.makeValue("root/send/userid" ,ipt_inapprtcdrid.currentText);
  1681. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1682. if(submit("TRMRD00406", false)){
  1683. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1684. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1685. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1686. // 20081218 수정
  1687. //ipt_inapprtcdrid.refresh();
  1688. //ipt_inapprtcdrnm.refresh();
  1689. model.refresh();
  1690. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1691. clearParameter("reqflag");
  1692. clearParameter("usernm");
  1693. clearParameter("stnddd");
  1694. clearParameter("autortnyn");
  1695. setParameter("reqflag", "userid");
  1696. setParameter("userid", ipt_inapprtcdrid.currentText);
  1697. setParameter("stnddd", inrmdd);
  1698. setParameter("autortnyn","Y");
  1699. model.resetInstanceNode("/root/temp/userinfo");
  1700. modal("SPMRF03200");
  1701. var userid = model.getValue("/root/temp/userinfo/userid")
  1702. if(userid!=""){
  1703. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  1704. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1705. // 20081218 수정
  1706. //ipt_inapprtcdrid.refresh();
  1707. //ipt_inapprtcdrnm.refresh();
  1708. model.refresh();
  1709. }else{
  1710. return;
  1711. }
  1712. }else{
  1713. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1714. // 20081218 수정
  1715. //ipt_inapprtcdrid.refresh();
  1716. //ipt_inapprtcdrnm.refresh();
  1717. model.refresh();
  1718. return;
  1719. }
  1720. }
  1721. }
  1722. }else if(flag =="ipt_inapprtcdrnm"){
  1723. if(event.keyCode == 13){
  1724. model.makeValue("root/send/stndd" ,inrmdd);
  1725. model.makeValue("root/send/usernm" ,ipt_inapprtcdrnm.currentText);
  1726. model.makeValue("root/send/stndeptcd" ,indeptcd);
  1727. if(submit("TRMRD00406", false)){
  1728. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1729. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1730. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1731. // 20081218 수정
  1732. //ipt_inapprtcdrid.refresh();
  1733. //ipt_inapprtcdrnm.refresh();
  1734. model.refresh();
  1735. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1736. clearParameter("reqflag");
  1737. clearParameter("usernm");
  1738. clearParameter("stnddd");
  1739. clearParameter("autortnyn");
  1740. setParameter("reqflag", "usernm");
  1741. setParameter("userid", ipt_inapprtcdrnm.currentText);
  1742. setParameter("stnddd", inrmdd);
  1743. setParameter("autortnyn","Y");
  1744. model.resetInstanceNode("/root/temp/userinfo");
  1745. modal("SPMRF03200");
  1746. var userid = model.getValue("/root/temp/userinfo/userid")
  1747. if(userid!=""){
  1748. model.setValue(xDschAnalyListPath+"/inapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  1749. model.setValue(xDschAnalyListPath+"/inapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1750. // 20081218 수정
  1751. //ipt_inapprtcdrid.refresh();
  1752. //ipt_inapprtcdrnm.refresh();
  1753. model.refresh();
  1754. }else{
  1755. return;
  1756. }
  1757. }else{
  1758. messageBox(cmb_indeptcd.label+"에는 입력하신 의사정보가","I004");
  1759. // 20081218 수정
  1760. //ipt_inapprtcdrid.refresh();
  1761. //ipt_inapprtcdrnm.refresh();
  1762. model.refresh();
  1763. return;
  1764. }
  1765. }
  1766. }
  1767. }else if(flag =="ipt_dschdrid"){
  1768. if(event.keyCode == 13){
  1769. model.makeValue("root/send/stndd" ,dschdd);
  1770. model.makeValue("root/send/userid" ,ipt_dschdrid.currentText);
  1771. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  1772. if(submit("TRMRD00406", false)){
  1773. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1774. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1775. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1776. // 20081218 수정
  1777. //ipt_dschdrid.refresh();
  1778. //ipt_dschdrnm.refresh();
  1779. model.refresh();
  1780. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1781. clearParameter("reqflag");
  1782. clearParameter("usernm");
  1783. clearParameter("stnddd");
  1784. clearParameter("autortnyn");
  1785. setParameter("reqflag", "userid");
  1786. setParameter("userid", ipt_dschdrid.currentText);
  1787. setParameter("stnddd", dschdd);
  1788. setParameter("autortnyn","Y");
  1789. model.resetInstanceNode("/root/temp/userinfo");
  1790. modal("SPMRF03200");
  1791. var userid = model.getValue("/root/temp/userinfo/userid")
  1792. if(userid!=""){
  1793. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/userinfo/userid"));
  1794. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1795. // 20081218 수정
  1796. //ipt_dschdrid.refresh();
  1797. //ipt_dschdrnm.refresh();
  1798. model.refresh();
  1799. }else{
  1800. return;
  1801. }
  1802. }else{
  1803. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  1804. // 20081218 수정
  1805. //ipt_dschdrid.refresh();
  1806. //ipt_dschdrnm.refresh();
  1807. model.refresh();
  1808. return;
  1809. }
  1810. }
  1811. }
  1812. }else if(flag =="ipt_dschdrnm"){
  1813. if(event.keyCode == 13){
  1814. model.makeValue("root/send/stndd" ,dschdd);
  1815. model.makeValue("root/send/usernm" ,ipt_dschdrnm.currentText);
  1816. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  1817. if(submit("TRMRD00406", false)){
  1818. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1819. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1820. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1821. // 20081218 수정
  1822. //ipt_dschdrid.refresh();
  1823. //ipt_dschdrnm.refresh();
  1824. model.refresh();
  1825. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1826. clearParameter("reqflag");
  1827. clearParameter("usernm");
  1828. clearParameter("stnddd");
  1829. clearParameter("autortnyn");
  1830. setParameter("reqflag", "usernm");
  1831. setParameter("userid", ipt_dschdrnm.currentText);
  1832. setParameter("stnddd", dschdd);
  1833. setParameter("autortnyn","Y");
  1834. model.resetInstanceNode("/root/temp/userinfo");
  1835. modal("SPMRF03200");
  1836. var userid = model.getValue("/root/temp/userinfo/userid")
  1837. if(userid!=""){
  1838. model.setValue(xDschAnalyListPath+"/dschdrid", model.getValue("/root/temp/userinfo/userid"));
  1839. model.setValue(xDschAnalyListPath+"/dschdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1840. // 20081218 수정
  1841. //ipt_dschdrid.refresh();
  1842. //ipt_dschdrnm.refresh();
  1843. model.refresh();
  1844. }else{
  1845. return;
  1846. }
  1847. }else{
  1848. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  1849. // 20081218 수정
  1850. //ipt_dschdrid.refresh();
  1851. //ipt_dschdrnm.refresh();
  1852. model.refresh();
  1853. return;
  1854. }
  1855. }
  1856. }
  1857. }else if(flag =="ipt_dschapprtcdrid"){
  1858. if(event.keyCode == 13){
  1859. model.makeValue("root/send/stndd" ,dschdd);
  1860. model.makeValue("root/send/userid" ,ipt_dschapprtcdrid.currentText);
  1861. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  1862. if(submit("TRMRD00406", false)){
  1863. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1864. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1865. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1866. // 20081218 수정
  1867. //ipt_dschapprtcdrid.refresh();
  1868. //ipt_dschapprtcdrnm.refresh();
  1869. model.refresh();
  1870. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1871. clearParameter("reqflag");
  1872. clearParameter("usernm");
  1873. clearParameter("stnddd");
  1874. clearParameter("autortnyn");
  1875. setParameter("reqflag", "userid");
  1876. setParameter("userid", ipt_dschapprtcdrid.currentText);
  1877. setParameter("stnddd", dschdd);
  1878. setParameter("autortnyn","Y");
  1879. model.resetInstanceNode("/root/temp/userinfo");
  1880. modal("SPMRF03200");
  1881. var userid = model.getValue("/root/temp/userinfo/userid")
  1882. if(userid!=""){
  1883. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  1884. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1885. // 20081218 수정
  1886. //ipt_dschapprtcdrid.refresh();
  1887. //ipt_dschapprtcdrnm.refresh();
  1888. model.refresh();
  1889. }else{
  1890. return;
  1891. }
  1892. }else{
  1893. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  1894. // 20081218 수정
  1895. //ipt_dschapprtcdrid.refresh();
  1896. //ipt_dschapprtcdrnm.refresh();
  1897. model.refresh();
  1898. return;
  1899. }
  1900. }
  1901. }
  1902. }else if(flag =="ipt_dschapprtcdrnm"){
  1903. if(event.keyCode == 13){
  1904. model.makeValue("root/send/stndd" ,dschdd);
  1905. model.makeValue("root/send/usernm" ,ipt_dschapprtcdrnm.currentText);
  1906. model.makeValue("root/send/stndeptcd" ,dschdeptcd);
  1907. if(submit("TRMRD00406",false)){
  1908. if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")==1){
  1909. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/stnuserinfo/stnuserlist/userid"));
  1910. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/stnuserinfo/stnuserlist/usernm"));
  1911. // 20081218 수정
  1912. //ipt_dschapprtcdrid.refresh();
  1913. //ipt_dschapprtcdrnm.refresh();
  1914. model.refresh();
  1915. }else if(getNodesetCnt(model,"/root/temp/stnuserinfo/stnuserlist")>1){
  1916. clearParameter("reqflag");
  1917. clearParameter("usernm");
  1918. clearParameter("stnddd");
  1919. clearParameter("autortnyn");
  1920. setParameter("reqflag", "usernm");
  1921. setParameter("usernm", ipt_dschapprtcdrnm.currentText);
  1922. setParameter("stnddd", dschdd);
  1923. setParameter("autortnyn","Y");
  1924. model.resetInstanceNode("/root/temp/userinfo");
  1925. modal("SPMRF03200");
  1926. var userid = model.getValue("/root/temp/userinfo/userid")
  1927. if(userid!=""){
  1928. model.setValue(xDschAnalyListPath+"/dschapprtcdrid", model.getValue("/root/temp/userinfo/userid"));
  1929. model.setValue(xDschAnalyListPath+"/dschapprtcdrnm", model.getValue("/root/temp/userinfo/usernm"));
  1930. // 20081218 수정
  1931. //ipt_dschapprtcdrid.refresh();
  1932. //ipt_dschapprtcdrnm.refresh();
  1933. model.refresh();
  1934. }else{
  1935. return;
  1936. }
  1937. }else{
  1938. messageBox(cmb_dschdeptcd.label+"에는 입력하신 의사정보가","I004");
  1939. // 20081218 수정
  1940. //ipt_dschapprtcdrid.refresh();
  1941. //ipt_dschapprtcdrnm.refresh();
  1942. model.refresh();
  1943. return;
  1944. }
  1945. }
  1946. }
  1947. }
  1948. model.removeNodeset("/root/send");
  1949. }