|
@@ -6,7 +6,7 @@ use App\Models\Point;
|
|
|
|
|
|
$goals = Point::getPointsOfCategoryExtended($patient, 'GOAL', $note);
|
|
|
|
|
|
-$goals = $goals->filter(function ($_x) use ($note) {
|
|
|
+$goals = array_filter($goals, function ($_x) use ($note) {
|
|
|
$rel = $_x->relevanceToNote($note);
|
|
|
$review = $_x->childPlanAddedInNote($note);
|
|
|
return ($rel ||
|
|
@@ -15,25 +15,13 @@ $goals = $goals->filter(function ($_x) use ($note) {
|
|
|
!!$review);
|
|
|
});
|
|
|
|
|
|
-$grouped = [];
|
|
|
-foreach($goals as $goal) {
|
|
|
- if(!@($goal->data->category)) continue;
|
|
|
- if($goal->is_removed && $goal->is_removed_due_to_entry_error) continue;
|
|
|
- if(!isset($grouped[$goal->data->category])) {
|
|
|
- $grouped[$goal->data->category] = [];
|
|
|
- }
|
|
|
- $grouped[$goal->data->category][] = $goal;
|
|
|
-}
|
|
|
-
|
|
|
$numRelevant = 0;
|
|
|
?>
|
|
|
|
|
|
-<?php if (!count($grouped)): ?>
|
|
|
+<?php if (!count($goals)): ?>
|
|
|
<div class="text-secondary">No goals</div>
|
|
|
<?php else: ?>
|
|
|
- <?php foreach($grouped as $k => $group): ?>
|
|
|
- <b><?= $k ?></b>
|
|
|
- <?php foreach ($group as $goal): ?>
|
|
|
+ <?php foreach ($goals as $goal): ?>
|
|
|
<?php $rel = $goal->relevanceToNote($note); ?>
|
|
|
<div class="pl-2 mb-2">
|
|
|
<div class="d-flex align-items-baseline">
|
|
@@ -71,7 +59,6 @@ $numRelevant = 0;
|
|
|
<?php endif; ?>
|
|
|
</div>
|
|
|
<?php endforeach; ?>
|
|
|
- <?php endforeach; ?>
|
|
|
@if($numRelevant)
|
|
|
<div class="d-flex align-items-baseline text-info mr-1 mt-3">
|
|
|
<span class="text-sm mr-1"><i class="fa fa-star text-sm"></i></span>
|