SMMNI01000.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /*
  2. 주사실통계(SMMNI01000.xfm - JScript )
  3. - Version :
  4. 1) : Ver.1.00.01
  5. */
  6. /**
  7. * @group :
  8. * @ver : 2007.08.16
  9. * @by : 신혁춘
  10. * @---------------------------------------------------
  11. * @type : function
  12. * @access : public
  13. * @desc : grd_chospat 구분 내용 삽입
  14. * @param :
  15. * @return :
  16. * @---------------------------------------------------
  17. */
  18. function fchospatstat(){
  19. for (i=0; i<9; i++){
  20. grd_chospat.insertRow(i,"below", "false", "true");
  21. }
  22. grd_chospat.rebuild();
  23. var xchospatPath = "/root/main/chospat/chospatlist";
  24. model.setValue(xchospatPath+"["+1+"]/flag" ,"예방");
  25. model.setValue(xchospatPath+"["+2+"]/flag" ,"항암");
  26. model.setValue(xchospatPath+"["+3+"]/flag" ,"항생");
  27. model.setValue(xchospatPath+"["+4+"]/flag" ,"일반");
  28. model.setValue(xchospatPath+"["+5+"]/flag" ,"수액");
  29. model.setValue(xchospatPath+"["+6+"]/flag" ,"혈액");
  30. model.setValue(xchospatPath+"["+7+"]/flag" ,"기타");
  31. model.setValue(xchospatPath+"["+8+"]/flag" ,"처치");
  32. model.setValue(xchospatPath+"["+9+"]/flag" ,"총 건수");
  33. grd_chospat.rebuild();
  34. fchospatvacn();
  35. }
  36. /**
  37. * @group :
  38. * @ver : 2007.08.16
  39. * @by : 신혁춘
  40. * @---------------------------------------------------
  41. * @type : function
  42. * @access : public
  43. * @desc : grd_vacn 구분 내용 삽입
  44. * @param :
  45. * @return :
  46. * @---------------------------------------------------
  47. */
  48. function fvacnstat(){
  49. var switc = switch1.selectedIndex;
  50. if (switc == "1"){
  51. model.removeNodeset("/root/send");
  52. var yearrefday = model.getValue("/root/main/yearref/yearrefday");
  53. if(yearrefday.length <= "4"){
  54. yearrefday=yearrefday+"0101";
  55. }
  56. model.makeValue("/root/send/yearrefday",yearrefday);
  57. if(submit("TRMNI01002")){
  58. model.refresh();
  59. fchospatvacn();
  60. }
  61. }
  62. //grd_vacn.insertRow(i,"below", "false", "true");
  63. //grd_vacn.textmatrix(21,0) = "월 총건수";
  64. }
  65. /**
  66. * @group :
  67. * @ver : 2007.08.17
  68. * @by : 신혁춘
  69. * @---------------------------------------------------
  70. * @type : function
  71. * @access : public
  72. * @desc : grd_chospat, grd_vacn 통계 조회
  73. * @param :
  74. * @return :
  75. * @---------------------------------------------------
  76. */
  77. function fchospatvacn(){
  78. var switc = switch1.selectedIndex;
  79. model.removeNodeset("/root/send");
  80. var yearrefday = model.getValue("/root/main/yearref/yearrefday");
  81. if(yearrefday.length <= "4"){
  82. yearrefday=yearrefday+"0101";
  83. }
  84. model.makeValue("/root/send/yearrefday",yearrefday);
  85. if (switc == "0"){
  86. var kTitData = "prvn anticncr antibio gnrl sap blod inj cure totcnt";
  87. var tData = kTitData.split(" ");
  88. var MonData = "mar,apr,may,jun,jul,aug,sep,oct,nov,dec,jan,feb,prioryysum";
  89. var sMonData = MonData.split(",");
  90. if(submit("TRMNI01001")){
  91. var xchospatPath = "/root/main/chospat/chospatlist";
  92. var xhiddenchospatPath = "/root/hidden/chos/chosdata";
  93. for (i=1; i<10; i++){
  94. var total = 0;
  95. a = i-1;
  96. for (j=1; j<14; j++){
  97. k = j-1;
  98. var d= tData[a];
  99. var m= sMonData[k];
  100. if(j != 13){
  101. model.setValue(xchospatPath+"["+i+"]/"+m ,model.getValue(xhiddenchospatPath+"["+j+"]/"+d));
  102. total = total+eval(model.getValue(xhiddenchospatPath+"["+j+"]/"+d));
  103. }else{
  104. model.setValue(xchospatPath+"["+i+"]/"+m ,model.getValue(xhiddenchospatPath+"["+j+"]/"+d));
  105. if(model.getValue(xhiddenchospatPath+"["+j+"]/"+d) == "0"){
  106. var fluctuate = "-"
  107. }else{
  108. var fluctuate = ((total-eval(model.getValue(xhiddenchospatPath+"["+j+"]/"+d)))/(eval(model.getValue(xhiddenchospatPath+"["+j+"]/"+d))*100))+"%";
  109. }
  110. model.setValue(xchospatPath+"["+i+"]/total" ,total);
  111. model.setValue(xchospatPath+"["+i+"]/fluctuate" ,fluctuate);
  112. }
  113. }
  114. }
  115. }
  116. model.refresh();
  117. }
  118. if (switc == "1"){
  119. var vRow = grd_vacn.rows;
  120. if(vRow != "1"){
  121. if(submit("TRMNI01003")){
  122. var xvacnpatPath = "/root/main/vacnpat/vacnlist";
  123. var xhiddenvacnPath = "/root/hidden/vacn/vacndata";
  124. var iRow = grd_vacn.rows;
  125. var hRow = getNodesetCount("/root/hidden/vacn/vacndata");
  126. var Row = iRow-1;
  127. var MonData = "mar,apr,may,jun,jul,aug,sep,oct,nov,dec,jan,feb";
  128. var TonData = "mar,apr,may,jun,jul,aug,sep,oct,nov,dec,jan,feb,total,prioryysum,fluctuate";
  129. var sMonData = MonData.split(",");
  130. var sTonData = TonData.split(",");
  131. for(i=1; i<iRow-1; i++){
  132. var total = 0;
  133. var a = grd_vacn.textmatrix(i,0);
  134. for(h=1; h<15; h++){
  135. var s = sTonData[h-1];
  136. var aaa = 0;
  137. model.setValue(xvacnpatPath+"["+i+"]/"+s ,aaa);
  138. }
  139. for(h=1; h<hRow+1; h++){
  140. var b = model.getValue(xhiddenvacnPath+"["+h+"]/drugcdname");
  141. var c = model.getValue(xhiddenvacnPath+"["+h+"]/sorder");
  142. var z = sMonData[c-1];
  143. if(c <=12){
  144. if(a == b){
  145. model.setValue(xvacnpatPath+"["+i+"]/"+z ,model.getValue(xhiddenvacnPath+"["+h+"]/drugcdseq"));
  146. total = total + eval(model.getValue(xvacnpatPath+"["+i+"]/"+z));
  147. }
  148. }
  149. if (c==13){
  150. var d = model.getValue(xhiddenvacnPath+"["+h+"]/drugcdname");
  151. if(a==d){
  152. model.setValue(xvacnpatPath+"["+i+"]/prioryysum",model.getValue(xhiddenvacnPath+"["+h+"]/drugcdseq"));
  153. }
  154. }
  155. model.setValue(xvacnpatPath+"["+i+"]/total" ,total);
  156. if(model.getValue(xvacnpatPath+"["+i+"]/prioryysum") == "0"){
  157. var fluctuate = "-";
  158. }else{
  159. var fluctuate = (total-eval(model.getValue(xvacnpatPath+"["+i+"]/prioryysum"))/(eval(model.getValue(xvacnpatPath+"["+i+"]/prioryysum"))*100))+"%";
  160. }
  161. model.setValue(xvacnpatPath+"["+i+"]/fluctuate", fluctuate);
  162. }
  163. }
  164. for(z=1; z<15; z++){
  165. var moontotal = 0;
  166. for (t=1; t<iRow-1; t++){
  167. var as = sTonData[z-1];
  168. moontotal = moontotal + eval(model.getValue(xvacnpatPath+"["+t+"]/"+as));
  169. }
  170. model.setValue(xvacnpatPath+"["+Row+"]/"+as ,moontotal);
  171. if(model.getValue(xvacnpatPath+"["+Row+"]/prioryysum") == "0"){
  172. var fluctuate = "-"
  173. }else{
  174. var fluctuate = (total-eval(model.getValue(xvacnpatPath+"["+Row+"]/prioryysum"))/(eval(model.getValue(xvacnpatPath+"["+Row+"]/prioryysum"))*100))+"%";
  175. }
  176. model.setValue(xvacnpatPath+"["+Row+"]/fluctuate", fluctuate);
  177. }
  178. }
  179. model.refresh();
  180. }
  181. }
  182. }
  183. /**
  184. * @group :
  185. * @ver : 2007.08.29
  186. * @by : 신혁춘
  187. * @---------------------------------------------------
  188. * @type : function
  189. * @access : public
  190. * @desc : grd_chospat, grd_vacn 엑셀 저장
  191. * @param :
  192. * @return :
  193. * @---------------------------------------------------
  194. */
  195. function fsavexls(){
  196. var switc = switch1.selectedIndex;
  197. var fileName = window.fileDialog("save", ",", false, "excel", "xls", "All Files (*.*)|*.*|Excel Files(*.xls)|*.xls");
  198. if (fileName != ""){
  199. if (switc=="0"){
  200. grd_chospat.saveExcel(fileName, "SheetName", true, true, "", "", false);
  201. }
  202. if (switc=="1"){
  203. grd_vacn.saveExcel(fileName, "SheetName", true, true, "", "", false);
  204. }
  205. }
  206. }
  207. /**
  208. * @group :
  209. * @ver : 2007.08.30
  210. * @by : 신혁춘
  211. * @---------------------------------------------------
  212. * @type : function
  213. * @access : public
  214. * @desc : grd_chospat, grd_vacn 출력 연동
  215. * @param :
  216. * @return :
  217. * @---------------------------------------------------
  218. */
  219. function frexpert(){
  220. model.removeNodeset("/root/send");
  221. var switc = switch1.selectedIndex;
  222. var yearrefday = model.getValue("/root/main/yearref/yearrefday");
  223. if(yearrefday.length >= "5"){
  224. yearrefday=yearrefday.substring(0,4);
  225. }
  226. model.makeValue("/root/send/ref/switch",switc);
  227. model.makeValue("/root/send/ref/yearrefday",yearrefday);
  228. model.makeValue("/root/send/rexdata","");
  229. if(switc=="0"){
  230. model.copyNode("/root/send/rexdata","/root/main/chospat");
  231. exeReportPreview("RPMNI01001", "XMLSTR");
  232. }
  233. if(switc=="1"){
  234. model.copyNode("/root/send/rexdata","/root/main/vacnpat");
  235. exeReportPreview("RPMNI01002", "XMLSTR");
  236. }
  237. }