|
@@ -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',
|