|
@@ -6,8 +6,19 @@
|
|
|
|
|
|
<div class="mb-3 d-flex align-items-center">
|
|
|
<span class="text-secondary min-width-140px">Current Height:</span>
|
|
|
- <div class="width-100px mr-2"><?= vsElement('current_height_in_inches', 'number', 'currentHeightInInches', $patient) ?></div>
|
|
|
- <span class="text-secondary">(in.)</span>
|
|
|
+ <div class="width-50px mr-1">
|
|
|
+ <input type="text" name="current_height_FT" class="form-control form-control-sm min-width-unset rounded-0"
|
|
|
+ heightFeetInput
|
|
|
+ value="{{feetFromInches($patient->current_height_in_inches)}}">
|
|
|
+ </div>
|
|
|
+ <span class="text-secondary mr-2">ft.</span>
|
|
|
+ <div class="width-50px mr-1">
|
|
|
+ <input type="text" name="current_height_IN" class="form-control form-control-sm min-width-unset rounded-0"
|
|
|
+ heightInchesInput
|
|
|
+ value="{{inchesAfterFeetFromInches($patient->current_height_in_inches)}}">
|
|
|
+ </div>
|
|
|
+ <span class="text-secondary mr-2">in.</span>
|
|
|
+ <?= vsElement('current_height_in_inches', 'hidden', 'currentHeightInInches', $patient) ?>
|
|
|
</div>
|
|
|
|
|
|
<hr class="my-3">
|
|
@@ -173,6 +184,17 @@
|
|
|
for (let i = 1; i <= 4; i++) {
|
|
|
initICDAutoSuggest($('[name="whyIsWeightMonitoringNeededIcd' + i + '"]'), $('[name="whyIsWeightMonitoringNeededDescription' + i + '"]'));
|
|
|
}
|
|
|
+
|
|
|
+ let parentSegment = $('#bmi-management-settings');
|
|
|
+ parentSegment.find('[heightFeetInput], [heightInchesInput]').off('change input paste');
|
|
|
+ parentSegment.find('[heightFeetInput], [heightInchesInput]').on('change input paste', function () {
|
|
|
+ debugger
|
|
|
+ let inches = 0;
|
|
|
+ let ft = +(parentSegment.find('[heightFeetInput]').val()),
|
|
|
+ inc = +(parentSegment.find('[heightInchesInput]').val());
|
|
|
+ inches = Math.round(ft * 12 + inc);
|
|
|
+ parentSegment.find('[name="currentHeightInInches"]').val(inches).trigger('change');
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
addMCInitializer('bmi-management-settings', init, '#bmi-management-settings');
|