Jelajahi Sumber

Plan-log UI update for "pre-existing" plan

Vijayakrishnan 3 tahun lalu
induk
melakukan
ac3b5de52d

+ 5 - 0
app/Models/Point.php

@@ -78,6 +78,11 @@ class Point extends Model
         return $this->hasOne(Point::class, 'id', 'core_child_plan_point_id');
     }
 
+    public function parentPoint()
+    {
+        return $this->hasOne(Point::class, 'id', 'parent_point_id');
+    }
+
     public function client()
     {
         return $this->hasOne(Client::class, 'id', 'client_id');

+ 2 - 0
resources/views/app/patient/note/plan-log.blade.php

@@ -11,6 +11,8 @@
                            href="<?= route('patients.view.notes.view.dashboard', ['patient' => $record->client, 'note' => $record->note]) ?>">
                             <?= friendlier_date_time($record->created_at) ?>
                         </a>
+                    @elseif($record->parentPoint && $record->parentPoint->core_child_plan_point_id === $record->id)
+                        <span class="text-sm"><?= friendlier_date_time($record->created_at) ?> as pre-existing plan</span>
                     @else
                         <span class="text-sm"><?= friendlier_date_time($record->created_at) ?> from the patient's chart</span>
                     @endif