SMMNB01800.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. /*
  2. (SMMNW01800_이송요원 호출.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. /**
  7. * @group :
  8. * @ver : 2007.09.03
  9. * @by : 김 진 명
  10. * @---------------------------------------------------
  11. * @type : function
  12. * @access : public
  13. * @desc : 이송요원 호출 초기화
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function fInit(){
  19. var instcd = getUserInfo("dutplceinstcd");
  20. var dutplcecd = getUserInfo("dutplcecd");
  21. var standard_yn = "orduseyn";
  22. var ord_deptflag = "W";
  23. var rslt_ref = "/root/hidden/orddeptlist";
  24. var sort_field = "depthngnm";
  25. var sort_method = "asc";
  26. zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref, sort_field, sort_method);
  27. mmbfGetDeptCodeComboList("/root/temp/reqdata", "/root/init/issdept", "I");
  28. grd_trancalllist.fixedcellcheckbox(0,0)=true;
  29. var MenuParam = getScreenMenuParameter();
  30. if( (MenuParam == "")||(MenuParam == null)||(MenuParam == "CA")||(MenuParam == "OP") ) {
  31. MenuParam = "1";//일반병동
  32. }else if( MenuParam == "RD" ) {
  33. MenuParam = "2";//영상의학과
  34. }
  35. model.setValue("/root/main/cond/calldeptflag", MenuParam);
  36. model.setValue("/root/main/cond/dept", dutplcecd); //로그인한 병동
  37. fGetRoom();
  38. model.removeNodeset("/root/main/trancalllist");
  39. model.makeValue("/root/send/reqdata/status", "2"); //콤보박스용으로 조회
  40. model.makeValue("/root/send/reqdata/calldeptflag", MenuParam);
  41. //submit("TRMNB01802", false);
  42. submit("TRMNB01811"); //부서콤보박스 조회
  43. // addComboItem("cmb_dept", "- 전체 -", "", "above" );
  44. // addComboItem("cmb_roomcd", "- 전체 -", "", "above" );
  45. //fGetNursHardCdInfo("'114','115','116'", getCurrentDate());
  46. zbcfGetCodeList( new Array("M0556","M0557", "M0558"), new Array("/root/init/M0556list","/root/init/M0557list", "/root/init/M0558list") );
  47. addComboItem("cmb_trflag", "- 전체 -", "", "above" );
  48. addComboItem("cmb_trtargetetc", "- 전체 -", "", "above" );
  49. addComboItem("cmb_issdept", "- 전체 -", "", "above" );
  50. var curtDate = getCurrentDate();
  51. var curtYYMM = curtDate.substr(0, 8);
  52. model.setValue("/root/main/cond/refdd", curtYYMM);
  53. // if ( checkOpener()){
  54. // var pid = opener.javascript.getParameter("pid");
  55. // if( pid != "" ) {
  56. // model.setValue("/root/main/cond/pid", pid);
  57. // }
  58. // }
  59. grd_trancalllist.explorerbar = "sort";
  60. fSearchTranCall();
  61. model.refresh();
  62. //model.copyNode("/root/send/reqdata", "/root/main/cond");
  63. //submit("TRMNB01801"); //현재 날짜로 자동 조회
  64. }
  65. /**
  66. * @group :
  67. * @ver : 2007.09.03
  68. * @by : 김 진 명
  69. * @---------------------------------------------------
  70. * @type : function
  71. * @access : public
  72. * @desc : 이송요원 호출 - 이송요원 호출 리스트 조회
  73. * @param :
  74. * @return :
  75. * @---------------------------------------------------
  76. */
  77. function fSearchTranCall(){
  78. model.removeNodeset("/root/send");
  79. model.makeNode("/root/send/reqdata");
  80. model.copyNode("/root/send/reqdata", "/root/main/cond");
  81. submit("TRMNB01801");
  82. model.refresh();
  83. }
  84. /**
  85. * @group :
  86. * @ver : 2007.09.03
  87. * @by : 김 진 명
  88. * @---------------------------------------------------
  89. * @type : function
  90. * @access : public
  91. * @desc : 이송요원 호출 - 콤보박스 제거
  92. * @param :
  93. * @return :
  94. * @---------------------------------------------------
  95. */
  96. function removeComboItem( comboID ) {
  97. var comboObj = document.all.item(comboID);
  98. var comboItemNodeSet = comboObj.choices.itemset.attribute("nodeset");
  99. model.removenode(comboItemNodeSet + "[1]");
  100. model.refresh();
  101. }
  102. /**
  103. * @group :
  104. * @ver : 2007.09.03
  105. * @by : 김 진 명
  106. * @---------------------------------------------------
  107. * @type : function
  108. * @access : public
  109. * @desc : 이송요원 호출 - 전송
  110. * @param :
  111. * @return :
  112. * @---------------------------------------------------
  113. */
  114. function fAddTranCall(){
  115. setParameter("status", "I");
  116. modal("SMMNB01810" ,"", "300", "150", "SMMNB01810", "", "");
  117. if( model.getValue("/root/temp/refstatus") == "C" ) {
  118. return;
  119. }else {
  120. fSearchTranCall();
  121. }
  122. }
  123. /**
  124. * @group :
  125. * @ver : 2007.09.03
  126. * @by : 김 진 명
  127. * @---------------------------------------------------
  128. * @type : function
  129. * @access : public
  130. * @desc : 이송요원 호출 - 재전송
  131. * @param :
  132. * @return :
  133. * @---------------------------------------------------
  134. */
  135. function fReInsTranCall(){
  136. var iRows = -1;
  137. var chkflag = "", prcsstat = "", pid = "", wardtel = "", updtflag = "", startposnm, arvposnm;
  138. var cnt = 0, cnt2 = 0;
  139. var iPath = "/root/main/trancalllist";
  140. //var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦wardtel▦startposnm▦arvposnm▦pdabpno";
  141. var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦wardtel▦startposnm▦arvposnm";
  142. iRows = grd_trancalllist.rows;
  143. for( var i = 1; i < iRows; i++ ) {
  144. chkflag = model.getValue( iPath+"["+i+"]/chkflag");
  145. prcsstat = model.getValue( iPath+"["+i+"]/prcsstat");
  146. pid = model.getValue( iPath+"["+i+"]/pid");
  147. trno = model.getValue( iPath+"["+i+"]/trno");
  148. wardtel = model.getValue( iPath+"["+i+"]/wardtel");
  149. startposnm = model.getValue(iPath+"["+i+"]/startposnm");
  150. arvposnm = model.getValue(iPath+"["+i+"]/arvposnm");
  151. updtflag = "RC";
  152. //pdabpno = model.getValue( iPath+"["+i+"]/pdabpno");
  153. if( chkflag == "true" ) {
  154. if( (prcsstat == "2")||(prcsstat == "3")||(prcsstat == "4")||(prcsstat == "5") ) {
  155. cnt2 += 1;
  156. }else {
  157. trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid + "▦" + trno
  158. + "▦" + updtflag + "▦" + chkflag + "▦" + wardtel
  159. + "▦" + startposnm + "▦" + arvposnm ;
  160. // + "▦" + startposnm + "▦" + arvposnm + "▦" + pdabpno ;
  161. }
  162. cnt += 1;
  163. }
  164. }
  165. if( cnt2 > 0 ) {
  166. //messageBox("호출, 응답, 완료, 취소 상태는 재호출을", "E001");
  167. messageBox("재전송은 진행상태값이 전송과 보류인 경우에만", "I006");
  168. }else if( cnt > 0 ) { //체크박스 체크유무
  169. model.removenode("/root/send");
  170. model.makeValue("/root/send/savedata", trancalllist);
  171. model.copyNode("/root/send/reqdata", "/root/main/cond");
  172. submit("TXMNB01801");
  173. }else {
  174. messageBox("선택한것이", "I004");
  175. }
  176. fSearchTranCall();
  177. }
  178. /**
  179. * @group :
  180. * @ver : 2007.09.03
  181. * @by : 김 진 명
  182. * @---------------------------------------------------
  183. * @type : function
  184. * @access : public
  185. * @desc : 이송요원 호출 - 접수
  186. * @param :
  187. * @return :
  188. * @---------------------------------------------------
  189. */
  190. function fAcptTranCall(){
  191. var iRows = -1;
  192. var chkflag = "", prcsstat = "", pid = "", wardtel = "", updtflag = "", startposnm, arvposnm;
  193. var cnt = 0, cnt2 = 0;
  194. var iPath = "/root/main/trancalllist";
  195. //var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦wardtel▦startposnm▦arvposnm▦pdabpno";
  196. var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦wardtel▦startposnm▦arvposnm";
  197. iRows = grd_trancalllist.rows;
  198. for( var i = 1; i < iRows; i++ ) {
  199. chkflag = model.getValue( iPath+"["+i+"]/chkflag");
  200. prcsstat = model.getValue( iPath+"["+i+"]/prcsstat");
  201. pid = model.getValue( iPath+"["+i+"]/pid");
  202. trno = model.getValue( iPath+"["+i+"]/trno");
  203. wardtel = model.getValue( iPath+"["+i+"]/wardtel");
  204. startposnm = model.getValue(iPath+"["+i+"]/startposnm");
  205. arvposnm = model.getValue(iPath+"["+i+"]/arvposnm");
  206. updtflag = "AC";
  207. //pdabpno = model.getValue( iPath+"["+i+"]/pdabpno");
  208. if( chkflag == "true" ) {
  209. if( (prcsstat == "2")||(prcsstat == "4")||(prcsstat == "5")||(prcsstat == "6") ) {
  210. cnt2 += 1;
  211. }else {
  212. trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid + "▦" + trno
  213. + "▦" + updtflag + "▦" + chkflag + "▦" + wardtel
  214. + "▦" + startposnm + "▦" + arvposnm ;
  215. // + "▦" + startposnm + "▦" + arvposnm + "▦" + pdabpno ;
  216. }
  217. cnt += 1;
  218. }
  219. }
  220. if( cnt2 > 0 ) {
  221. messageBox("접수는 진행상태값이 전송과 재전송인 경우에만", "I006");
  222. }else if( cnt > 0 ) { //체크박스 체크유무
  223. model.removenode("/root/send");
  224. model.makeValue("/root/send/savedata", trancalllist);
  225. model.copyNode("/root/send/reqdata", "/root/main/cond");
  226. submit("TXMNB01801");
  227. }else {
  228. messageBox("선택한것이", "I004");
  229. }
  230. fSearchTranCall();
  231. }
  232. /**
  233. * @group :
  234. * @ver : 2007.09.03
  235. * @by : 김 진 명
  236. * @---------------------------------------------------
  237. * @type : function
  238. * @access : public
  239. * @desc : 이송요원 호출 - 보류
  240. * @param :
  241. * @return :
  242. * @---------------------------------------------------
  243. */
  244. function fReteCall(){
  245. var iRows = -1, cnt = 0, cnt2 = 0;
  246. var chkflag = "", prcsstat = "", pid, trno, updtflag;
  247. var iPath = "/root/main/trancalllist";
  248. var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag";
  249. iRows = grd_trancalllist.rows;
  250. for( var i = 1; i < iRows; i++ ) {
  251. chkflag = model.getValue(iPath+"["+i+"]/chkflag");
  252. prcsstat = model.getValue(iPath+"["+i+"]/prcsstat");
  253. pid = model.getValue(iPath+"["+i+"]/pid");
  254. trno = model.getValue(iPath+"["+i+"]/trno");
  255. updtflag = "R";
  256. if( chkflag == "true" ) {
  257. if( (prcsstat == "2")||(prcsstat == "3")||(prcsstat == "4")||(prcsstat == "5")||(prcsstat == "6") ) {
  258. cnt2 += 1;
  259. }else {
  260. cnt += 1;
  261. trancalllist = trancalllist + "▩" + "u" + "▦" + cnt + "▦" + pid
  262. + "▦" + trno + "▦" + updtflag + "▦" + chkflag;
  263. }
  264. }
  265. }
  266. if(cnt2 >0) {
  267. //messageBox("완료, 취소, 보류 상태는 보류를", "E001");
  268. messageBox("보류는 진행상태값이 전송인 경우에만", "I006");
  269. }else if(cnt > 0 ) {
  270. model.removenode("/root/send");
  271. model.makeValue("/root/send/savedata", trancalllist);
  272. model.copyNode("/root/send/reqdata", "/root/main/cond");
  273. submit("TXMNB01801");
  274. }else {
  275. messageBox("선택한것이", "I004");
  276. }
  277. fSearchTranCall();
  278. }
  279. /**
  280. * @group :
  281. * @ver : 2007.09.03
  282. * @by : 김 진 명
  283. * @---------------------------------------------------
  284. * @type : function
  285. * @access : public
  286. * @desc : 이송요원 호출 - 취소
  287. * @param :
  288. * @return :
  289. * @---------------------------------------------------
  290. */
  291. function fTranCallCncl() {
  292. var iRows = -1;
  293. var chkflag = "", trno = "", prcsstat = "", pid = "", updtflag = "";//, msgkey = "";
  294. var cnt = 0, cnt2 = 0;
  295. var iPath = "/root/main/trancalllist";
  296. var trancalllist = "m▦rownum▦pid▦updtflag▦chkflag▦trno";
  297. //var trancalllist = "m▦rownum▦pid▦updtflag▦chkflag▦trno▦msgkey";
  298. iRows = grd_trancalllist.rows;
  299. for( var i = 1; i < iRows; i++ ) {
  300. chkflag = model.getValue(iPath+"["+i+"]/chkflag");
  301. prcsstat = model.getValue(iPath+"["+i+"]/prcsstat");
  302. pid = model.getValue(iPath+"["+i+"]/pid");
  303. trno = model.getValue(iPath+"["+i+"]/trno");
  304. updtflag = "C";
  305. //msgkey = model.getValue(iPath+"["+i+"]/msgkey");
  306. if( chkflag == "true" ) {
  307. if( (prcsstat == "2")||(prcsstat == "4")||(prcsstat == "5") ) {
  308. cnt2 += 1;
  309. }else {
  310. trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid + "▦"+ updtflag + "▦" + chkflag + "▦" + trno ;
  311. //trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid + "▦"+ updtflag + "▦" + chkflag + "▦" + trno + "▦" + msgkey;
  312. }
  313. cnt += 1;
  314. }
  315. }
  316. if( cnt2 > 0 ) {
  317. //messageBox("완료, 취소 상태는 취소를", "E001");
  318. messageBox("취소는 진행상태값이 전송,보류,재전송인 경우에만", "I006");
  319. }else if( cnt > 0 ) {
  320. model.removenode("/root/send");
  321. model.makeValue("/root/send/savedata", trancalllist);
  322. model.copyNode("/root/send/reqdata", "/root/main/cond");
  323. submit("TXMNB01801");
  324. }else {
  325. messageBox("선택한것이", "I004");
  326. return;
  327. }
  328. fSearchTranCall();
  329. }
  330. /**
  331. * @group :
  332. * @ver : 2007.09.03
  333. * @by : 김 진 명
  334. * @---------------------------------------------------
  335. * @type : function
  336. * @access : public
  337. * @desc : 이송요원 호출 - 이송요원 추가/수정 호출
  338. * @param :
  339. * @return :
  340. * @---------------------------------------------------
  341. */
  342. function fDblClick(){
  343. var iRow = -1;
  344. iRow = grd_trancalllist.row;
  345. if(iRow < 1)
  346. {
  347. return;
  348. }else
  349. {
  350. var iPath = "/root/main/trancalllist";
  351. var prcsstat = model.getValue (iPath + "["+iRow+"]/prcsstat");
  352. if( ( prcsstat == "4" )||( prcsstat == "5" ) ) {
  353. messageBox("취소 또는 완료 상태", "E008");
  354. }else {
  355. setParameter("status", "U");
  356. setParameter("pid", model.getValue( iPath + "[" + iRow + "]/pid") );
  357. setParameter("patnm", model.getValue( iPath + "[" + iRow + "]/patnm") );
  358. setParameter("trtargetetc", model.getValue( iPath + "[" + iRow + "]/trtargetetc"));
  359. setParameter("trtarget", model.getValue( iPath + "[" + iRow + "]/trtarget") );
  360. setParameter("trflag", model.getValue( iPath + "[" + iRow + "]/trflag"));
  361. if(model.getValue( iPath + "[" + iRow + "]/trflag") == "1") {
  362. setParameter("trtargetetc", model.getValue( iPath + "[" + iRow + "]/trtargetetc"));
  363. }else if (model.getValue( iPath + "[" + iRow + "]/trflag") == "2") {
  364. setParameter("prcpno", model.getValue( iPath + "[" + iRow + "]/trtargetetc"));
  365. }
  366. setParameter("prepfact", model.getValue( iPath + "[" + iRow + "]/prepfact"));
  367. setParameter("wardcd", model.getValue( iPath + "[" + iRow + "]/wardcd") );
  368. setParameter("wardtel", model.getValue( iPath + "[" + iRow + "]/wardtel") );
  369. setParameter("roomcd", model.getValue( iPath + "[" + iRow + "]/roomcd") );
  370. setParameter("startposcd", model.getValue( iPath + "[" + iRow + "]/startposcd") );
  371. setParameter("startposnm", model.getValue( iPath + "[" + iRow + "]/startposnm") );
  372. setParameter("startrgstflag", model.getValue( iPath + "[" + iRow + "]/startrgstflag") );
  373. setParameter("arvposcd", model.getValue( iPath + "[" + iRow + "]/arvposcd") );
  374. setParameter("arvposnm", model.getValue( iPath + "[" + iRow + "]/arvposnm") );
  375. setParameter("arvrgstflag", model.getValue( iPath + "[" + iRow + "]/arvrgstflag") );
  376. setParameter("movewayno", model.getValue( iPath + "[" + iRow + "]/movewayno") );
  377. setParameter("remark", model.getValue( iPath + "[" + iRow + "]/remark") );
  378. setParameter("remarkno", model.getValue( iPath + "[" + iRow + "]/remarkno") );
  379. setParameter("trno", model.getValue( iPath + "[" + iRow + "]/trno") );
  380. //setParameter("rsrvdt", model.getValue( iPath + "[" + iRow + "]/rsrvdt").substr(4, 4));
  381. setParameter("rsrvdt", model.getValue( iPath + "[" + iRow + "]/rsrvdt"));
  382. setParameter("posstm", model.getValue( iPath + "[" + iRow + "]/posstm") );
  383. setParameter("prcsstat", model.getValue( iPath + "[" + iRow + "]/prcsstat") );
  384. setParameter("updtflag", model.getValue( iPath + "[" + iRow + "]/updtflag") );
  385. //setParameter("pdabpno", model.getValue( iPath + "[" + iRow + "]/pdabpno") );
  386. //setParameter("msgkey", model.getValue( iPath + "[" + iRow + "]/msgkey") );
  387. /*
  388. var iRow = grd_trancalllist.row;
  389. var pid = ""
  390. var prcpnm = "";
  391. var trtargetetc = "";
  392. var rsrvdt = "";
  393. var prcpexecdeptcd = "";
  394. var prcpno= "";
  395. pid =model.getValue("/root/main/trancalllist["+iRow+"]/pid");
  396. prcpnm =model.getValue("/root/main/trancalllist["+iRow+"]/trtarget");
  397. trtargetetc =model.getValue("/root/main/trancalllist["+iRow+"]/trtargetetc");
  398. rsrvdt =model.getValue("/root/main/trancalllist["+iRow+"]/rsrvdt");
  399. prcpexecdeptcd =model.getValue("/root/main/trancalllist["+iRow+"]/prcpexecdeptcd");
  400. prcpno =model.getValue("/root/main/trancalllist["+iRow+"]/trtargetetc");
  401. alert(pid);
  402. alert(prcpnm);
  403. alert(trtargetetc);
  404. alert(rsrvdt);
  405. alert(prcpexecdeptcd);
  406. alert(prcpno);
  407. pid ="1";
  408. prcpnm ="2";
  409. trtargetetc ="3";
  410. rsrvdt ="4";
  411. prcpexecdeptcd ="5";
  412. prcpno ="6";
  413. fInsTranCallInfo(pid, prcpnm, trtargetetc, rsrvdt, prcpexecdeptcd, prcpno);
  414. */
  415. modal("SMMNB01810" ,"", "300", "150", "SMMNB01810", "", "");
  416. if( model.getValue("/root/temp/refstatus") == "C" ) {
  417. return;
  418. }else {
  419. model.removenode("/root/send");
  420. model.copyNode("/root/send/reqdata", "/root/main/cond");
  421. submit("TRMNB01801");
  422. }
  423. }
  424. }
  425. }
  426. /**
  427. * @group :
  428. * @ver : 2007.09.03
  429. * @by : 김 진 명
  430. * @---------------------------------------------------
  431. * @type : function
  432. * @access : public
  433. * @desc : 이송요원 호출 - 반복
  434. * @param :
  435. * @return :
  436. * @---------------------------------------------------
  437. */
  438. function fReptCall(){
  439. var iRows = -1, cnt = 0, cnt2 = 0;
  440. var chkflag = "", prcsstat = "", pid = "", trno = "", trtarget = "", trtargetetc = "", startposcd = "", arvposcd = "";
  441. var movewayno = "", remarkno = "", freetext = "", updtflag = "", trflag = "", wardtel = "" , prepfact = "" ,rsrvdt ="" ,prcpno="";//, pdabpno = "";
  442. var rsrvyn = "0";
  443. // var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦trtarget▦trtargetetc▦startposcd▦arvposcd▦movewayno▦remarkno▦freetext▦rsrvyn▦trflag▦wardtel▦prepfact▦rsrvdt▦prcpno▦pdabpno";
  444. var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦trtarget▦trtargetetc▦startposcd▦arvposcd▦movewayno▦remarkno▦freetext▦rsrvyn▦trflag▦wardtel▦prepfact▦rsrvdt▦prcpno";
  445. var iPath = "/root/main/trancalllist";
  446. iRows = grd_trancalllist.rows;
  447. for( var i = 1; i < iRows; i++ ) {
  448. chkflag = model.getValue( iPath + "["+i+"]/chkflag" );
  449. prcsstat = model.getValue( iPath + "["+i+"]/prcsstat" );
  450. pid = model.getValue( iPath + "["+i+"]/pid" );
  451. trno = model.getValue( iPath + "["+i+"]/trno" );
  452. trtarget = model.getValue( iPath + "["+i+"]/trtarget" );
  453. if(model.getValue( iPath + "[" + i + "]/trflag") == "1") {
  454. trtargetetc = model.getValue( iPath + "["+i+"]/trtargetetc" );
  455. }else if (model.getValue( iPath + "[" + i + "]/trflag") == "2") {
  456. prcpno = model.getValue( iPath + "["+i+"]/trtargetetc" );
  457. }else{
  458. trtargetetc ="";
  459. }
  460. startposcd = model.getValue( iPath + "["+i+"]/startposcd" );
  461. arvposcd = model.getValue( iPath + "["+i+"]/arvposcd" );
  462. movewayno = model.getValue( iPath + "["+i+"]/movewayno" );
  463. remarkno = model.getValue( iPath + "["+i+"]/remarkno" );
  464. freetext = model.getValue( iPath + "["+i+"]/remark" );
  465. trflag = model.getValue( iPath + "["+i+"]/trflag");
  466. if(model.getValue( iPath + "["+i+"]/rsrvdt") !='') {
  467. rsrvdt = getCurrentDate().substr(0,8)+model.getValue( iPath + "["+i+"]/rsrvdt");
  468. }else{
  469. rsrvdt ="";
  470. }
  471. wardtel = model.getValue( iPath + "["+i+"]/wardtel");
  472. prepfact = model.getValue( iPath + "["+i+"]/prepfact");
  473. updtflag = "R";
  474. //pdabpno = model.getValue( iPath + "["+i+"]/pdabpno" );
  475. if( chkflag == "true" ) {
  476. if( (prcsstat == "1")||(prcsstat == "2")||(prcsstat == "3")||(prcsstat == "5")||(prcsstat == "6") ) {
  477. cnt2 += 1;
  478. }else {
  479. trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid + "▦" + trno
  480. + "▦" + updtflag + "▦" + chkflag + "▦" + trtarget + "▦" + trtargetetc
  481. + "▦" + startposcd + "▦" + arvposcd + "▦" + movewayno + "▦" + remarkno
  482. + "▦" + freetext + "▦" + rsrvyn + "▦" + trflag + "▦" + wardtel
  483. + "▦" + prepfact + "▦" + rsrvdt + "▦" + prcpno ;
  484. // + "▦" + prepfact + "▦" + rsrvdt + "▦" + prcpno + "▦" + pdabpno ;
  485. }
  486. cnt += 1;
  487. }
  488. }
  489. if( cnt2 > 0 ) {
  490. messageBox("반복은 진행상태값이 완료인 경우에만", "I006");
  491. }else if( cnt > 0 ) {
  492. model.removenode("/root/send");
  493. model.makeValue("/root/send/savedata", trancalllist);
  494. model.copyNode("/root/send/reqdata", "/root/main/cond");
  495. submit("TXMNB01802");
  496. }else {
  497. messageBox("선택한것이", "I004");
  498. return;
  499. }
  500. fSearchTranCall();
  501. }
  502. /**
  503. * @group :
  504. * @ver : 2007.09.03
  505. * @by : 김 진 명
  506. * @---------------------------------------------------
  507. * @type : function
  508. * @access : public
  509. * @desc : 이송요원 호출 - Return
  510. * @param :
  511. * @return :
  512. * @---------------------------------------------------
  513. */
  514. function fRtnCall() {
  515. var iRows = -1, cnt = 0, cnt2 = 0;
  516. var chkflag, prcsstat, pid, trno, trtarget, trtargetetc, startposcd, arvposcd, patnm, arvposnm, startposnm, rsrvdt;
  517. var movewayno, remarkno, freetext, updtflag, indd, cretno, arvposnm, rtnValue, roomcd, movewaynm, userid, trflag, wardtel, prepfact, prcpno;//, pdabpno;
  518. var rsrvyn = "0"; //호출
  519. var iPath = "/root/main/trancalllist";
  520. var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦trtarget▦trtargetetc▦startposcd▦arvposcd▦movewayno▦remarkno▦freetext▦rsrvyn▦roomcd▦movewaynm▦patnm▦startposnm▦arvposnm▦trflag▦wardtel▦prepfact▦rsrvdt▦prcpno";
  521. // var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag▦trtarget▦trtargetetc▦startposcd▦arvposcd▦movewayno▦remarkno▦freetext▦rsrvyn▦roomcd▦movewaynm▦patnm▦startposnm▦arvposnm▦trflag▦wardtel▦prepfact▦rsrvdt▦prcpno▦pdabpno";
  522. iRows = grd_trancalllist.rows;
  523. for( var i = 1; i < iRows; i++ ) {
  524. chkflag = model.getValue( iPath + "["+i+"]/chkflag");
  525. prcsstat = model.getValue( iPath + "["+i+"]/prcsstat");
  526. pid = model.getValue( iPath + "["+i+"]/pid");
  527. trno = model.getValue( iPath + "["+i+"]/trno");
  528. trtarget = model.getValue( iPath + "["+i+"]/trtarget");
  529. if(model.getValue( iPath + "[" + i + "]/trflag") == "1") {
  530. trtargetetc = model.getValue( iPath + "["+i+"]/trtargetetc" );
  531. }else if (model.getValue( iPath + "[" + i + "]/trflag") == "2") {
  532. prcpno = model.getValue( iPath + "["+i+"]/trtargetetc" );
  533. }else{
  534. trtargetetc ="";
  535. }
  536. startposcd = model.getValue( iPath + "["+i+"]/startposcd");
  537. arvposcd = model.getValue( iPath + "["+i+"]/arvposcd");
  538. movewayno = model.getValue( iPath + "["+i+"]/movewayno");
  539. remarkno = model.getValue( iPath + "["+i+"]/remarkno");
  540. freetext = model.getValue( iPath + "["+i+"]/remark");
  541. if(model.getValue( iPath + "["+i+"]/rsrvdt") !='') {
  542. rsrvdt = getCurrentDate().substr(0,8)+model.getValue( iPath + "["+i+"]/rsrvdt");
  543. }else{
  544. rsrvdt ="";
  545. }
  546. trflag = model.getValue( iPath + "["+i+"]/trflag");
  547. indd = model.getValue( iPath + "["+i+"]/indd");
  548. cretno = model.getValue( iPath + "["+i+"]/cretno");
  549. arvposnm = model.getValue( iPath + "["+i+"]/arvposnm2");
  550. roomcd = model.getValue( iPath + "["+i+"]/roomcd");
  551. movewaynm = model.getValue( iPath + "["+i+"]/movewaynm");
  552. patnm = model.getValue( iPath + "["+i+"]/patnm");
  553. arvposnm = model.getValue( iPath + "["+i+"]/arvposnm");
  554. startposnm = model.getValue( iPath + "["+i+"]/startposnm");
  555. userid = model.getValue( iPath + "["+i+"]/userid");
  556. trflag = model.getValue( iPath + "["+i+"]/trflag");
  557. wardtel = model.getValue( iPath + "["+i+"]/wardtel");
  558. prepfact = model.getValue( iPath + "["+i+"]/prepfact");
  559. updtflag = "RTN";
  560. //pdabpno = model.getValue( iPath + "["+i+"]/pdabpno");
  561. if( chkflag == "true" ) {
  562. if((prcsstat == "1")||(prcsstat == "2")|| (prcsstat == "3")||(prcsstat == "5")||(prcsstat == "6")) {//전송,접수,재전송,취소,보류
  563. cnt2 += 1;
  564. }else {
  565. /*
  566. if( prcsstat != "4" ) {//완료일 경우 간호기록을 했으므로 다시 하지 않는다.
  567. rtnValue = fDifBizSaveStmtInfo(pid, indd, cretno, arvposnm+"(으)로 이송함", "J", "I", "R", userid);//J : 간호일지 이송요원 정보 저장, 외래입원구분(I : 입원, O : 외래), DNAR 정보(D : 데이터, N : 진단, A : 행동, R : 결과)
  568. if( !rtnValue ) {
  569. messageBox("간호 일지 기록에 ", "E009");
  570. return;
  571. }
  572. }
  573. */
  574. trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid + "▦" + trno
  575. + "▦" + updtflag + "▦" + chkflag + "▦" + trtarget + "▦" + trtargetetc
  576. + "▦" + startposcd + "▦" + arvposcd + "▦" + movewayno + "▦" + remarkno
  577. + "▦" + freetext + "▦" + rsrvyn + "▦" + roomcd
  578. + "▦" + movewaynm + "▦" + patnm + "▦" + arvposnm + "▦" + startposnm
  579. + "▦" + trflag + "▦" + wardtel + "▦" + prepfact + "▦" + rsrvdt
  580. + "▦" + prcpno ;
  581. // + "▦" + prcpno + "▦" + pdabpno;
  582. }
  583. cnt += 1;
  584. }
  585. }
  586. if( cnt2 > 0 ) {
  587. //messageBox("호출, 응답, 완료를 제외한 상태는", "E001");
  588. messageBox("RETURN은 진행상태값이 완료인 경우에만", "I006");
  589. }else if( cnt > 0 ) {
  590. model.removenode("/root/send");
  591. model.makeValue("/root/send/savedata", trancalllist);
  592. model.copyNode("/root/send/reqdata", "/root/main/cond");
  593. submit("TXMNB01801");
  594. submit("TXMNB01802");
  595. }else {
  596. messageBox("선택한것이", "I004");
  597. }
  598. fSearchTranCall();
  599. }
  600. /**
  601. * @group :
  602. * @ver : 2007.09.03
  603. * @by : 김 진 명
  604. * @---------------------------------------------------
  605. * @type : function
  606. * @access : public
  607. * @desc : 이송요원 호출 - 완료
  608. * @param :
  609. * @return :
  610. * @---------------------------------------------------
  611. */
  612. function fTranEnd(){
  613. var iRows = -1, cnt = 0, cnt2 = 0;
  614. var chkflag = "", prcsstat = "", pid, trno, updtflag, indd, cretno, arvposnm, rtnValue;
  615. var iPath = "/root/main/trancalllist";
  616. var trancalllist = "m▦rownum▦pid▦trno▦updtflag▦chkflag";
  617. iRows = grd_trancalllist.rows;
  618. for( var i = 1; i < iRows; i++ ) {
  619. chkflag = model.getValue(iPath + "[" + i + "]/chkflag");
  620. prcsstat = model.getValue(iPath + "[" + i + "]/prcsstat");
  621. pid = model.getValue(iPath + "[" + i + "]/pid");
  622. trno = model.getValue(iPath + "[" + i + "]/trno");
  623. indd = model.getValue(iPath + "[" + i + "]/indd");
  624. cretno = model.getValue(iPath + "[" + i + "]/cretno");
  625. arvposnm = model.getValue(iPath + "[" + i + "]/arvposnm2");
  626. userid = model.getValue( iPath + "["+i+"]/userid");
  627. updtflag = "END";
  628. if( chkflag == "true" ) {
  629. if( (prcsstat == "2")||(prcsstat == "3")||(prcsstat == "4")||(prcsstat == "5")||(prcsstat == "6") ) {
  630. cnt2 += 1;
  631. }else {
  632. rtnValue = fDifBizSaveStmtInfo(pid, indd, cretno, arvposnm+"(으)로 이송함", "J", "I", "R", userid);//J : 간호일지 이송요원 정보 저장, 외래입원구분(I : 입원, O : 외래), DNAR 정보(D : 데이터, N : 진단, A : 행동, R : 결과)
  633. if( !rtnValue ) {
  634. messageBox("간호 일지 기록에 ", "E009");
  635. return;
  636. }
  637. trancalllist = trancalllist + "▩" + "u" + "▦" + i + "▦" + pid
  638. + "▦" + trno + "▦" + updtflag + "▦" + chkflag;
  639. }
  640. cnt += 1;
  641. }
  642. }
  643. if( cnt2 > 0 ) {
  644. messageBox("완료는 진행상태값이 접수인 경우에만", "I006");
  645. }else if( cnt > 0 ) {
  646. model.removenode("/root/send");
  647. model.makeValue("/root/send/savedata", trancalllist);
  648. model.copyNode("/root/send/reqdata", "/root/main/cond");
  649. submit("TXMNB01801");
  650. }else {
  651. messageBox("선택한것이", "I004");
  652. }
  653. fSearchTranCall();
  654. }
  655. /**
  656. * @group :
  657. * @ver : 2007.11.07
  658. * @by : 김 진 명
  659. * @---------------------------------------------------
  660. * @type : function
  661. * @access : public
  662. * @desc : 이송요원 호출 - 출력
  663. * @param :
  664. * @return :
  665. * @---------------------------------------------------
  666. */
  667. function fPrntTranCallList(){
  668. // 출력할 데이터가 없는 경우
  669. if(getNodesetCount("/root/main/trancalllist")==0){
  670. messageBox("출력할 데이터가", "I004"); return;
  671. }else{
  672. var instcd = getUserInfo("dutplceinstcd");
  673. var refdd = model.getValue("/root/main/cond/refdd");
  674. if( refdd == "" ) {
  675. refdd = "%%";
  676. }
  677. var pid = model.getValue("/root/main/cond/pid");
  678. if( pid == "" ) {
  679. pid = "%%";
  680. }
  681. var wardcd = model.getValue("/root/main/cond/wardcd");
  682. if( wardcd == "" ) {
  683. wardcd = "%%";
  684. }
  685. var prcsstat = model.getValue("/root/main/cond/prcsstat");
  686. if( prcsstat == "" ) {
  687. prcsstat = "%%";
  688. }
  689. var trtargetetc = model.getValue("/root/main/cond/trtargetetc");
  690. if( trtargetetc == "" ) {
  691. trtargetetc = "%%";
  692. }
  693. var patnm = model.getValue("/root/main/cond/patnm");
  694. if( patnm == "" ) {
  695. patnm = "%%";
  696. }
  697. /*
  698. var pdabpno = model.getValue("/root/main/cond/pdabpno");
  699. if( pdabpno == "" ) {
  700. pdabpno = "%%";
  701. }
  702. */
  703. model.makeValue("/root/send/report/instcd", instcd );
  704. model.makeValue("/root/send/report/calldd", refdd );
  705. model.makeValue("/root/send/report/pid", pid );
  706. model.makeValue("/root/send/report/wardcd", wardcd );
  707. model.makeValue("/root/send/report/prcsstat", prcsstat);
  708. model.makeValue("/root/send/report/trtargetetc", trtargetetc );
  709. model.makeValue("/root/send/report/patnm", patnm );
  710. //model.makeValue("/root/send/report/pdabpno", pdabpno );
  711. for(var i=1;i<grd_trancalllist.rows;i++) {
  712. model.makeNode("/root/hidden/trancalllist/trancalllist["+i+"]");
  713. model.copyNode("/root/hidden/trancalllist/trancalllist["+i+"]", "/root/main/trancalllist["+i+"]");
  714. }
  715. exeReportPreview("RPMNB01801", "XMLSTR", "/root/hidden/trancalllist", "", "", "", "", "", "", "");
  716. }
  717. }
  718. /**
  719. * @group :
  720. * @ver : 2009.08.10
  721. * @by : 최영
  722. * @---------------------------------------------------
  723. * @type : function
  724. * @access : public
  725. * @desc : 이송요원 병실 검색
  726. * @param :
  727. * @return :
  728. * @---------------------------------------------------
  729. */
  730. function fGetRoom(){
  731. model.removeNodeset("/root/send");
  732. model.makeValue("/root/send/wardcd",model.getValue("/root/main/cond/dept"));
  733. submit("TRMNB01803"); //병실 조회
  734. addComboItem("cmb_roomcd", "- 전체 -", "", "above" );
  735. }