Ver Fonte

Vitals - height I/O in feet/inches

Vijayakrishnan há 3 anos atrás
pai
commit
c8350a062d

+ 22 - 1
resources/views/app/patient/segment-templates/vitals/edit.blade.php

@@ -110,7 +110,7 @@ $copyTriggerAdded = [];
                         <td>
                             <input type="text" tabindex="-1"
                                    class="form-control form-control-sm events-none border-0"
-                                   value="{{ $k === 'systolicBP' ? 'Blood Pressure' : $v }}" readonly>
+                                   value="{{ $k === 'systolicBP' ? 'Blood Pressure' : ($k === 'heightInInches' ? 'Height' : $v) }}" readonly>
                         </td>
                         <td class="position-relative">
                             @if($k === "bmi")
@@ -162,6 +162,18 @@ $copyTriggerAdded = [];
                                            data-name="diastolicBP" diastolicBP
                                            value="{{$contentData['diastolicBP']}}" placeholder="Diastolic">
                                 </div>
+                            @elseif($k === 'heightInInches')
+                                <div class="d-flex align-items-center bg-white">
+                                    <input type="text" class="form-control form-control-sm min-width-unset w-auto-input width-30px border-0 edit"
+                                           heightFeetInput
+                                           value="{{feetFromInches($contentData['heightInInches'])}}">
+                                    <span class="pl-1 pr-2 text-secondary bg-white">ft.</span>
+                                    <input type="text" class="form-control form-control-sm min-width-unset w-auto-input width-30px border-0 edit"
+                                           heightInchesInput
+                                           value="{{inchesAfterFeetFromInches($contentData['heightInInches'])}}">
+                                    <span class="pl-1 text-secondary bg-white">in.</span>
+                                    <input type="hidden" data-name="heightInInches" value="{{$contentData['heightInInches']}}">
+                                </div>
                             @else
                                 <input type="text"
                                        class="form-control form-control-sm border-0" data-name="{{$k}}" {{$k}}
@@ -217,6 +229,15 @@ $copyTriggerAdded = [];
             parentSegment.find('[bmi-date]').val(parentSegment.find('[weight-date]').val());
         });
 
+        parentSegment.find('[heightFeetInput], [heightInchesInput]').off('change input paste');
+        parentSegment.find('[heightFeetInput], [heightInchesInput]').on('change input paste', function () {
+            let inches = 0;
+            let ft = +(parentSegment.find('[heightFeetInput]').val()),
+                inc = +(parentSegment.find('[heightInchesInput]').val());
+            inches = Math.round(ft * 12 + inc);
+            parentSegment.find('[data-name="heightInInches"]').val(inches);
+        });
+
         parentSegment.find('.vitals-copy-trigger').off('click.copy-vital');
         parentSegment.find('.vitals-copy-trigger').on('click.copy-vital', function () {
             let td = $(this).closest('td'), value = $.trim(td.text());

+ 5 - 2
resources/views/app/patient/segment-templates/vitals/summary.blade.php

@@ -56,8 +56,11 @@ if(!$contentData) {
                 @if($k === 'systolicBP')
                     <span>Blood Pressure:</span>
                     <b>{{ @$contentData['systolicBP'] ?: '-' }}/{{ @$contentData['diastolicBP'] ?: '-' }}</b>
-                @elseif($k === 'diastolicBP') <!--ignore-->
-
+                @elseif($k === 'diastolicBP')
+                    <!--ignore-->
+                @elseif($k === 'heightInInches')
+                    <span>Height:</span>
+                    <b>{{ !empty($vital) ? toFeetAndInches($vital) : '-' }}</b>
                 @else
                     <span>{{$v}}:</span>
                     <b>{{ !empty($vital) ? $vital : '-' }}</b>