|
@@ -50,9 +50,10 @@ $previousVitals = [];
|
|
|
$previousVitals = \App\Models\Point::where('parent_point_id', $point->id)
|
|
|
->where('category', 'REVIEW')
|
|
|
->whereIn('added_in_note_id', $last4VisitsIDs)
|
|
|
- ->orderBy('id', 'DESC')
|
|
|
+ ->orderBy('id', 'ASC')
|
|
|
->get();
|
|
|
|
|
|
+
|
|
|
// convert to new format
|
|
|
$previousData = [];
|
|
|
$previousDataAssoc = [];
|
|
@@ -74,8 +75,8 @@ foreach ($previousVitals as $p) {
|
|
|
$newFormat['date'] = $p->note->effective_dateest; // unfriendly_date($p->created_at);
|
|
|
if(!isset($previousDataAssoc[$newFormat['date']])){
|
|
|
$previousData[] = $newFormat;
|
|
|
- $previousDataAssoc[$newFormat['date']] = $newFormat; // for easy iter to cols
|
|
|
- }
|
|
|
+ $previousDataAssoc[$newFormat['date']] = $newFormat; // for easy iter to cols
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|