Advertisement
Guest User

Untitled

a guest
Aug 8th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.61 KB | None | 0 0
  1. <!--
  2. ~ The contents of this file are subject to the OpenMRS Public License
  3. ~ Version 1.0 (the "License"); you may not use this file except in
  4. ~ compliance with the License. You may obtain a copy of the License at
  5. ~ http://license.openmrs.org
  6. ~
  7. ~ Software distributed under the License is distributed on an "AS IS"
  8. ~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  9. ~ License for the specific language governing rights and limitations
  10. ~ under the License.
  11. ~
  12. ~ Copyright (C) OpenMRS, LLC. All Rights Reserved.
  13. -->
  14.  
  15. <htmlform formUuid="a000cb34-9ec1-4344-a1c8-f692232f6edd" formName="Vitals" formEncounterType="67a71486-1a54-468f-ac3e-7091a9a79584" formVersion="1.0">
  16. <style>
  17. #calculated-bmi {
  18. font-weight: bold;
  19. font-size: 1.4em;
  20. }
  21.  
  22. .encounter-summary-container #calculated-bmi {
  23. font-size: 1em;
  24. font-weight: normal;
  25. }
  26. #clinicians_name > input{
  27. width:200px;
  28. }
  29. </style>
  30.  
  31. <!-- only show BMI if patient is more than 5 years old (on the encounterDate) -->
  32. <includeIf velocityTest="$patient.getAge($encounter.getEncounterDatetime()) > 5">
  33. <script type="text/javascript">var ctx = "${pageContext.request.contextPath}"</script>
  34. <script type="text/javascript">
  35. var calculateBmi = function(wt, ht) {
  36. var bmi = null
  37. if (wt &amp;&amp; ht) {
  38. bmi = wt / ((ht/100) * (ht/100));
  39. }
  40. return bmi ;
  41. }
  42. </script>
  43.  
  44. <ifMode mode="ENTER">
  45. <script type="text/javascript">
  46.  
  47. // functions to handle updating the bmi when in ENTER mode
  48. var updateBmi = function() {
  49. var wt = htmlForm.getValueIfLegal('weight.value');
  50. var ht = htmlForm.getValueIfLegal('height.value');
  51.  
  52. var bmi = calculateBmi(wt, ht);
  53.  
  54. if (bmi == null || isNaN(bmi)) {
  55. jq('#calculated-bmi-wrapper').hide();
  56. } else {
  57. jq('#no-calculated-bmi').hide();
  58. jq('#calculated-bmi-wrapper').show();
  59. jq('#calculated-bmi').html(bmi.toFixed(1));
  60. jq('#hidden-calculated-bmi').val(bmi.toFixed(1));
  61. }
  62. };
  63.  
  64. jq(function() {
  65. jq('#calculated-bmi-wrapper').hide();
  66.  
  67. getField('weight.value').change(updateBmi)
  68. getField('height.value').change(updateBmi);
  69.  
  70. updateBmi();
  71. });
  72.  
  73. jq(function() {
  74. jq('#bp_systolic input[type=text]').attr('min', '50');
  75. });
  76.  
  77. jq(function() {
  78. jq('#bp_diastolic input[type=text]').attr('min', '30');
  79. });
  80. </script>
  81. </ifMode>
  82.  
  83. <script>
  84. // set the blood pressure fields as "expected"
  85. jq(function() {
  86. jq('#bp_systolic > input').addClass('expected');
  87. jq('#bp_diastolic > input').addClass('expected');
  88. });
  89. </script>
  90.  
  91. <ifMode mode="VIEW">
  92. <script type="text/javascript">
  93.  
  94. // handle displaying the bmi when in VIEW mode
  95. jq(function() {
  96.  
  97. // we have to iterate through in case there are multiple vitals forms
  98. // displayed on a single page
  99.  
  100. jq('htmlform').each(function(index, form) {
  101. jq(form).find('#calculated-bmi-continue').hide();
  102. jq(form).find('#no-calculated-bmi').hide();
  103.  
  104. var wt = jq(form).find('#weight').find('.value').text();
  105. var ht = jq(form).find('#height').find('.value').text();
  106.  
  107. var bmi = calculateBmi(wt, ht);
  108.  
  109. if (bmi != null &amp;&amp; !isNaN(bmi)) {
  110. jq(form).find('#calculated-bmi-wrapper').show();
  111. jq(form).find('#calculated-bmi').html(bmi.toFixed(1));
  112. jq(form).find('#hidden-calculated-bmi').val(bmi.toFixed(1));
  113. }
  114. });
  115.  
  116. });
  117.  
  118. </script>
  119. </ifMode>
  120.  
  121. </includeIf>
  122.  
  123. <div class="hidden" id="encounter-details" sectionTag="section" headerStyle="title" headerLabel="Encounter Details">
  124. <fieldset>
  125. <legend>When?</legend>
  126. <label>When?</label>
  127.  
  128. <encounterDate default="now" showTime="false"/>
  129. </fieldset>
  130.  
  131. <fieldset>
  132. <legend>Who?</legend>
  133. <label>Who?</label>
  134.  
  135. <encounterProviderAndRole default="currentUser" encounterRole="240b26f9-dd88-4172-823d-4a8bfeb7841f" required="true"/>
  136. </fieldset>
  137.  
  138. <fieldset>
  139. <legend>Where?</legend>
  140. <label>Where?</label>
  141.  
  142. <encounterLocation default="SessionAttribute:emrContext.sessionLocationId"/>
  143. </fieldset>
  144. </div>
  145.  
  146.  
  147. <section id="management_section" sectionTag="section" headerStyle="title" headerCode="Upload">
  148.  
  149. <fieldset>
  150. <legend>Upload</legend>
  151. <h3>Upload</h3>
  152. <p class="left">
  153. <obs conceptId="162827" id="upload"/>
  154. </p>
  155. </fieldset>
  156.  
  157.  
  158.  
  159.  
  160. </section>
  161.  
  162. <submit/>
  163.  
  164. </htmlform>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement