Quellcode durchsuchen

Omega - plan system > all lifestyle

Vijayakrishnan vor 3 Jahren
Ursprung
Commit
6a3e7949a7
22 geänderte Dateien mit 298 neuen und 40 gelöschten Zeilen
  1. 29 0
      app/Models/Point.php
  2. 63 0
      resources/views/app/patient/module-specific-summary-renderers/behavior/plan.blade.php
  3. 63 0
      resources/views/app/patient/module-specific-summary-renderers/exercise/plan.blade.php
  4. 63 0
      resources/views/app/patient/module-specific-summary-renderers/nutrition/plan.blade.php
  5. 3 3
      resources/views/app/patient/segment-templates/_child_plan/behavior/CRAVINGS/last-plan.php
  6. 3 3
      resources/views/app/patient/segment-templates/_child_plan/behavior/FOOD_TRIGGERS/last-plan.php
  7. 3 3
      resources/views/app/patient/segment-templates/_child_plan/behavior/SELF_MONITORING/last-plan.php
  8. 3 3
      resources/views/app/patient/segment-templates/_child_plan/behavior/SLEEP_HABITS/last-plan.php
  9. 3 3
      resources/views/app/patient/segment-templates/_child_plan/exercise/AEROBIC_ACTIVITY/last-plan.php
  10. 3 3
      resources/views/app/patient/segment-templates/_child_plan/exercise/NEAT/last-plan.php
  11. 3 3
      resources/views/app/patient/segment-templates/_child_plan/exercise/STRENGTH_TRAINING/last-plan.php
  12. 1 1
      resources/views/app/patient/segment-templates/_child_plan/last-plan.php
  13. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CALORIES/last-plan.php
  14. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CARBOHYDRATES/last-plan.php
  15. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/FAST_FOOD/last-plan.php
  16. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/HIGH_SUGAR_BEVERAGES/last-plan.php
  17. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/PORTION_SIZES/last-plan.php
  18. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/SNACKS/last-plan.php
  19. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/VEGETABLES/last-plan.php
  20. 2 2
      resources/views/app/patient/segment-templates/_child_plan/nutrition/WATER_INTAKE/last-plan.php
  21. 0 1
      resources/views/app/patient/segment-templates/omega_plan_system/edit.blade.php
  22. 42 1
      resources/views/app/patient/segment-templates/omega_plan_system/summary.blade.php

+ 29 - 0
app/Models/Point.php

@@ -207,6 +207,35 @@ class Point extends Model
         return $points;
     }
 
+    public static function getPlanPoints(Client $_patient, Note $_note, $_assoc = false) {
+        $points = Point
+            ::where('client_id', $_patient->id)
+            ->where('is_removed_due_to_entry_error', false)
+            ->where(function ($query1) use ($_note) {
+                $query1
+                    ->where(function ($query2) use ($_note) {
+                        $query2->where('is_removed', false)
+                            ->where('addition_reason_category', 'DURING_VISIT')
+                            ->where('added_in_note_id', $_note->id);
+                    })
+                    ->orWhere(function ($query2) use ($_note) {
+                        $query2->where('is_removed', true)
+                            ->where('removal_reason_category', 'DURING_VISIT')
+                            ->where('removed_in_note_id', $_note->id);
+                    })
+                    ->orWhere('last_child_plan_point_scoped_note_id', $_note->id)
+                    ->orWhereRaw("(SELECT count(id) from note_point WHERE is_active IS TRUE AND note_id = {$_note->id} AND point_id = point.id) > 0");
+            })
+            ->orderBy('created_at')
+            ->get();
+        foreach ($points as $point) {
+            if ($point->data) {
+                $point->data = json_decode($point->data, $_assoc);
+            }
+        }
+        return $points;
+    }
+
     public static function getUnifiedPointsOfCategory(Client $_patient, String $_category, Note $_note, $_assoc = false) {
         $points = Point
             ::where('client_id', $_patient->id)

+ 63 - 0
resources/views/app/patient/module-specific-summary-renderers/behavior/plan.blade.php

@@ -0,0 +1,63 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px font-weight-bold"
+           open-in-stag-popup
+           href="/behavior-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="behavior-center-{{$note->id}}"
+           title="<img src='/img/behavior-rx.png'/> Behavior Rx"
+           popup-style="medium-large overflow-visible">
+            Behavior Rx
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
+                        @if($rel)
+                            <?php $numRelevant++; ?>
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class="font-weight-bold <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            {{ucwords(str_replace('_', ' ', strtolower($point->category)))}}
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="pl-3">
+                            <?php $plan = $point->childPlanAddedInNote($note); ?>
+                            <?php if(!!$plan): ?>
+                                <?php
+                                $flat = true;
+                                include resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $point['category'] . '/last-plan.php');
+                                ?>
+                            <?php endif; ?>
+                        </div>
+                        <div class="pl-3">
+                            <?php if ($point->is_removed): ?>
+                            @if($point->removal_reason_category === 'DURING_VISIT')
+                                <span class="text-sm text-secondary">Removed during visit</span>
+                            @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                <span class="text-sm text-secondary">Removed on intake</span>
+                            @endif
+                            <?php elseif ($point->added_in_note_id === $note->id): ?>
+                            <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="text-sm text-success">* Added during visit</span>
+                            <?php else: ?>
+                            <span class="text-sm text-info">* Added on intake</span>
+                            <?php endif;?>
+                            <?php endif; ?>
+                        </div>
+
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 63 - 0
resources/views/app/patient/module-specific-summary-renderers/exercise/plan.blade.php

