SMMNR03800.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. /*
  2. 투약반환예정조회(SMMNR03800.xrw - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. var xCondPath = "/root/main/cond";
  7. var xWardPatListPath = "/root/main/wardpatinfo/wardpatlist";
  8. var xPatInfoPath = "/root/main/paminfo/pamlist";
  9. /**
  10. * @group :
  11. * @ver : 2007.09.12
  12. * @by :
  13. * @---------------------------------------------------
  14. * @type : function
  15. * @access : public
  16. * @desc : 초기화
  17. * @param :
  18. * @param :
  19. * @return :
  20. * @---------------------------------------------------
  21. */
  22. function fInitialize(){
  23. //처방내역 초기화
  24. model.removenodeset("/root/main/warddrugrtninfo/warddrugrtnlist");
  25. //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)(20080510)
  26. var tempdate = getCurrentDate();
  27. model.setValue("/root/main/cond/dtto", tempdate);
  28. //----------(20080910)----------(20091020)
  29. //model.setValue("/root/main/cond/dtto", tempdate);
  30. var date = getCurrentDate().toDate().getAddDate(-1,"M").getDateFormat("YYYYMMDD");
  31. model.setValue("/root/main/cond/dtfr", date);
  32. //----------(20080910)----------(20091020)
  33. model.setValue(xCondPath+"/execprcphistcd", "%");
  34. model.setValue(xCondPath+"/wardcd", getUserInfo("dutplcecd"));
  35. model.copynode("/root/send/reqdata", xCondPath);
  36. // 환자정보 조회
  37. var sPamInfo = getGlobalVariable("paminfo");
  38. setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist");
  39. var sPID = model.getValue(xPatInfoPath + "/pid");
  40. var sWardCd = model.getValue(xPatInfoPath+"/wardcd");
  41. //-----------------(20080416)
  42. // 병실설정하기
  43. var sRoomCd = model.getValue(xPatInfoPath+"/roomcd");
  44. if(sPID == ""){
  45. model.setValue(xCondPath + "/wardcd", getUserInfo("dutplcecd"));
  46. }else{
  47. model.setValue(xCondPath + "/pid", sPID);
  48. model.setValue(xCondPath + "/wardcd", sWardCd);
  49. model.setValue(xCondPath + "/roomcd", sRoomCd); //조회조건에 반영하고
  50. }
  51. submit("TRMNR00601");
  52. fGetRoomList();
  53. if(sPID == ""){
  54. }else{
  55. model.setValue(xCondPath + "/roomcd", sRoomCd); //콤보에 재반영한다.
  56. }
  57. //-----------------(20080416)
  58. fGetPatList();
  59. //-----------------------------(20080906)
  60. fSetsettingrnid();
  61. //-----------------------------(20080906)
  62. if(sPID != ""){
  63. for(var i = 1; i <= getNodesetCount(xWardPatListPath); i++){
  64. if(model.getValue(xWardPatListPath + "[" + i + "]/pid") == sPID){
  65. model.setFocus("grd_patlist");
  66. grd_patlist.row = i;
  67. grd_patlist.dispatch("onentercell");
  68. fClickDrugList(i);
  69. }
  70. }
  71. }
  72. model.refresh();
  73. }
  74. /**
  75. * @group :
  76. * @ver : 2008.09.06
  77. * @by :
  78. * @---------------------------------------------------
  79. * @type : function
  80. * @access : public
  81. * @desc : 내환자가 설정되어 있으면 자동으로 내환자설정시키기(성공)
  82. * @param :
  83. * @param :
  84. * @return :
  85. * @---------------------------------------------------
  86. */
  87. function fSetsettingrnid(){
  88. var sUserId = getUserId();
  89. var sUserIdFind = ""
  90. for(i = 1; i <= getNodesetCount("/root/main/wardpatinfo/settingrn"); i++ ) {
  91. sUserIdFind = model.getValue("/root/main/wardpatinfo/settingrn["+ i +"]/settingrnid");
  92. if (sUserId == sUserIdFind) {
  93. model.setValue("/root/main/cond/settingrnid", sUserIdFind);
  94. model.refresh();
  95. fGetPatList();
  96. return;
  97. }
  98. }
  99. }
  100. /**
  101. * @group :
  102. * @ver : 2007.09.12
  103. * @by :
  104. * @---------------------------------------------------
  105. * @type : function
  106. * @access : public
  107. * @desc : 투약기록 병동별 병실 리스트 조회
  108. * @param :
  109. * @param :
  110. * @return :
  111. * @---------------------------------------------------
  112. */
  113. function fGetRoomList(){
  114. model.setValue(xCondPath+"/roomcd", "");
  115. model.resetInstanceNode("/root/send/reqdata");
  116. model.copynode("/root/send/reqdata", xCondPath);
  117. submit("TRMNR00602");
  118. }
  119. /**
  120. * @group :
  121. * @ver : 2007.09.12
  122. * @by :
  123. * @---------------------------------------------------
  124. * @type : function
  125. * @access : public
  126. * @desc : 투약기록 환자 리스트 조회
  127. * @param :
  128. * @param :
  129. * @return :
  130. * @---------------------------------------------------
  131. */
  132. function fGetPatList(){
  133. model.removenodeset("/root/main/wardpatinfo/wardpatlist");
  134. model.resetInstanceNode("/root/send/reqdata");
  135. model.copynode("/root/send/reqdata", xCondPath);
  136. submit("TRMNR00603");
  137. }
  138. /**
  139. * @group :
  140. * @ver : 2007.09.12
  141. * @by :
  142. * @---------------------------------------------------
  143. * @type : function
  144. * @access : public
  145. * @desc : 투약기록 환자별 투약 기록 리스트 조회
  146. * @param :
  147. * @param :
  148. * @return :
  149. * @---------------------------------------------------
  150. */
  151. function fClickDrugList(row){
  152. if(row > 0){
  153. model.makeValue("/root/send/reqdata/pid", model.getValue(xWardPatListPath+"["+row+"]/pid"));
  154. model.makeValue("/root/send/reqdata/indd", model.getValue(xWardPatListPath+"["+row+"]/indd"));
  155. model.makeValue("/root/send/reqdata/cretno", model.getValue(xWardPatListPath+"["+row+"]/cretno"));
  156. model.makeValue("/root/send/reqdata/execprcphistcd",model.getValue(xCondPath+"/execprcphistcd"));
  157. //-------------(20080510)
  158. //일자구분
  159. model.makeValue("/root/send/reqdata/dtflag", model.getValue(xCondPath+"/dtflag"));
  160. model.makeValue("/root/send/reqdata/dtfr", model.getValue(xCondPath+"/dtfr"));
  161. model.makeValue("/root/send/reqdata/dtto", model.getValue(xCondPath+"/dtto"));
  162. submit("TRMNR03801");
  163. } else {
  164. messageBox("환자를 선택하십시오.","E999");
  165. }
  166. }
  167. /**
  168. * @group :
  169. * @ver : 2007.09.12
  170. * @by :
  171. * @---------------------------------------------------
  172. * @type : function
  173. * @access : public
  174. * @desc : 등록번호 조회시 환자리스트에서 검색
  175. * @param :
  176. * @param :
  177. * @return :
  178. * @---------------------------------------------------
  179. */
  180. function fPid_Search(){
  181. model.setFocus("grd_patlist");
  182. //var sPID = model.getValue(xCondPath + "/pid");
  183. var sPID = model.getValue("root/main/pidinfo/pidlist/pid");
  184. var seq = 0;
  185. for(var i = 1; i <= getNodesetCount(xWardPatListPath); i++){
  186. if(model.getValue(xWardPatListPath + "[" + i + "]/pid") == sPID){
  187. seq = i;
  188. }
  189. }
  190. //alert(seq);
  191. if(seq > 0){
  192. grd_patlist.row = seq;
  193. grd_patlist.dispatch("onentercell");
  194. fClickDrugList(seq);
  195. }else{
  196. grd_patlist.row = 0;
  197. grd_patlist.dispatch("onentercell");
  198. model.removenodeset("/root/main/warddrugrtninfo/warddrugrtnlist");
  199. }
  200. }
  201. /**
  202. * @group :
  203. * @ver : 2008.05.10
  204. * @by :
  205. * @---------------------------------------------------
  206. * @type : function
  207. * @access : public
  208. * @desc : 환자리스트에 대한 처방 내역 조회
  209. * @param :
  210. * @param :
  211. * @return :
  212. * @---------------------------------------------------
  213. */
  214. function fnSubQuery() {
  215. var sPath1 = "/root/main/cond/patinfo/patlist";
  216. var sPath2 = "/root/main/wardpatinfo/wardpatlist";
  217. var pGrd = grd_patlist
  218. if (pGrd.row < 1) return ;
  219. var mouserow = pGrd.row;
  220. var patcnt = getNodesetCount(xWardPatListPath);
  221. //model.setValue("/root/main/cond/pid", model.getValue("/root/main/wardpatinfo/wardpatlist[" + mouserow + "]/pid"));
  222. //model.setValue(sPath1 + "/pid", model.getValue(sPath2 + "[" + mouserow + "]/pid"));
  223. if(mouserow > 0 && mouserow <= patcnt){
  224. fClickDrugList(mouserow);
  225. }
  226. }
  227. /* --------------------------------------------------*/
  228. /* type : function */
  229. /* access : public */
  230. /* desc : 환자정보 가져오기 */
  231. /* param : 검색구분 */
  232. /* return : */
  233. /* --------------------------------------------------*/
  234. function fSearchPatInfo(qryflag) {
  235. var sPath1 = "/root/main/pidinfo/pidlist"; //화면상 연결
  236. var sPath2 = "/root/main/patinfo/patinfolist"; //팝업의리턴 정보
  237. model.removenodeset("/root/temp/");
  238. model.makeValue("/root/temp/pid", model.getValue("/root/main/pidinfo/pidlist/pid"));
  239. model.makeValue("/root/temp/srchcond","1");
  240. model.makeValue("/root/temp/autoflag","Y");
  241. //modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send");
  242. //modal("../../../pam/commonweb/xrw/SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/source", "/root/send");
  243. modal("SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/temp", "/root/send");
  244. //환자번호 copy
  245. var popupendflag = model.getValue("/root/main/popupendflag");
  246. if (popupendflag == "ok"){
  247. model.setValue(sPath1 + "/pid" , model.getValue(sPath2 + "/pid") );
  248. model.setValue(sPath1 + "/hngnm", model.getValue(sPath2 + "/hngnm") );
  249. model.refresh();
  250. }
  251. }
  252. /* --------------------------------------------------*/
  253. /* type : function */
  254. /* access : public */
  255. /* desc : 환자에 대한 투약반환예정조회 */
  256. /* param : 검색구분 */
  257. /* return : */
  258. /* --------------------------------------------------*/
  259. function fClickPat() {
  260. var sPathpidlist = "/root/main/pidinfo/pidlist";
  261. var sPathwardpatlist= "/root/main/wardpatinfo/wardpatlist";
  262. var pGrd = grd_patlist;
  263. var row = pGrd.Row;
  264. if (pGrd.rows <= 1 || pGrd.row < 1 ) return;
  265. var patcnt = getNodesetCount(xWardPatListPath);
  266. model.setValue(sPathpidlist + "/pid", model.getValue(sPathwardpatlist + "[" + row + "]/pid"));
  267. model.setValue(sPathpidlist + "/hngnm", model.getValue(sPathwardpatlist + "[" + row + "]/patnm"));
  268. model.setValue("/root/main/cond/pid", model.getValue(sPathwardpatlist + "[" + row + "]/pid"));
  269. fClickDrugList(row);
  270. }
  271. function fClickPat_OLD() {
  272. var sPathpidlist = "/root/main/pidinfo/pidlist";
  273. var sPathwardpatlist= "/root/main/wardpatinfo/wardpatlist";
  274. var pGrd = grd_patlist;
  275. var mouserow = pGrd.mouseRow;
  276. var patcnt = getNodesetCount(xWardPatListPath);
  277. model.setValue(sPathpidlist + "/pid", model.getValue(sPathwardpatlist + "[" + mouserow + "]/pid"));
  278. model.setValue(sPathpidlist + "/hngnm", model.getValue(sPathwardpatlist + "[" + mouserow + "]/patnm"));
  279. model.setValue("/root/main/cond/pid", model.getValue(sPathwardpatlist + "[" + mouserow + "]/pid"));
  280. if(mouserow > 0 && mouserow <= patcnt){
  281. fClickDrugList(mouserow);
  282. }
  283. }