SMMNP01100.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. /* ---------------------------------------------------------------------
  2. 마취방법등록(SMMNP01100.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By K. J. M
  6. : 2010.02.09
  7. ---------------------------------------------------------------------- */
  8. /* ------------------------------------------------- */
  9. /* SMMNP01100_마취방법등록 */
  10. /* On Load 시 Call */
  11. /* ------------------------------------------------- */
  12. /* group : EMR 간호 수술마취 */
  13. /* ver : 2010.02.09 */
  14. /* by : 김진명 */
  15. /* --------------------------------------------------*/
  16. /* type : function */
  17. /* access : public */
  18. /* desc : xforms-ready시 수행한다 */
  19. /* return : */
  20. /* --------------------------------------------------*/
  21. function fInit() {
  22. model.removeNodeset("/root/main/anstdrinfo/anstdrlist");
  23. model.removeNodeset("/root/main/copyanstdringo/copyanstdrlist");
  24. model.removenode("/root/send");
  25. model.makeValue("/root/send/reqdata/cdgrupid", "061");//마취과
  26. model.makeValue("/root/send/reqdata/supcdid", "");//서브구분
  27. model.makeValue("/root/send/reqdata/cdid", "");//서브구분
  28. model.makeValue("/root/send/reqdata/cdnm", "A1");//서브구분
  29. submit("TRMNP04903", false);
  30. model.setValue("/root/main/cond/orddeptcd", model.getValue("/root/init/hardcodeinfo/cdid"));
  31. model.removenode("/root/send" );
  32. model.makeNode("/root/send" );
  33. model.makeNode("/root/send/reqdata");
  34. model.makeValue("/root/send/reqdata/orddept", model.getValue("/root/init/hardcodeinfo/cdid"));
  35. submit("TRMNP00103");
  36. model.copyNode("/root/temp/DrInfo/DrLists", "root/init/DrLists");
  37. model.copyNode("/root/temp/DrInfo2/DrLists", "root/init/DrLists");
  38. addComboItem("cmb_perf" , "전 체", "", "above" );
  39. addComboItem("cmb_perf2" , "전 체", "", "above" );
  40. grd_anstdrlist.explorerbar = "sort";
  41. grd_copyanstlist.explorerbar = "sort";
  42. grd_anstdrlist.fixedcellcheckbox(0,1) = true;
  43. grd_copyanstlist.fixedcellcheckbox(0,1) = true;
  44. model.refresh();
  45. }
  46. /* ------------------------------------------------- */
  47. /* group : EMR 간호 수술마취 */
  48. /* ver : 2010.02.09 */
  49. /* by : 김진명 */
  50. /* ------------------------------------------------- */
  51. /* SMMNP01100_마취방법등록 */
  52. /* desc : 마취방법등록 조회 */
  53. /* --------------------------------------------------*/
  54. function fSearch(){
  55. model.removenode("/root/send");
  56. model.makeNode("/root/send/reqdata");
  57. model.copyNode("/root/send/reqdata", "/root/main/cond");
  58. submit("TRMNP01100");
  59. }
  60. /* ------------------------------------------------- */
  61. /* group : EMR 간호 수술마취 */
  62. /* ver : 2010.02.09 */
  63. /* by : 김진명 */
  64. /* ------------------------------------------------- */
  65. /* SMMNP01100_마취방법등록 */
  66. /* desc : 마취방법등록 초기화 */
  67. /* --------------------------------------------------*/
  68. function fClear(){
  69. model.removenode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 그리드 초기화
  70. model.makeNode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 인스턴스 생성
  71. model.refresh();
  72. }
  73. /* ------------------------------------------------- */
  74. /* group : EMR 간호 수술마취 */
  75. /* ver : 2010.02.10 */
  76. /* by : 김진명 */
  77. /* ------------------------------------------------- */
  78. /* SMMNP01100_마취방법등록 */
  79. /* desc : 마취명 복사 */
  80. /* --------------------------------------------------*/
  81. function fCopyAnstNm(){
  82. var cnt = 0;
  83. model.removenode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 그리드 초기화
  84. model.makeNode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 인스턴스 생성
  85. for( var iRow = 1; iRow < grd_anstdrlist.rows; iRow++ ) {
  86. if( model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow + "]/chkflag") == "true" ) {
  87. if( model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow + "]/anstccrtno") != "" ) {
  88. if( model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow + "]/anstuseflag") == "N" ) {
  89. messageBox("미 사용중인 마취명은 선택 ", "E001");
  90. model.removenode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 그리드 초기화
  91. model.makeNode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 인스턴스 생성
  92. model.refresh();
  93. return;
  94. }
  95. model.duplicate("/root/main/copyanstdringo/copyanstdrlist", "/root/main/anstdrinfo/anstdrlist["+ iRow +"]");
  96. cnt++;
  97. }else {
  98. messageBox("미 등록된 마취명은 선택 ", "E001");
  99. model.removenode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 그리드 초기화
  100. model.makeNode("/root/main/copyanstdringo/copyanstdrlist");//마취명복사 인스턴스 생성
  101. model.refresh();
  102. return;
  103. }
  104. }
  105. }
  106. if( cnt < 1 ) {
  107. messageBox("선택하신 마취명이 없습니다.!", "E000");
  108. return;
  109. }else {
  110. model.refresh();
  111. }
  112. }
  113. /* ------------------------------------------------- */
  114. /* group : EMR 간호 수술마취 */
  115. /* ver : 2010.02.10 */
  116. /* by : 김진명 */
  117. /* ------------------------------------------------- */
  118. /* desc : Case Cart MASTER 자료저장하기 */
  119. /* param : S:저장, D:삭제 */
  120. /* return : */
  121. /* ------------------------------------------------- */
  122. function fSave(pFlag){
  123. var anstccrtno, anstmthdnm, anstuseflag, anstdrid, cartgubn, orddeptcd, newanstdrid, rgstflag, anstappdd;
  124. var cnt = 0;
  125. var anstsavelist = "m▦anstdrid▦orddeptcd▦anstmthdnm▦cartgubn▦anstuseflag▦anstccrtno▦deptinit▦anstappdd";
  126. var orddeptcd = model.getValue("/root/init/hardcodeinfo/cdid");
  127. var anstdrid = model.getValue("/root/main/cond/anstdrid");
  128. var cartgubn = model.getValue("/root/main/cond/cartgubn");
  129. if( anstdrid == "" ) {
  130. messageBox("마취의를 선택하지 않았습니다.!", "E000");
  131. model.setFocus("cmb_perf");
  132. return;
  133. }
  134. for(var iRow = 1; iRow < grd_anstdrlist.rows; iRow++ ) {
  135. if( model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow + "]/chkflag") == "true" ) {
  136. anstccrtno = model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow +"]/anstccrtno");
  137. anstmthdnm = model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow +"]/anstmthdnm");
  138. anstuseflag = model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow +"]/anstuseflag");
  139. newanstdrid = model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow +"]/anstdrid");
  140. anstappdd = model.getValue("/root/main/anstdrinfo/anstdrlist[" + iRow +"]/anstappdd");
  141. if( anstdrid != newanstdrid ) {
  142. messageBox("선택한 마취의와 저장할려는 마취의가 같지 않습니다.!", "E000");
  143. model.setFocus("cmb_perf");
  144. return;
  145. }
  146. if( anstmthdnm == "" ) {
  147. messageBox("마취명을 입력하셔야 합니다.!", "E000");
  148. return;
  149. }
  150. if( anstccrtno == "" ) {//등록된 카트가 아니면 신규등록, 등록된 카트이면서 미사용중이면 수정
  151. rgstflag = "I";
  152. }else {
  153. rgstflag = "U";
  154. }
  155. if( pFlag == "D" ) {//삭제이면
  156. rgstflag = "D";
  157. anstuseflag = "N";
  158. }
  159. if( !((anstccrtno == "")&&(pFlag == "D")) ) {//신규등록인데 삭제인경우는 스킵
  160. cnt++
  161. anstsavelist = anstsavelist + "▩" + rgstflag + "▦" + newanstdrid + "▦" + orddeptcd + "▦" + anstmthdnm + "▦" + cartgubn + "▦" + anstuseflag
  162. + "▦" + anstccrtno + "▦" + "AN" + "▦" + anstappdd;
  163. }
  164. }
  165. }
  166. if( cnt > 0 ) {
  167. model.removenode("/root/send");
  168. model.makeNode("/root/send/reqdata");
  169. model.copyNode("/root/send/reqdata", "/root/main/cond");
  170. model.makeValue("/root/send/savedata", anstsavelist);
  171. submit("TXMNP01102");
  172. }else {
  173. messageBox("선택하신 마취명이 ", "E007");
  174. return;
  175. }
  176. }
  177. /* ------------------------------------------------- */
  178. /* desc : 마취명 복사 */
  179. /* param : */
  180. /* return : */
  181. /* -------------------------------------------------- */
  182. function fAnstCopy(){
  183. var copylist = "anstccrtno▦anstmthdnm▦cartgubn▦anstuseflag▦copyanstdrid▦deptinit▦anstappdd▦orddeptcd";
  184. var orddeptcd = model.getValue("/root/init/hardcodeinfo/cdid");
  185. var copyanstdrid = model.getValue("/root/main/cond/copyanstdrid");
  186. var copyflag = model.getValue("/root/main/cond/copyflag");
  187. var cartgubn = model.getValue("/root/main/cond/cartgubn");
  188. if( copyanstdrid == "" ) {
  189. messageBox("복사할 마취의를 선택하지 않았습니다.", "E000");
  190. model.setFocus("cmb_perf2");
  191. return;
  192. }else if( copyflag == "" ) {
  193. messageBox("복사 조건을 선택하지 않았습니다.!", "E000");
  194. model.setFocus("rdo_copyflag");
  195. return;
  196. }
  197. var cnt = 0;
  198. for( var i=0; i < grd_copyanstlist.rows; i++ ) {
  199. var chk = model.getValue("/root/main/copyanstdringo/copyanstdrlist/anstdrlist[" + i + "]/chkflag");
  200. var anstmthdnm = model.getValue("/root/main/copyanstdringo/copyanstdrlist/anstdrlist[" + i + "]/anstmthdnm");
  201. var anstccrtno = model.getValue("/root/main/copyanstdringo/copyanstdrlist/anstdrlist[" + i + "]/anstccrtno");
  202. var anstappdd = model.getValue("/root/main/copyanstdringo/copyanstdrlist/anstdrlist[" + i +"]/anstappdd");
  203. if( chk == "true" ) {
  204. copylist = copylist + "▩" + anstccrtno + "▦" + anstmthdnm + "▦" + cartgubn + "▦" + "Y" + "▦" + copyanstdrid + "▦" + "AN"
  205. + "▦" + anstappdd + "▦" + orddeptcd;
  206. cnt++;
  207. }
  208. }
  209. if( cnt > 0 ) {
  210. model.removenode("/root/send");
  211. model.makeValue("/root/send/reqdata/copyflag", copyflag);
  212. model.makeValue("/root/send/savedata", copylist);
  213. submit("TXMNP01103", false);
  214. fClear();//수술명 복사 초기화
  215. }else {
  216. messageBox("선택하신 마취명이 ", "I004");
  217. }
  218. }
  219. /* ------------------------------------------------- */
  220. /* ------End Of List ------------------------------- */
  221. /* -------------------------------------------------- */