SPMNE04800.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. /*
  2. 응급센터 의사소통Pg(SPMNE04800.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xCmpgInfoPath = "/root/main/patcmpginfo";
  7. var xPatInfoPath = "/root/main/cond/patinfo";
  8. var xCmpglistPath = "/root/main/cmpginfo/cmpglist";
  9. var iPid = "";
  10. var iCretno = "";
  11. var iIndd = "";
  12. var iPname = "";
  13. /**
  14. * @group :
  15. * @ver : 2009.06.05
  16. * @by : 이은영
  17. * @---------------------------------------------------
  18. * @type : function
  19. * @access : public
  20. * @desc : 초기화
  21. * @param :
  22. * @return :
  23. * @---------------------------------------------------
  24. */
  25. function fInit(){
  26. //이전 화면에서 넘어온 환자정보 param/상단에 환자정보가 존재하면 그 값을 셋팅해줌(2009.06.14 JJE)
  27. var grb_patinfo1 = opener.javascript.getParameter ( "SPMNE04800_patinfo" );
  28. var grb_patinfo2 = opener.javascript.getParameter ( "SPMNE04900_patinfo" );
  29. var grb_patinfo3 = getPatientInfo("pid");
  30. if( !isNull(grb_patinfo1) ){
  31. iPid = grb_patinfo1.split("▩")[0];
  32. iCretno = grb_patinfo1.split("▩")[1];
  33. iIndd = grb_patinfo1.split("▩")[2];
  34. iPname = grb_patinfo1.split("▩")[3];
  35. }else if( !isNull(grb_patinfo2) ){
  36. iPid = grb_patinfo2.split("▩")[0];
  37. iCretno = grb_patinfo2.split("▩")[1];
  38. iIndd = grb_patinfo2.split("▩")[2];
  39. iPname = grb_patinfo2.split("▩")[3];
  40. }else{
  41. if( !isNull(grb_patinfo3) ){
  42. iPid = grb_patinfo3;
  43. iCretno = getPatientInfoDetail("cretno");
  44. iIndd = getPatientInfoDetail("indd");
  45. iPname = getPatientInfo("pname");
  46. }
  47. }
  48. if( !isNull(iPid) && !isNull(iCretno) && !isNull(iIndd) ){
  49. model.setValue(xPatInfoPath + "/selpatinfo", iPid);
  50. model.setValue(xPatInfoPath + "/pid", iPid);
  51. model.setValue(xPatInfoPath + "/bedposcnts", "");
  52. model.setValue(xPatInfoPath + "/patinfo", iPname + " " + iPid);
  53. }
  54. model.setValue("/root/main/cond/patlist/endyn" , "N");
  55. model.setValue(xPatInfoPath + "/srchtype", "X");
  56. model.setValue(xPatInfoPath + "/fromdd", getCurrentDate());
  57. model.setValue(xPatInfoPath + "/todd" , getCurrentDate());
  58. submit("TRMNE04801");
  59. fGetNursHardCdInfo("'096'", getCurrentDate());
  60. fSrchCMPGList("A");
  61. model.refresh();
  62. }
  63. /**
  64. * @group :
  65. * @ver : 2009.06.05
  66. * @by : 이은영
  67. * @---------------------------------------------------
  68. * @type : function
  69. * @access : public
  70. * @desc : 메시지 콤보 리스트 변경
  71. * @param :
  72. * @return :
  73. * @---------------------------------------------------
  74. */
  75. function fChngMsgList(){
  76. model.setValue(xCmpgInfoPath+"/trscnts", model.getValue(xCmpgInfoPath+"/selmsginfo"));
  77. model.setFocus("ipt_trscnts");
  78. model.refresh();
  79. }
  80. /**
  81. * @group :
  82. * @ver : 2009.06.05
  83. * @by : 이은영
  84. * @---------------------------------------------------
  85. * @type : function
  86. * @access : public
  87. * @desc : 환자 리스트 변경시
  88. * @param :
  89. * @return :
  90. * @---------------------------------------------------
  91. */
  92. function fChngERPatList(){
  93. var pid = model.getValue(xPatInfoPath+"/selpatinfo");
  94. model.setValue(xPatInfoPath+"/pid", pid);
  95. model.setValue(xPatInfoPath+"/bedposcnts",model.getValue("/root/main/erpatinfo/erpatlist[pid='"+pid+"']/bedposcnts"));
  96. model.setValue(xPatInfoPath+"/patinfo",model.getValue("/root/main/erpatinfo/erpatlist[pid='"+pid+"']/patinfo"));
  97. model.setValue("/root/main/patcmpginfo/selmsginfo", "");
  98. model.setValue("/root/main/patcmpginfo/ugcyyn", "");
  99. model.setValue("/root/main/patcmpginfo/trscnts", "");
  100. model.setValue(xPatInfoPath+"/histno",""); //키 초기화 (2009.06.14 JJE)
  101. model.refresh();
  102. }
  103. /**
  104. * @group :
  105. * @ver : 2009.06.05
  106. * @by : 이은영
  107. * @---------------------------------------------------
  108. * @type : function
  109. * @access : public
  110. * @desc : 저장
  111. * @param :flag(I:insert or update, D:delete)
  112. * @return :
  113. * @---------------------------------------------------
  114. */
  115. function fSave(flag){
  116. if( isNull(flag) ) flag = "I";
  117. var pid = model.getValue(xPatInfoPath+"/pid");
  118. var trscnts = model.getValue(xCmpgInfoPath+"/trscnts");
  119. if( flag == "T" ){
  120. model.removenodeset("/root/send");
  121. model.makeNode("/root/send/savedata");
  122. copyNodeListType("/root/send/savedata", "/root/main/cmpginfo/cmpglist", "replace", model, model);
  123. }else{
  124. if(pid == ""){
  125. messageBox("환자를 선택","I008");
  126. model.setFocus("cmb_selpatinfo");
  127. return;
  128. }
  129. if(trscnts == ""){
  130. messageBox("전달한 내용을 입력","I008");
  131. model.setFocus("cmb_selmsginfo");
  132. return;
  133. }
  134. model.removenodeset("/root/send");
  135. model.makeNode("/root/send/savedata");
  136. model.makeValue("/root/send/savedata/pid",pid);
  137. model.makeValue("/root/send/savedata/ugcyyn",model.getValue(xCmpgInfoPath+"/ugcyyn"));
  138. model.makeValue("/root/send/savedata/trscnts",trscnts);
  139. model.makeValue("/root/send/savedata/histcd","O");
  140. model.makeValue("/root/send/savedata/bedposcnts", model.getValue(xPatInfoPath+"/bedposcnts"));
  141. model.makeValue("/root/send/savedata/histno", model.getValue(xPatInfoPath+"/histno"));
  142. }
  143. model.makeNode("/root/send/reqdata");
  144. model.makeValue("/root/send/reqdata/endyn", model.getValue("/root/main/cond/patlist/endyn"));
  145. model.makeValue("/root/send/reqdata/pid" , model.getValue("/root/main/cond/patlist/pid"));
  146. if( flag == "I" && !isNull(model.getValue(xPatInfoPath+"/histno")) ) flag = "U";
  147. model.makeValue("/root/send/savedata/status", flag);
  148. if(submit("TXMNE04801") == true){
  149. if(model.getValue("/root/main/cond/patinfo/status") != "T" ){
  150. cmb_selmsginfo.value = "";
  151. txt_trscnts.value = "";
  152. model.setValue("/root/main/cond/patinfo/histno", "");
  153. }
  154. fGridSetting();
  155. }
  156. }
  157. /**
  158. * @group :
  159. * @ver : 2009.06.05
  160. * @by : 이은영
  161. * @---------------------------------------------------
  162. * @type : function
  163. * @access : public
  164. * @desc : 의사소통 관련 환자 리스트
  165. * @param : flag(P:수동조회, A:자동조회)
  166. * @return :
  167. * @---------------------------------------------------
  168. */
  169. function fSrchCMPGList(flag){
  170. if( isNull(flag) ) flag = "A";
  171. if( submit("TRMNE04802") ){
  172. fGridSetting();
  173. if( flag != "A" ){
  174. //fClear(); //재조회 후 상단 입력부 초기화 (2009.06.14 JJE)
  175. }
  176. }
  177. }
  178. function fGridSetting(){
  179. grd_userlist.rebuildStyle();
  180. for(var i = 1 ; i <= getNodesetCount("/root/main/cmpginfo/cmpglist") ; i++){
  181. if(model.getValue("/root/main/cmpginfo/cmpglist["+i+"]/ugcyyn") == "Y"){
  182. //grd_userlist.cellstyle("background-color", i, 0, i, grd_userlist.colRef("trscnts")) = "#ff0000";
  183. grd_userlist.cellstyle("font-weight", i, 0, i, grd_userlist.colRef("trscnts")) = "bold";
  184. grd_userlist.cellstyle("color", i, 0, i, grd_userlist.colRef("trscnts")) = "#ff5500";
  185. }
  186. }
  187. }
  188. /**
  189. * @group :
  190. * @ver : 2009.06.14
  191. * @by : 전지은
  192. * @---------------------------------------------------
  193. * @type : function
  194. * @access : public
  195. * @desc : 의사소통 관련 환자 리스트를 더블클릭하면 상단 입력부에 값을 셋팅
  196. * @param : falg (A:간호사-신청, R:사원-전송)
  197. * @return :
  198. * @---------------------------------------------------
  199. */
  200. function fDblclick(flag){
  201. if( isNull(flag) ) flag = "A";
  202. var iRow = grd_userlist.row;
  203. if( iRow > 0 && iRow <= grd_userlist.rows ){
  204. var pid = model.getValue( xCmpglistPath + "[" + iRow + "]/pid");
  205. var pname = model.getValue( xCmpglistPath + "[" + iRow + "]/hngnm");
  206. var bedposcnts = model.getValue( xCmpglistPath + "[" + iRow + "]/bedposcnts");
  207. var patinfo = pname + " " + pid;
  208. var trscnts = model.getValue( xCmpglistPath + "[" + iRow + "]/trscnts");
  209. var ugcyyn = model.getValue( xCmpglistPath + "[" + iRow + "]/ugcyyn");
  210. var histno = model.getValue( xCmpglistPath + "[" + iRow + "]/histno");
  211. if( flag == "A" ){
  212. model.setValue(xPatInfoPath + "/selpatinfo", pid);
  213. model.setValue(xPatInfoPath + "/pid", pid);
  214. model.setValue(xPatInfoPath + "/bedposcnts", bedposcnts);
  215. model.setValue(xPatInfoPath + "/patinfo", patinfo);
  216. model.setValue(xPatInfoPath + "/histno", histno);
  217. model.setValue(xCmpgInfoPath + "/trscnts", trscnts);
  218. model.setValue(xCmpgInfoPath + "/ugcyyn", ugcyyn);
  219. cmb_selpatinfo.refresh();
  220. ipt_pid.refresh();
  221. ipt_bedno.refresh();
  222. ipt_patinfo.refresh();
  223. txt_trscnts.refresh();
  224. chk_ugcyyn.refresh();
  225. }
  226. else if( flag == "T" ){
  227. if(model.getValue(xCmpglistPath + "[" + iRow + "]/empid") != "" && rdo_endyn.value == "N"){
  228. model.setValue(xCmpglistPath + "[" + iRow + "]/empid", "");
  229. model.setValue(xCmpglistPath + "[" + iRow + "]/empnm", "");
  230. model.setValue(xCmpglistPath + "[" + iRow + "]/status", "");
  231. }else{
  232. model.setValue(xCmpglistPath + "[" + iRow + "]/empid", getUserInfo("userid"));
  233. model.setValue(xCmpglistPath + "[" + iRow + "]/empnm", getUserInfo("usernm"));
  234. model.setValue(xCmpglistPath + "[" + iRow + "]/status", "T");
  235. }
  236. }
  237. }
  238. }
  239. /**
  240. * @group :
  241. * @ver : 2009.06.14
  242. * @by : 전지은
  243. * @---------------------------------------------------
  244. * @type : function
  245. * @access : public
  246. * @desc : 입력부 초기화
  247. * @param :
  248. * @return :
  249. * @---------------------------------------------------
  250. */
  251. function fClear(){
  252. model.resetInstanceNode(xPatInfoPath);
  253. model.resetInstanceNode(xCmpgInfoPath);
  254. cmb_selmsginfo.refresh();
  255. cmb_selpatinfo.refresh();
  256. ipt_pid.refresh();
  257. ipt_bedno.refresh();
  258. ipt_patinfo.refresh();
  259. txt_trscnts.refresh();
  260. chk_ugcyyn.refresh();
  261. }