SMPMI03800_병상가동률조회.xrw 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <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">
  4. <xhtml:head>
  5. <xhtml:title>병상가동률조회</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <send>
  10. <data1>
  11. <refcond/>
  12. <fromdd/>
  13. <todd/>
  14. <termflag/>
  15. <kindflag/>
  16. </data1>
  17. </send>
  18. <main>
  19. <bedoperatingratelist/>
  20. </main>
  21. <init>
  22. </init>
  23. <hidden>
  24. </hidden>
  25. </root>
  26. </instance>
  27. <submission id="TRPMI03801" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/data1" resultref="/root/main/bedoperatingratelist"/>
  28. <script type="javascript" ev:event="xforms-ready">
  29. <![CDATA[
  30. // zbcfGetCodeList(new Array("P0149","P0016"), new Array("/root/init/P0149list", "/root/init/P0016list"));
  31. // submit("TRPMI00106", false);
  32. model.setValue("/root/send/data1/refcond" , "WARD");
  33. fShowGridWithRefCond("WARD");
  34. ipt_fromdd.value = getCurrentDate();
  35. ipt_todd.value = getCurrentDate();
  36. if (getUserInfo("dutplceinstcd") == "032" || getUserId() == "PAM") {
  37. chk_kindflag.disabled = false;
  38. }
  39. makeReportPreview(0, 0, 10, 10, "grp_report");
  40. model.refresh();
  41. ]]>
  42. </script>
  43. </model>
  44. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  45. <script type="javascript" src="../../../com/commonweb/js/utilHelper.js"/>
  46. <script type="javascript" src="../../../com/basiccodeweb/js/ZBC001.js"/>
  47. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  48. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  49. <script type="javascript">
  50. <![CDATA[
  51. function fInitialize() {
  52. model.resetInstanceNode("/root/main/bedoperatingratelist");
  53. model.resetInstanceNode("/root/send");
  54. model.setValue("/root/send/data1/refcond" , "WARD");
  55. model.refresh();
  56. }
  57. // 그리드 조건에 따라 컬럼 감추기
  58. function fShowGridWithRefCond(pRefCond) {
  59. var kindflag = model.getValue("/root/send/data1/kindflag");
  60. if (pRefCond == "WARD") {
  61. if (chk_term.value == "T" ) {
  62. grd_list.colHidden(grd_list.colRef("dschnoticnt") ) = true;
  63. } else {
  64. grd_list.colHidden( grd_list.colRef("dschnoticnt") ) = false;
  65. }
  66. if (kindflag == "Y") {
  67. grd_list.colHidden(0) = true;
  68. grd_list.colHidden(1) = false;
  69. grd_list.fixedCols = 2;
  70. } else {
  71. grd_list.colHidden(0) = false;
  72. grd_list.colHidden(1) = true;
  73. grd_list.fixedCols = 1;
  74. }
  75. grd_list.colHidden(2) = true;
  76. grd_list.colHidden(3) = false;
  77. grd_list.colHidden(4) = true;
  78. grd_list.mergeCellsFixedCols = "bycol"; // 병동정보를 merge한다.
  79. } else if ( pRefCond == "CENTER") {
  80. grd_list.colHidden(0) = true;
  81. grd_list.colHidden(1) = true;
  82. grd_list.colHidden(2) = false;
  83. grd_list.colHidden(3) = true;
  84. grd_list.colHidden(4) = true;
  85. grd_list.fixedCols = 4;
  86. grd_list.colHidden( grd_list.colRef("dschnoticnt") ) = false;
  87. } else if ( pRefCond == "DEPT") {
  88. grd_list.colHidden(0) = true;
  89. grd_list.colHidden(1) = true;
  90. grd_list.colHidden(2) = true;
  91. grd_list.colHidden(3) = true;
  92. grd_list.colHidden(4) = false;
  93. grd_list.fixedCols = 5;
  94. grd_list.colHidden( grd_list.colRef("dschnoticnt") ) = false;
  95. } else {
  96. if (kindflag == "Y") {
  97. grd_list.colHidden(0) = true;
  98. grd_list.colHidden(1) = false;
  99. grd_list.fixedCols = 2;
  100. } else {
  101. grd_list.colHidden(0) = false;
  102. grd_list.colHidden(1) = true;
  103. grd_list.fixedCols = 1;
  104. }
  105. grd_list.colHidden(2) = true;
  106. grd_list.colHidden(3) = false;
  107. grd_list.colHidden( grd_list.colRef("dschnoticnt") ) = false;
  108. grd_list.mergeCellsFixedCols = "bycol"; // 병동정보를 merge한다.
  109. }
  110. }
  111. // 통계
  112. function fSetSubTotal(pRefCond) {
  113. grd_list.subtotal("sum", -1, grd_list.colRef("bedcnt"),"", "", 1, "Total");
  114. grd_list.subtotal("sum", -1, grd_list.colRef("inpatcnt"),"", "", 1, "Total");
  115. grd_list.subtotal("sum", -1, grd_list.colRef("vacantcnt"),"", "", 1, "Total");
  116. grd_list.subtotal("sum", -1, grd_list.colRef("dschnoticnt"),"", "", 1, "Total");
  117. if (pRefCond == "WARD") {
  118. grd_list.subtotal("average", -1, grd_list.colRef("operatingrate"),"#,###.#", "", 0, "Total");
  119. } else if ( pRefCond == "CENTER") {
  120. grd_list.subtotal("average", -1, grd_list.colRef("operatingrate"),"#,###.#", "", 1, "Total");
  121. } else {
  122. grd_list.subtotal("average", -1, grd_list.colRef("operatingrate"),"#,###.#", "", 0, "Total");
  123. }
  124. }
  125. // 병동가동률 퍼센트별 색깔구분
  126. function fSetColor() {
  127. var iGridCount = grd_list.rows;
  128. for (var idx = 1 ; idx <= iGridCount ; idx++) {
  129. var sOperatingRate = model.getValue("/root/main/bedoperatingratelist[" + idx + "]/operatingrate");
  130. var iOperatingRate = parseInt(sOperatingRate); // parseIn("19.9") -> 19 floor와 같은 작용
  131. // 0 <= xx < 90
  132. if (iOperatingRate >= 0 && iOperatingRate < 90) {
  133. grd_list.cellstyle("background-color", idx, 7) = "#7FFFD4";
  134. }
  135. // 90 <= xx < 95
  136. if (iOperatingRate >= 90 && iOperatingRate < 95) {
  137. grd_list.cellstyle("background-color", idx, 7) = "#FAF58C";
  138. }
  139. // 95 <= xx
  140. if (iOperatingRate >= 95) {
  141. grd_list.cellstyle("background-color", idx, 7) = "#FF4646";
  142. }
  143. }
  144. model.refresh();
  145. }
  146. function fPrint(pCond) {
  147. var sPrintYN = "false";
  148. var sAutoCloseYN = "false";
  149. var sViewYN = "";
  150. if (pCond == "PREVIEW") {
  151. sPrintYN = "false";
  152. sAutoCloseYN = "false";
  153. sViewYN = "";
  154. }
  155. if (pCond == "PRINT") {
  156. sPrintYN = "true";
  157. sAutoCloseYN = "false";
  158. sViewYN = "grp_report";
  159. }
  160. var iCount = getNodesetCount("/root/main/vipinpatlist/vipinpatspec");
  161. if (iCount > 0) {
  162. var sPrintFromdd = model.getValue("/root/send/fromdd");
  163. var sPrinttodd = model.getValue("/root/send/todd");
  164. sPrintFromdd = sPrintFromdd.substr(0, 4) + "-" + sPrintFromdd.substr(4, 2) + "-" + sPrintFromdd.substr(6, 4);
  165. model.makeValue("/root/hidden/printtype/printkind", "VIP재원");
  166. model.makeValue("/root/hidden/printtype/printfromdd", sPrintFromdd);
  167. model.makeValue("/root/hidden/printtype/printtodd", sPrinttodd);
  168. exeReportPreview("RPPMI03601", "XMLSTR" , "" , "" , sPrintYN , "", "", "", "", sAutoCloseYN, "", sViewYN);
  169. } else {
  170. messageBox("출력할 내용이 없습니다!!", "I");
  171. }
  172. }
  173. ]]>
  174. </script>
  175. </xhtml:head>
  176. <xhtml:body guideline="1,1192;1,1196;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  177. <group id="group1" style="left:0px; top:0px; width:1195px; height:13px; ">
  178. <caption id="caption6" class="tit_1" style="left:0px; top:0px; width:200px; height:14px; ">병상가동률조회</caption>
  179. </group>
  180. <group id="group3" style="left:0px; top:13px; width:1195px; height:744px; ">
  181. <group id="group2" style="left:0px; top:10px; width:1194px; height:35px; ">
  182. <shape id="roundrect1" class="roundrect_search" appearance="roundrect" ellipsewidth="10" ellipseheight="10" style="left:0px; top:0px; width:1194px; height:35px; background-color:#fffbf2; border-color:#ffd799; "/>
  183. <line id="line2" class="line_4" style="x1:1108px; y1:7px; x2:1108px; y2:29px; border-color:#ffe4bb; border-left-style:solid; "/>
  184. <caption id="caption17" class="search_name" style="left:5px; top:10px; width:86px; height:17px; ">조회구분 :</caption>
  185. <select1 id="radio1" ref="/root/send/data1/refcond" appearance="full" cellspacing="5" cols="3" overflow="visible" style="left:95px; top:11px; width:250px; height:17px; border-style:none; ">
  186. <choices>
  187. <item>
  188. <label>병동별</label>
  189. <value>WARD</value>
  190. </item>
  191. <item>
  192. <label>센터별</label>
  193. <value>CENTER</value>
  194. </item>
  195. <item>
  196. <label>진료과별(재원기준)</label>
  197. <value>DEPT</value>
  198. </item>
  199. </choices>
  200. <script type="javascript" ev:event="xforms-value-changed">
  201. <![CDATA[
  202. //btn_search.dispatch("DOMActivate");
  203. if ( radio1.value == "WARD" ) {
  204. chk_kindflag.visible = true;
  205. chk_term.visible = true;
  206. // grd_list.visible = true;
  207. // grd_list2.visible = false;
  208. } else if ( radio1.value == "CENTER" ) {
  209. chk_kindflag.visible = true;
  210. chk_term.visible = false;
  211. // grd_list.visible = true;
  212. // grd_list2.visible = false;
  213. } else {
  214. chk_kindflag.visible = false;
  215. chk_term.visible = false;
  216. // grd_list.visible = false;
  217. // grd_list2.visible = true;
  218. }
  219. chk_term.dispatch("xforms-value-changed");
  220. ]]>
  221. </script>
  222. </select1>
  223. <button id="btn_search" class="btn1_letter2" style="left:1123px; top:7px; width:56px; height:22px; ">
  224. <caption>조회</caption>
  225. <script type="javascript" ev:event="DOMActivate">
  226. <![CDATA[
  227. var sRefCond = model.getValue("/root/send/data1/refcond");
  228. fShowGridWithRefCond(sRefCond);
  229. if( chk_term.value == "T") {
  230. var fromdd = ipt_fromdd.value;
  231. var todd = ipt_todd.value;
  232. var term = getDateInterval(fromdd, todd);
  233. if ( term > 185 ) {
  234. messageBox("조회기간은 6개월을 넘을수 없습니다.", "E999");
  235. ipt_fromdd.value = getCurrentDate();
  236. ipt_todd.value = getCurrentDate();
  237. return;
  238. }
  239. }
  240. // 병상가동률 조회
  241. submit("TRPMI03801");
  242. // subtotal 추가
  243. //fSetSubTotal(sRefCond);
  244. // mgr에서 total 계산
  245. // color setting
  246. fSetColor();
  247. model.refresh();
  248. ]]>
  249. </script>
  250. </button>
  251. <select id="chk_term" ref="/root/send/data1/termflag" visibility="visible" overflow="visible" appearance="full" style="left:458px; top:11px; width:57px; height:15px; border-style:none; ">
  252. <choices>
  253. <item>
  254. <label>기간별</label>
  255. <value>T</value>
  256. </item>
  257. </choices>
  258. <script type="javascript" ev:event="xforms-value-changed">
  259. <![CDATA[
  260. if ( chk_term.value == "T" ) {
  261. caption7.visible = true;
  262. caption5.visible = true;
  263. ipt_fromdd.visible = true;
  264. ipt_todd.visible = true;
  265. } else {
  266. caption7.visible = false;
  267. caption5.visible = false;
  268. ipt_fromdd.visible = false;
  269. ipt_todd.visible = false;
  270. }
  271. ]]>
  272. </script>
  273. </select>
  274. <input id="ipt_fromdd" ref="/root/send/data1/fromdd" class="input_search" visibility="hidden" inputtype="date" style="left:610px; top:9px; width:95px; height:19px; "/>
  275. <input id="ipt_todd" ref="/root/send/data1/todd" class="input_search" visibility="hidden" inputtype="date" style="left:725px; top:9px; width:95px; height:19px; "/>
  276. <caption id="caption5" visibility="hidden" style="left:710px; top:10px; width:15px; height:20px; ">~</caption>
  277. <caption id="caption7" class="search_name" visibility="hidden" style="left:520px; top:10px; width:86px; height:17px; ">조회일자 :</caption>
  278. <select id="chk_kindflag" ref="/root/send/data1/kindflag" disabled="true" overflow="visible" appearance="full" style="left:365px; top:11px; width:80px; height:15px; border-style:none; ">
  279. <choices>
  280. <item>
  281. <label>병동구분별</label>
  282. <value>Y</value>
  283. </item>
  284. </choices>
  285. </select>
  286. </group>
  287. <caption id="caption2" class="tit_2" style="left:5px; top:55px; width:300px; height:14px; font-family:돋움; vertical-align:middle; ">병상가동률</caption>
  288. <line id="line1" class="line_1" style="x1:0px; y1:70px; x2:1194px; y2:70px; "/>
  289. <group id="grp_report" visibility="hidden" style="left:865px; top:50px; width:65px; height:15px; "/>
  290. <button id="btn_preview" class="btn2_letter4" visibility="hidden" style="left:1018px; top:50px; width:64px; height:19px; ">
  291. <caption>미리보기</caption>
  292. <script type="javascript" ev:event="DOMActivate">
  293. <![CDATA[
  294. fPrint("PREVIEW");
  295. ]]>
  296. </script>
  297. </button>
  298. <button id="btn_print" class="btn2_letter2" visibility="hidden" style="left:1085px; top:50px; width:42px; height:19px; ">
  299. <caption>출력</caption>
  300. <script type="javascript" ev:event="DOMActivate">
  301. <![CDATA[
  302. fPrint("PRINT");
  303. ]]>
  304. </script>
  305. </button>
  306. <button id="btn_excel" class="btn2_letter4" style="left:1130px; top:50px; width:64px; height:19px; ">
  307. <caption>엑셀저장</caption>
  308. <script type="javascript" ev:event="DOMActivate">
  309. <![CDATA[
  310. var fileName = window.fileDialog("save", ",", false, getCurrentDate(), "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
  311. if (fileName != "")
  312. {
  313. grd_list.saveExcel(fileName, "SheetName", false, false, "", "", false);
  314. }
  315. ]]>
  316. </script>
  317. </button>
  318. <datagrid id="grd_list" nodeset="/root/main/bedoperatingratelist" class="datagrid2" caption="층^구분^센터^병동^진료과^병상수^재원병상^빈병상^퇴원예정(통보)^병상가동률(%)" colsep="^" colwidth="100, 100, 100, 150, 200, 100, 100, 100, 100, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:0px; top:75px; width:1194px; height:668px; ">
  319. <col ref="posinfocd" style="text-align:center; "/>
  320. <col ref="wardkind" style="text-align:center; "/>
  321. <col disabled="true" ref="spaceflag" type="output" style="text-align:left; "/>
  322. <col ref="wardcd" style="text-align:left; "/>
  323. <col ref="spaceflag" style="text-align:left; "/>
  324. <col ref="bedcnt" format="#,###" style="text-align:center; "/>
  325. <col ref="inpatcnt" format="#,###" style="text-align:center; "/>
  326. <col ref="vacantcnt" format="#,###" style="text-align:center; "/>
  327. <col ref="dschnoticnt" format="#,###" style="text-align:center; "/>
  328. <col ref="operatingrate" roundmode="round" roundposition="1" style="text-align:right; padding-right:10; "/>
  329. </datagrid>
  330. <caption id="caption8" style="left:115px; top:50px; width:860px; height:15px; font-weight:bold; color:#0000ff; ">★ 병동 기간별 가동률 조회시 병상정보는 자정12시를 기준으로 저장된 데이터를 기준으로 조회됩니다. 조회기간은 6개월을 넘길수 없습니다.★</caption>
  331. </group>
  332. <group id="group5" style="left:0px; top:757px; width:1195px; height:27px; ">
  333. <button id="button2" class="btn4_letter3" style="left:1126px; top:5px; width:68px; height:22px; ">
  334. <caption>초기화</caption>
  335. <script type="javascript" ev:event="DOMActivate">
  336. <![CDATA[
  337. fInitialize();
  338. ]]>
  339. </script>
  340. </button>
  341. <line id="line32" class="line_6" style="x1:0px; y1:0px; x2:1194px; y2:0px; "/>
  342. <shape id="rectangle1" appearance="rectangle" style="left:35px; top:5px; width:12px; height:12px; "/>
  343. </group>
  344. <group id="group4" style="left:0px; top:757px; width:1195px; height:27px; ">
  345. <button id="button1" class="btn4_letter3" style="left:1126px; top:5px; width:68px; height:22px; ">
  346. <caption>초기화</caption>
  347. <script type="javascript" ev:event="DOMActivate">
  348. <![CDATA[
  349. fInitialize();
  350. ]]>
  351. </script>
  352. </button>
  353. <line id="line3" class="line_6" style="x1:0px; y1:0px; x2:1194px; y2:0px; "/>
  354. <shape id="rectangle2" appearance="rectangle" style="left:35px; top:5px; width:12px; height:12px; "/>
  355. </group>
  356. <group id="group6" style="left:0px; top:757px; width:1195px; height:27px; ">
  357. <button id="button3" class="btn4_letter3" style="left:1126px; top:5px; width:68px; height:22px; ">
  358. <caption>초기화</caption>
  359. <script type="javascript" ev:event="DOMActivate">
  360. <![CDATA[
  361. fInitialize();
  362. ]]>
  363. </script>
  364. </button>
  365. <line id="line4" class="line_6" style="x1:0px; y1:0px; x2:1194px; y2:0px; "/>
  366. <shape id="rectangle3" appearance="rectangle" style="left:0px; top:5px; width:12px; height:12px; background-color:#7FFFD4; "/>
  367. <shape id="rectangle4" appearance="rectangle" style="left:57px; top:5px; width:12px; height:12px; background-color:#FAF58C; "/>
  368. <shape id="rectangle5" appearance="rectangle" style="left:114px; top:5px; width:12px; height:12px; background-color:#FF4646; "/>
  369. <caption id="caption1" style="left:14px; top:5px; width:35px; height:12px; ">: 여유</caption>
  370. <caption id="caption3" style="left:71px; top:5px; width:35px; height:14px; ">: 경고</caption>
  371. <caption id="caption4" style="left:128px; top:5px; width:35px; height:14px; ">: 부족</caption>
  372. </group>
  373. </xhtml:body>
  374. </xhtml:html>