|
@@ -14,7 +14,7 @@ use App\Models\SectionTemplate;
|
|
|
|
|
|
class NoteController extends Controller
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
public function dashboard(Request $request, Client $patient, Note $note)
|
|
|
{
|
|
|
$pros = $this->pros;
|
|
@@ -49,10 +49,22 @@ class NoteController extends Controller
|
|
|
$summaryHtml = '';
|
|
|
$patient = Client::where('id', $patientID)->first();
|
|
|
$sectionTemplate = SectionTemplate::where('id', $sectionTemplateID)->first();
|
|
|
-
|
|
|
- if (file_exists(storage_path('sections/' . $sectionTemplate->internal_name . '/default.php'))) {
|
|
|
- // default should simply assign to $contentData and $summaryHtml as needed
|
|
|
- include(storage_path('sections/' . $sectionTemplate->internal_name . '/default.php'));
|
|
|
+
|
|
|
+ if ($sectionTemplate->is_canvas) {
|
|
|
+ if (file_exists(resource_path('views/app/patient/canvas-sections/' . $sectionTemplate->internal_name . '/default.php'))) {
|
|
|
+ // default should simply assign to $contentData
|
|
|
+ include(resource_path('views/app/patient/canvas-sections/' . $sectionTemplate->internal_name . '/default.php'));
|
|
|
+
|
|
|
+ ob_start();
|
|
|
+ include(resource_path('views/app/patient/canvas-sections/' . $sectionTemplate->internal_name . '/summary.php'));
|
|
|
+ $summaryHtml = ob_get_contents();
|
|
|
+ ob_end_clean();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (file_exists(storage_path('sections/' . $sectionTemplate->internal_name . '/default.php'))) {
|
|
|
+ // default should simply assign to $contentData and $summaryHtml as needed
|
|
|
+ include(storage_path('sections/' . $sectionTemplate->internal_name . '/default.php'));
|
|
|
+ }
|
|
|
}
|
|
|
return [
|
|
|
'contentData' => $contentData,
|
|
@@ -85,7 +97,7 @@ class NoteController extends Controller
|
|
|
}else{
|
|
|
$client = Client::where('id', $section->client_id)->first();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$patient = $client;
|
|
|
$sectionTemplate = SectionTemplate::where('id', $section->section_template_id)->first();
|
|
|
|
|
@@ -112,7 +124,7 @@ class NoteController extends Controller
|
|
|
} else {
|
|
|
$newContentData = json_decode($request->get('data'), true);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ob_start();
|
|
|
include(resource_path("views/app/patient/canvas-sections/{$sectionInternalName}/summary.php"));
|
|
|
$newSummaryHtml = ob_get_contents();
|