Bladeren bron

lifestyle_rx_update (wip)

Vijayakrishnan 4 jaren geleden
bovenliggende
commit
eb4dedee8a

+ 46 - 0
resources/views/app/patient/canvas-sections/lifestyle_rx_update/default.php

@@ -0,0 +1,46 @@
+<?php
+
+/** @var \App\Models\Pro $sectionPro */
+/** @var \App\Models\Pro $pro */
+/** @var \App\Models\Note $note */
+
+if(!@$sectionPro) {
+    if(@$note) {
+        $sectionPro = $note->hcpPro;
+    }
+    else {
+        $sectionPro = $pro; // should never get here
+    }
+}
+
+
+$canvasData = [];
+if ($patient->canvas_data) {
+    $canvasData = json_decode($patient->canvas_data, true);
+    if (isset($canvasData["lifestyle_rx_update"])) {
+        $canvasData = $canvasData["lifestyle_rx_update"];
+    }
+
+    // if lifestyle_rx_review available, prefill with that
+    /*if (isset($canvasData["next_fu"]) && isset($canvasData["next_fu"][$sectionPro])) {
+        $nextFU = $canvasData["next_fu"][$sectionPro];
+        if(isset($nextFU['list']) && count($nextFU['list'])) {
+            if(!isset($canvasData[$sectionPro])) {
+                $canvasData[$sectionPro] = [];
+            }
+            $prefillData = array_map(function($_x) {
+                if(!isset($_x['icd'])) $_x['icd'] = '';
+                if(!isset($_x['memo'])) $_x['memo'] = '';
+                $_x['hpi'] = [
+                    'free_text' => ''
+                ];
+                return $_x;
+            }, $nextFU['list']);
+            $canvasData[$sectionPro]['current_cch'] = [
+                'list' => $prefillData
+            ];
+        }
+    }*/
+
+}
+$contentData = $canvasData;

+ 506 - 0
resources/views/app/patient/canvas-sections/lifestyle_rx_update/form.blade.php

