Browse Source

implemented 'physical-activity-assessment'

Josh 4 năm trước cách đây
mục cha
commit
1bb1c41089

+ 3 - 1
app/Http/Controllers/NoteController.php

@@ -108,7 +108,9 @@ class NoteController extends Controller
             ob_end_clean();
         }else{
             $newContentData = json_decode($request->get('data'), true);
-            $newSummaryHtml = $newContentData['value'];
+            if(isset($newContentData['value'])){
+                $newSummaryHtml = $newContentData['value'];
+            }  
         }
 
         if($section){

+ 15 - 11
resources/views/app/patient/note/note-list.blade.php

@@ -72,27 +72,31 @@
                 }
                 $formID = rand(0, 100000);
             ?>
-            <form ajax-form method="POST" action="/process_form_submit">
-                
-                <input type="hidden" name="section_uid" value="<?= $section->uid?>">
-
-                <input type="hidden" name="data" value="">
+            
 
                 <?php
                     if(file_exists(storage_path('sections/' . $sectionInternalName . '/form.blade.php'))) {
-                         include(storage_path('sections/' . $sectionInternalName . '/form.blade.php'));
+                ?>
+                
+                    @include('sections.' . $sectionInternalName . '.form')
+                <?php
                     }else{
                 ?>
+                <form ajax-form method="POST" action="/process_form_submit">
+                    <input type="hidden" name="section_uid" value="<?= $section->uid?>">
+                    <input type="hidden" name="data" value="">
                     <div note-rte data-content="{{$contentData['value']}}" class="form-group mb-2 border-left border-right rte-holder"></div>
+                    <div class="form-group m-0 d-flex">
+                        <button class="btn btn-sm btn-primary mr-2">Submit</button>
+                        <button class="btn btn-sm btn-default border" onclick="return cancelFormNoteSection(this)">Cancel</button>
+                    </div>
+                </form>
+                
                 <?php
                     }
                 ?>
 
-                <div class="form-group m-0 d-flex">
-                    <button class="btn btn-sm btn-primary mr-2">Submit</button>
-                    <button class="btn btn-sm btn-default border" onclick="return cancelFormNoteSection(this)">Cancel</button>
-                </div>
-            </form>
+                
         </div>
     </div>
     @endforeach

+ 1 - 0
storage/sections/physical-activity-assessment/form.blade.php

@@ -7,6 +7,7 @@ if (!$contentData) {
     $contentData = [];
 }
 $formID = rand(0, 100000);
+
 ?>
 <form method="POST" action="/process_form_submit" onsubmit="return submitForm_NoteSection_{{ $formID }}(this);">
     <?php if($section): ?>

+ 1 - 15
storage/sections/sample/default.php

@@ -1,19 +1,5 @@
 <?php
-$value = [];
-$infoLines = json_decode($patient->info_lines);
-$infoLines = !$infoLines ? [] : $infoLines;
-global $defaultData;
-foreach($infoLines as $category => $lines):
-    if($category === "dx"):
-        foreach ($lines as $line):
-            $value[] = $line->contentText;
-        endforeach;
-    endif;
-endforeach;
-$result = $patient->displayName() . ", {$patient->age_in_years} years old {$patient->sex} ";
-if(count($value)) {
-    $result .= "presenting with " . implode(", ", $value);
-}
+
 $defaultData = [
     "summary" => $result,
     "value" => $result,