Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- ~ The contents of this file are subject to the OpenMRS Public License
- ~ Version 1.0 (the "License"); you may not use this file except in
- ~ compliance with the License. You may obtain a copy of the License at
- ~ http://license.openmrs.org
- ~
- ~ Software distributed under the License is distributed on an "AS IS"
- ~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- ~ License for the specific language governing rights and limitations
- ~ under the License.
- ~
- ~ Copyright (C) OpenMRS, LLC. All Rights Reserved.
- -->
- <htmlform formUuid="a000cb34-9ec1-4344-a1c8-f692232f6edd" formName="Vitals" formEncounterType="67a71486-1a54-468f-ac3e-7091a9a79584" formVersion="1.0">
- <style>
- #calculated-bmi {
- font-weight: bold;
- font-size: 1.4em;
- }
- .encounter-summary-container #calculated-bmi {
- font-size: 1em;
- font-weight: normal;
- }
- #clinicians_name > input{
- width:200px;
- }
- </style>
- <!-- only show BMI if patient is more than 5 years old (on the encounterDate) -->
- <includeIf velocityTest="$patient.getAge($encounter.getEncounterDatetime()) > 5">
- <script type="text/javascript">var ctx = "${pageContext.request.contextPath}"</script>
- <script type="text/javascript">
- var calculateBmi = function(wt, ht) {
- var bmi = null
- if (wt && ht) {
- bmi = wt / ((ht/100) * (ht/100));
- }
- return bmi ;
- }
- </script>
- <ifMode mode="ENTER">
- <script type="text/javascript">
- // functions to handle updating the bmi when in ENTER mode
- var updateBmi = function() {
- var wt = htmlForm.getValueIfLegal('weight.value');
- var ht = htmlForm.getValueIfLegal('height.value');
- var bmi = calculateBmi(wt, ht);
- if (bmi == null || isNaN(bmi)) {
- jq('#calculated-bmi-wrapper').hide();
- } else {
- jq('#no-calculated-bmi').hide();
- jq('#calculated-bmi-wrapper').show();
- jq('#calculated-bmi').html(bmi.toFixed(1));
- jq('#hidden-calculated-bmi').val(bmi.toFixed(1));
- }
- };
- jq(function() {
- jq('#calculated-bmi-wrapper').hide();
- getField('weight.value').change(updateBmi)
- getField('height.value').change(updateBmi);
- updateBmi();
- });
- jq(function() {
- jq('#bp_systolic input[type=text]').attr('min', '50');
- });
- jq(function() {
- jq('#bp_diastolic input[type=text]').attr('min', '30');
- });
- </script>
- </ifMode>
- <script>
- // set the blood pressure fields as "expected"
- jq(function() {
- jq('#bp_systolic > input').addClass('expected');
- jq('#bp_diastolic > input').addClass('expected');
- });
- </script>
- <ifMode mode="VIEW">
- <script type="text/javascript">
- // handle displaying the bmi when in VIEW mode
- jq(function() {
- // we have to iterate through in case there are multiple vitals forms
- // displayed on a single page
- jq('htmlform').each(function(index, form) {
- jq(form).find('#calculated-bmi-continue').hide();
- jq(form).find('#no-calculated-bmi').hide();
- var wt = jq(form).find('#weight').find('.value').text();
- var ht = jq(form).find('#height').find('.value').text();
- var bmi = calculateBmi(wt, ht);
- if (bmi != null && !isNaN(bmi)) {
- jq(form).find('#calculated-bmi-wrapper').show();
- jq(form).find('#calculated-bmi').html(bmi.toFixed(1));
- jq(form).find('#hidden-calculated-bmi').val(bmi.toFixed(1));
- }
- });
- });
- </script>
- </ifMode>
- </includeIf>
- <div class="hidden" id="encounter-details" sectionTag="section" headerStyle="title" headerLabel="Encounter Details">
- <fieldset>
- <legend>When?</legend>
- <label>When?</label>
- <encounterDate default="now" showTime="false"/>
- </fieldset>
- <fieldset>
- <legend>Who?</legend>
- <label>Who?</label>
- <encounterProviderAndRole default="currentUser" encounterRole="240b26f9-dd88-4172-823d-4a8bfeb7841f" required="true"/>
- </fieldset>
- <fieldset>
- <legend>Where?</legend>
- <label>Where?</label>
- <encounterLocation default="SessionAttribute:emrContext.sessionLocationId"/>
- </fieldset>
- </div>
- <section id="management_section" sectionTag="section" headerStyle="title" headerCode="Upload">
- <fieldset>
- <legend>Upload</legend>
- <h3>Upload</h3>
- <p class="left">
- <obs conceptId="162827" id="upload"/>
- </p>
- </fieldset>
- </section>
- <submit/>
- </htmlform>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement