|
@@ -0,0 +1,168 @@
|
|
|
+<?php
|
|
|
+if(!$contentData) {
|
|
|
+ $contentData = [
|
|
|
+ "heightInches" => [
|
|
|
+ "label" => "Ht. (in.)",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "weightPounds" => [
|
|
|
+ "label" => "Wt. (lbs.)",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "temperatureF" => [
|
|
|
+ "label" => "Temp. (F)",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "pulseRatePerMinute" => [
|
|
|
+ "label" => "Pulse",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "respirationRatePerMinute" => [
|
|
|
+ "label" => "Resp.",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "pulseOx" => [
|
|
|
+ "label" => "Pulse Ox.",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "systolicBP" => [
|
|
|
+ "label" => "SBP",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "diastolicBP" => [
|
|
|
+ "label" => "DBP",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "smokingStatus" => [
|
|
|
+ "label" => "Smoking Status",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ "bmi" => [
|
|
|
+ "label" => "BMI (kg/m²)",
|
|
|
+ "value" => "",
|
|
|
+ "date" => "",
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+}
|
|
|
+
|
|
|
+$formID = rand(0, 100000);
|
|
|
+?>
|
|
|
+<div id="vitalsSection">
|
|
|
+ <h3 class="stag-popup-title mb-2 border-bottom-0 pb-1 hide-if-note">
|
|
|
+ <span>Vitals</span>
|
|
|
+ <a href="#" onclick="return closeStagPopup()"
|
|
|
+ class="ml-auto text-secondary">
|
|
|
+ <i class="fa fa-times-circle"></i>
|
|
|
+ </a>
|
|
|
+ </h3>
|
|
|
+
|
|
|
+ <input type="hidden" name="data" value="{{json_encode($contentData)}}">
|
|
|
+
|
|
|
+ <table class="table table-sm table-bordered mb-2 table-edit-sheet">
|
|
|
+ <thead>
|
|
|
+ <tr class="bg-light">
|
|
|
+ <th class="px-2 text-secondary border-bottom-0 w-25">Vital</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0 w-35">Value</th>
|
|
|
+ <th class="px-2 text-secondary border-bottom-0">Date</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="(item, index) in items">
|
|
|
+ <td>
|
|
|
+ <input type="text" :data-index="index" tabindex="-1"
|
|
|
+ class="form-control form-control-sm events-none"
|
|
|
+ data-field="title" v-model="item.label" readonly>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input type="text" :data-index="index" v-if="index === 'bmi'" :readonly="index === 'bmi'"
|
|
|
+ class="form-control form-control-sm vitals-title"
|
|
|
+ data-field="value" v-model="bmi">
|
|
|
+ <input type="text" :data-index="index" v-if="index !== 'bmi'"
|
|
|
+ class="form-control form-control-sm vitals-title"
|
|
|
+ data-field="value" v-model="item.value">
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input type="date" :data-index="index" v-if="index !== 'bmi'"
|
|
|
+ class="form-control form-control-sm vitals-title"
|
|
|
+ data-field="date" v-model="item.date">
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ window.clientVitalsApp = new Vue({
|
|
|
+ el: '#vitalsSection',
|
|
|
+ data: {
|
|
|
+ items: <?= json_encode($contentData) ?>
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ $(this.$el).closest('#vitalsSection').find('[name="data"]').val(
|
|
|
+ JSON.stringify(this.cleanObject(this.items))
|
|
|
+ );
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $data: {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
+ $(this.$el).closest('#vitalsSection').find('[name="data"]').val(
|
|
|
+ JSON.stringify(this.cleanObject(this.items))
|
|
|
+ );
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ bmi: function () {
|
|
|
+ let result = '';
|
|
|
+ let h = this.items.heightInches.value, w = this.items.weightPounds.value;
|
|
|
+ if(!h || !w) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ h = parseFloat(h);
|
|
|
+ w = parseFloat(w);
|
|
|
+ if(!h || !w) {
|
|
|
+ this.items.bmi.value = '';
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ let result = (w / [ h * h]) * 703;
|
|
|
+ return result.toFixed(1);
|
|
|
+ }
|
|
|
+ catch (e) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ cleanObject: function(_source) {
|
|
|
+ let plObject = {};
|
|
|
+ for (let y in _source) {
|
|
|
+ if(_source.hasOwnProperty(y)) {
|
|
|
+ plObject[y] = _source[y];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ plObject.bmi = {
|
|
|
+ label: "BMI (kg/m²)",
|
|
|
+ value: this.bmi,
|
|
|
+ date: "",
|
|
|
+ };
|
|
|
+ return plObject;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ addMCInitializer('client-vitals-{{ $patient->uid }}', init);
|
|
|
+ })();
|
|
|
+</script>
|