@@ -0,0 +1,63 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px font-weight-bold"
+           open-in-stag-popup
+           href="/exercise-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="exercise-center-{{$note->id}}"
+           title="<img src='/img/exercise-rx.png'/> Exercise Rx"
+           popup-style="medium-large overflow-visible">
+            Exercise Rx
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
+                        @if($rel)
+                            <?php $numRelevant++; ?>
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class="font-weight-bold <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            {{ucwords(str_replace('_', ' ', strtolower($point->category)))}}
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="pl-3">
+                            <?php $plan = $point->childPlanAddedInNote($note); ?>
+                            <?php if(!!$plan): ?>
+                                <?php
+                                $flat = true;
+                                include resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $point['category'] . '/last-plan.php');
+                                ?>
+                            <?php endif; ?>
+                        </div>
+                        <div class="pl-3">
+                            <?php if ($point->is_removed): ?>
+                            @if($point->removal_reason_category === 'DURING_VISIT')
+                                <span class="text-sm text-secondary">Removed during visit</span>
+                            @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                <span class="text-sm text-secondary">Removed on intake</span>
+                            @endif
+                            <?php elseif ($point->added_in_note_id === $note->id): ?>
+                            <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="text-sm text-success">* Added during visit</span>
+                            <?php else: ?>
+                            <span class="text-sm text-info">* Added on intake</span>
+                            <?php endif;?>
+                            <?php endif; ?>
+                        </div>
+
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 63 - 0
resources/views/app/patient/module-specific-summary-renderers/nutrition/plan.blade.php

@@ -0,0 +1,63 @@
+@if($points && count($points))
+    <div class="d-flex border-bottom">
+        <a class="mr-2 min-width-110px font-weight-bold"
+           open-in-stag-popup
+           href="/nutrition-center/{{$note->client->uid}}/{{$note->uid}}"
+           mc-initer="nutrition-center-{{$note->id}}"
+           title="<img src='/img/nutrition-rx.png'/> Nutrition Rx"
+           popup-style="medium-large overflow-visible">
+            Nutrition Rx
+        </a>
+        <div class="flex-grow-1">
+            <table class="table table-bordered table-xs table-cage mb-0">
+                <?php $j = 0; foreach ($points as $point): $j++; ?>
+                <?php $rel = $point->relevanceToNote($note); ?>
+                <tr>
+                    <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
+                        @if($rel)
+                            <?php $numRelevant++; ?>
+                            {{ $j }}.*
+                        @else
+                            {{ $j }}.
+                        @endif
+                    </td>
+                    <td class="px-2 width-300px">
+                        <div class="font-weight-bold <?= $point->is_removed ? 'strike-through' : '' ?>">
+                            {{ucwords(str_replace('_', ' ', strtolower($point->category)))}}
+                        </div>
+                    </td>
+                    <td class="width-300px">
+                        <div class="pl-3">
+                            <?php $plan = $point->childPlanAddedInNote($note); ?>
+                            <?php if(!!$plan): ?>
+                                <?php
+                                $flat = true;
+                                include resource_path('views/app/patient/segment-templates/_child_plan/nutrition/' . $point['category'] . '/last-plan.php');
+                                ?>
+                            <?php endif; ?>
+                        </div>
+                        <div class="pl-3">
+                            <?php if ($point->is_removed): ?>
+                            @if($point->removal_reason_category === 'DURING_VISIT')
+                                <span class="text-sm text-secondary">Removed during visit</span>
+                            @elseif($point->removal_reason_category === 'ON_INTAKE')
+                                <span class="text-sm text-secondary">Removed on intake</span>
+                            @endif
+                            <?php elseif ($point->added_in_note_id === $note->id): ?>
+                            <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
+                            <span class="text-sm text-success">* Added during visit</span>
+                            <?php else: ?>
+                            <span class="text-sm text-info">* Added on intake</span>
+                            <?php endif;?>
+                            <?php endif; ?>
+                        </div>
+
+                    </td>
+                    <td></td>
+                </tr>
+                <?php endforeach; ?>
+            </table>
+
+        </div>
+    </div>
+@endif

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/behavior/CRAVINGS/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/behavior/FOOD_TRIGGERS/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/behavior/SELF_MONITORING/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/behavior/SLEEP_HABITS/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/exercise/AEROBIC_ACTIVITY/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/exercise/NEAT/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 3 - 3
resources/views/app/patient/segment-templates/_child_plan/exercise/STRENGTH_TRAINING/last-plan.php

