SPANC00301_열량HB계산.xrw 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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>열량HB계산</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <main>
  10. <maledata>
  11. <wt/>
  12. <ht/>
  13. <age/>
  14. <kcal/>
  15. </maledata>
  16. <femaledata>
  17. <wt/>
  18. <ht/>
  19. <age/>
  20. <kcal/>
  21. </femaledata>
  22. <receivedata>
  23. <sex/>
  24. <age/>
  25. <wt/>
  26. <abw/>
  27. <pibw/>
  28. <ht/>
  29. <flag/>
  30. </receivedata>
  31. </main>
  32. <send>
  33. <kcal/>
  34. </send>
  35. <init/>
  36. <hidden/>
  37. </root>
  38. </instance>
  39. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  40. <script type="javascript" src="../../../com/commonweb/js/numericHelper.js"/>
  41. <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
  42. <script type="javascript" ev:event="xforms-ready">
  43. <![CDATA[
  44. var sex = model.getValue("/root/main/receivedata/sex");
  45. var age = model.getValue("/root/main/receivedata/age");
  46. var wt = model.getValue("/root/main/receivedata/wt");
  47. var ht = model.getValue("/root/main/receivedata/ht");
  48. var abw = model.getValue("/root/main/receivedata/abw");
  49. var pibw = model.getValue("/root/main/receivedata/pibw");
  50. var kcal = 0;
  51. //화면 오픈시 해당 데이터 셋팅
  52. if (sex == "M") { //남자일 경우
  53. model.setValue("/root/main/maledata/age", age);
  54. model.setValue("/root/main/maledata/ht", ht);
  55. if (pibw < 120) { //PIBW가 120 이상인 경우는 WT 대신 ABW로 계산
  56. model.setValue("/root/main/maledata/wt", wt);
  57. kcal = 66+13.7*wt+5*ht-6.8*age;
  58. } else {
  59. model.setValue("/root/main/maledata/wt", abw);
  60. kcal = 66+13.7*abw+5*ht-6.8*age;
  61. }
  62. model.setValue("/root/main/maledata/kcal", kcal);
  63. } else if (sex == "F") { //여자일 경우
  64. model.setValue("/root/main/femaledata/age", age);
  65. model.setValue("/root/main/femaledata/ht", ht);
  66. if (pibw < 120) { //PIBW가 120 이상인 경우는 WT 대신 ABW로 계산
  67. model.setValue("/root/main/femaledata/wt", wt);
  68. kcal = 655+9.6*wt+1.8*ht-4.7*age;
  69. } else {
  70. model.setValue("/root/main/femaledata/wt", abw);
  71. kcal = 655+9.6*abw+1.8*ht-4.7*age;
  72. }
  73. model.setValue("/root/main/femaledata/kcal", kcal);
  74. }
  75. //계산된 최종값을 메인 화면으로 전달하기위해
  76. model.setValue("/root/send/kcal", kcal)
  77. model.refresh();
  78. ]]>
  79. </script>
  80. </model>
  81. </xhtml:head>
  82. <xhtml:body pagewidth="619" pageheight="343" guideline="2,13;1,1194;2,784;2,757;" style="margin-left:8; margin-top:0; margin-right:8; margin-bottom:0; ">
  83. <group id="grp_biz" scroll="auto" style="left:0px; top:0px; width:501px; height:155px; ">
  84. <caption id="caption1" class="tit_2" style="left:5px; top:11px; width:135px; height:13px; ">열량-HB 계산</caption>
  85. <line id="line1" class="line_1" style="x1:0px; y1:26px; x2:500px; y2:26px; "/>
  86. <caption id="caption2" style="left:10px; top:60px; width:80px; height:13px; ">남: 66 + 13.7 *</caption>
  87. <input id="opt_mwt" ref="/root/main/maledata/wt" class="output_fix" format="###.##" editable="true" autonext="false" style="left:95px; top:55px; width:40px; height:19px; text-align:center; "/>
  88. <caption id="caption3" style="left:135px; top:60px; width:55px; height:13px; ">kg + 5 *</caption>
  89. <input id="opt_mht" ref="/root/main/maledata/ht" class="output_fix" format="###.##" editable="true" autonext="false" style="left:185px; top:55px; width:40px; height:19px; text-align:center; "/>
  90. <caption id="caption4" style="left:225px; top:60px; width:60px; height:13px; ">cm - 6.8 *</caption>
  91. <input id="opt_mage" ref="/root/main/maledata/age" class="output_fix" format="###.##" editable="true" autonext="false" style="left:285px; top:55px; width:40px; height:19px; text-align:center; "/>
  92. <caption id="caption5" style="left:325px; top:60px; width:25px; height:13px; ">yr =</caption>
  93. <output id="opt_mkcal" ref="/root/main/maledata/kcal" class="output_fix" format="###.##" autonext="false" style="left:350px; top:55px; width:48px; height:19px; text-align:center; "/>
  94. <caption id="caption6" style="left:400px; top:60px; width:25px; height:13px; ">kcal</caption>
  95. <output id="opt_fmkcal" ref="/root/main/femaledata/kcal" class="output_fix" format="###.##" autonext="false" style="left:360px; top:85px; width:48px; height:19px; text-align:center; "/>
  96. <caption id="caption7" style="left:10px; top:90px; width:80px; height:13px; ">여: 655 + 9.6 *</caption>
  97. <caption id="caption8" style="left:135px; top:90px; width:55px; height:13px; ">kg + 1.8 *</caption>
  98. <caption id="caption9" style="left:235px; top:90px; width:60px; height:13px; ">cm - 4.7 *</caption>
  99. <caption id="caption10" style="left:335px; top:90px; width:25px; height:13px; ">yr =</caption>
  100. <caption id="caption11" style="left:410px; top:90px; width:25px; height:13px; ">kcal</caption>
  101. <input id="opt_fmwt" ref="/root/main/femaledata/wt" class="output_fix" format="###.##" autonext="false" style="left:95px; top:85px; width:40px; height:19px; text-align:center; "/>
  102. <input id="opt_fmht" ref="/root/main/femaledata/ht" class="output_fix" format="###.##" editable="true" autonext="false" style="left:195px; top:85px; width:40px; height:19px; text-align:center; "/>
  103. <input id="opt_fmage" ref="/root/main/femaledata/age" class="output_fix" format="###.##" editable="true" autonext="false" style="left:295px; top:85px; width:40px; height:19px; text-align:center; "/>
  104. </group>
  105. <group id="grp_btn" scroll="auto" style="left:0px; top:156px; width:501px; height:27px; ">
  106. <button id="btn_cfm" class="btn4_letter2" style="left:385px; top:5px; width:56px; height:22px; ">
  107. <caption>확인</caption>
  108. <script type="javascript" ev:event="onclick">
  109. <![CDATA[
  110. var sex = model.getValue("/root/main/receivedata/sex");
  111. //열량-HB 재계산
  112. if (sex == "M") { // 남자일 경우
  113. var wt = opt_mwt.value;
  114. var ht = opt_mht.value;
  115. var age = opt_mage.value;
  116. var kcal = 66+13.7*wt+5*ht-6.8*age;
  117. model.setValue("/root/main/maledata/kcal", kcal);
  118. } else if (sex == "F") { // 여자일 경우
  119. var wt = opt_fmwt.value;
  120. var ht = opt_fmht.value;
  121. var age = opt_fmage.value;
  122. var kcal = 655+9.6*wt+1.8*ht-4.7*age;
  123. model.setValue("/root/main/femaledata/kcal", kcal);
  124. }
  125. // 계산된 최종값을 메인 화면으로 전달하기위해
  126. model.setValue("/root/send/kcal", kcal)
  127. model.refresh();
  128. var flag = model.getValue("/root/main/receivedata/flag");
  129. if ( flag == 1 ) { // 협진의뢰 tab화면의 열량HB에 값 셋팅
  130. opener.model.setValue("/root/main/maindata/cnstreq/optcalrhb1", model.getValue("/root/send/kcal"));
  131. } else if ( flag == 2 ) { // 추구관리 tab화면의 열량HB에 값 셋팅
  132. opener.model.setValue("/root/main/maindata/pursmngt/optcalrhb2", model.getValue("/root/send/kcal"));
  133. }
  134. window.close();
  135. ]]>
  136. </script>
  137. </button>
  138. <button id="btn_can" class="btn4_letter2" style="left:444px; top:5px; width:56px; height:22px; ">
  139. <caption>취소</caption>
  140. <script type="javascript" ev:event="xforms-activate">
  141. <![CDATA[
  142. window.close();
  143. ]]>
  144. </script>
  145. </button>
  146. </group>
  147. </xhtml:body>
  148. </xhtml:html>