Преглед изворни кода

added claims resolver view

unknown пре 4 година
родитељ
комит
77f005fe8d

+ 9 - 1
app/Http/Controllers/PatientController.php

@@ -28,9 +28,17 @@ class PatientController extends Controller
 
     public function claimsResolver(Request $request, Client $patient)
     {
+        $notes = $patient->notesAscending();
+        $hcpSignedNotes = 0;
+        foreach($notes as $note){
+            if($note->is_signed_by_hcp){
+                $hcpSignedNotes++;
+            }
+        }
         $data = [
             'dog' => 'bark',
-            'patient' => $patient
+            'patient' => $patient,
+            'hcpSignedNotes' => $hcpSignedNotes
         ];
         return view('app.patient.claims-resolver', $data);
     }

+ 6 - 0
app/Models/Client.php

@@ -67,6 +67,12 @@ class Client extends Model
             ->orderBy('effective_dateest', 'desc');
     }
 
+    public function notesAscending()
+    {
+        return $this->hasMany(Note::class, 'client_id', 'id')
+            ->orderBy('effective_dateest', 'asc');
+    }
+
     public function activeNotes()
     {
         return $this->hasMany(Note::class, 'client_id', 'id')

+ 2 - 1
resources/views/app/patient/claims-resolver.blade.php

@@ -1,5 +1,6 @@
 @extends ('layouts.patient')
 
 @section('inner-content')
-    <h1>Okay, good things coming here...</h1>
+    <h1>Here is the story of all the notes, bills, and claims for this patient.</h1>
+    <h2>HCP Signed Notes: {{$hcpSignedNotes}}</h2>
 @endsection