SMRSD07200.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /* ---------------------------------------------------------------------
  2. SMRSD07200_진단검사과 처방집계 출력(경북대).xrw (SMRSD07200.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. : Create By Chungpd.
  6. : 2010.12.08
  7. ---------------------------------------------------------------------- */
  8. var vProgramCls = "SMRSD07100";
  9. //
  10. var vGoodReqPath = "/root/main/list/goodreq/goodreqlist";
  11. var xAuth = !(checkAuth("X"));
  12. var pAuth = !(checkAuth("P"));
  13. var DataPath = "/root/main/RscmggbnEmpData";
  14. var MainPath = "/root/main/RscmggbnLists/rscmggbnlist";
  15. var ListsPath = "/root/main/RscmggbnEmpLists";
  16. var ListPath = "/root/main/RscmggbnEmpLists/rscmggbnemplist";
  17. var HidePath = "/root/WorkData/HideData";
  18. var TreePath = "/root/main/RscmgubnLists/TreeList";
  19. var WorkPath = "/root/init/WorkInit";
  20. var CompPath = "/root/init/CompareInit";
  21. var TreeSendPath = "/root/send/SearchTree";
  22. // --------------------------------------------------
  23. // Tree정보 가져오기
  24. // --------------------------------------------------
  25. function fInit() {
  26. // 화면 Control을 초기화한다
  27. fInitialize();
  28. return;
  29. }
  30. // --------------------------------------------------------------
  31. // 화면 open시와 초기화 버튼 클릭시 화면 초기화 기능을 수행한다.
  32. // --------------------------------------------------------------
  33. function fInitialize() {
  34. model.setValue(opt_instcd.attribute("ref") , getUserInfo("dutplceinstcd")); // 기관코드
  35. model.setValue(opt_instcdnm.attribute("ref") , getUserInfo("dutplceinstnm")); // 기관코드명
  36. // model.setValue(ipt_prcpdeptcd.attribute("ref"), getUserInfo("dutplcecd")); // 시행부서
  37. // model.setValue(ipt_prcpdeptnm.attribute("ref"), getUserInfo("dutplcenm")); // 시행부서명
  38. var curdate = getCurrentDate();
  39. var cvtdate = curdate.toDate("YYYYMMDD");
  40. model.setValue(ipt_prcpdd.attribute("ref") , curdate);
  41. model.setValue(ipt_prcpdd2.attribute("ref"), curdate);
  42. model.setValue(rdo_sumflag.attribute("ref") , "Y");
  43. //model.setValue(rdo_ioflag.attribute("ref") , "");
  44. //model.setValue(rdo_prntmthd.attribute("ref") , "G");
  45. model.removeNodeset("/root/main/list/prcpgoodcase/prcpgoodcaselist");
  46. model.removeNodeset("/root/main/list/prcppatcase/prcppatcaselist");
  47. //ipt_prcpdd.dispatch("xforms-value-changed");
  48. model.refresh();
  49. }
  50. function fDataSearchTree() {
  51. // if (fCheckRetrieveData(false) == false) return;
  52. submit("TRRSD07103");
  53. trv_setcode.rebuild();
  54. }
  55. // 처방전달물품내역조회
  56. function fDataSearchDetail(pIdx)
  57. {
  58. var rPath = "/root/send/SearchTree";
  59. var dPath = "/root/send/prcppatcaseinfo";
  60. var tPath = "/root/main/PrcpGoodTrees/TreeList";
  61. var vCaption = " 처방전달물품";
  62. // if (fCheckRetrieveData(false) == false)return; // 입력항목 Check
  63. var Idx = pIdx + 1;
  64. var sDepth = model.getValue(tPath +"["+Idx+"]/depth" );
  65. var vCodeCd = model.getValue(tPath +"["+Idx+"]/codecd" );
  66. var vCodeNm = model.getValue(tPath +"["+Idx+"]/codenm" );
  67. var vBaseCd = model.getValue(tPath +"["+Idx+"]/basecode");
  68. var Tree2 = trv_setcode.item(pIdx);
  69. //var ioflag = model.getValue(rdo_ioflag.attribute("ref"));
  70. //cpt_disp.value = "";
  71. //cpt_disp.refresh();
  72. if (vCodeCd == "") return;
  73. model.setValue(dPath + "/instcd" , model.getValue(rPath + "/instcd" )); // 01 기관코드
  74. model.setValue(dPath + "/prcpdd" , model.getValue(rPath + "/prcpdd" )); // 02 처방일자
  75. model.setValue(dPath + "/prcpdd2" , model.getValue(rPath + "/prcpdd2" )); // 02 처방일자
  76. model.setValue(dPath + "/sumflag" , model.getValue(rPath + "/sumflag" )); // 04 집계여부
  77. model.setValue(dPath + "/reqflag" , model.getValue(rPath + "/reqflag" )); // 05 청구구분
  78. model.setValue(dPath + "/reqdeptcd" , "" ); // 06 처방부서
  79. model.setValue(dPath + "/reqprid" , model.getValue(rPath + "/reqprid" )); // 07 청구주기
  80. model.setValue(dPath + "/prcpdeptcd" , "" ); // 08 시행부서
  81. model.setValue(dPath + "/goodcd" , model.getValue(rPath + "/goodcd" )); // 09 물품코드
  82. //model.setValue(dPath + "/ioflag" , model.getValue(rPath + "/ioflag" )); // 10 입외구분
  83. model.setValue(dPath + "/deptgr" , "" ); // 11 부서그룹
  84. model.setValue(dPath + "/pid" , model.getValue(rPath + "/pid" )); // 12 환자번호
  85. model.setValue(dPath + "/patnm" , model.getValue(rPath + "/patnm" )); // 13 환자명
  86. model.setValue(dPath + "/purcflag" , model.getValue(rPath + "/purcflag" )); // 14 구매구분
  87. model.setValue(dPath + "/prodcmpynm" , model.getValue(rPath + "/prodcmpynm" )); // 15 제조회사명
  88. model.setValue(dPath + "/suplplcecdnm", model.getValue(rPath + "/suplplcecdnm" )); // 16 주거래처명
  89. model.setValue(dPath + "/suppcustnm" , model.getValue(rPath + "/suppcustnm" )); // 17 보조거래처명
  90. model.setValue(dPath + "/prntmthd" , 'G' ); // 18 출력형식
  91. model.setValue(dPath + "/sumcnt" , model.getValue(rPath + "/sumcnt" )); // 19 집계횟수
  92. // 선불출 조회조건 추가 이창록
  93. model.makeValue(dPath + "/querycls" , model.getValue("/root/send/SearchTree/querycls")); // 19 라디오박스 선불출코드
  94. // 물류창고 조회조건 추가
  95. model.setValue(dPath + "/wareflag" , model.getValue(rPath + "/wareflag" )); // 창고구분(물류창고)
  96. model.setValue(dPath + "/scrnid" , "SMRSD07200" ); // 창고구분(물류창고)
  97. var vCls = parseInt(rdo_viewcls.value+sDepth);
  98. switch(vCls) {
  99. case 01 : vCaption = " :: 전체" ;
  100. break;
  101. case 02 :
  102. model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
  103. vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
  104. // grd_goodreq.colwidth(3) = "74";
  105. break;
  106. case 11 : model.setValue(dPath + "/reqdeptcd" , vCodeCd);
  107. vCaption = "처방부서 : "+ vCodeCd + " - " + vCodeNm;
  108. // grd_goodreq.colwidth(3) = "74";
  109. break;
  110. case 12 : model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
  111. vCode = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codecd" );
  112. vName = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codenm" );
  113. model.setValue(dPath + "/reqdeptcd" , vCode );
  114. vCaption = "처방부서 : "+vCode + " - " + vName + " >> 시행부서 : "+vCodeCd+ " - "+vCodeNm;
  115. // grd_goodreq.colwidth(3) = "0";
  116. break;
  117. case 21 : model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
  118. vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
  119. // grd_goodreq.colwidth(3) = "74";
  120. break;
  121. case 22 : model.setValue(dPath + "/reqdeptcd" , vCodeCd);
  122. vCode = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codecd" );
  123. vName = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codenm" );
  124. model.setValue(dPath + "/prcpdeptcd" , vCode );
  125. vCaption = "시행부서 : "+vCode + " - " + vName + " >> 처방부서 : "+vCodeCd+ " - "+vCodeNm ;
  126. break;
  127. case 31 : model.setValue(dPath + "/prcpdeptcd" , vCodeCd );
  128. vCaption = "시행부서 : "+vCodeCd + " - " + vCodeNm;
  129. // grd_goodreq.colwidth(3) = "74";
  130. break;
  131. case 32 : model.setValue(dPath + "/goodcd" , vCodeCd);
  132. vCode = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codecd" );
  133. vName = model.getValue(tPath +"["+(Tree2.parentindex + 1)+"]/codenm" );
  134. model.setValue(dPath + "/prcpdeptcd" , vCode );
  135. vCaption = "시행부서 : "+vCode + " - " + vName + " >> 물품코드 : "+vCodeCd+ " - "+vCodeNm ;
  136. }
  137. //
  138. ////cpt_disp.value = vCaption; // + " 처방전달물품";
  139. if (model.getValue(dPath + "/prntmthd") == "P"){
  140. submit("TRRSD07101"); //환자별 집계내역
  141. }else{
  142. submit("TRRSD07102"); //물품별 집계내역
  143. }
  144. //fGrdiDataValid();
  145. ////cpt_disp.refresh();
  146. }
  147. // 조회 결과 Count Setting
  148. function fAfterRetrieve() {
  149. // case 1 count
  150. model.setValue(opt_goodreqcnt.attribute("ref"),(grd_goodreq.rows-grd_goodreq.fixedRows));
  151. model.refresh();
  152. }
  153. /***********************************************************
  154. * 물품 처방 집계에서 사용한 Script
  155. ************************************************************/
  156. // 부서코드 읽어오기...
  157. function fDeptValidationCheck(pData1, pData2, pCodeName) {
  158. if (pData1.value.length == 0) {
  159. pData2.value = "";
  160. } else {
  161. rszfValidationCheck("TRRPZ00201", "deptcodelist", "refcond,deptnm","deptnm," + pData1.value,"", pCodeName, pData1, "SPRPZ00200", "","");
  162. }
  163. model.refresh();
  164. }
  165. /* ------------------------------------------------- */
  166. /* ------End Of List ------------------------------- */
  167. /* -------------------------------------------------- */