|
@@ -67,6 +67,8 @@ class NoteController extends Controller
|
|
|
|
|
|
$section = Section::where('uid', $section_uid)->first();
|
|
$section = Section::where('uid', $section_uid)->first();
|
|
$note = Note::where('id', $section->note_id)->first();
|
|
$note = Note::where('id', $section->note_id)->first();
|
|
|
|
+ $client = Client::where('id', $note->client_id)->first();
|
|
|
|
+ $patient = $client;
|
|
$sectionTemplate = SectionTemplate::where('id', $section->section_template_id)->first();
|
|
$sectionTemplate = SectionTemplate::where('id', $section->section_template_id)->first();
|
|
|
|
|
|
$newContentData = [];
|
|
$newContentData = [];
|
|
@@ -75,15 +77,28 @@ class NoteController extends Controller
|
|
$sectionInternalName = $sectionTemplate->internal_name;
|
|
$sectionInternalName = $sectionTemplate->internal_name;
|
|
if ($sectionTemplate->is_canvas) {
|
|
if ($sectionTemplate->is_canvas) {
|
|
|
|
|
|
- if (file_exists("app.patient.canvas-sections.{$sectionInternalName}.processor")) {
|
|
|
|
- include("app.patient.canvas-sections.{$sectionInternalName}.processor");
|
|
|
|
|
|
+ $response = null;
|
|
|
|
+ $data = [
|
|
|
|
+ 'uid' => $client->uid,
|
|
|
|
+ 'key' => $sectionTemplate->internal_name,
|
|
|
|
+ 'data' => $request->get('data')
|
|
|
|
+ ];
|
|
|
|
+ $response = $this->calljava($request, '/client/updateCanvasData', $data);
|
|
|
|
+ //TODO: handle $response->success == false
|
|
|
|
+
|
|
|
|
+ $client = Client::where('id', $note->client_id)->first();
|
|
|
|
+ $patient = $client;
|
|
|
|
+ if (file_exists(resource_path("views/app/patient/canvas-sections/{$sectionInternalName}/processor.php"))) {
|
|
|
|
+ include(resource_path("views/app/patient/canvas-sections/{$sectionInternalName}/processor.php"));
|
|
} else {
|
|
} else {
|
|
$newContentData = json_decode($request->get('data'), true);
|
|
$newContentData = json_decode($request->get('data'), true);
|
|
}
|
|
}
|
|
|
|
+
|
|
ob_start();
|
|
ob_start();
|
|
- include("app.patient.canvas-sections.{$sectionInternalName}.summary");
|
|
|
|
|
|
+ include(resource_path("views/app/patient/canvas-sections/{$sectionInternalName}/summary.php"));
|
|
$newSummaryHtml = ob_get_contents();
|
|
$newSummaryHtml = ob_get_contents();
|
|
ob_end_clean();
|
|
ob_end_clean();
|
|
|
|
+ // TODO call Java to update the canvas
|
|
} elseif (file_exists(storage_path('sections/' . $sectionTemplate->internal_name . '/form.blade.php'))) {
|
|
} elseif (file_exists(storage_path('sections/' . $sectionTemplate->internal_name . '/form.blade.php'))) {
|
|
|
|
|
|
include(storage_path('sections/' . $sectionTemplate->internal_name . '/processor.php'));
|
|
include(storage_path('sections/' . $sectionTemplate->internal_name . '/processor.php'));
|
|
@@ -107,6 +122,7 @@ class NoteController extends Controller
|
|
'summaryHtml' => $newSummaryHtml
|
|
'summaryHtml' => $newSummaryHtml
|
|
];
|
|
];
|
|
$response = $this->calljava($request, '/section/update', $data);
|
|
$response = $this->calljava($request, '/section/update', $data);
|
|
|
|
+
|
|
return [
|
|
return [
|
|
'success' => $response['success'],
|
|
'success' => $response['success'],
|
|
'newSummaryHtml' => $newSummaryHtml
|
|
'newSummaryHtml' => $newSummaryHtml
|