Răsfoiți Sursa

New HPI log

Vijayakrishnan 3 ani în urmă
părinte
comite
739905e7c7

+ 4 - 0
app/Http/Controllers/NoteController.php

@@ -287,6 +287,10 @@ class NoteController extends Controller
         return view('app.patient.note.edit-hpi', compact('note', 'point'));
     }
 
+    public function hpiLog(Note $note, Point $point) {
+        return view('app.patient.note.hpi-log', compact('note', 'point'));
+    }
+
     // review log
     public function reviewLog(Point $point) {
         return view('app.patient.note.review-log', compact('point'));

+ 37 - 0
resources/views/app/patient/note/hpi-log.blade.php

@@ -0,0 +1,37 @@
+<div class="p-3">
+    <?php $numReviews = 0; ?>
+    @foreach($point->childReviews as $record)
+        @if(@$record->data)
+            <?php $numReviews++; ?>
+            <div class="border mb-3">
+                <div class="border-bottom p-2">
+                    <span class="text-secondary text-sm">Reviewed on </span>
+                    @if($record->client->core_note_id !== $record->note->id)
+                        <a native target="_blank" class="text-sm"
+                           href="<?= route('patients.view.notes.view.dashboard', ['patient' => $record->client, 'note' => $record->note]) ?>">
+                            <?= friendlier_date_time($record->created_at) ?>
+                        </a>
+                    @else
+                        <span class="text-sm"><?= friendlier_date_time($record->created_at) ?> from the patient's chart</span>
+                    @endif
+                </div>
+                <div class="p-2">
+                    <?php
+                    if(!@$template) $template = 'hpi/core.json';
+                    $review = json_decode($record->data);
+                    $data = $review ? $review : null;
+                    $patient = $note->client;
+                    ?>
+                    @include('app.dq-engine.read', compact('template', 'note', 'patient', 'point', 'data'))
+                </div>
+            </div>
+        @endif
+    @endforeach
+    @if(!$numReviews)
+        <div class="border mb-3">
+            <div class="p-2">
+                No HPI present
+            </div>
+        </div>
+    @endif
+</div>

+ 2 - 2
resources/views/app/patient/problems-center.blade.php

@@ -83,8 +83,8 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
-                                   href="/point/review-log/<?= $problem->uid ?>?popupmode=1">
+                                   title="HPI log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
+                                   href="/point/hpi-log/<?= $problem->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>
                             </div>

+ 1 - 0
routes/web.php

@@ -378,6 +378,7 @@ Route::middleware('pro.auth')->group(function () {
     });
 
     Route::get('/point/edit-hpi/{note}/{point}', 'NoteController@editHPI')->name('point-edit-hpi');
+    Route::get('/point/hpi-log/{point}', 'NoteController@hpiLog')->name('point-hpi-log');
     Route::get('/point/review-log/{point}', 'NoteController@reviewLog')->name('point-review-log');
     Route::get('/point/plan-log/{point}', 'NoteController@planLog')->name('point-plan-log');
     Route::get('/note/pdf/{note}', 'NoteController@downloadAsPdf')->name('note-pdf');