@@ -1,10 +1,10 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container">
             <?php $plan = $parsedPlan; ?>
-            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
+            <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $point->category . '/view-plan.php')); ?>
         </div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/last-plan.php

@@ -1,6 +1,6 @@
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CALORIES/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CARBOHYDRATES/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/FAST_FOOD/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/HIGH_SUGAR_BEVERAGES/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/PORTION_SIZES/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/SNACKS/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/VEGETABLES/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/nutrition/WATER_INTAKE/last-plan.php

@@ -1,7 +1,7 @@
-<div class="mb-1 font-weight-bold text-secondary">Change Goal</div>
+<?php if(!@$flat): ?> <div class="mb-1 font-weight-bold text-secondary">Change Goal</div> <?php endif; ?>
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
-    <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+    <div class="<?= !@$flat && $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
         <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 

+ 0 - 1
resources/views/app/patient/segment-templates/omega_plan_system/edit.blade.php

@@ -1 +0,0 @@
-<h1>omega_plan_system</h1>

+ 42 - 1
resources/views/app/patient/segment-templates/omega_plan_system/summary.blade.php

@@ -1 +1,42 @@
-<h1>omega_plan_system</h1>
+<?php
+
+use App\Models\Point;
+
+/** @var \App\Models\Client $patient */
+/** @var \App\Models\Note $note */
+
+$points = Point::getPlanPoints($patient, $note);
+
+$topLevelPointToRendererMap = [
+    'HIGH_SUGAR_BEVERAGES' => 'nutrition',
+    'WATER_INTAKE' => 'nutrition',
+    'FAST_FOOD' => 'nutrition',
+    'SNACKS' => 'nutrition',
+    'VEGETABLES' => 'nutrition',
+    'PORTION_SIZES' => 'nutrition',
+    'DAILY_INTAKE_CARBOHYDRATES' => 'nutrition',
+    'DAILY_INTAKE_CALORIES' => 'nutrition',
+    'AEROBIC_ACTIVITY' => 'exercise',
+    'STRENGTH_TRAINING' => 'exercise',
+    'NEAT,' => 'exercise',
+    'SELF_MONITORING' => 'behavior',
+    'FOOD_TRIGGERS' => 'behavior',
+    'CRAVINGS' => 'behavior',
+    'SLEEP_HABITS' => 'behavior',
+];
+
+$pointMap = [];
+
+foreach($points as $point){
+    if(!isset($topLevelPointToRendererMap[$point->category])) continue;
+    $renderer = $topLevelPointToRendererMap[$point->category];
+    if(!isset($pointMap[$renderer])) $pointMap[$renderer] = [];
+    $pointMap[$renderer][] = $point;
+}
+
+foreach ($pointMap as $renderer => $points) {
+?>
+@include('app.patient.module-specific-summary-renderers.' . $renderer . '.plan', compact('points'))
+<?php
+}
+