Parcourir la source

Nutri/behav/exer - open in edit mode if note not signed

Vijayakrishnan il y a 3 ans
Parent
commit
bd35ad32da

+ 27 - 20
resources/views/app/patient/behavior-center.blade.php

@@ -263,31 +263,38 @@ $points = [
             <?php
             $missing = [];
             foreach ($points as $p) {
-                if(!$p['point']) {
+                if (!$p['point']) {
                     $missing[] = $p['category'];
                 }
             }
             if(count($missing)) {
-            foreach ($missing as $m) {
-            ?>
-            createCalls.push($.ajax({
-                url: "/api/visitPoint/addTopLevel",
-                type: 'post',
-                data: {
-                    noteUid: '{{$note->uid}}',
-                    category: '{{$m}}',
-                    additionReasonCategory: 'ON_INTAKE'
-                },
-                success: function(jsonSaveResponse) {},
-                error: function(jqXHR, textStatus, errorThrown) {}
-            }));
-            <?php
+                foreach ($missing as $m) {
+                    ?>
+                    createCalls.push($.ajax({
+                        url: "/api/visitPoint/addTopLevel",
+                        type: 'post',
+                        data: {
+                            noteUid: '{{$note->uid}}',
+                            category: '{{$m}}',
+                            additionReasonCategory: 'ON_INTAKE'
+                        },
+                        success: function (jsonSaveResponse) {},
+                        error: function (jqXHR, textStatus, errorThrown) {}
+                    }));
+                    <?php
+                }
+                ?>
+                Promise.all(createCalls).then(() => {
+                    refreshDynamicStagPopup();
+                });
+                <?php
             }
-            ?>
-            Promise.all(createCalls).then(() => {
-                refreshDynamicStagPopup();
-            });
-            <?php
+            else {
+                if(!$note->is_signed_by_hcp) { // auto-open edit mode
+                    ?>
+                    button.trigger('click');
+                    <?php
+                }
             }
             ?>
         }

+ 26 - 19
resources/views/app/patient/exercise-center.blade.php

@@ -265,26 +265,33 @@ $points = [
                 }
             }
             if(count($missing)) {
-            foreach ($missing as $m) {
-            ?>
-            createCalls.push($.ajax({
-                url: "/api/visitPoint/addTopLevel",
-                type: 'post',
-                data: {
-                    noteUid: '{{$note->uid}}',
-                    category: '{{$m}}',
-                    additionReasonCategory: 'ON_INTAKE'
-                },
-                success: function(jsonSaveResponse) {},
-                error: function(jqXHR, textStatus, errorThrown) {}
-            }));
-            <?php
+                foreach ($missing as $m) {
+                    ?>
+                    createCalls.push($.ajax({
+                        url: "/api/visitPoint/addTopLevel",
+                        type: 'post',
+                        data: {
+                            noteUid: '{{$note->uid}}',
+                            category: '{{$m}}',
+                            additionReasonCategory: 'ON_INTAKE'
+                        },
+                        success: function(jsonSaveResponse) {},
+                        error: function(jqXHR, textStatus, errorThrown) {}
+                    }));
+                    <?php
+                }
+                ?>
+                Promise.all(createCalls).then(() => {
+                    refreshDynamicStagPopup();
+                });
+                <?php
             }
-            ?>
-            Promise.all(createCalls).then(() => {
-                refreshDynamicStagPopup();
-            });
-            <?php
+            else {
+                if(!$note->is_signed_by_hcp) { // auto-open edit mode
+                    ?>
+                    button.trigger('click');
+                    <?php
+                }
             }
             ?>
 

+ 7 - 0
resources/views/app/patient/nutrition-center.blade.php

@@ -203,6 +203,13 @@ $points = [
                 });
                 <?php
             }
+            else {
+                if(!$note->is_signed_by_hcp) { // auto-open edit mode
+                    ?>
+                    button.trigger('click');
+                    <?php
+                }
+            }
             ?>
 
         }