SMLLS00400_처방부서별채혈환자수.xrw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * 제 목 : SMLLS00400_처방부서별채혈환자수.xrw
  4. * 설 명 : 처방부서별채혈환자수
  5. * 설 계 자 : (주)에이씨케이 - 윤재한
  6. * 작 성 자 : (주)에이씨케이 -
  7. * 작 성 일 : 2008.04.15
  8. * 수정이력 :
  9. * 기 타 :
  10. -->
  11. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  12. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  13. <xhtml:head>
  14. <xhtml:title>처방부서별 채혈 환자 수</xhtml:title>
  15. <model id="model1">
  16. <instance id="instance1">
  17. <root xmlns="">
  18. <main>
  19. <ddstats/>
  20. <yystats/>
  21. </main>
  22. <send/>
  23. <init>
  24. </init>
  25. <hidden>
  26. <ioflag/>
  27. <statshopefromdd/>
  28. <statshopetodd/>
  29. </hidden>
  30. </root>
  31. </instance>
  32. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  33. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  34. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  35. <script type="javascript" src="../../../lis/commonweb/js/LLZ001.js"/>
  36. <script type="javascript" ev:event="xforms-ready">
  37. <![CDATA[
  38. fSetInit(); //초기화 함수 호출
  39. ]]>
  40. </script>
  41. <submission id="TRLLS00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/ddstats"/>
  42. <submission id="TRLLS00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/hidden/yystats"/>
  43. <submission id="TRLLS00403" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" replace="instance" resultref="/root/main/qurtyystats"/>
  44. </model>
  45. <script type="javascript">
  46. <![CDATA[
  47. //화면 open시 초기화
  48. function fSetInit() {
  49. var toDay = getCurrentDate();
  50. model.setValue("/root/hidden/ioflag", "0"); //입원/외래구분 = 전체
  51. model.setValue("/root/hidden/statshopefromdd", toDay); //통계희망시작일 = 현재일자
  52. model.setValue("/root/hidden/statshopetodd", toDay); //통계희망종료일 = 현재일자
  53. //그리드초기화
  54. model.removeNodeset("/root/main/ddstats"); //일별, 월별, 분기별
  55. model.removeNodeset("/root/main/yystats"); //연별
  56. model.toggle("dd"); //초기시 일별그리드 표시
  57. btn_ddstats.selected = true; //일별switch 버튼 선택
  58. model.refresh();
  59. }
  60. //switch 버튼 클릭시 그리드 초기화
  61. function fGridInit() {
  62. var cols = grd_yy.cols-grd_yy.fixedCols;
  63. for( var i = 0; i < cols; i++ ) {
  64. grd_yy.removeColumn(); //그리드 컬럼 다 지우기.. 지우지 않으면 그리드 형태가 유지되어 다른 통계 조회후 연별 통계시 그리드 옆에 이어져 조회됨.
  65. }
  66. model.removeNodeset("/root/main/ddstats"); //일별, 월별, 분기별
  67. model.removeNodeset("/root/main/yystats"); //연별
  68. model.refresh();
  69. }
  70. //통계희망일, 입원/외래구분, 조회구분(일,월,분기,연) 에 따른 조회
  71. function fGetStats() {
  72. if(btn_ddstats.selected == true) {
  73. model.makeValue("/root/send/refflag", "d");
  74. } else if(btn_mmstats.selected == true) {
  75. model.makeValue("/root/send/refflag", "m");
  76. } else if(btn_qurtyystats.selected == true) {
  77. model.makeValue("/root/send/refflag", "q");
  78. } else if(btn_yystats.selected == true) {
  79. fGetYYStats();
  80. return;
  81. }
  82. model.makeValue("/root/send/ioflag", model.getValue("/root/hidden/ioflag")); //입원/외래구분
  83. model.makeValue("/root/send/statshopefromdd", model.getValue("/root/hidden/statshopefromdd")); //통계희망시작일
  84. model.makeValue("/root/send/statshopetodd", model.getValue("/root/hidden/statshopetodd")); //통계희망종료일
  85. submit("TRLLS00401");
  86. model.removeNodeset("/root/send");
  87. model.makeNode("/root/send");
  88. }
  89. //연별 통계 조회
  90. function fGetYYStats() {
  91. var cols = grd_yy.cols-grd_yy.fixedCols;
  92. var rows = grd_yy.rows-grd_yy.fixedRows;
  93. for( var i = 0; i < cols; i++ ) {
  94. grd_yy.removeColumn(false); //그리드 컬럼 다 지우기..지우지 않으면 그리드 형태가 유지되어 그리드 옆에 이어져 조회됨.
  95. }
  96. model.removeNodeset("/root/main/yystats"); //연별그리드 초기화
  97. model.makeNode("/root/main/yystats/row");
  98. model.makeValue("/root/send/ioflag", model.getValue("/root/hidden/ioflag")); //입원/외래구분
  99. model.makeValue("/root/send/statshopefromdd", model.getValue("/root/hidden/statshopefromdd")); //통계희망시작일
  100. model.makeValue("/root/send/statshopetodd", model.getValue("/root/hidden/statshopetodd")); //통계희망종료일
  101. submit("TRLLS00402"); //통계조회
  102. model.removeNodeset("/root/send");
  103. model.makeNode("/root/send");
  104. //caption 정보
  105. var gridCaption = model.getValue("/root/hidden/yystats/header/caption");
  106. if(gridCaption == "") return;
  107. //ref 정보
  108. var gridColRef = model.getValue("/root/hidden/yystats/header/colref");
  109. var gridColRefArray = gridColRef.split("^");
  110. //type 정보
  111. var gridColType = model.getValue("/root/hidden/yystats/header/type");
  112. var gridColTypeArray = gridColType.split("^");
  113. for( var i = 0; i < gridColRefArray.length; i++ ) {
  114. if(i == 0) {
  115. grd_yy.addColumn("ref:" + gridColRefArray[i] + "; type:"+gridColTypeArray[i]+"; style:text-align:left; ", false); //Grid 속성 지정
  116. } else {
  117. grd_yy.addColumn("ref:" + gridColRefArray[i] + "; type:"+gridColTypeArray[i]+"; format:#,###; ", false); //Grid 속성 지정
  118. }
  119. }
  120. grd_yy.colWidth(1) = 55; //처방부서별 Column은 폭이 달라서 따로 지정.
  121. for( i = 2; i < grd_yy.cols; i++ ) {
  122. grd_yy.colWidth(i) = 60; //Column 폭 조정
  123. }
  124. grd_yy.caption = gridCaption; //Caption 지정
  125. var node = instance1.selectSingleNode("/root/main");
  126. node.replaceChild(instance1.root.hidden.yystats, instance1.root.main.yystats); //조회하고 수정한 사항을 main에 보냄
  127. grd_yy.rowheight(0) = 23; //Title 높이 조정
  128. model.refresh();
  129. fGetTotal(); //연도별 Total 계산
  130. }
  131. //연도별 통계 Total계산
  132. function fGetTotal() {
  133. //Column 합계
  134. for(r = 1; r < grd_yy.rows; r++) {
  135. colsum = 0;
  136. for(i = 2; i < grd_yy.cols - 1; i++) {
  137. if(grd_yy.textmatrix(r, i) != "") {
  138. colsum += parseInt(grd_yy.textmatrix(r, i));
  139. }
  140. }
  141. model.setValue("/root/main/yystats/row["+ r +"]/total", colsum);
  142. }
  143. //Row 합계
  144. grd_yy.addRow();
  145. model.refresh();
  146. grd_yy.textmatrix(grd_yy.rows-1, 1) = "Total";
  147. for(i = 2; i < grd_yy.cols; i++) {
  148. rowsum = 0;
  149. for(r = 1; r < grd_yy.rows-1; r++) {
  150. if(grd_yy.textmatrix(r, i) != "") {
  151. rowsum += parseInt(grd_yy.textmatrix(r, i));
  152. }
  153. }
  154. grd_yy.textmatrix(grd_yy.rows-1, i) = rowsum;
  155. }
  156. }
  157. //엑셀저장
  158. function fExeSaveToExcel() {
  159. if(btn_ddstats.selected == true) { //일별
  160. fSaveExcel("grd_dd");
  161. } else if(btn_mmstats.selected == true) { //월별
  162. fSaveExcel("grd_mm");
  163. } else if(btn_qurtyystats.selected == true) { //분기별
  164. fSaveExcel("grd_qurtyy");
  165. } else if(btn_yystats.selected == true) { //연별
  166. fSaveExcel("grd_yy");
  167. }
  168. }
  169. //통계그리드를 출력한다.
  170. function fPrint() {
  171. if(btn_ddstats.selected == true) { //일별
  172. exeReportPreview("RPLLS00200", "XMLSTR");
  173. } else if(btn_mmstats.selected == true) { //월별
  174. exeReportPreview("RPLLS00300", "XMLSTR");
  175. } else if(btn_qurtyystats.selected == true) { //분기별
  176. exeReportPreview("RPLLS00400", "XMLSTR");
  177. } else if(btn_yystats.selected == true) { //연별
  178. exeReportPreview("RPLLS00500", "XMLSTR");
  179. }
  180. }
  181. ]]>
  182. </script>
  183. </xhtml:head>
  184. <xhtml:body style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  185. <group id="group3" scroll="auto" style="left:0px; top:40px; width:1195px; height:744; ">
  186. <group id="group1" style="left:0px; top:10px; width:1195px; height:35px; ">
  187. <shape id="roundrect2" class="roundrect_search" appearance="roundrect" style="left:0px; top:0px; width:1195px; height:35px; "/>
  188. <button id="btn_ref" class="btn1_letter2" style="left:1123px; top:7px; width:56px; height:22px; ">
  189. <caption>조회</caption>
  190. <script type="javascript" ev:event="DOMActivate">
  191. <![CDATA[
  192. fGetStats();
  193. ]]>
  194. </script>
  195. </button>
  196. <line id="line3" class="line_4" style="x1:1108px; y1:6px; x2:1108px; y2:28px; "/>
  197. <caption id="caption5" class="search_name" style="left:894px; top:9px; width:94px; height:17px; ">입원/외래 :</caption>
  198. <input id="ipt_workfromdd" ref="/root/hidden/statshopefromdd" class="input_search" inputtype="date" style="left:128px; top:8px; width:90px; height:19px; "/>
  199. <input id="ipt_worktodd" ref="/root/hidden/statshopetodd" class="input_search" inputtype="date" style="left:233px; top:8px; width:90px; height:19px; "/>
  200. <caption id="caption4" class="search_name" style="left:15px; top:9px; width:110px; height:17px; ">통계 희망일 :</caption>
  201. <caption id="caption9" class="search_no_b" style="left:220px; top:10px; width:13px; height:17px; ">~</caption>
  202. <select1 id="cmb_rtnabnflag" ref="/root/hidden/ioflag" appearance="minimal" style="left:991px; top:8px; width:102px; height:19px; ">
  203. <choices>
  204. <item>
  205. <label>- 전 체 -</label>
  206. <value>0</value>
  207. </item>
  208. <item>
  209. <label>입원</label>
  210. <value>I</value>
  211. </item>
  212. <item>
  213. <label>외래</label>
  214. <value>O</value>
  215. </item>
  216. </choices>
  217. </select1>
  218. </group>
  219. <switch id="swt_statflag" class="sw_box" style="left:0px; top:75px; width:1195px; height:663px; ">
  220. <case id="dd">
  221. <datagrid id="grd_dd" nodeset="/root/main/ddstats" caption="처방부서^01^02^03^04^05^06^07^08^09^10^11^12^13^14^15^16^17^18^19^20^21^22^23^24^25^26^27^28^29^30^31^Total" colsep="^" colwidth="55, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 60" dataheight="23" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:right; ">
  222. <col ref="orddeptnm" style="text-align:left; "/>
  223. <col ref="d01" format="#,###"/>
  224. <col ref="d02" format="#,###"/>
  225. <col ref="d03" format="#,###"/>
  226. <col ref="d04" format="#,###"/>
  227. <col ref="d05" format="#,###"/>
  228. <col ref="d06" format="#,###"/>
  229. <col ref="d07" format="#,###"/>
  230. <col ref="d08" format="#,###"/>
  231. <col ref="d09" format="#,###"/>
  232. <col ref="d10" format="#,###"/>
  233. <col ref="d11" format="#,###"/>
  234. <col ref="d12" format="#,###"/>
  235. <col ref="d13" format="#,###"/>
  236. <col ref="d14" format="#,###"/>
  237. <col ref="d15" format="#,###"/>
  238. <col ref="d16" format="#,###"/>
  239. <col ref="d17" format="#,###"/>
  240. <col ref="d18" format="#,###"/>
  241. <col ref="d19" format="#,###"/>
  242. <col ref="d20" format="#,###"/>
  243. <col ref="d21" format="#,###"/>
  244. <col ref="d22" format="#,###"/>
  245. <col ref="d23" format="#,###"/>
  246. <col ref="d24" format="#,###"/>
  247. <col ref="d25" format="#,###"/>
  248. <col ref="d26" format="#,###"/>
  249. <col ref="d27" format="#,###"/>
  250. <col ref="d28" format="#,###"/>
  251. <col ref="d29" format="#,###"/>
  252. <col ref="d30" format="#,###"/>
  253. <col ref="d31" format="#,###"/>
  254. <col ref="total" format="#,###"/>
  255. <script type="javascript" ev:event="onaftersort">
  256. <![CDATA[
  257. grd_dd.gridToInstance();
  258. ]]>
  259. </script>
  260. </datagrid>
  261. </case>
  262. <case id="mm">
  263. <datagrid id="grd_mm" nodeset="/root/main/ddstats" caption="처방부서^01^02^03^04^05^06^07^08^09^10^11^12^Total" colsep="^" colwidth="55, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60" dataheight="23" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:right; ">
  264. <col ref="orddeptnm" style="text-align:left; "/>
  265. <col ref="d01" format="#,###"/>
  266. <col ref="d02" format="#,###"/>
  267. <col ref="d03" format="#,###"/>
  268. <col ref="d04" format="#,###"/>
  269. <col ref="d05" format="#,###"/>
  270. <col ref="d06" format="#,###"/>
  271. <col ref="d07" format="#,###"/>
  272. <col ref="d08" format="#,###"/>
  273. <col ref="d09" format="#,###"/>
  274. <col ref="d10" format="#,###"/>
  275. <col ref="d11" format="#,###"/>
  276. <col ref="d12" format="#,###"/>
  277. <col ref="total" format="#,###"/>
  278. <script type="javascript" ev:event="onaftersort">
  279. <![CDATA[
  280. grd_mm.gridToInstance();
  281. ]]>
  282. </script>
  283. </datagrid>
  284. </case>
  285. <case id="qurtyy" selected="true">
  286. <datagrid id="grd_qurtyy" nodeset="/root/main/ddstats" caption="처방부서^1^2^3^4^Total" colsep="^" colwidth="55, 60, 60, 60, 60, 60" dataheight="23" explorerbar="sortshow" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:right; ">
  287. <col ref="orddeptnm" style="text-align:left; "/>
  288. <col ref="d01" format="#,###"/>
  289. <col ref="d02" format="#,###"/>
  290. <col ref="d03" format="#,###"/>
  291. <col ref="d04" format="#,###"/>
  292. <col ref="total" format="#,###"/>
  293. <script type="javascript" ev:event="onaftersort">
  294. <![CDATA[
  295. grd_qurtyy.gridToInstance();
  296. ]]>
  297. </script>
  298. </datagrid>
  299. </case>
  300. <case id="yy">
  301. <datagrid id="grd_yy" nodeset="/root/main/yystats/row" backcoloralternate="transparent" colsep="^" dataheight="23" explorerbar="sortshow" frozencols="2" mergecellsfixedrows="bycolrec" rowheader="seq" rowheight="23" style="left:5px; top:5px; width:1180px; height:646px; text-align:center; ">
  302. <script type="javascript" ev:event="onaftersort">
  303. <![CDATA[
  304. grd_qurtyy.gridToInstance();
  305. ]]>
  306. </script>
  307. </datagrid>
  308. </case>
  309. </switch>
  310. <button id="btn_mmstats" class="btn_sw" group="tab" style="left:75px; top:54px; width:75px; height:22px; ">
  311. <caption>월별 통계</caption>
  312. <toggle case="mm" ev:event="DOMActivate"/>
  313. <script type="javascript" ev:event="DOMActivate">
  314. <![CDATA[
  315. fGridInit();
  316. ]]>
  317. </script>
  318. </button>
  319. <button id="btn_qurtyystats" class="btn_sw" group="tab" style="left:150px; top:54px; width:90px; height:22px; ">
  320. <caption>분기별 통계</caption>
  321. <toggle case="qurtyy" ev:event="DOMActivate"/>
  322. <script type="javascript" ev:event="DOMActivate">
  323. <![CDATA[
  324. fGridInit();
  325. ]]>
  326. </script>
  327. </button>
  328. <button id="btn_ddstats" class="btn_sw" group="tab" style="left:0px; top:54px; width:75px; height:22px; ">
  329. <caption>일별 통계</caption>
  330. <toggle case="dd" ev:event="DOMActivate"/>
  331. <script type="javascript" ev:event="DOMActivate">
  332. <![CDATA[
  333. fGridInit();
  334. ]]>
  335. </script>
  336. </button>
  337. <button id="btn_yystats" class="btn_sw" group="tab" style="left:240px; top:54px; width:75px; height:22px; ">
  338. <caption>연별 통계</caption>
  339. <toggle case="yy" ev:event="DOMActivate"/>
  340. <script type="javascript" ev:event="DOMActivate">
  341. <![CDATA[
  342. fGridInit();
  343. ]]>
  344. </script>
  345. </button>
  346. </group>
  347. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:800px; height:14px; ">처방부서별 채혈 환자 수</caption>
  348. <group id="group4" scroll="auto" style="left:0px; top:13px; width:1195px; height:27px; ">
  349. <line id="line2" class="line_2" style="x1:0px; y1:25px; x2:1195px; y2:25px; "/>
  350. <button id="btn_print" class="btn6_letter2" style="left:0px; top:3px; width:56px; height:22px; ">
  351. <caption>출력</caption>
  352. <script type="javascript" ev:event="DOMActivate">
  353. <![CDATA[
  354. fPrint();
  355. ]]>
  356. </script>
  357. </button>
  358. <button id="btn_excel" class="btn6_letter5" style="left:59px; top:3px; width:92px; height:22px; ">
  359. <caption>EXCEL저장</caption>
  360. <script type="javascript" ev:event="DOMActivate">
  361. <![CDATA[
  362. fExeSaveToExcel();
  363. ]]>
  364. </script>
  365. </button>
  366. </group>
  367. </xhtml:body>
  368. </xhtml:html>