SMMNI00900.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. /*
  2. 주사실통계(SMMNI00900.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. //20090717 dhkim 사용자부서정보 dddd
  7. var userdeptcd = getUserInfo("dutplcecd");
  8. //20090717 dhkim 주사실코드
  9. var injdeptcd;
  10. /**
  11. * 20090415 dhkim
  12. * 실시시행부서조회
  13. */
  14. function fPrcpExecDeptSrch(flag) {
  15. var prcpcd = model.getValue ( "/root/main/prcp/prcplist/prcpcd" );
  16. var prcpdd = opener.model.getValue ( "/root/init/prcpdd" );
  17. if ( isNull(prcpdd)) {
  18. prcpdd = model.getValue ( "/root/init/prcpdd" );
  19. if (isNull(prcpdd)) {
  20. prcpdd = getCurrentDate();
  21. }
  22. }
  23. model.makeValue("/root/send/cond1" , prcpcd);
  24. model.makeValue("/root/send/cond2" , prcpdd);
  25. model.makeValue("/root/send/cond3" , flag);
  26. if(submit("TRMNI00903")){
  27. return true;
  28. }else{
  29. return false;
  30. }
  31. }
  32. /*
  33. //SMY
  34. function testPopup() {
  35. htmlwindow.open("http://dev999.cmcnu.or.kr:9081/himed/webapps/emr/injroomweb/jsp/web_ocs.jsp", "testPop", "width='600', heigth='500'");
  36. }
  37. */
  38. /**
  39. * @group :
  40. * @ver : 2009.04.13
  41. * @by : 김달현
  42. * @---------------------------------------------------
  43. * @type : function
  44. * @access : public
  45. * @desc : 화면초기화
  46. * @param :
  47. * @return :
  48. * @---------------------------------------------------
  49. */
  50. function fInit(){
  51. // 간호하드코딩 테이블 조회_20090702_SMY
  52. var pCode = "'077'"; // 조회할 CdGrupID 코드정보
  53. var pDate = getCurrentDate(); //조회기준일자
  54. fGetNursHardCdInfo(pCode, pDate);
  55. //전체병원 버튼조회_20090727_SMY
  56. //성가일 경우만 예방접종등록 버튼 활성화
  57. if(model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '03' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid")){ //supcdid='03' : 부천성가병원
  58. btn_test.visible = true;
  59. }
  60. //부서코드로드
  61. fPrcpExecDeptSrch();
  62. //20090717 dhkim 주사실코드 가져오기
  63. if(!submit("TRMNI00504")){
  64. messageBox("주사실코드조회를", "E009");
  65. return false;
  66. }
  67. injdeptcd = model.getValue("/root/hidden/injcdinfo/injdeptcd");
  68. //20090717 dhkim
  69. //로그인사용자부서가 주사실이 아닌경우 default시행부서조회로 세팅
  70. var srchflag;
  71. if(injdeptcd == userdeptcd){
  72. srchflag = 'I';
  73. }else{
  74. srchflag = 'D';
  75. }
  76. //model.setValue("/root/main/cond/srchflag", "I");//조회구분(디폴트:주사실)
  77. model.setValue("/root/main/cond/srchflag", srchflag);//조회구분(로그인한 부서에 따라 변경)
  78. model.setValue("/root/main/cond/fromdd", getCurrentDate());//기준일에 현재날짜(디폴트);
  79. model.setValue("/root/main/cond/todd", getCurrentDate());//기준일에 현재날짜(디폴트);
  80. model.setValue("/root/main/cond/execdeptcd", getUserInfo('dutplcecd'));//시행부서코드
  81. model.removeNodeset("/root/main/prcpdetl/prcpdetllist");
  82. model.refresh();
  83. }
  84. /**
  85. * @group :
  86. * @ver : 2007.08.14
  87. * @by : 신혁춘
  88. * @---------------------------------------------------
  89. * @type : function
  90. * @access : public
  91. * @desc : 통계건수 조회
  92. * @param :
  93. * @return :
  94. * @---------------------------------------------------
  95. */
  96. function fstatsdata(){
  97. var fromdd = model.getValue("/root/main/cond/fromdd");
  98. var todd = model.getValue("/root/main/cond/todd");
  99. var srchflag = model.getValue("/root/main/cond/srchflag");
  100. var execdeptcd = model.getValue("/root/main/cond/execdeptcd");
  101. //널값처리
  102. if(fromdd == null || fromdd == ''){
  103. fromdd = getCurrentDate();
  104. }
  105. if(todd == null || todd == ''){
  106. todd = getCurrentDate();
  107. }
  108. if(srchflag == null || srchflag == ''){
  109. srchflag = "I";//주사실
  110. }
  111. //주사실일때에 시행부서값 없애기
  112. if(srchflag != "D"){
  113. execdeptcd = '-';
  114. }
  115. //조회조건 화면세팅
  116. model.setValue("/root/main/cond/fromdd", fromdd);
  117. model.setValue("/root/main/cond/todd", todd);
  118. model.setValue("/root/main/cond/srchflag", srchflag);
  119. model.setValue("/root/main/cond/execdeptcd", execdeptcd);
  120. //파라미터세팅
  121. model.removeNodeset("/root/send");
  122. model.makeValue("/root/send/fromdd", fromdd);
  123. model.makeValue("/root/send/todd", todd);
  124. model.makeValue("/root/send/srchflag", srchflag);
  125. model.makeValue("/root/send/execdeptcd", execdeptcd);
  126. model.refresh();
  127. if(submit("TRMNI00901")){
  128. model.removeNodeset("/root/main/prcpdetl/prcpdetllist");
  129. model.refresh();
  130. }
  131. grd_deptcntlist.subtotalposition = "below";
  132. grd_deptcntlist.subtotal("sum", -1, grd_deptcntlist.colRef("cnt"), "#,###", "background-color:#99ff99", grd_deptcntlist.colRef("deptnm"), "합계");
  133. }
  134. /**
  135. * @group :
  136. * @ver : 2008.01.05
  137. * @by : 신혁춘
  138. * @---------------------------------------------------
  139. * @type : function
  140. * @access : public
  141. * @desc : 건수별 내용 검색
  142. * @param :
  143. * @return :
  144. * @---------------------------------------------------
  145. */
  146. function fStats(flag){
  147. var fromdd = model.getValue("/root/main/cond/fromdd");
  148. var todd = model.getValue("/root/main/cond/todd");
  149. var srchflag = model.getValue("/root/main/cond/srchflag");
  150. var execdeptcd = model.getValue("/root/main/cond/execdeptcd");
  151. //널값처리
  152. if(fromdd == null || fromdd == ''){
  153. fromdd = getCurrentDate();
  154. }
  155. if(todd == null || todd == ''){
  156. todd = getCurrentDate();
  157. }
  158. if(srchflag == null || srchflag == ''){
  159. srchflag = "I";//주사실
  160. }
  161. //주사실일때에 시행부서값 없애기
  162. if(srchflag != "D"){
  163. execdeptcd = '-';
  164. }
  165. //조회조건 화면세팅
  166. model.setValue("/root/main/cond/fromdd", fromdd);
  167. model.setValue("/root/main/cond/todd", todd);
  168. model.setValue("/root/main/cond/srchflag", srchflag);
  169. model.setValue("/root/main/cond/execdeptcd", execdeptcd);
  170. //파라미터세팅
  171. model.removeNodeset("/root/send");
  172. model.makeValue("/root/send/todd", model.getValue("/root/main/cond/todd"));
  173. model.makeValue("/root/send/fromdd", model.getValue("/root/main/cond/fromdd"));
  174. model.makeValue("/root/send/flag", flag);
  175. model.makeValue("/root/send/srchflag", srchflag);
  176. model.makeValue("/root/send/execdeptcd", execdeptcd);
  177. if(!submit("TRMNI00902")){
  178. messageBox('건수별내역조회를', 'E009');
  179. return;
  180. }else{
  181. //20090603 dhkim
  182. //엑셀저장시 파일이름 변경을 위해 op_xlsnm에 파일이름을 임시저장함
  183. //파일이름 : 사용자부서 + (처방종류) + 조회구간
  184. //예) 주사실사용자의 경우 예방조회 -> 주사실(예방)통계(20090101~20090102).xls
  185. // bmt주사실사용자의경우 총건수 조회시 -> bmt주사실통계(20090101~20090102).xls
  186. var xlsnm = '주사실';
  187. if(srchflag == 'D'){
  188. //xlsnm = getUserInfo('dutplcenm');
  189. var selectDept = model.getValue('/root/main/cond/execdeptcd');
  190. xlsnm = model.getValue("/root/init/orddept/dept[deptcd='" + selectDept + "']/depthngnm");
  191. }
  192. if(flag == 'prvn'){
  193. xlsnm += '예방통계(' + fromdd + '~'+ todd + ')';
  194. }else if(flag == 'cncr'){
  195. xlsnm += '항암통계(' + fromdd + '~'+ todd + ')';
  196. }else if(flag == 'cncr2'){
  197. xlsnm += '임상항암통계(' + fromdd + '~'+ todd + ')';
  198. }else if(flag == 'bio'){
  199. xlsnm += '항생통계(' + fromdd + '~'+ todd + ')';
  200. }else if(flag == 'gnrl'){
  201. xlsnm += '일반통계(' + fromdd + '~'+ todd + ')';
  202. }else if(flag == 'sap'){
  203. xlsnm += '수액통계(' + fromdd + '~'+ todd + ')';
  204. }else if(flag == 'blod'){
  205. xlsnm += '혈액통계(' + fromdd + '~'+ todd + ')';
  206. }else if(flag == 'tret'){
  207. xlsnm += '처치통계(' + fromdd + '~'+ todd + ')';
  208. }else if(flag == 'etc'){
  209. xlsnm += '기타통계(' + fromdd + '~'+ todd + ')';
  210. //20150810 kya 추가
  211. }else if(flag == 'dump'){
  212. xlsnm += 'DUMP통계(' + fromdd + '~'+ todd + ')';
  213. }else if(flag == 'tot'){
  214. xlsnm += '통계(' + fromdd + '~'+ todd + ')';
  215. }
  216. model.removenode('/root/temp/xlsnm');
  217. model.makeValue('/root/temp/xlsnm', xlsnm);
  218. model.refresh();
  219. }
  220. }
  221. /**
  222. * @group :
  223. * @ver : 2007.08.14
  224. * @by : 신혁춘
  225. * @---------------------------------------------------
  226. * @type : function
  227. * @access : public
  228. * @desc : 주사실통계건수 출력
  229. * @param :
  230. * @return :
  231. * @---------------------------------------------------
  232. */
  233. function fprintdata(){
  234. model.removeNodeset("/root/send");
  235. model.makeValue("/root/send/rexdata/prvn" ,model.getValue("/root/main/statsdata/statsdatalist/prvn"));
  236. model.makeValue("/root/send/rexdata/cncr" ,model.getValue("/root/main/statsdata/statsdatalist/cncr"));
  237. model.makeValue("/root/send/rexdata/bio" ,model.getValue("/root/main/statsdata/statsdatalist/bio"));
  238. model.makeValue("/root/send/rexdata/gnrl" ,model.getValue("/root/main/statsdata/statsdatalist/gnrl"));
  239. model.makeValue("/root/send/rexdata/sap" ,model.getValue("/root/main/statsdata/statsdatalist/sap"));
  240. model.makeValue("/root/send/rexdata/blod" ,model.getValue("/root/main/statsdata/statsdatalist/blod"));
  241. model.makeValue("/root/send/rexdata/tret" ,model.getValue("/root/main/statsdata/statsdatalist/tret"));
  242. model.makeValue("/root/send/rexdata/etc" ,model.getValue("/root/main/statsdata/statsdatalist/etc"));
  243. model.makeValue("/root/send/rexdata/tot" ,model.getValue("/root/main/statsdata/statsdatalist/tot"));
  244. model.makeValue("/root/send/rexdata/todd" ,model.getValue("/root/main/cond/todd"));
  245. model.makeValue("/root/send/rexdata/fromdd" ,model.getValue("/root/main/cond/fromdd"));
  246. //20081216 dhkim
  247. //itc변경개발요청으로 예외용법테이블에 경구약추가
  248. model.makeValue("/root/send/rexdata/mouth" ,model.getValue("/root/main/statsdata/statsdatalist/mouth"));
  249. exeReportPreview("RPMNI00900", "XMLSTR", "", "", "false","","","","","false", "", "");//미리보기
  250. //exeReportPreview("RPMNI00900", "XMLSTR", "", "", "true","","","","","true", "", "");//미리보기안함
  251. }
  252. /**
  253. * @group :
  254. * @ver : 2008.01.14
  255. * @by : 신혁춘
  256. * @---------------------------------------------------
  257. * @type : function
  258. * @access : public
  259. * @desc : 세부내역 출력
  260. * @param :
  261. * @return :
  262. * @---------------------------------------------------
  263. */
  264. function fprintlistdata(){
  265. if(datagrid1.rows == 1){
  266. messageBox('출력할 내역이 없습니다.', 'E999');
  267. return;
  268. }
  269. model.removeNodeset("/root/send");
  270. model.makeNode("/root/send/rexdata/prcpdetl");
  271. model.copyNode("/root/send/rexdata/prcpdetl", "/root/main/prcpdetl");
  272. exeReportPreview("RPMNI00901", "XMLSTR", "", "", "false","","","","","false", "", "");//미리보기
  273. // exeReportPreview("RPMNI00901", "XMLSTR", "", "", "true","","","","","true", "", "");//미리보기안함
  274. }
  275. /**
  276. * @group :
  277. * @ver : 2007.08.14
  278. * @by : 신혁춘
  279. * @---------------------------------------------------
  280. * @type : function
  281. * @access : public
  282. * @desc : 엑셀저장
  283. * @param :
  284. * @return :
  285. * @---------------------------------------------------
  286. function fsavexls(){
  287. var xStatsPath = '/root/main/statsdata/statsdatalist'; //20081124 dhkim 상황실에서 에러연락받고 수정
  288. // var xStatsPath = '/root/temp/exceldata/excellist'; //20081124 dhkim 상황실에서 에러연락받고 수정
  289. // var cut = model.getValue(xStatsPath+"["+1+"]/cut");
  290. var cut = model.getValue(xStatsPath+"["+1+"]/tot"); //20081124 dhkim 상황실에서 에러연락받고 수정
  291. if(cut == "" || datagrid1.rows < 2){
  292. messageBox("조회가 되지", "E007");
  293. return;
  294. }
  295. //20081231 파일이름을 '주사실통계(조회일자)' 로 변경
  296. var exNm = '주사실통계(' + ipt_fromdd.value + '~' + ipt_todd.value + ')';
  297. var fileName = window.fileDialog("save", ",", false, exNm, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  298. if(fileName != ""){
  299. datagrid1.saveExcel(fileName, "SheetName", true, true, "", "", false);
  300. }
  301. }
  302. */
  303. /**
  304. * @group :
  305. * @ver : 20090604
  306. * @by : dhkim
  307. * @---------------------------------------------------
  308. * @type : function
  309. * @access : public
  310. * @desc : 건수별내역엑셀저장
  311. * @param :
  312. * @return :
  313. * @---------------------------------------------------
  314. */
  315. function fsavexls(){
  316. var xStatsPath = '/root/main/statsdata/statsdatalist'; //20081124 dhkim 상황실에서 에러연락받고 수정
  317. // var xStatsPath = '/root/temp/exceldata/excellist'; //20081124 dhkim 상황실에서 에러연락받고 수정
  318. // var cut = model.getValue(xStatsPath+"["+1+"]/cut");
  319. var cut = model.getValue(xStatsPath+"["+1+"]/tot"); //20081124 dhkim 상황실에서 에러연락받고 수정
  320. if(cut == "" || datagrid1.rows < 2){
  321. messageBox("조회가 되지", "E007");
  322. return;
  323. }
  324. //20081231 파일이름을 '주사실통계(조회일자)' 로 변경
  325. //var exNm = '주사실통계(' + ipt_fromdd.value + '~' + ipt_todd.value + ')';
  326. //20090604 dhkim
  327. //엑셀저장시 파일이름 변경을 위해 op_xlsnm에 파일이름을 임시저장함
  328. //파일이름 : 사용자부서 + (처방종류) + 조회구간
  329. //예) 주사실사용자의 경우 예방조회 -> 주사실(예방)통계(20090101~20090102).xls
  330. // bmt주사실사용자의경우 총건수 조회시 -> bmt주사실통계(20090101~20090102).xls
  331. var exNm = model.getValue('root/temp/xlsnm');
  332. var fileName = window.fileDialog("save", ",", false, exNm, "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  333. if(fileName != ""){
  334. datagrid1.saveExcel(fileName, "SheetName", true, true, "", "", false);
  335. }
  336. }