|
@@ -0,0 +1,159 @@
|
|
|
|
+<?php
|
|
|
|
+
|
|
|
|
+use App\Models\Point;
|
|
|
|
+
|
|
|
|
+$category = 'VITALS';
|
|
|
|
+$endPoint = 'upsertNoteSingleton';
|
|
|
|
+
|
|
|
|
+$vitalLabels = [
|
|
|
|
+ "heightInInches" => "Ht. (in.)",
|
|
|
|
+ "weightPounds" => "Wt. (lbs.)",
|
|
|
|
+ "temperatureF" => "Temp. (F)",
|
|
|
|
+ "systolicBP" => "SBP",
|
|
|
|
+ "diastolicBP" => "DBP",
|
|
|
|
+ "pulseRatePerMinute" => "Pulse",
|
|
|
|
+ "respirationRatePerMinute" => "Resp.",
|
|
|
|
+ "pulseOx" => "Pulse Ox.",
|
|
|
|
+ "smokingStatus" => "Smoking Status",
|
|
|
|
+ "bmi" => "BMI (kg/m²)",
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
|
|
|
|
+$contentData = null;
|
|
|
|
+if (!!@$point->data) {
|
|
|
|
+ $contentData = json_decode($point->data);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+if(!$contentData) {
|
|
|
|
+ $contentData = [
|
|
|
|
+ "heightInInches" => [
|
|
|
|
+ "label" => "Ht. (in.)",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "weightPounds" => [
|
|
|
|
+ "label" => "Wt. (lbs.)",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "temperatureF" => [
|
|
|
|
+ "label" => "Temp. (F)",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "systolicBP" => [
|
|
|
|
+ "label" => "SBP",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "diastolicBP" => [
|
|
|
|
+ "label" => "DBP",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "pulseRatePerMinute" => [
|
|
|
|
+ "label" => "Pulse",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "respirationRatePerMinute" => [
|
|
|
|
+ "label" => "Resp.",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "pulseOx" => [
|
|
|
|
+ "label" => "Pulse Ox.",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "smokingStatus" => [
|
|
|
|
+ "label" => "Smoking Status",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ "bmi" => [
|
|
|
|
+ "label" => "BMI (kg/m²)",
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ],
|
|
|
|
+ ];
|
|
|
|
+}else {
|
|
|
|
+ foreach ($vitalLabels as $k => $v) {
|
|
|
|
+ if (!isset($contentData[$k])) {
|
|
|
|
+ $contentData[$k] = [
|
|
|
|
+ "label" => $v,
|
|
|
|
+ "value" => "",
|
|
|
|
+ "date" => "",
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+?>
|
|
|
|
+<div>
|
|
|
|
+ <form show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
|
|
|
|
+ <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
|
+ <input type="hidden" name="category" value="<?= $category ?>">
|
|
|
|
+ <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>
|
|
|
|
+ @foreach($vitalLabels as $k => $v)
|
|
|
|
+ <tr>
|
|
|
|
+ <td>
|
|
|
|
+ <input type="text" tabindex="-1"
|
|
|
|
+ class="form-control form-control-sm events-none"
|
|
|
|
+ data-field="title" value="{{ $v }}" readonly>
|
|
|
|
+ </td>
|
|
|
|
+ <td class="position-relative">
|
|
|
|
+ @if($k === "bmi")
|
|
|
|
+ <input type="text" readonly
|
|
|
|
+ class="form-control form-control-sm vitals-title"
|
|
|
|
+ data-field="value" v-model="bmi">
|
|
|
|
+ <p class="py-1 m-0 px-2 font-weight-bold bg-white" v-if="!!bmi">
|
|
|
|
+ <span class="text-sm text-warning-mellow" v-if="+bmi < 18.5">Underweight</span>
|
|
|
|
+ <span class="text-sm text-success" v-if="+bmi >= 18.5 && +bmi < 25">Healthy Weight</span>
|
|
|
|
+ <span class="text-sm text-warning-mellow" v-if="+bmi >= 25 && +bmi < 30">Overweight</span>
|
|
|
|
+ <span class="text-sm text-warning-mellow" v-if="+bmi >= 30">Obese</span>
|
|
|
|
+ </p>
|
|
|
|
+ @elseif($k === "smokingStatus")
|
|
|
|
+ <input type="text"
|
|
|
|
+ class="form-control form-control-sm"
|
|
|
|
+ data-field="value" v-model="items['smokingStatus'].value"
|
|
|
|
+ data-option-list="smokingStatus"
|
|
|
|
+ v-on:change="autoDate(items['smokingStatus'], 'smokingStatus')" v-on:keyup="autoDate(items['smokingStatus'], 'smokingStatus')">
|
|
|
|
+ <div id="smoking-status-options" class="data-option-list">
|
|
|
|
+ <div>Current</div>
|
|
|
|
+ <div>Former</div>
|
|
|
|
+ <div>Never</div>
|
|
|
|
+ </div>
|
|
|
|
+ @else
|
|
|
|
+ <input type="text"
|
|
|
|
+ class="form-control form-control-sm"
|
|
|
|
+ data-field="value" v-model="items['{{ $k }}'].value"
|
|
|
|
+ v-on:change="autoDate(items['{{ $k }}'], '{{ $k }}')" v-on:keyup="autoDate(items['{{ $k }}'], '{{ $k }}')">
|
|
|
|
+ @endif
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <input type="date" {{ $k === 'bmi' ? 'readonly' : '' }}
|
|
|
|
+ class="form-control form-control-sm vitals-title"
|
|
|
|
+ data-field="date" v-model="items['{{ $k }}'].date">
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ @endforeach
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ </form>
|
|
|
|
+</div>
|
|
|
|
+<script>
|
|
|
|
+ window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
|
|
|
|
+ alert("Initializing...");
|
|
|
|
+ };
|
|
|
|
+</script>
|