Просмотр исходного кода

lifestyle_rx_review => pro-scoped change updates

Vijayakrishnan 4 лет назад
Родитель
Сommit
50b0b1eeeb

+ 22 - 21
resources/views/app/patient/canvas-sections/lifestyle_rx_review/default.php

@@ -1,43 +1,44 @@
 <?php
 
-/** @var \App\Models\Pro $sectionPro */
+/** @var \App\Models\Pro $hcpPro */
 /** @var \App\Models\Pro $pro */
 /** @var \App\Models\Note $note */
 
-if(!@$sectionPro) {
+if(!@$hcpPro) {
     if(@$note) {
-        $sectionPro = $note->hcpPro;
+        $hcpPro = $note->hcpPro;
     }
     else {
-        $sectionPro = $pro; // should never get here
+        $hcpPro = $pro; // should never get here
     }
 }
 
-
 $canvasData = [];
 if ($patient->canvas_data) {
     $canvasData = json_decode($patient->canvas_data, true);
-    if (!isset($canvasData["lifestyle_rx_review"])) $canvasData["lifestyle_rx_review"] = [];
-    if (!isset($canvasData["lifestyle_rx_review"][$sectionPro->uid])) $canvasData["lifestyle_rx_review"][$sectionPro->uid] = [
-        'physical_activity' => [
-            'type' => '',
-            'frequency' => '',
-            'time' => '',
-            'intensity' => '',
-            'enjoyment' => '',
-        ],
-        'barriers' => '',   // free text
-        'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
-    ];
+    if(!isset($canvasData["lifestyle_rx_review"])) $canvasData["lifestyle_rx_review"] = [];
+    if(!isset($canvasData["lifestyle_rx_review"][$hcpPro->id])) {
+        $canvasData["lifestyle_rx_review"][$hcpPro->id] = [
+            'physical_activity' => [
+                'type' => '',
+                'frequency' => '',
+                'time' => '',
+                'intensity' => '',
+                'enjoyment' => '',
+            ],
+            'barriers' => '',   // free text
+            'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
+        ];
+    }
 
     // if lifestyle_rx_update available, prefill with that
     if (isset($canvasData["lifestyle_rx_update"]) &&
-        isset($canvasData["lifestyle_rx_update"][$sectionPro->uid]) &&
-        isset($canvasData["lifestyle_rx_update"][$sectionPro->uid]['prescription'])) {
-        $canvasData["lifestyle_rx_review"][$sectionPro->uid]['adherence'] = $canvasData["lifestyle_rx_update"][$sectionPro->uid]['prescription'];
+        isset($canvasData["lifestyle_rx_update"][$hcpPro->id]) &&
+        isset($canvasData["lifestyle_rx_update"][$hcpPro->id]['prescription'])) {
+        $canvasData["lifestyle_rx_review"][$hcpPro->id]['adherence'] = $canvasData["lifestyle_rx_update"][$hcpPro->id]['prescription'];
     }
 
-    $canvasData = $canvasData["lifestyle_rx_review"];
+    $canvasData = $canvasData['lifestyle_rx_review'][$hcpPro->id];
 
 }
 $contentData = $canvasData;

+ 107 - 118
resources/views/app/patient/canvas-sections/lifestyle_rx_review/form.blade.php

@@ -1,20 +1,9 @@
 <?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 is already pro-scoped by this point!
 
-if(!$contentData) $contentData = [];
-if(!isset($contentData[$sectionPro->uid])) {
-    $contentData[$sectionPro->uid] = [
+if(!$contentData) {
+    $contentData = [
         'physical_activity' => [
             'type' => '',
             'frequency' => '',
@@ -153,39 +142,39 @@ $formID = rand(0, 100000);
             <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">
+                    <input type="text" v-model="data['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">
+                    <input type="text" v-model="data['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">
+                    <input type="text" v-model="data['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">
+                    <input type="text" v-model="data['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">
+                    <input type="text" v-model="data['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">
+        <input type="text" v-model="data['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>
+            <select v-model="data['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>
@@ -208,231 +197,231 @@ $formID = rand(0, 100000);
         </tr>
         </thead>
 
-        <tbody class="border-0" v-if="data['{{$sectionPro->uid}}']['adherence']['seated']['active'] || data['{{$sectionPro->uid}}']['adherence']['arm']['active'] || data['{{$sectionPro->uid}}']['adherence']['aquatic']['active']">
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['seated']['active']">
+        <tbody class="border-0" v-if="data['adherence']['seated']['active'] || data['adherence']['arm']['active'] || data['adherence']['aquatic']['active']">
+            <tr v-if="data['adherence']['seated']['active']">
                 <td class="px-2 align-middle">
                     Seated Exercises
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['seated']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['seated']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['seated']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['seated']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['seated']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['seated']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['seated']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['seated']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['seated']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['seated']['adherence_memo']">
                 </td>
             </tr>
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['arm']['active']">
+            <tr v-if="data['adherence']['arm']['active']">
                 <td class="px-2 align-middle">
                     Arm Exercises
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['arm']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['arm']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['arm']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['arm']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['arm']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['arm']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['arm']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['arm']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['arm']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['arm']['adherence_memo']">
                 </td>
             </tr>
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['aquatic']['active']">
+            <tr v-if="data['adherence']['aquatic']['active']">
                 <td class="px-2 align-middle">
                     Aquatic Exercises
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['aquatic']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['aquatic']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aquatic']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['aquatic']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aquatic']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['aquatic']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aquatic']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['aquatic']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['aquatic']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['aquatic']['adherence_memo']">
                 </td>
             </tr>
         </tbody>
 
-        <tbody class="border-0" v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['active']">
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['active']">
+        <tbody class="border-0" v-if="data['adherence']['aerobic']['active']">
+            <tr v-if="data['adherence']['aerobic']['walk']['active']">
                 <td class="px-2 align-middle">
                     Aerobic → Walk
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['intensity']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['intensity']"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['days_per_week']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['days_per_week'] + ' days/wk'"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['minutes_per_day']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['minutes_per_day'] + ' mins/days'"></span>
+                    <span v-if="data['adherence']['aerobic']['walk']['intensity']" v-html="' / ' + data['adherence']['aerobic']['walk']['intensity']"></span>
+                    <span v-if="data['adherence']['aerobic']['walk']['days_per_week']" v-html="' / ' + data['adherence']['aerobic']['walk']['days_per_week'] + ' days/wk'"></span>
+                    <span v-if="data['adherence']['aerobic']['walk']['minutes_per_day']" v-html="' / ' + data['adherence']['aerobic']['walk']['minutes_per_day'] + ' mins/days'"></span>
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['aerobic']['walk']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['aerobic']['walk']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['aerobic']['walk']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['aerobic']['walk']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['walk']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['aerobic']['walk']['adherence_memo']">
                 </td>
             </tr>
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['active']">
+            <tr v-if="data['adherence']['aerobic']['jog']['active']">
                 <td class="px-2 align-middle">
                     Aerobic → Jog
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['intensity']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['intensity']"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['days_per_week']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['days_per_week'] + ' days/wk'"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['minutes_per_day']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['minutes_per_day'] + ' mins/days'"></span>
+                    <span v-if="data['adherence']['aerobic']['jog']['intensity']" v-html="' / ' + data['adherence']['aerobic']['jog']['intensity']"></span>
+                    <span v-if="data['adherence']['aerobic']['jog']['days_per_week']" v-html="' / ' + data['adherence']['aerobic']['jog']['days_per_week'] + ' days/wk'"></span>
+                    <span v-if="data['adherence']['aerobic']['jog']['minutes_per_day']" v-html="' / ' + data['adherence']['aerobic']['jog']['minutes_per_day'] + ' mins/days'"></span>
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['aerobic']['jog']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['aerobic']['jog']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['aerobic']['jog']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['aerobic']['jog']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['jog']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['aerobic']['jog']['adherence_memo']">
                 </td>
             </tr>
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['active']">
+            <tr v-if="data['adherence']['aerobic']['elliptical']['active']">
                 <td class="px-2 align-middle">
                     Aerobic → Elliptical
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['intensity']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['intensity']"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['days_per_week']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['days_per_week'] + ' days/wk'"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['minutes_per_day']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['minutes_per_day'] + ' mins/days'"></span>
+                    <span v-if="data['adherence']['aerobic']['elliptical']['intensity']" v-html="' / ' + data['adherence']['aerobic']['elliptical']['intensity']"></span>
+                    <span v-if="data['adherence']['aerobic']['elliptical']['days_per_week']" v-html="' / ' + data['adherence']['aerobic']['elliptical']['days_per_week'] + ' days/wk'"></span>
+                    <span v-if="data['adherence']['aerobic']['elliptical']['minutes_per_day']" v-html="' / ' + data['adherence']['aerobic']['elliptical']['minutes_per_day'] + ' mins/days'"></span>
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['aerobic']['elliptical']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['aerobic']['elliptical']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['aerobic']['elliptical']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['aerobic']['elliptical']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['elliptical']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['aerobic']['elliptical']['adherence_memo']">
                 </td>
             </tr>
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['active']">
+            <tr v-if="data['adherence']['aerobic']['swim']['active']">
                 <td class="px-2 align-middle">
                     Aerobic → Swim
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['intensity']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['intensity']"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['days_per_week']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['days_per_week'] + ' days/wk'"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['minutes_per_day']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['minutes_per_day'] + ' mins/days'"></span>
+                    <span v-if="data['adherence']['aerobic']['swim']['intensity']" v-html="' / ' + data['adherence']['aerobic']['swim']['intensity']"></span>
+                    <span v-if="data['adherence']['aerobic']['swim']['days_per_week']" v-html="' / ' + data['adherence']['aerobic']['swim']['days_per_week'] + ' days/wk'"></span>
+                    <span v-if="data['adherence']['aerobic']['swim']['minutes_per_day']" v-html="' / ' + data['adherence']['aerobic']['swim']['minutes_per_day'] + ' mins/days'"></span>
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['aerobic']['swim']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['aerobic']['swim']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['aerobic']['swim']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['aerobic']['swim']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['swim']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['aerobic']['swim']['adherence_memo']">
                 </td>
             </tr>
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['active']">
+            <tr v-if="data['adherence']['aerobic']['bike']['active']">
                 <td class="px-2 align-middle">
                     Aerobic → Bike
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['intensity']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['intensity']"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['days_per_week']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['days_per_week'] + ' days/wk'"></span>
-                    <span v-if="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['minutes_per_day']" v-html="' / ' + data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['minutes_per_day'] + ' mins/days'"></span>
+                    <span v-if="data['adherence']['aerobic']['bike']['intensity']" v-html="' / ' + data['adherence']['aerobic']['bike']['intensity']"></span>
+                    <span v-if="data['adherence']['aerobic']['bike']['days_per_week']" v-html="' / ' + data['adherence']['aerobic']['bike']['days_per_week'] + ' days/wk'"></span>
+                    <span v-if="data['adherence']['aerobic']['bike']['minutes_per_day']" v-html="' / ' + data['adherence']['aerobic']['bike']['minutes_per_day'] + ' mins/days'"></span>
                 </td>
-                <td class="px-2 align-middle" v-html="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['memo']"></td>
+                <td class="px-2 align-middle" v-html="data['adherence']['aerobic']['bike']['memo']"></td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['aerobic']['bike']['adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['aerobic']['bike']['adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 mb-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['aerobic']['bike']['adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['aerobic']['bike']['adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['aerobic']['bike']['adherence_memo']">
                 </td>
             </tr>
         </tbody>
 
 
-        <tbody class="border-0" v-if="data['{{$sectionPro->uid}}']['adherence']['strength']['active']">
+        <tbody class="border-0" v-if="data['adherence']['strength']['active']">
 
-            <tr v-for="(exercise) in data['{{$sectionPro->uid}}']['adherence']['strength']['exercises']">
+            <tr v-for="(exercise) in data['adherence']['strength']['exercises']">
                 <td class="px-2 align-middle">
                     Strength → <span v-html="exercise.name"></span>
                     <span v-if="exercise.intensity" v-html="' / ' + exercise.intensity"></span>
@@ -462,130 +451,130 @@ $formID = rand(0, 100000);
             </tr>
         </tbody>
 
-        <tbody class="border-0" v-if="data['{{$sectionPro->uid}}']['adherence']['neat']['active']">
+        <tbody class="border-0" v-if="data['adherence']['neat']['active']">
 
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['park_farther']">
+            <tr v-if="data['adherence']['neat']['recommendations']['park_farther']">
                 <td class="px-2 align-middle" colspan="2">
                     NEAT → Park farther away from entrances
                 </td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['park_farther_adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['park_farther_adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['park_farther_adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['park_farther_adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['park_farther_adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['park_farther_adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['park_farther_adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['neat']['recommendations']['park_farther_adherence_memo']">
                 </td>
             </tr>
 
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_instead_of_elevator']">
+            <tr v-if="data['adherence']['neat']['recommendations']['steps_instead_of_elevator']">
                 <td class="px-2 align-middle" colspan="2">
                     NEAT → Take the stairs instead of escalator/elevator
                 </td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence_memo']">
                 </td>
             </tr>
 
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['stand_instead_of_sit']">
+            <tr v-if="data['adherence']['neat']['recommendations']['stand_instead_of_sit']">
                 <td class="px-2 align-middle" colspan="2">
                     NEAT → Stand instead of sit
                 </td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence_memo']">
                 </td>
             </tr>
 
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_goal_per_day']">
+            <tr v-if="data['adherence']['neat']['recommendations']['steps_goal_per_day']">
                 <td class="px-2 align-middle" colspan="2">
-                    NEAT → Steps goal / day: <b v-html="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_goal_per_day']"></b>
+                    NEAT → Steps goal / day: <b v-html="data['adherence']['neat']['recommendations']['steps_goal_per_day']"></b>
                 </td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_goal_per_day_adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['steps_goal_per_day_adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_goal_per_day_adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['steps_goal_per_day_adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_goal_per_day_adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['steps_goal_per_day_adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['steps_goal_per_day_adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['neat']['recommendations']['steps_goal_per_day_adherence_memo']">
                 </td>
             </tr>
 
-            <tr v-if="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['other']">
+            <tr v-if="data['adherence']['neat']['recommendations']['other']">
                 <td class="px-2 align-middle" colspan="2">
-                    NEAT → Other: <b v-html="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['other']"></b>
+                    NEAT → Other: <b v-html="data['adherence']['neat']['recommendations']['other']"></b>
                 </td>
                 <td class="px-2 align-middle">
                     <div class="d-flex align-items-center">
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['other_adherence']" value="Yes">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['other_adherence']" value="Yes">
                             <span class="ml-1">Yes</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['other_adherence']" value="No">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['other_adherence']" value="No">
                             <span class="ml-1">No</span>
                         </label>
                         <label class="d-inline-flex align-items-center mr-3 my-0">
-                            <input type="radio" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['other_adherence']" value="Other">
+                            <input type="radio" v-model="data['adherence']['neat']['recommendations']['other_adherence']" value="Other">
                             <span class="ml-1">Other</span>
                         </label>
                     </div>
                 </td>
                 <td class="px-0 align-middle">
-                    <input type="text" class="form-control form-control-sm border-0" v-model="data['{{$sectionPro->uid}}']['adherence']['neat']['recommendations']['other_adherence_memo']">
+                    <input type="text" class="form-control form-control-sm border-0" v-model="data['adherence']['neat']['recommendations']['other_adherence_memo']">
                 </td>
             </tr>
 
@@ -617,7 +606,7 @@ $formID = rand(0, 100000);
                 },
                 methods: {
                     addItem: function() {
-                        this.data['{{$sectionPro->uid}}']['current_cch']['list'].push({
+                        this.data['current_cch']['list'].push({
                             "category": '',
                             "name": '',
                             "icd": '',
@@ -628,7 +617,7 @@ $formID = rand(0, 100000);
                         });
                     },
                     removeItem: function(_index) {
-                        this.data['{{$sectionPro->uid}}']['current_cch']['list'].splice(_index, 1);
+                        this.data['current_cch']['list'].splice(_index, 1);
                     },
                     cleanArray: function(_source) {
                         let plItems = [], plObject = {};

+ 95 - 95
resources/views/app/patient/canvas-sections/lifestyle_rx_review/summary.php

@@ -1,54 +1,54 @@
 <?php
 
-/** @var \App\Models\Pro $sectionPro */
-/** @var \App\Models\Pro $pro */
-/** @var \App\Models\Note $note */
+// HUMONGOUS FIX! This CRITICAL "if" was never there till now!
+if(!@$contentData) {
+    /** @var \App\Models\Pro $hcpPro */
+    /** @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(!@$hcpPro) {
+        if(@$note) {
+            $hcpPro = $note->hcpPro;
+        }
+        else {
+            $hcpPro = $pro; // should never get here
+        }
     }
-}
 
-if(!@$contentData) {
     $contentData = false;
     if ($patient->canvas_data) {
         $canvasData = json_decode($patient->canvas_data, true);
-        if (isset($canvasData["lifestyle_rx_review"])) {
-            $contentData = $canvasData["lifestyle_rx_review"];
+        if(isset($canvasData["lifestyle_rx_review"]) && isset($canvasData["lifestyle_rx_review"][$hcpPro->id])) {
+            $contentData = $canvasData["lifestyle_rx_review"][$hcpPro->id];
         }
     }
 }
 
-if($contentData === false || !isset($contentData[$sectionPro->uid])) {
+if($contentData === false) {
     ?>
     <div class="text-secondary">No data in this section yet</div>
     <?php
 }
 else {
-    $lsRxReview = $contentData[$sectionPro->uid];
     ?>
     <p class="font-weight-bold text-secondary my-2">Current Physical Activity</p>
     <p class="my-2">
-        <b><?= $lsRxReview['physical_activity']['type'] ?></b>
-        <?php if($lsRxReview['physical_activity']['frequency']): ?>
-            <span class="text-secondary">&nbsp;/&nbsp;<?= @$lsRxReview['physical_activity']['frequency'] ?></span>
+        <b><?= $contentData['physical_activity']['type'] ?></b>
+        <?php if($contentData['physical_activity']['frequency']): ?>
+            <span class="text-secondary">&nbsp;/&nbsp;<?= @$contentData['physical_activity']['frequency'] ?></span>
         <?php endif; ?>
-        <?php if($lsRxReview['physical_activity']['time']): ?>
-            <span class="text-secondary">&nbsp;/&nbsp;<?= @$lsRxReview['physical_activity']['time'] ?></span>
+        <?php if($contentData['physical_activity']['time']): ?>
+            <span class="text-secondary">&nbsp;/&nbsp;<?= @$contentData['physical_activity']['time'] ?></span>
         <?php endif; ?>
-        <?php if($lsRxReview['physical_activity']['intensity']): ?>
-            <span class="text-secondary">&nbsp;/&nbsp;<?= @$lsRxReview['physical_activity']['intensity'] ?></span>
+        <?php if($contentData['physical_activity']['intensity']): ?>
+            <span class="text-secondary">&nbsp;/&nbsp;<?= @$contentData['physical_activity']['intensity'] ?></span>
         <?php endif; ?>
-        <?php if($lsRxReview['physical_activity']['enjoyment']): ?>
-            <span class="text-secondary">&nbsp;/&nbsp;<?= @$lsRxReview['physical_activity']['enjoyment'] ?></span>
+        <?php if($contentData['physical_activity']['enjoyment']): ?>
+            <span class="text-secondary">&nbsp;/&nbsp;<?= @$contentData['physical_activity']['enjoyment'] ?></span>
         <?php endif; ?>
     </p>
-    <p class="font-weight-bold text-secondary my-2">Barriers To Physical Activity: <?= @$lsRxReview['physical_activity']['barriers'] ?></p>
-    <p class="font-weight-bold text-secondary my-2">Assessment of Physical Activity Level: <?= @$lsRxReview['physical_activity']['assessment'] ?></p>
+    <p class="font-weight-bold text-secondary my-2">Barriers To Physical Activity: <?= @$contentData['physical_activity']['barriers'] ?></p>
+    <p class="font-weight-bold text-secondary my-2">Assessment of Physical Activity Level: <?= @$contentData['physical_activity']['assessment'] ?></p>
     <p class="font-weight-bold text-secondary my-2">Lifestyle Rx Adherence</p>
 
     <div class="pl-3 border-left mb-3">
@@ -62,108 +62,108 @@ else {
             </tr>
             </thead>
 
-            <?php if ($lsRxReview['adherence']['seated']['active'] || $lsRxReview['adherence']['arm']['active'] || $lsRxReview['adherence']['aquatic']['active']): ?>
+            <?php if ($contentData['adherence']['seated']['active'] || $contentData['adherence']['arm']['active'] || $contentData['adherence']['aquatic']['active']): ?>
                 <tbody class="border-0">
-                <?php if ($lsRxReview['adherence']['seated']['active']): ?>
+                <?php if ($contentData['adherence']['seated']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">Seated Exercises</td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['seated']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['seated']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['seated']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['seated']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['seated']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['seated']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['arm']['active']): ?>
+                <?php if ($contentData['adherence']['arm']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">Arm Exercises</td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['arm']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['arm']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['arm']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['arm']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['arm']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['arm']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['aquatic']['active']): ?>
+                <?php if ($contentData['adherence']['aquatic']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">Aquatic Exercises</td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['aquatic']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['aquatic']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= $lsRxReview['adherence']['aquatic']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['aquatic']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['aquatic']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= $contentData['adherence']['aquatic']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
                 </tbody>
             <?php endif; ?>
 
-            <?php if ($lsRxReview['adherence']['aerobic']['active']): ?>
+            <?php if ($contentData['adherence']['aerobic']['active']): ?>
                 <tbody class="border-0">
-                <?php if ($lsRxReview['adherence']['aerobic']['walk']['active']): ?>
+                <?php if ($contentData['adherence']['aerobic']['walk']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">
                             Aerobic → Walk
-                            <?= @$lsRxReview['adherence']['aerobic']['walk']['intensity'] ? ' / ' . $lsRxReview['adherence']['aerobic']['walk']['intensity'] : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['walk']['days_per_week'] ? ' / ' . $lsRxReview['adherence']['aerobic']['walk']['days_per_week'] . ' days/wk' : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['walk']['minutes_per_day'] ? ' / ' . $lsRxReview['adherence']['aerobic']['walk']['minutes_per_day'] . ' mins/day' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['walk']['intensity'] ? ' / ' . $contentData['adherence']['aerobic']['walk']['intensity'] : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['walk']['days_per_week'] ? ' / ' . $contentData['adherence']['aerobic']['walk']['days_per_week'] . ' days/wk' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['walk']['minutes_per_day'] ? ' / ' . $contentData['adherence']['aerobic']['walk']['minutes_per_day'] . ' mins/day' : '' ?>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['walk']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['walk']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['walk']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['walk']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['walk']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['walk']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['aerobic']['jog']['active']): ?>
+                <?php if ($contentData['adherence']['aerobic']['jog']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">
                             Aerobic → Jog
-                            <?= @$lsRxReview['adherence']['aerobic']['jog']['intensity'] ? ' / ' . $lsRxReview['adherence']['aerobic']['jog']['intensity'] : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['jog']['days_per_week'] ? ' / ' . $lsRxReview['adherence']['aerobic']['jog']['days_per_week'] . ' days/wk' : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['jog']['minutes_per_day'] ? ' / ' . $lsRxReview['adherence']['aerobic']['jog']['minutes_per_day'] . ' mins/day' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['jog']['intensity'] ? ' / ' . $contentData['adherence']['aerobic']['jog']['intensity'] : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['jog']['days_per_week'] ? ' / ' . $contentData['adherence']['aerobic']['jog']['days_per_week'] . ' days/wk' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['jog']['minutes_per_day'] ? ' / ' . $contentData['adherence']['aerobic']['jog']['minutes_per_day'] . ' mins/day' : '' ?>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['jog']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['jog']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['jog']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['jog']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['jog']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['jog']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['aerobic']['elliptical']['active']): ?>
+                <?php if ($contentData['adherence']['aerobic']['elliptical']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">
                             Aerobic → Elliptical
-                            <?= @$lsRxReview['adherence']['aerobic']['elliptical']['intensity'] ? ' / ' . $lsRxReview['adherence']['aerobic']['elliptical']['intensity'] : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['elliptical']['days_per_week'] ? ' / ' . $lsRxReview['adherence']['aerobic']['elliptical']['days_per_week'] . ' days/wk' : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['elliptical']['minutes_per_day'] ? ' / ' . $lsRxReview['adherence']['aerobic']['elliptical']['minutes_per_day'] . ' mins/day' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['elliptical']['intensity'] ? ' / ' . $contentData['adherence']['aerobic']['elliptical']['intensity'] : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['elliptical']['days_per_week'] ? ' / ' . $contentData['adherence']['aerobic']['elliptical']['days_per_week'] . ' days/wk' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['elliptical']['minutes_per_day'] ? ' / ' . $contentData['adherence']['aerobic']['elliptical']['minutes_per_day'] . ' mins/day' : '' ?>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['elliptical']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['elliptical']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['elliptical']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['elliptical']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['elliptical']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['elliptical']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['aerobic']['swim']['active']): ?>
+                <?php if ($contentData['adherence']['aerobic']['swim']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">
                             Aerobic → Swim
-                            <?= @$lsRxReview['adherence']['aerobic']['swim']['intensity'] ? ' / ' . $lsRxReview['adherence']['aerobic']['swim']['intensity'] : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['swim']['days_per_week'] ? ' / ' . $lsRxReview['adherence']['aerobic']['swim']['days_per_week'] . ' days/wk' : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['swim']['minutes_per_day'] ? ' / ' . $lsRxReview['adherence']['aerobic']['swim']['minutes_per_day'] . ' mins/day' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['swim']['intensity'] ? ' / ' . $contentData['adherence']['aerobic']['swim']['intensity'] : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['swim']['days_per_week'] ? ' / ' . $contentData['adherence']['aerobic']['swim']['days_per_week'] . ' days/wk' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['swim']['minutes_per_day'] ? ' / ' . $contentData['adherence']['aerobic']['swim']['minutes_per_day'] . ' mins/day' : '' ?>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['swim']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['swim']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['swim']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['swim']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['swim']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['swim']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['aerobic']['bike']['active']): ?>
+                <?php if ($contentData['adherence']['aerobic']['bike']['active']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">
                             Aerobic → Bike
-                            <?= @$lsRxReview['adherence']['aerobic']['bike']['intensity'] ? ' / ' . $lsRxReview['adherence']['aerobic']['bike']['intensity'] : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['bike']['days_per_week'] ? ' / ' . $lsRxReview['adherence']['aerobic']['bike']['days_per_week'] . ' days/wk' : '' ?>
-                            <?= @$lsRxReview['adherence']['aerobic']['bike']['minutes_per_day'] ? ' / ' . $lsRxReview['adherence']['aerobic']['bike']['minutes_per_day'] . ' mins/day' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['bike']['intensity'] ? ' / ' . $contentData['adherence']['aerobic']['bike']['intensity'] : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['bike']['days_per_week'] ? ' / ' . $contentData['adherence']['aerobic']['bike']['days_per_week'] . ' days/wk' : '' ?>
+                            <?= @$contentData['adherence']['aerobic']['bike']['minutes_per_day'] ? ' / ' . $contentData['adherence']['aerobic']['bike']['minutes_per_day'] . ' mins/day' : '' ?>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['bike']['memo'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['bike']['adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['aerobic']['bike']['adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['bike']['memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['bike']['adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['aerobic']['bike']['adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
                 </tbody>
             <?php endif; ?>
 
-            <?php if ($lsRxReview['adherence']['strength']['active']): ?>
+            <?php if ($contentData['adherence']['strength']['active']): ?>
                 <tbody class="border-0">
-                <?php foreach ($lsRxReview['adherence']['strength']['exercises'] as $exercise): ?>
+                <?php foreach ($contentData['adherence']['strength']['exercises'] as $exercise): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white">
                             Strength → <?= @$exercise['name'] ?>
@@ -179,52 +179,52 @@ else {
                 </tbody>
             <?php endif; ?>
 
-            <?php if ($lsRxReview['adherence']['neat']['active']): ?>
+            <?php if ($contentData['adherence']['neat']['active']): ?>
                 <tbody class="border-0">
-                <?php if ($lsRxReview['adherence']['neat']['recommendations']['park_farther']): ?>
+                <?php if ($contentData['adherence']['neat']['recommendations']['park_farther']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white" colspan="2">
                             NEAT → Park farther away from entrances
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['park_farther_adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['park_farther_adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['park_farther_adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['park_farther_adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['neat']['recommendations']['steps_instead_of_elevator']): ?>
+                <?php if ($contentData['adherence']['neat']['recommendations']['steps_instead_of_elevator']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white" colspan="2">
                             NEAT → Take the stairs instead of escalator/elevator
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['steps_instead_of_elevator_adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['neat']['recommendations']['stand_instead_of_sit']): ?>
+                <?php if ($contentData['adherence']['neat']['recommendations']['stand_instead_of_sit']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white" colspan="2">
                             NEAT → Stand instead of sit
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['stand_instead_of_sit_adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['neat']['recommendations']['steps_goal_per_day']): ?>
+                <?php if ($contentData['adherence']['neat']['recommendations']['steps_goal_per_day']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white" colspan="2">
                             NEAT → Steps goal / day:
-                            <b><?= @$lsRxReview['adherence']['neat']['recommendations']['steps_goal_per_day'] ?></b>
+                            <b><?= @$contentData['adherence']['neat']['recommendations']['steps_goal_per_day'] ?></b>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['steps_goal_per_day_adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['steps_goal_per_day_adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['steps_goal_per_day_adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['steps_goal_per_day_adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
-                <?php if ($lsRxReview['adherence']['neat']['recommendations']['other']): ?>
+                <?php if ($contentData['adherence']['neat']['recommendations']['other']): ?>
                     <tr>
                         <td class="px-2 align-middle py-1 bg-white" colspan="2">
-                            NEAT → Other: <b><?= @$lsRxReview['adherence']['neat']['recommendations']['other'] ?></b>
+                            NEAT → Other: <b><?= @$contentData['adherence']['neat']['recommendations']['other'] ?></b>
                         </td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['other_adherence'] ?></td>
-                        <td class="px-2 align-middle py-1 bg-white"><?= @$lsRxReview['adherence']['neat']['recommendations']['other_adherence_memo'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['other_adherence'] ?></td>
+                        <td class="px-2 align-middle py-1 bg-white"><?= @$contentData['adherence']['neat']['recommendations']['other_adherence_memo'] ?></td>
                     </tr>
                 <?php endif; ?>
                 </tbody>