@@ -0,0 +1,506 @@
+<?php
+/** @var \App\Models\Pro $sectionPro */
+/** @var \App\Models\Pro $pro */
+/** @var \App\Models\Note $note */
+
+if(!@$sectionPro) {
+    if(@$note) {
+        $sectionPro = $note->hcpPro;
+    }
+    else {
+        $sectionPro = $pro; // should never get here
+    }
+}
+
+if(!$contentData) $contentData = [];
+if(!isset($contentData[$sectionPro->uid])) {
+    $contentData[$sectionPro->uid] = [
+        'physical_activity' => [
+            'type' => '',
+            'frequency' => '',
+            'time' => '',
+            'intensity' => '',
+            'enjoyment' => '',
+        ],
+        'barriers' => '',   // free text
+        'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
+        'prescription' => [
+            'seated' => [
+                'active' => false,
+                'memo' => ''
+            ],
+            'arm' => [
+                'active' => false,
+                'memo' => ''
+            ],
+            'aquatic' => [
+                'active' => false,
+                'memo' => ''
+            ],
+            'aerobic' => [
+                'active' => false,
+                'walk' => [
+                    'active' => false,
+                    'days_per_week' => '',
+                    'minutes_per_day' => '',
+                    'intensity' => '', // Light, Moderate, Vigorous
+                    'memo' => ''
+                ],
+                'jog' => [
+                    'active' => false,
+                    'days_per_week' => '',
+                    'minutes_per_day' => '',
+                    'intensity' => '', // Light, Moderate, Vigorous
+                    'memo' => ''
+                ],
+                'elliptical' => [
+                    'active' => false,
+                    'days_per_week' => '',
+                    'minutes_per_day' => '',
+                    'intensity' => '', // Light, Moderate, Vigorous
+                    'memo' => ''
+                ],
+                'swim' => [
+                    'active' => false,
+                    'days_per_week' => '',
+                    'minutes_per_day' => '',
+                    'intensity' => '', // Light, Moderate, Vigorous
+                    'memo' => ''
+                ],
+                'bike' => [
+                    'active' => false,
+                    'days_per_week' => '',
+                    'minutes_per_day' => '',
+                    'intensity' => '', // Light, Moderate, Vigorous
+                    'memo' => ''
+                ],
+            ],
+            'strength' => [
+                'active' => false,
+                'exercises' => [
+                    [
+                        'name' => '',
+                        'days_per_week' => '',
+                        'reps' => '',
+                        'intensity' => '', // Light, Moderate, Vigorous
+                        'memo' => '',
+                    ]
+                ]
+            ],
+            'neat' => [
+                'active' => false,
+                'recommendations' => [
+                    'park_farther' => false,
+                    'steps_instead_of_elevator' => false,
+                    'stands_instead_of_sit' => false,
+                    'steps_goal_per_day' => '',
+                    'other' => '',
+                ]
+            ]
+        ]
+    ];
+}
+
+$formID = rand(0, 100000);
+?>
+
+<div id="pauSection_{{$formID}}">
+    <h3 class="stag-popup-title mb-3 border-bottom pb-1 hide-if-note pt-1 pb-2">
+        <span>Lifestyle Rx Update</span>
+        <a href="#" onclick="return closeStagPopup()"
+           class="ml-auto text-secondary">
+            <i class="fa fa-times-circle"></i>
+        </a>
+    </h3>
+
+    <p class="font-weight-bold my-2">Physical Activity History</p>
+
+    <div class="pl-3 border-left mb-3">
+
+        <p class="font-weight-bold text-secondary my-2">Current Physical Activity</p>
+
+        <input type="hidden" name="data" value="{{json_encode($contentData)}}">
+
+        <div class="border p-2 mb-3">
+            <div class="row mb-2">
+                <div class="col-4">
+                    <label class="mb-1 text-secondary text-sm">Type:</label>
+                    <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['type']" class="form-control form-control-sm">
+                </div>
+                <div class="col-4">
+                    <label class="mb-1 text-secondary text-sm">Frequency:</label>
+                    <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['frequency']" class="form-control form-control-sm">
+                </div>
+                <div class="col-4">
+                    <label class="mb-1 text-secondary text-sm">Time:</label>
+                    <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['time']" class="form-control form-control-sm">
+                </div>
+            </div>
+
+            <div class="row mb-2">
+                <div class="col-4">
+                    <label class="mb-1 text-secondary text-sm">Intensity:</label>
+                    <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['intensity']" class="form-control form-control-sm">
+                </div>
+                <div class="col-8">
+                    <label class="mb-1 text-secondary text-sm">Enjoyment:</label>
+                    <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['enjoyment']" class="form-control form-control-sm">
+                </div>
+            </div>
+        </div>
+
+        <p class="font-weight-bold text-secondary mt-2 mb-1">Barriers To Physical Activity</p>
+        <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['barriers']" class="form-control form-control-sm">
+
+    </div>
+
+    <div class="row mb-3">
+        <div class="col-4">
+            <p class="font-weight-bold mb-1">Assessment of Physical Activity Level</p>
+            <select v-model="data['{{$sectionPro->uid}}']['physical_activity']['assessment']" class="form-control form-control-sm" required>
+                <option value="">-- select --</option>
+                <option value="Inactive">Inactive</option>
+                <option value="Insufficiently Active">Insufficiently Active</option>
+                <option value="Active">Active</option>
+                <option value="Highly Active">Highly Active</option>
+            </select>
+        </div>
+    </div>
+
+    <p class="font-weight-bold">Lifestyle Rx Prescriptions/Recommendations</p>
+
+    <div class="pl-3 border-left mb-3">
+
+        <div class="mb-1 d-flex align-items-center">
+            <label class="mb-2 mt-1 width-200px d-inline-flex align-items-start">
+                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['seated']['active']" class="mr-2">
+                <span>Seated Exercises</span>
+            </label>
+            <input v-if="data['{{$sectionPro->uid}}']['prescription']['seated']['active']" type="text"
+                   v-model="data['{{$sectionPro->uid}}']['prescription']['seated']['memo']"
+                   placeholder="Details" class="form-control form-control-sm ml-3">
+        </div>
+
+        <div class="mb-1 d-flex align-items-center">
+            <label class="mb-2 mt-1 width-200px d-inline-flex align-items-start">
+                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['arm']['active']" class="mr-2">
+                <span>Arm Exercises</span>
+            </label>
+            <input v-if="data['{{$sectionPro->uid}}']['prescription']['arm']['active']" type="text"
+                   v-model="data['{{$sectionPro->uid}}']['prescription']['arm']['memo']"
+                   placeholder="Details" class="form-control form-control-sm ml-3">
+        </div>
+
+        <div class="mb-1 d-flex align-items-center">
+            <label class="mb-2 mt-1 width-200px d-inline-flex align-items-start">
+                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aquatic']['active']" class="mr-2">
+                <span>Aquatic Exercises</span>
+            </label>
+            <input v-if="data['{{$sectionPro->uid}}']['prescription']['aquatic']['active']" type="text"
+                   v-model="data['{{$sectionPro->uid}}']['prescription']['aquatic']['memo']"
+                   placeholder="Details" class="form-control form-control-sm ml-3">
+        </div>
+
+        <div class="my-2">
+            <label class="m-0 width-200px d-inline-flex align-items-start">
+                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['active']" class="mr-2">
+                <span class="font-weight-bold text-secondary">Aerobic Activity</span>
+            </label>
+        </div>
+
+        <div v-if="data['{{$sectionPro->uid}}']['prescription']['aerobic']['active']" class="pl-3">
+            <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 width-30px text-center"></th>
+                    <th class="px-2 text-secondary border-bottom-0 width-100px text-nowrap">Activity</th>
+                    <th class="px-2 text-secondary border-bottom-0 width-100px text-nowrap">Days / Week</th>
+                    <th class="px-2 text-secondary border-bottom-0 width-100px text-nowrap">Minutes / Day</th>
+                    <th class="px-2 text-secondary border-bottom-0">Intensity</th>
+                    <th class="px-2 text-secondary border-bottom-0 w-50">Details</th>
+                </tr>
+                </thead>
+                <tbody>
+                <tr>
+                    <td class="px-2 align-middle">
+                        <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['walk']['active']" class="align-middle">
+                    </td>
+                    <td class="px-2 align-middle">Walk</td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['walk']['days_per_week']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['walk']['minutes_per_day']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <select v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['walk']['intensity']" class="form-control form-control-sm">
+                            <option value="">-- select --</option>
+                            <option value="Light">Light</option>
+                            <option value="Moderate">Moderate</option>
+                            <option value="Vigorous">Vigorous</option>
+                        </select>
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['walk']['memo']">
+                    </td>
+                </tr>
+                <tr>
+                    <td class="px-2 align-middle">
+                        <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['jog']['active']" class="align-middle">
+                    </td>
+                    <td class="px-2 align-middle">Jog</td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['jog']['days_per_week']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['jog']['minutes_per_day']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <select v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['jog']['intensity']" class="form-control form-control-sm">
+                            <option value="">-- select --</option>
+                            <option value="Light">Light</option>
+                            <option value="Moderate">Moderate</option>
+                            <option value="Vigorous">Vigorous</option>
+                        </select>
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['jog']['memo']">
+                    </td>
+                </tr>
+                <tr>
+                    <td class="px-2 align-middle">
+                        <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['elliptical']['active']" class="align-middle">
+                    </td>
+                    <td class="px-2 align-middle">Elliptical</td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['elliptical']['days_per_week']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['elliptical']['minutes_per_day']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <select v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['elliptical']['intensity']" class="form-control form-control-sm">
+                            <option value="">-- select --</option>
+                            <option value="Light">Light</option>
+                            <option value="Moderate">Moderate</option>
+                            <option value="Vigorous">Vigorous</option>
+                        </select>
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['elliptical']['memo']">
+                    </td>
+                </tr>
+                <tr>
+                    <td class="px-2 align-middle">
+                        <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['swim']['active']" class="align-middle">
+                    </td>
+                    <td class="px-2 align-middle">Swim</td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['swim']['days_per_week']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['swim']['minutes_per_day']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <select v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['swim']['intensity']" class="form-control form-control-sm">
+                            <option value="">-- select --</option>
+                            <option value="Light">Light</option>
+                            <option value="Moderate">Moderate</option>
+                            <option value="Vigorous">Vigorous</option>
+                        </select>
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['swim']['memo']">
+                    </td>
+                </tr>
+                <tr>
+                    <td class="px-2 align-middle">
+                        <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['bike']['active']" class="align-middle">
+                    </td>
+                    <td class="px-2 align-middle">Bike</td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['bike']['days_per_week']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['bike']['minutes_per_day']">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <select v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['bike']['intensity']" class="form-control form-control-sm">
+                            <option value="">-- select --</option>
+                            <option value="Light">Light</option>
+                            <option value="Moderate">Moderate</option>
+                            <option value="Vigorous">Vigorous</option>
+                        </select>
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="data['{{$sectionPro->uid}}']['prescription']['aerobic']['bike']['memo']">
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+
+        <div class="mt-3 mb-2">
+            <label class="m-0 d-inline-flex align-items-start">
+                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['strength']['active']" class="mr-2">
+                <span class="font-weight-bold text-secondary">Strength Training</span>
+            </label>
+            <a v-if="data['{{$sectionPro->uid}}']['prescription']['strength']['active']"
+               href="#" class="ml-3"
+               v-on:click.prevent="data['{{$sectionPro->uid}}']['prescription']['strength']['exercises'].push({name: '', days_per_week: '', reps: '', intensity: '', memo: ''})">
+                + Add Exercise
+            </a>
+        </div>
+
+        <div v-if="data['{{$sectionPro->uid}}']['prescription']['strength']['active']" class="pl-3">
+            <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 width-100px text-nowrap">Exercise</th>
+                    <th class="px-2 text-secondary border-bottom-0 width-100px text-nowrap">Days / Week</th>
+                    <th class="px-2 text-secondary border-bottom-0 width-100px text-nowrap">Reps</th>
+                    <th class="px-2 text-secondary border-bottom-0">Intensity</th>
+                    <th class="px-2 text-secondary border-bottom-0 w-35">Details</th>
+                    <th v-if="data['{{$sectionPro->uid}}']['prescription']['strength']['exercises'].length > 1"></th>
+                </tr>
+                </thead>
+                <tbody>
+                <tr v-for="(exercise, exIndex) in data['{{$sectionPro->uid}}']['prescription']['strength']['exercises']">
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="exercise.name">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="exercise.days_per_week">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="exercise.reps">
+                    </td>
+                    <td class="px-0 align-middle">
+                        <select v-model="exercise.intensity" class="form-control form-control-sm">
+                            <option value="">-- select --</option>
+                            <option value="Light">Light</option>
+                            <option value="Moderate">Moderate</option>
+                            <option value="Vigorous">Vigorous</option>
+                        </select>
+                    </td>
+                    <td class="px-0 align-middle">
+                        <input type="text" class="form-control form-control-sm" v-model="exercise.memo">
+                    </td>
+                    <td class="px-2" v-if="data['{{$sectionPro->uid}}']['prescription']['strength']['exercises'].length > 1" class="px-0 align-middle">
+                        <a href="#" v-on:click.prevent="data['{{$sectionPro->uid}}']['prescription']['strength']['exercises'].splice(exIndex, 1)"
+                           class="on-hover-opaque text-danger mt-1 d-inline-block">
+                            <i class="fa fa-trash-alt"></i>
+                        </a>
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+        </div>
+
+        <div class="mt-3 mb-2">
+            <label class="m-0 d-inline-flex align-items-start">
+                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['neat']['active']" class="mr-2">
+                <span class="font-weight-bold text-secondary">Non-Exercise Activity Time (NEAT)</span>
+            </label>
+        </div>
+
+        <div v-if="data['{{$sectionPro->uid}}']['prescription']['neat']['active']" class="pl-3">
+
+            <div class="mb-1 d-flex align-items-center">
+                <label class="mb-0 mt-1 d-inline-flex align-items-start">
+                    <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['neat']['recommendations']['park_farther']" class="mr-2">
+                    <span>Park farther away from entrances</span>
+                </label>
+            </div>
+
+            <div class="mb-1 d-flex align-items-center">
+                <label class="mb-0 mt-1 d-inline-flex align-items-start">
+                    <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['neat']['recommendations']['steps_instead_of_elevator']" class="mr-2">
+                    <span>Take the stairs instead of escalator/elevator</span>
+                </label>
+            </div>
+
+            <div class="mb-1 d-flex align-items-center">
+                <label class="mb-0 mt-1 d-inline-flex align-items-start">
+                    <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['prescription']['neat']['recommendations']['stands_instead_of_sit']" class="mr-2">
+                    <span>Stand instead of sit</span>
+                </label>
+            </div>
+
+            <div class="mt-2 mb-1 d-flex align-items-center">
+                <label class="mb-2 mt-1 width-200px d-inline-flex align-items-start">
+                    <span>Steps goal / day:</span>
+                </label>
+                <input type="text"
+                       v-model="data['{{$sectionPro->uid}}']['prescription']['neat']['recommendations']['steps_goal_per_day']"
+                       placeholder="Details" class="form-control form-control-sm ml-3">
+            </div>
+
+            <div class="mb-1 d-flex align-items-center">
+                <label class="mb-2 mt-1 width-200px d-inline-flex align-items-start">
+                    <span>Other:</span>
+                </label>
+                <input type="text"
+                       v-model="data['{{$sectionPro->uid}}']['prescription']['neat']['recommendations']['other']"
+                       placeholder="Details" class="form-control form-control-sm ml-3">
+            </div>
+
+        </div>
+
+    </div>
+
+</div>
+<script>
+    (function() {
+        function init() {
+            window.clientPAUApp_{{$formID}} = new Vue({
+                el: '#pauSection_{{$formID}}',
+                data: {
+                    data: <?= json_encode($contentData) ?>,
+                },
+                mounted: function() {
+                    $('#pauSection_{{$formID}} [moe][initialized]').removeAttr('initialized');
+                    initMoes();
+                },
+                watch: {
+                    $data: {
+                        handler: function(val, oldVal) {
+                            $(this.$el).closest('#pauSection_{{$formID}}').find('[name="data"]').val(JSON.stringify(this.data));
+                        },
+                        deep: true
+                    }
+                },
+                methods: {
+                    addItem: function() {
+                        this.data['{{$sectionPro->uid}}']['current_cch']['list'].push({
+                            "category": '',
+                            "name": '',
+                            "icd": '',
+                            "memo": '',
+                            "hpi": {
+                                "free_text": ''
+                            },
+                        });
+                    },
+                    removeItem: function(_index) {
+                        this.data['{{$sectionPro->uid}}']['current_cch']['list'].splice(_index, 1);
+                    },
+                    cleanArray: function(_source) {
+                        let plItems = [], plObject = {};
+                        for (let x=0; x<_source.length; x++) {
+                            plObject = {};
+                            for (let y in _source[x]) {
+                                if(_source[x].hasOwnProperty(y)) {
+                                    plObject[y] = _source[x][y];
+                                }
+                            }
+                            plItems.push(plObject);
+                        }
+                        return plItems;
+                    },
+                }
+            });
+        }
+        addMCInitializer('client-pau{{$formID}}', init, '#pauSection_{{$formID}}');
+    })();
+</script>

+ 79 - 0
resources/views/app/patient/canvas-sections/lifestyle_rx_update/summary.php

@@ -0,0 +1,79 @@
+<?php
+
+/** @var \App\Models\Pro $sectionPro */
+/** @var \App\Models\Pro $pro */
+/** @var \App\Models\Note $note */
+
+if(!@$sectionPro) {
+    if(@$note) {
+        $sectionPro = $note->hcpPro;
+    }
+    else {
+        $sectionPro = $pro; // should never get here
+    }
+}
+
+$contentData = false;
+if ($patient->canvas_data) {
+    $canvasData = json_decode($patient->canvas_data, true);
+    if(isset($canvasData["lifestyle_rx_update"])) {
+        $contentData = $canvasData["lifestyle_rx_update"];
+    }
+}
+
+if($contentData === false || !isset($contentData[$sectionPro->uid])) {
+    ?>
+    <div class="text-secondary">No data in this section yet</div>
+    <?php
+}
+else {
+    print_r($contentData);
+    // $lines = $contentData[$sectionPro->uid]['current_cch']['list'];
+    /*
+    ?>
+    <p class="font-weight-bold mb-2">CC</p>
+    <table class="table table-sm table-bordered mb-2 table-edit-sheet">
+        <thead>
+        <tr class="bg-light">
+            <th class="px-2 py-1 text-secondary border-bottom-0 width-30px text-center">#</th>
+            <th class="px-2 py-1 text-secondary border-bottom-0 w-25">Category</th>
+            <th class="px-2 py-1 text-secondary border-bottom-0">Title</th>
+            <th class="px-2 py-1 text-secondary border-bottom-0">ICD</th>
+            <th class="px-2 py-1 text-secondary border-bottom-0 w-35">Memo</th>
+        </tr>
+        </thead>
+        <tbody class="bg-white">
+        <?php foreach($lines as $i => $line): ?>
+        <tr class="bg-white">
+            <td class="bg-white px-2 py-1 text-center text-sm font-weight-bold"><?= ++$i ?></td>
+            <td class="bg-white px-2 py-1"><?= ucwords($line['category']) ?></td>
+            <td class="bg-white px-2 py-1"><?= $line['name'] ?></td>
+            <td class="bg-white px-2 py-1"><?= $line['icd'] ?></td>
+            <td class="bg-white px-2 py-1"><?= $line['memo'] ?></td>
+        </tr>
+        <?php endforeach; ?>
+        </tbody>
+    </table>
+    <p class="font-weight-bold mb-2">HPI</p>
+    <table class="table table-sm table-bordered mb-2 table-edit-sheet">
+        <thead>
+        <tr class="bg-light">
+            <th class="px-2 py-1 text-secondary border-bottom-0 width-30px text-center">#</th>
+            <th class="px-2 py-1 text-secondary border-bottom-0 w-25">Issue</th>
+            <th class="px-2 py-1 text-secondary border-bottom-0">HPI</th>
+        </tr>
+        </thead>
+        <tbody class="bg-white">
+        <?php foreach($lines as $i => $line): ?>
+            <tr>
+                <td class="px-2 bg-white py-1 text-center text-sm font-weight-bold"><?= ++$i ?></td>
+                <td class="px-2 bg-white py-1"><?= ucwords($line['category']) ?><?= $line['name'] ? ' <span class="text-secondary on-hover-opaque">/</span> ' . $line['name'] : '' ?><?= $line['icd'] ? ' <span class="text-secondary on-hover-opaque">/</span> ' . $line['icd'] : ''?></td>
+                <td class="px-2 bg-white py-1"><?= $line['hpi']['free_text'] ?></td>
+            </tr>
+        <?php endforeach; ?>
+        </tbody>
+    </table>
+    <?php
+    */
+}
+?>

+ 1 - 1
resources/views/app/patients.blade.php

@@ -31,7 +31,7 @@
                 <i class="fas fa-user-injured"></i>
                 Patients
             </strong>
-            <select class="ml-auto max-width-300px form-control form-control-sm" onchange="fastLoad('/patients/' + this.value, true, false, false)">
+            <select class="ml-3 max-width-300px form-control form-control-sm" onchange="fastLoad('/patients/' + this.value, true, false, false)">
                 <option value="" {{ $filter === '' ? 'selected' : '' }}>All patients</option>
                 <option value="not-yet-seen" {{ $filter === 'not-yet-seen' ? 'selected' : '' }}>Patients I have not seen yet</option>
                 <option value="having-birthday-today" {{ $filter === 'having-birthday-today' ? 'selected' : '' }}>Patients having birthday today</option>