Przeglądaj źródła

removed note sections

= 1 rok temu
rodzic
commit
94350457a4
1 zmienionych plików z 12 dodań i 14 usunięć
  1. 12 14
      app/Http/Controllers/NoteController.php

+ 12 - 14
app/Http/Controllers/NoteController.php

@@ -28,8 +28,8 @@ class NoteController extends Controller
     public function dashboard(Request $request, Client $patient, Note $note)
     {
         $pros = $this->pros;
-        $noteSections = [];// $note->sections;
-        $allSections = []; //SectionTemplate::where('is_active', true)->get();
+        $noteSections = $note->sections;
+        $allSections = SectionTemplate::where('is_active', true)->get();
         foreach ($allSections as $section) {
             $section->used = false;
             foreach ($noteSections as $noteSection) {
@@ -42,27 +42,25 @@ class NoteController extends Controller
         }
 
         // load supplyOrders created on note->effective_date for patient
-        $supplyOrdersOnNote = [];
-//            = SupplyOrder::where('client_id', $patient->id)
-//            ->where('is_cancelled', false)
-//            ->where('note_id', $note->id)
-//            ->get();
+        $supplyOrdersOnNote = SupplyOrder::where('client_id', $patient->id)
+            ->where('is_cancelled', false)
+            ->where('note_id', $note->id)
+            ->get();
 
         // other open supplyOrders as of today
-        $otherOpenSupplyOrders = [];
-//            SupplyOrder::where('client_id', $patient->id)
-//            ->where('is_cancelled', false)
-//            ->where('note_id', '<>', $note->id)
-//            ->get();
+        $otherOpenSupplyOrders = SupplyOrder::where('client_id', $patient->id)
+            ->where('is_cancelled', false)
+            ->where('note_id', '<>', $note->id)
+            ->get();
 
-        $companyProIDs = []; //DB::select('SELECT company_pro_id FROM company_pro_document WHERE related_client_id  = ?', [$patient->id]);
+        $companyProIDs = DB::select('SELECT company_pro_id FROM company_pro_document WHERE related_client_id  = ?', [$patient->id]);
 
         $companyProIDInts = [];
         foreach($companyProIDs as $cpId){
             $companyProIDInts[] = $cpId->company_pro_id;
         }
 
-        $companyPros = []; //CompanyPro::whereIn('id', $companyProIDInts)->get();
+        $companyPros = CompanyPro::whereIn('id', $companyProIDInts)->get();
 
         return view('app.patient.note.dashboard', compact('patient', 'note',
             'allSections',