Vijayakrishnan 3 سال پیش
والد
کامیت
378f99b601

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

@@ -357,7 +357,7 @@ class NoteController extends Controller
     public function noteSegmentView(Request $request, Client $patient, Note $note, Segment $segment, $segmentInternalName, $view) {
         return view("app.patient.segment-templates.{$segmentInternalName}.{$view}", [
             'patient' => $patient,
-            'note' => $patient->coreNote,
+            'note' => $note,
             'segment' => $segment,
             'segmentInternalName' => $segmentInternalName
         ]);

+ 1 - 1
public/css/style.css

@@ -2536,7 +2536,7 @@ table.table-xs tr td {
     position: relative;
 }
 .rspace input[type="radio"][value="-"]:checked:before,
-.rspace input[type="radio"][value="+"]:checked:before
+.rspace input[type="radio"][value="+"]:checked:before,
 .rspace input[type="radio"][value="-"]:checked:after,
 .rspace input[type="radio"][value="+"]:checked:after{
     content: '';

+ 14 - 0
resources/views/app/patient/note/dashboard_script.blade.php

@@ -185,6 +185,20 @@
                             return false;
                         }
 
+                        <?php
+                        $rosSegment = $note->getSegmentByInternalName('ros');
+                        ?>
+                        @if($rosSegment)
+                        if(editParent.is('[data-segment-template-name="ros"]')) {
+                            openDynamicStagPopup('/note-segment-view/{{$note->client->uid}}/{{$note->uid}}/{{$rosSegment->uid}}/ros/edit',
+                                'init-ros-{{$note->id}}',
+                                'Review of Systems',
+                                false,
+                                "medium-large overflow-visible");
+                            return false;
+                        }
+                        @endif
+
                         // OPEN popup for if note-segment-view exists
                         if($('.' + editParent.attr('data-segment-template-name') + '-trigger').length) {
                             $('.' + editParent.attr('data-segment-template-name') + '-trigger').trigger('click');

+ 1 - 1
resources/views/app/patient/note/segment.blade.php

@@ -119,7 +119,7 @@
         'intake_supplements',
         'plan_supplements',
     ];
-    if(!in_array($iName, $wizardPowered)) { ?>
+    if(!in_array($iName, $wizardPowered) && $iName !== 'ros') { ?>
     <div class="d-none if-edit edit-container">
         {!! $segment->edit_html !!}
     </div>

+ 13 - 14
resources/views/app/patient/segment-templates/ros/edit.blade.php

@@ -232,7 +232,7 @@ for ($i = 0; $i < count($fields); $i++) {
                 <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
             @endif
             <input type="hidden" name="category" value="ROS">
-            <input type="hidden" name="data">
+            <input type="hidden" name="data" value='{!! json_encode($contentData) !!}'>
 
             <div id="edit-ros-container">
                 <div class="d-flex align-items-center mb-3">
@@ -300,11 +300,8 @@ for ($i = 0; $i < count($fields); $i++) {
                 <div class="mb-2">
                     <textarea class="form-control form-control-sm" v-model="comments">{!! $parsed && @$parsed->content ? @$parsed->content : '' !!}</textarea>
                 </div>
-            </div>
-
-            @if(!!$segment)
-                <div class="my-2">
-                    <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></button>
+                <div class="mt-3">
+                    <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="saveROS()">Save</button>
                     <div class="d-inline-flex align-self-stretch align-items-center">
                         <span class="autosave-indicator saving text-sm text-secondary">Saving changes &hellip;</span>
                         <span class="autosave-indicator saved text-sm text-secondary">
@@ -313,12 +310,7 @@ for ($i = 0; $i < count($fields); $i++) {
                     </span>
                     </div>
                 </div>
-            @else
-                <div class="my-2">
-                    <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                    <button cancel class="btn btn-sm btn-default border" {!! @$closeOnSave ? 'onmousedown="return closeStagPopup()"' : '' !!}>Close</button>
-                </div>
-            @endif
+            </div>
 
         </form>
     </div>
@@ -326,7 +318,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
+        function initROS() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
 
@@ -355,11 +347,18 @@ for ($i = 0; $i < count($fields); $i++) {
                         Vue.nextTick(function() {
                             $('#edit-ros-container').find('textarea').first().trigger('input');
                         });
+                    },
+                    saveROS: function() {
+                        saveVisitForm($('#edit-ros-container')[0], false, true);
                     }
                 }
             });
 
-        };
+        }
+
+        // window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = initROS;
+
+        addMCInitializer('init-ros-{{$note->id}}', initROS, '#edit-ros-container');
 
     }).call(window);
 </script>