SPMMO10900.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. Therapy일정관리 ( SPMMO10900_Therapy일정관리.xrw - JScript )
  4. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  5. */
  6. var sTHERPLIST_PATH = "/root/main/therpinfo/therplist";
  7. /**
  8. * @desc : Therapy일정관리 초기화
  9. * @
  10. * @param :
  11. * @return :
  12. * @author : 오지훈
  13. * @---------------------------------------------------
  14. */
  15. function fInitialize_SPMMO10900(){
  16. //조회기간 시작일자는 현재, 종료일자는 7일 후로 설정한다.
  17. model.setValue("/root/init/today", getCurrentDate());
  18. model.setValue("/root/main/cond/fromdd", model.getValue("/root/init/today"));
  19. var todd = ((getCurrentDate()).toDate()).getAddDate(7);
  20. model.setValue("/root/main/cond/todd" , todd.getDateFormat());
  21. //콤보박스에 설정될 부서리스트 조회
  22. reqGetDeptList("/root/send/reqdata", "/root/init/deptlist", "", getUserInfo("dutplceinstcd"));
  23. //콤보박스에 설정된 병실리스트 조회
  24. reqGetRoomList("0000030107");
  25. //Therapy일정리스트 그리드 초기화
  26. model.removeNodeset(sTHERPLIST_PATH);
  27. model.refresh();
  28. }
  29. /**
  30. * @desc : Therapy 일정리스트 한줄 추가
  31. * @
  32. * @param :
  33. * @return :
  34. * @author : 오지훈
  35. * @---------------------------------------------------
  36. */
  37. function fAddRow(){
  38. //그리드 한줄 추가 후에 refresh, disabled상태 유지 모두 true
  39. grd_therapy.addRow();
  40. var iRow = grd_therapy.row;
  41. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/genrdd", model.getValue("/root/init/today"));
  42. //예약일자는 기본을 현재일자로 설정
  43. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/rsrvdd", model.getValue("/root/init/today"));
  44. grd_therapy.col = 4;
  45. grd_therapy.editCell();
  46. model.refresh();
  47. }
  48. /**
  49. * @desc : Therapy 일정 저장
  50. * @
  51. * @param :
  52. * @return :
  53. * @author : 오지훈
  54. * @---------------------------------------------------
  55. */
  56. function fSaveTherapyInfo(){
  57. if(fChkValidSaveData()==true){
  58. model.setValue("/root/send/savedata", grd_therapy.getUpdateData());
  59. submit("TXMMO10901");
  60. }
  61. }
  62. /**
  63. * @desc : Therapy 일정 조회
  64. * @
  65. * @param :
  66. * @return :
  67. * @author : 오지훈
  68. * @---------------------------------------------------
  69. */
  70. function fReqTherapyInfo(){
  71. model.copyNode("/root/send/reqdata", "/root/main/cond");
  72. submit("TRMMO10901");
  73. }
  74. /**
  75. * @desc : Therapy 일정 삭제
  76. * @
  77. * @param :
  78. * @return :
  79. * @author : 오지훈
  80. * @---------------------------------------------------
  81. */
  82. function fDelRow(){
  83. var iRow = grd_therapy.row;
  84. var iStatus = grd_therapy.rowStatus(iRow);
  85. if(iStatus == 1 || iStatus == 3){
  86. grd_therapy.deleteRow(iRow);
  87. }else{
  88. grd_therapy.rowStatus(iRow) = 4;
  89. }
  90. }
  91. /**
  92. * @desc : 환자정보 확인버튼 클릭
  93. * @
  94. * @param :
  95. * @return :
  96. * @author : 오지훈
  97. * @---------------------------------------------------
  98. */
  99. function fClkCfrmBtn(){
  100. var iRow = grd_patinfopopup.row;
  101. fSetPatInfo(iRow);
  102. group1.attribute("height") = 0;
  103. btn_add.disabled = false;
  104. btn_del.disabled = false;
  105. btn_save.disabled= false;
  106. btn_req.disabled = false;
  107. btn_getpatinfo.disabled = false;
  108. }
  109. /**
  110. * @desc : 환자정보 조회
  111. * @
  112. * @param :
  113. * @return :
  114. * @author : 오지훈
  115. * @---------------------------------------------------
  116. */
  117. function fReqPatInfo(paramflag, param, param2){
  118. var iRow = grd_therapy.row;
  119. if(reqPatInfo(paramflag, "otpt", param, param2) == true){ //환자정보 조회
  120. var iCnt = getNodeSetCnt("/root/init/patnm/patnm");
  121. if(iCnt > 1){ //조회결과가 두 줄 이상인 경우, grid를 화면에 보여준다.
  122. group1.attribute("top") = 116 + (23 * (grd_therapy.rows - 2));
  123. group1.attribute("height") = 170;
  124. btn_add.disabled = true;
  125. btn_del.disabled = true;
  126. btn_save.disabled= true;
  127. btn_req.disabled = true;
  128. btn_getpatinfo.disabled = true;
  129. }else{
  130. fSetPatInfo(1); //조회결과가 한 줄인 경우, grid를 보여주는 것 없이 바로 결과값을 setting
  131. }
  132. }else{
  133. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/pid" , "");
  134. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/hngnm", "");
  135. model.refresh();
  136. }
  137. }
  138. /**
  139. * @desc : 환자정보 설정
  140. * @
  141. * @param :
  142. * @return :
  143. * @author : 오지훈
  144. * @---------------------------------------------------
  145. */
  146. function fSetPatInfo(iRow){
  147. sPid = model.getValue("/root/init/patnm/patnm[" + iRow + "]/pid");
  148. sHngNM = model.getValue("/root/init/patnm/patnm[" + iRow + "]/hngnm");
  149. sDeptCD = model.getValue("/root/init/patnm/patnm[" + iRow + "]/deptcd");
  150. sDrID = model.getValue("/root/init/patnm/patnm[" + iRow + "]/drid");
  151. sDrNM = model.getValue("/root/init/patnm/patnm[" + iRow + "]/drnm");
  152. var iCurRow = grd_therapy.row;
  153. model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/pid", sPid);
  154. model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/hngnm", sHngNM);
  155. model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/orddeptcd", sDeptCD);
  156. model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/orddrid", sDrID);
  157. model.setValue("/root/main/therpinfo/therplist[" + iCurRow + "]/orddrnm", sDrNM);
  158. model.refresh();
  159. }
  160. /**
  161. * @desc : 환자정보 취소버튼 클릭
  162. * @
  163. * @param :
  164. * @return :
  165. * @author : 오지훈
  166. * @---------------------------------------------------
  167. */
  168. function fClkCnClBtn(){
  169. group1.attribute("height") = 0;
  170. btn_add.disabled = false;
  171. btn_del.disabled = false;
  172. btn_save.disabled= false;
  173. btn_req.disabled = false;
  174. btn_getpatinfo.disabled = false;
  175. }
  176. /**
  177. * @desc : 그리드 input button클릭
  178. * @
  179. * @param :
  180. * @return :
  181. * @author : 오지훈
  182. * @---------------------------------------------------
  183. */
  184. function fClkGrdInptBtn(){
  185. //model.setValue("/root/hidden/srchcond", "2");
  186. modal("SPPMC02500", "1", 100, 100, "SPPMC02500", "/root/hidden", "/root/send");
  187. var sPid = model.getValue("/root/main/patinfo/patinfolist/pid");
  188. var sHngnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
  189. if(model.getValue("/root/main/popupendflag") != "cancel"){
  190. var iRow = grd_therapy.row;
  191. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/pid" , sPid);
  192. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/hngnm", sHngnm);
  193. }
  194. }
  195. /**
  196. * @desc : 그리드 input button클릭
  197. * @
  198. * @param :
  199. * @return :
  200. * @author : 오지훈
  201. * @---------------------------------------------------
  202. */
  203. function fClkGrdInptBtn(){
  204. model.setValue("/root/hidden/srchcond", "2");
  205. modal("SPPMC02500", "1", 100, 100, "SPPMC02500", "/root/hidden", "/root/send");
  206. var sPid = model.getValue("/root/main/patinfo/patinfolist/pid");
  207. var sHngnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
  208. if(model.getValue("/root/main/popupendflag") != "cancel"){
  209. var iRow = grd_therapy.row;
  210. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/pid" , sPid);
  211. model.setValue(sTHERPLIST_PATH + "[" + iRow + "]/hngnm", sHngnm);
  212. }
  213. }
  214. /**
  215. * @desc : 저장데이터의 무결성검사
  216. * @
  217. * @param :
  218. * @return :
  219. * @author : 오지훈
  220. * @---------------------------------------------------
  221. */
  222. function fChkValidSaveData(){
  223. if(grd_therapy.rows < 2){
  224. messageBox("저장할 내역이", "I004");
  225. return;
  226. }
  227. var sDoseVal = model.getValue(sTHERPLIST_PATH + "[doseval='" + "" + "']/rsrvdd");
  228. var sRoomCD = model.getValue(sTHERPLIST_PATH + "[roomcd='" + "" + "']/rsrvdd");
  229. var sPid = model.getValue(sTHERPLIST_PATH + "[pid='" + "" + "']/rsrvdd");
  230. var sHngNM = model.getValue(sTHERPLIST_PATH + "[hngnm='" + "" + "']/rsrvdd");
  231. var sDeptCD = model.getValue(sTHERPLIST_PATH + "[orddeptcd='" + "" + "']/rsrvdd");
  232. if(sDoseVal != ""){
  233. messageBox("Dose 값을", "C001");
  234. return false;
  235. }else if(sRoomCD != ""){
  236. messageBox("병실을 ", "C002");
  237. return false;
  238. }else if(sPid != ""){
  239. messageBox("등록번호를 ", "C001");
  240. return false;
  241. }else if(sHngNM != ""){
  242. messageBox("환자명를 ", "C001");
  243. return false;
  244. }else if(sDeptCD != ""){
  245. messageBox("부서를 ", "C001");
  246. return false;
  247. }else{
  248. return true;
  249. }
  250. }