浏览代码

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2

= 3 年之前
父节点
当前提交
ede6030f15
共有 31 个文件被更改,包括 590 次插入238 次删除
  1. 1 1
      config/app.php
  2. 39 4
      js-dev/mc.js
  3. 44 3
      public/css/style.css
  4. 13 1
      resources/views/app/patient/allergies-center.blade.php
  5. 30 21
      resources/views/app/patient/behavior-center.blade.php
  6. 13 1
      resources/views/app/patient/careteam-center.blade.php
  7. 29 20
      resources/views/app/patient/exercise-center.blade.php
  8. 13 1
      resources/views/app/patient/goals-center.blade.php
  9. 13 1
      resources/views/app/patient/medications-center.blade.php
  10. 13 1
      resources/views/app/patient/medications-reconcile.blade.php
  11. 4 1
      resources/views/app/patient/module-specific-summary-renderers/behavior/plan.blade.php
  12. 4 1
      resources/views/app/patient/module-specific-summary-renderers/behavior/subjective.blade.php
  13. 4 1
      resources/views/app/patient/module-specific-summary-renderers/exercise/plan.blade.php
  14. 4 1
      resources/views/app/patient/module-specific-summary-renderers/exercise/subjective.blade.php
  15. 4 1
      resources/views/app/patient/module-specific-summary-renderers/nutrition/plan.blade.php
  16. 4 1
      resources/views/app/patient/module-specific-summary-renderers/nutrition/subjective.blade.php
  17. 111 0
      resources/views/app/patient/module-specific-summary-renderers/typical_day_lifestyle/subjective.blade.php
  18. 5 3
      resources/views/app/patient/note/dashboard.blade.php
  19. 32 0
      resources/views/app/patient/note/dashboard_script.blade.php
  20. 2 1
      resources/views/app/patient/note/segment-slim.blade.php
  21. 10 1
      resources/views/app/patient/nutrition-center.blade.php
  22. 13 1
      resources/views/app/patient/problems-center.blade.php
  23. 0 4
      resources/views/app/patient/segment-templates/_child_plan/edit-plan-in-place.php
  24. 0 4
      resources/views/app/patient/segment-templates/_child_plan/edit-plan.php
  25. 0 5
      resources/views/app/patient/segment-templates/_child_review/edit-review-in-place.php
  26. 0 5
      resources/views/app/patient/segment-templates/_child_review/edit-review.php
  27. 17 53
      resources/views/app/patient/segment-templates/omega_subjective_system/summary.blade.php
  28. 15 4
      resources/views/app/patient/segment-templates/typical_day_lifestyle/edit.blade.php
  29. 19 15
      resources/views/app/patient/vitals-settings/bmi-management-summary.blade.php
  30. 5 5
      resources/views/app/patient/vitals-settings/bp-management-form.blade.php
  31. 129 77
      resources/views/app/patient/vitals-settings/bp-management-summary.blade.php

+ 1 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 61,
+    'asset_version' => 63,
 
     'temp_dir' => env('TEMP_DIR'),
 

+ 39 - 4
js-dev/mc.js

@@ -590,13 +590,48 @@ window.saveVisitForm = function(_trigger, _silent = false, _close = false, _done
                 // if /api/visitPoint/upsertChildReview - refresh subjective_general_v2
                 // if /api/visitPoint/upsertChildPlan - refresh plan_free_text_v2
                 if(form.attr('url') === '/api/visitPoint/upsertChildReview') {
-                    if(!form.is('.frm-review-plan-lifestyle') && !form.is('.frm-upsert-review-plan-nutrition') && !form.is('.frm-upsert-review-typical-day-ls')) {
-                        $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
+                    if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('past_medical_history/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_past_medical"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('history_family/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_family"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('history_social/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_social"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('history_surgical/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_surgical"]').find('.refresh-segment').trigger('click');
                     }
                 }
                 else if(form.attr('url') === '/api/visitPoint/upsertChildPlan') {
-                    if(!form.is('.frm-review-plan-lifestyle') && !form.is('.frm-upsert-review-plan-nutrition') && !form.is('.frm-upsert-review-typical-day-ls')) {
-                        $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                    if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('past_medical_history/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_past_medical"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('history_family/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_family"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('history_social/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_social"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('history_surgical/edit') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_history_surgical"]').find('.refresh-segment').trigger('click');
+                    }
+                }
+                else if(form.attr('url') === '/api/visitPoint/destroyCurrentChildReview' || form.attr('url') === '/api/visitPoint/destroyCurrentChildPlan') {
+                    if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('allergies-center') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_allergies"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('medications-center') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_medications"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('problems-center') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_problems"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('goals-center') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_goals"]').find('.refresh-segment').trigger('click');
+                    }
+                    else if(form.closest('.stag-popup').attr('stag-popup-key').indexOf('careteam-center') !== -1) {
+                        $('.visit-segment[data-segment-template-name="omega_care_team"]').find('.refresh-segment').trigger('click');
                     }
                 }
 

+ 44 - 3
public/css/style.css

@@ -50,6 +50,7 @@
 .text-link {
     color: rgb(13, 89, 175) !important;
 }
+
 .stag-primary-bg {
   background-color: var(--primary-color) !important;
   color: #fff;
@@ -340,13 +341,16 @@ body>nav.navbar {
     width: 800px;
 }
 [moe][center][extra-wide] [url]:not([show]) {
-    left: calc(50% - 450px);
-    width: 900px;
+    left: calc(50% - 500px);
+    width: 1000px;
 }
 [moe][center] [url]:not([show]) .form-control.form-control-sm {
     min-width: unset;
     max-width: 100%;
 }
+.form-check-label {
+  padding-top: 2px;
+}
 .mcp-theme-1 .rotateh {
     transform: rotateY(180deg);
 }
@@ -624,6 +628,34 @@ input.search_field, textarea.search_field {
         padding-top: 55px;
     }
 }
+.flex-parent-container {
+  display: flex;
+  align-items: flex-start;
+}
+.flex-parent-container > div:first-child {
+  border-right: 1px solid #eee !important;
+  margin-right: 10px;
+}
+.flex-parent-container > div {
+  flex-basis: 50%;
+}
+@media screen and (min-width: 1400px) {
+  .flex-container, .flex-parent-container {
+    display: flex;
+    align-items: flex-start;
+    justify-content: space-between;
+  }
+  .flex-container >div {
+    flex-basis: 50%;
+  }
+  .flex-parent-container > div:first-child {
+    flex-basis: 40%;
+  }
+  .flex-parent-container > div {
+    flex-basis: 60%;
+  }
+}
+
 .main-row > .sidebar .nav .nav-item a {
     white-space: nowrap;
 }
@@ -2549,7 +2581,7 @@ td.row-selection-highlight:after {
     max-height: 14px;
 }
 
-.table td.fit, 
+.table td.fit,
 .table th.fit {
     white-space: nowrap;
     width: 1%;
@@ -3177,3 +3209,12 @@ body.forced-masking #mask {
 .note_template_omega_soap_visit .system_segment .d-flex.border-bottom:last-of-type {
     border-bottom: 0 !important;
 }
+.note-signed-by-hcp .hide-if-note-signed {
+    display: none !important;
+}
+.show-if-note-signed {
+    display: none !important;
+}
+.note-signed-by-hcp .show-if-note-signed {
+    display: block !important;
+}

+ 13 - 1
resources/views/app/patient/allergies-center.blade.php

@@ -171,6 +171,7 @@ if(!@$summaryView) {
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_allergies');
                     if(!$segment) $segment = $note->getSegmentByInternalName('allergies');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start">
@@ -211,6 +212,7 @@ if(!@$summaryView) {
                     <?php
                     $segment = $note->getSegmentByInternalName('plan_allergies');
                     if(!$segment) $segment = $note->getSegmentByInternalName('allergies');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start position-relative">
@@ -409,12 +411,22 @@ if(!@$summaryView) {
                         $(this).text('Back to Read Mode');
                         $('#allergies-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
 
             buttonContainer.insertAfter(titleElem);
+
+            <?php
+            if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                ?>
+                button.trigger('click');
+                <?php
+            }
+            ?>
         }
         addMCInitializer('allergies-center-{{$note->id}}', init, '#allergies-center-{{$note->id}}');
     }).call(window);

+ 30 - 21
resources/views/app/patient/behavior-center.blade.php

@@ -252,7 +252,9 @@ $points = [
                         $(this).text('Back to Read Mode');
                         $('#behavior-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
@@ -263,31 +265,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 && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                    ?>
+                    button.trigger('click');
+                    <?php
+                }
             }
             ?>
         }

+ 13 - 1
resources/views/app/patient/careteam-center.blade.php

@@ -163,6 +163,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_care_team');
                     if(!$segment) $segment = $note->getSegmentByInternalName('care_team');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start">
@@ -203,6 +204,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                     <?php
                     $segment = $note->getSegmentByInternalName('plan_care_team');
                     if(!$segment) $segment = $note->getSegmentByInternalName('care_team');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start position-relative">
@@ -403,12 +405,22 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                         $(this).text('Back to Read Mode');
                         $('#careteam-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
 
             buttonContainer.insertAfter(titleElem);
+
+            <?php
+            if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                ?>
+                button.trigger('click');
+                <?php
+            }
+            ?>
         }
         addMCInitializer('careteam-center-{{$note->id}}', init, '#careteam-center-{{$note->id}}');
     }).call(window);

+ 29 - 20
resources/views/app/patient/exercise-center.blade.php

@@ -249,7 +249,9 @@ $points = [
                         $(this).text('Back to Read Mode');
                         $('#exercise-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
@@ -265,26 +267,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 && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                    ?>
+                    button.trigger('click');
+                    <?php
+                }
             }
             ?>
 

+ 13 - 1
resources/views/app/patient/goals-center.blade.php

@@ -103,6 +103,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_goals');
                     if(!$segment) $segment = $note->getSegmentByInternalName('goals');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start">
@@ -143,6 +144,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                     <?php
                     $segment = $note->getSegmentByInternalName('plan_goals');
                     if(!$segment) $segment = $note->getSegmentByInternalName('goals');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start position-relative">
@@ -295,12 +297,22 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                         $(this).text('Back to Read Mode');
                         $('#goals-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
 
             buttonContainer.insertAfter(titleElem);
+
+            <?php
+            if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                ?>
+                button.trigger('click');
+                <?php
+            }
+            ?>
         }
         addMCInitializer('goals-center-{{$note->id}}', init, '#goals-center-{{$note->id}}');
     }).call(window);

+ 13 - 1
resources/views/app/patient/medications-center.blade.php

@@ -163,6 +163,7 @@ if(!@$summaryView) {
                         <?php
                         $segment = $note->getSegmentByInternalName('intake_medications');
                         if(!$segment) $segment = $note->getSegmentByInternalName('medications');
+                        if(!$segment) $segment = $note->coreSegment;
                         ?>
                         <div if-read-mode>
                             <div class="d-flex align-items-start">
@@ -203,6 +204,7 @@ if(!@$summaryView) {
                         <?php
                         $segment = $note->getSegmentByInternalName('plan_medications');
                         if(!$segment) $segment = $note->getSegmentByInternalName('medications');
+                        if(!$segment) $segment = $note->coreSegment;
                         ?>
                         <div if-read-mode>
                             <div class="d-flex align-items-start position-relative">
@@ -456,12 +458,22 @@ if(!@$summaryView) {
                     $(this).text('Back to Read Mode');
                     $('#medications-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                 } else {
-                    refreshDynamicStagPopup();
+                    let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                    if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                    refreshDynamicStagPopup(url);
                 }
                 return false;
             });
 
         buttonContainer.insertAfter(titleElem);
+
+        <?php
+        if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+            ?>
+            button.trigger('click');
+            <?php
+        }
+        ?>
     }
     addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}');
 }).call(window);

+ 13 - 1
resources/views/app/patient/medications-reconcile.blade.php

@@ -28,7 +28,9 @@ $medications = $points;
         <tr>
             <th class="text-secondary bg-light border-bottom-0 w-25">Medication</th>
             <th class="text-secondary bg-light border-bottom-0 w-25">Pre-existing Plan</th>
-            <th class="text-secondary bg-light border-bottom-0 w-25">Current Subjective</th>
+            <th class="text-secondary bg-light border-bottom-0 w-25">Current Subjective
+                <a href="#" class="text-sm font-weight-normal ml-3 btn-copy-all">Copy all to new subj.</a>
+            </th>
             <th class="text-secondary bg-light border-bottom-0 w-25">New Subjective</th>
         </tr>
         </thead>
@@ -157,6 +159,15 @@ $medications = $points;
                     return false;
                 });
 
+            $('#medications-reconcile-{{$note->id}} .btn-copy-all')
+                .off('click')
+                .on('click', function() {
+                    $('#medications-reconcile-{{$note->id}} .copy-to-new-subjective').each(function() {
+                        $(this).trigger('click');
+                    });
+                    return false;
+                });
+
             $('#medications-reconcile-{{$note->id}} .btn-save-reviews')
                 .off('click')
                 .on('click', function() {
@@ -198,6 +209,7 @@ $medications = $points;
                                 closeStagPopup();
                                 $('.visit-segment[data-segment-template-name="intake_medications"]').find('.refresh-segment').trigger('click');
                                 $('.visit-segment[data-segment-template-name="plan_medications"]').find('.refresh-segment').trigger('click');
+                                $('.visit-segment[data-segment-template-name="omega_medications"]').find('.refresh-segment').trigger('click');
                             }
                         }
                     }).then(() => {

+ 4 - 1
resources/views/app/patient/module-specific-summary-renderers/behavior/plan.blade.php

@@ -1,6 +1,6 @@
 @if($points && count($points))
     <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px "
+        <a class="mr-2 min-width-110px hide-if-note-signed"
            open-in-stag-popup
            href="/behavior-center/{{$note->client->uid}}/{{$note->uid}}"
            mc-initer="behavior-center-{{$note->id}}"
@@ -8,6 +8,9 @@
            popup-style="overflow-visible">
             Behavior Rx
         </a>
+        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+            Behavior Rx
+        </span>
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>

+ 4 - 1
resources/views/app/patient/module-specific-summary-renderers/behavior/subjective.blade.php

@@ -1,6 +1,6 @@
 @if($points && count($points))
     <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px "
+        <a class="mr-2 min-width-110px hide-if-note-signed"
            open-in-stag-popup
            href="/behavior-center/{{$note->client->uid}}/{{$note->uid}}"
            mc-initer="behavior-center-{{$note->id}}"
@@ -8,6 +8,9 @@
            popup-style="overflow-visible">
             Behavior Rx
         </a>
+        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+            Behavior Rx
+        </span>
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>

+ 4 - 1
resources/views/app/patient/module-specific-summary-renderers/exercise/plan.blade.php

@@ -1,6 +1,6 @@
 @if($points && count($points))
     <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px "
+        <a class="mr-2 min-width-110px hide-if-note-signed"
            open-in-stag-popup
            href="/exercise-center/{{$note->client->uid}}/{{$note->uid}}"
            mc-initer="exercise-center-{{$note->id}}"
@@ -8,6 +8,9 @@
            popup-style="overflow-visible">
             Exercise Rx
         </a>
+        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+            Exercise Rx
+        </span>
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>

+ 4 - 1
resources/views/app/patient/module-specific-summary-renderers/exercise/subjective.blade.php

@@ -1,6 +1,6 @@
 @if($points && count($points))
     <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px "
+        <a class="mr-2 min-width-110px hide-if-note-signed"
            open-in-stag-popup
            href="/exercise-center/{{$note->client->uid}}/{{$note->uid}}"
            mc-initer="exercise-center-{{$note->id}}"
@@ -8,6 +8,9 @@
            popup-style="overflow-visible">
             Exercise Rx
         </a>
+        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+            Exercise Rx
+        </span>
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>

+ 4 - 1
resources/views/app/patient/module-specific-summary-renderers/nutrition/plan.blade.php

@@ -1,6 +1,6 @@
 @if($points && count($points))
     <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px "
+        <a class="mr-2 min-width-110px hide-if-note-signed"
            open-in-stag-popup
            href="/nutrition-center/{{$note->client->uid}}/{{$note->uid}}"
            mc-initer="nutrition-center-{{$note->id}}"
@@ -8,6 +8,9 @@
            popup-style="overflow-visible">
             Nutrition Rx
         </a>
+        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+            Nutrition Rx
+        </span>
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>

+ 4 - 1
resources/views/app/patient/module-specific-summary-renderers/nutrition/subjective.blade.php

@@ -1,6 +1,6 @@
 @if($points && count($points))
     <div class="d-flex border-bottom">
-        <a class="mr-2 min-width-110px "
+        <a class="mr-2 min-width-110px hide-if-note-signed"
            open-in-stag-popup
            href="/nutrition-center/{{$note->client->uid}}/{{$note->uid}}"
            mc-initer="nutrition-center-{{$note->id}}"
@@ -8,6 +8,9 @@
            popup-style="overflow-visible">
             Nutrition Rx
         </a>
+        <span class="mr-2 min-width-110px font-weight-bold show-if-note-signed">
+            Nutrition Rx
+        </span>
         <div class="flex-grow-1">
             <table class="table table-bordered table-xs table-cage mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>

+ 111 - 0
resources/views/app/patient/module-specific-summary-renderers/typical_day_lifestyle/subjective.blade.php

@@ -0,0 +1,111 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+use App\Models\Segment;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+?>
+
+@if($points && count($points))
+
+    <div class="d-flex border-bottom">
+        <span class="mr-2 min-width-110px font-weight-bold">
+            Typical Day / Lifestyle
+        </span>
+        <div class="flex-grow-1">
+
+            <?php
+
+            $point = $points[0];
+
+            if(!@$note) {
+                $note = $patient->coreNote;
+            }
+
+            $contentData = $parsed = false;
+
+            if ($point->lastChildReview && $point->lastChildReview->data) {
+                $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+                $contentData = $parsed = $point->lastChildReview->data;
+            }
+
+            if ($contentData) {
+                ?>
+                <div class="events-none form-read-mode">
+                    <p class="mb-2 font-weight-bold">Typical Day</p>
+
+                    @if(@$contentData["lines"] && count($contentData["lines"]))
+                        <table class="table table-sm table-bordered mb-3">
+                            <thead class="bg-light">
+                            <tr>
+                                <th class="border-bottom-0 text-secondary">Subjective</th>
+                                <th class="border-bottom-0 text-secondary w-50">Impression & Plan</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @foreach(@$contentData["lines"] as $line)
+                                <tr>
+                                    <td><pre class="m-0">{{$line['S']}}&nbsp;</pre></td>
+                                    <td>
+                                        <div class="d-flex align-items-baseline">
+                                            @if(@$line['I'])
+                                                <b class="mr-2">{{$line['I']}}</b>
+                                            @endif
+                                            <pre class="m-0">{{$line['P']}}&nbsp;</pre>
+                                        </div>
+                                    </td>
+                                </tr>
+                            @endforeach
+                            </tbody>
+                        </table>
+                    @endif
+
+                    <p class="mb-2 font-weight-bold">Daily Aggregates</p>
+
+                    <table class="table table-sm table-bordered mb-2">
+                        <thead class="bg-light">
+                        <tr>
+                            <th class="border-bottom-0 text-secondary width-200px">Subject</th>
+                            <th class="border-bottom-0 text-secondary">Current</th>
+                            <th class="border-bottom-0 text-secondary w-50">Target</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr>
+                            <td class="pl-1 align-middle bg-light">Est. Daily Calories</td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_calories"]["S"]}}</pre></td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_calories"]["P"]}}</pre></td>
+                        </tr>
+                        <tr>
+                            <td class="pl-1 align-middle bg-light">Est. Daily Protein Grams</td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_protein_grams"]["S"]}}</pre></td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_protein_grams"]["P"]}}</pre></td>
+                        </tr>
+                        <tr>
+                            <td class="pl-1 align-middle bg-light">Est. Daily Vegetable Servings</td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_vegetable_servings"]["S"]}}</pre></td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_vegetable_servings"]["P"]}}</pre></td>
+                        </tr>
+                        <tr>
+                            <td class="pl-1 align-middle bg-light">Est. Daily Hours Of Sleep</td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_hours_of_sleep"]["S"]}}</pre></td>
+                            <td><pre class="m-0">{{@$contentData["estimated_daily_hours_of_sleep"]["P"]}}</pre></td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+                <?php
+            } else {
+                echo '<div class="text-secondary">-</div>';
+            }
+
+            ?>
+
+        </div>
+    </div>
+
+@endif

+ 5 - 3
resources/views/app/patient/note/dashboard.blade.php

@@ -426,6 +426,7 @@ use App\Models\Handout;
             @endif
 
             {{-- additional modules --}}
+            @if(!$note->is_signed_by_hcp)
             <?php
             $availableModules = [
                 [
@@ -529,6 +530,7 @@ use App\Models\Handout;
                     @endforeach
                 </form>
             </div>
+            @endif
 
 
             @if($note->is_signed_by_hcp)
@@ -568,7 +570,7 @@ use App\Models\Handout;
                                                 <input type="hidden" name="uid" value="{{$note->uid}}">
                                                 <p>Undo HCP signature?</p>
                                                 <div class="mb-0">
-                                                    <button class="btn btn-success btn-sm" submit>Sign</button>
+                                                    <button class="btn btn-primary btn-sm" submit>Undo</button>
                                                     <button class="btn btn-default border btn-sm" cancel>Cancel</button>
                                                 </div>
                                             </form>
@@ -949,7 +951,7 @@ use App\Models\Handout;
                         <p class="font-weight-bold text-secondary m-0 font-size-14">Vitals Settings</p>
                     </div>
                     <div class="row" id="vitals-settings-{{$patient->uid}}">
-                        <div class="col-4 border-right">
+                        <div class="col-5 border-right">
                             <div class="d-flex align-items-baseline">
                                 <b>BMI/Weight Management</b>
                                 <span class="mx-2 text-secondary">|</span>
@@ -959,7 +961,7 @@ use App\Models\Handout;
                                 @include('app.patient.vitals-settings.bmi-management-summary')
                             </div>
                         </div>
-                        <div class="col-8">
+                        <div class="col-7">
                             <div class="d-flex align-items-baseline">
                                 <b>BP Management</b>
                                 <span class="mx-2 text-secondary">|</span>

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

@@ -203,6 +203,38 @@
                             $('.note-bottom-toolbar .supplements-center-trigger').trigger('click');
                             return false;
                         }
+                        else if(editParent.is('[data-segment-template-name="omega_history_past_medical"]')) {
+                            openDynamicStagPopup('/note-segment-view-by-name/{{$note->uid}}/past_medical_history/edit',
+                                'edit-univ_history_past_medical-container-{{$note->id}}',
+                                'Past Medical History',
+                                false,
+                                "overflow-visible");
+                            return false;
+                        }
+                        else if(editParent.is('[data-segment-template-name="omega_history_family"]')) {
+                            openDynamicStagPopup('/note-segment-view-by-name/{{$note->uid}}/history_family/edit',
+                                'edit-univ_history_family-container-{{$note->id}}',
+                                'Family History',
+                                false,
+                                "overflow-visible");
+                            return false;
+                        }
+                        else if(editParent.is('[data-segment-template-name="omega_history_social"]')) {
+                            openDynamicStagPopup('/note-segment-view-by-name/{{$note->uid}}/history_social/edit',
+                                'edit-univ_history_social-container-{{$note->id}}',
+                                'Social History',
+                                false,
+                                "overflow-visible");
+                            return false;
+                        }
+                        else if(editParent.is('[data-segment-template-name="omega_history_surgical"]')) {
+                            openDynamicStagPopup('/note-segment-view-by-name/{{$note->uid}}/history_surgical/edit',
+                                'edit-univ_history_surgical-container-{{$note->id}}',
+                                'Surgical History',
+                                false,
+                                "overflow-visible");
+                            return false;
+                        }
 
                         // TEMP: open in popup if LS segment
                         if(editParent.is('[data-segment-template-name^="lifestyle_"]')) {

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

@@ -3,6 +3,7 @@ $iName = $segment->segmentTemplate->internal_name;
 
 // if omega system segment - no only read mode
 $isOmegaSystemSegment = (strpos($iName, 'omega_') === 0 && substr($iName, -7) === '_system') && $iName !== 'omega_objective_system';
+$isOmegaHistorySegment = strpos($iName, 'omega_history_') === 0;
 ?>
 
 <div class="border-bottom note-section visit-segment {{$isOmegaSystemSegment || $note->is_signed_by_hcp ? '' : 'edit-trigger'}}"
@@ -33,7 +34,7 @@ $isOmegaSystemSegment = (strpos($iName, 'omega_') === 0 && substr($iName, -7) ==
                     @endif
                 </div>
 
-                <?php if($iName !== 'ros' && $iName !== 'omega_ros') { ?>
+                <?php if($iName !== 'ros' && $iName !== 'omega_ros' && !$isOmegaHistorySegment) { ?>
                 <div class="d-none if-edit edit-container">
                     {!! $segment->edit_html !!}
                 </div>

+ 10 - 1
resources/views/app/patient/nutrition-center.blade.php

@@ -166,7 +166,9 @@ $points = [
                         $(this).text('Back to Read Mode');
                         $('#nutrition-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
@@ -203,6 +205,13 @@ $points = [
                 });
                 <?php
             }
+            else {
+                if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                    ?>
+                    button.trigger('click');
+                    <?php
+                }
+            }
             ?>
 
         }

+ 13 - 1
resources/views/app/patient/problems-center.blade.php

@@ -200,6 +200,7 @@ if(!@$summaryView) {
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_problems');
                     if(!$segment) $segment = $note->getSegmentByInternalName('problems');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start">
@@ -240,6 +241,7 @@ if(!@$summaryView) {
                     <?php
                     $segment = $note->getSegmentByInternalName('plan_problems');
                     if(!$segment) $segment = $note->getSegmentByInternalName('problems');
+                    if(!$segment) $segment = $note->coreSegment;
                     ?>
                     <div if-read-mode>
                         <div class="d-flex align-items-start position-relative">
@@ -488,7 +490,9 @@ if(!@$summaryView) {
                         $(this).text('Back to Read Mode');
                         $('#problems-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
                     } else {
-                        refreshDynamicStagPopup();
+                        let url = $(this).closest('.stag-popup').attr('stag-popup-key');
+                        if(url.indexOf('forceReadMode') === -1) url += '&forceReadMode=1';
+                        refreshDynamicStagPopup(url);
                     }
                     return false;
                 });
@@ -504,6 +508,14 @@ if(!@$summaryView) {
                     '</span>' +
                     '</div>').appendTo(buttonContainer);
             }, 1000);
+
+            <?php
+            if(@$note && !$note->is_signed_by_hcp && !request()->input('forceReadMode')) { // auto-open edit mode
+                ?>
+                button.trigger('click');
+                <?php
+            }
+            ?>
         }
         addMCInitializer('problems-center-{{$note->id}}', init, '#problems-center-{{$note->id}}');
     }).call(window);

+ 0 - 4
resources/views/app/patient/segment-templates/_child_plan/edit-plan-in-place.php

@@ -33,10 +33,6 @@ else {
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
 
-            <?php if($segment->segmentTemplate->internal_name === 'plan_problems' && $previousValue): ?>
-            <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
-            <?php endif; ?>
-
             <?php if($previousValue): ?>
             <div class="mb-2">
                 <div class="d-flex align-items-baseline mb-1">

+ 0 - 4
resources/views/app/patient/segment-templates/_child_plan/edit-plan.php

@@ -35,10 +35,6 @@ else {
         <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
         <input type="hidden" name="data">
 
-        <?php if($segment->segmentTemplate->internal_name === 'plan_problems' && $previousValue): ?>
-        <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
-        <?php endif; ?>
-
         <p class="mb-2"><b>Plan</b></p>
 
         <?php if($previousValue): ?>

+ 0 - 5
resources/views/app/patient/segment-templates/_child_review/edit-review-in-place.php

@@ -37,10 +37,6 @@ else {
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
 
-            <?php if($segment->segmentTemplate->internal_name === 'intake_problems' && $previousValue): ?>
-                <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
-            <?php endif; ?>
-
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
@@ -52,7 +48,6 @@ else {
 
             <div class="mb-0">
                 <div note-rte slim-rte
-                     <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
                      class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>

+ 0 - 5
resources/views/app/patient/segment-templates/_child_review/edit-review.php

@@ -39,10 +39,6 @@ else {
         <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
         <input type="hidden" name="data">
 
-        <?php if($segment->segmentTemplate->internal_name === 'intake_problems' && $previousValue): ?>
-            <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
-        <?php endif; ?>
-
         <p class="mb-2"><b>Subjective</b></p>
 
         <?php if($previousValue): ?>
@@ -56,7 +52,6 @@ else {
 
         <div class="mb-2">
             <div note-rte
-                 <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
                  class="form-group mb-2 border-left border-right rte-holder"
                  data-field-name="value"><?= $currentValue ?></div>
         </div>

+ 17 - 53
resources/views/app/patient/segment-templates/omega_subjective_system/summary.blade.php

@@ -7,65 +7,28 @@ use App\Models\Point;
 
 $wizardLinks = [
     [
-        "name" => 'Allergies',
-        "href" => "/allergies-center/{$note->client->uid}/{$note->uid}",
-        "initer" => "allergies-center-{$note->id}"
+        "name" => 'Nutrition Rx',
+        "title" => '<img src=\'/img/nutrition-rx.png\'/> Nutrition Rx',
+        "href" => "/nutrition-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "nutrition-center-{$note->id}"
     ],
     [
-        "name" => 'Medications',
-        "href" => "/medications-center/{$note->client->uid}/{$note->uid}",
-        "initer" => "medications-center-{$note->id}"
+        "name" => 'Exercise Rx',
+        "title" => '<img src=\'/img/exercise-rx.png\'/> Exercise Rx',
+        "href" => "/exercise-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "exercise-center-{$note->id}"
     ],
     [
-        "name" => 'Problems',
-        "href" => "/problems-center/{$note->client->uid}/{$note->uid}",
-        "initer" => "problems-center-{$note->id}"
-    ],
-    [
-        "name" => 'Goals',
-        "href" => "/goals-center/{$note->client->uid}/{$note->uid}",
-        "initer" => "goals-center-{$note->id}"
-    ],
-    [
-        "name" => 'Care Team',
-        "href" => "/careteam-center/{$note->client->uid}/{$note->uid}",
-        "initer" => "careteam-center-{$note->id}"
-    ],
-    [
-        "name" => 'PMHx',
-        "title" => 'Past Medical History',
-        "href" => "/note-segment-view-by-name/{$note->uid}/past_medical_history/edit",
-        "initer" => "edit-univ_history_past_medical-container-{$note->id}"
-    ],
-    [
-        "name" => 'FHx',
-        "title" => 'Family History',
-        "href" => "/note-segment-view-by-name/{$note->uid}/history_family/edit",
-        "initer" => "edit-univ_history_family-container-{$note->id}"
-    ],
-    [
-        "name" => 'Soc Hx',
-        "title" => 'Social History',
-        "href" => "/note-segment-view-by-name/{$note->uid}/history_social/edit",
-        "initer" => "edit-univ_history_social-container-{$note->id}"
-    ],
-    [
-        "name" => 'Surg Hx',
-        "title" => 'Surgical History',
-        "href" => "/note-segment-view-by-name/{$note->uid}/history_surgical/edit",
-        "initer" => "edit-univ_history_surgical-container-{$note->id}"
-    ],
-    [
-        "name" => 'ROS',
-        "title" => 'Review Of Systems',
-        "href" => "/note-segment-view-by-name/{$note->uid}/omega_ros/edit",
-        "initer" => "init-ros-{$note->id}"
+        "name" => 'Behavior Rx',
+        "title" => '<img src=\'/img/behavior-rx.png\'/> Behavior Rx',
+        "href" => "/behavior-center/{$note->client->uid}/{$note->uid}",
+        "initer" => "behavior-center-{$note->id}"
     ],
 ];
 
 ?>
 
-<div class="mb-2">
+<div class="mb-2 hide-if-note-signed">
     @foreach($wizardLinks as $link)
         @if(@$link['name'])
             <a href="{{$link['href']}}"
@@ -80,7 +43,7 @@ $wizardLinks = [
 
 <div class="system_segment">
 <?php
-
+/*
 $inPoints = Point::getPointsOfCategory($patient, 'ALLERGY');
 if(count($inPoints)) {
 ?>
@@ -99,8 +62,6 @@ $inPoints = Point::getIntakePointsWithChildReview($patient, $note);
 
 // allergies/meds/problems/goals/careteam
 $topLevelPointToRendererMap = [
-    'ALLERGY' => 'allergy',
-    'MEDICATION' => 'medication',
     'PROBLEM' => 'problem',
     'GOAL' => 'goal',
     'CARE_TEAM_MEMBER' => 'care_team_member'
@@ -144,6 +105,9 @@ foreach ($pointMap as $renderer => $points) {
 @include('app.patient.module-specific-summary-renderers.' . $renderer . '.subjective', compact('points'))
 <?php
 }
+*/
+
+$inPoints = Point::getIntakePointsWithChildReview($patient, $note);
 
 $topLevelPointToRendererMap = [
     'HIGH_SUGAR_BEVERAGES' => 'nutrition',

+ 15 - 4
resources/views/app/patient/segment-templates/typical_day_lifestyle/edit.blade.php

@@ -155,6 +155,10 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
             return tr;
         }
 
+        function createRowAfter(_tr) {
+            return newRow().insertAfter(_tr);
+        }
+
         function newRow() {
             return $('<tr><td class="align-middle text-center bg-light"><a href="#" class="delete-line"><i class="fa fa-trash-alt on-hover-opaque text-danger"></i></a></td>' +
                 '<td><textarea rows="1" key="S"></textarea></td>' +
@@ -162,6 +166,11 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                 '<td><textarea rows="1" key="P"></textarea></td></tr>');
         }
 
+        function createAndMoveToNextRowInput(_td) {
+            let tr = createRowAfter(_td.closest('tr'));
+            tr.find('td:eq(' + _td.index() + ') textarea').first().focus();
+        }
+
         function moveToNextRowInput(_td, _forceCreate = false) {
             let tr = _forceCreate ? getOrCreateRowAfter(_td.closest('tr')) : getRowAfter(_td.closest('tr'));
             if(tr.length) {
@@ -221,13 +230,15 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         parentSegment
             .off('keydown', '.stag-sheet textarea')
             .on('keydown', '.stag-sheet textarea', function(_e) {
-                console.log(_e.which);
-                console.log(this.selectionStart, this.selectionEnd);
-                console.log(this.value.length);
                 switch (_e.which) {
                     case 13: // ENTER: If shift NOT pressed, move to next row same column
                         if (!_e.shiftKey) {
-                            moveToNextRowInput($(this).closest('td'), $(this).closest('.stag-sheet').is('.allow-row-addition'));
+                            if($(this).closest('.stag-sheet').is('.allow-row-addition')) {
+                                createAndMoveToNextRowInput($(this).closest('td'), );
+                            }
+                            else {
+                                moveToNextRowInput($(this).closest('td'), false);
+                            }
                             return false;
                         }
                         break;

+ 19 - 15
resources/views/app/patient/vitals-settings/bmi-management-summary.blade.php

@@ -9,54 +9,58 @@
 <div class="mb-1 d-flex align-items-baseline">
     <span class="text-secondary text-nowrap">Weight (usual):</span>
     <div class="ml-2">
-        Between <b><?= vsValue('usual_weight_in_pounds_min', $patient) ?></b>
-        and <b><?= vsValue('usual_weight_in_pounds_max', $patient) ?></b>
+      @if($patient->usual_weight_in_pounds_min)
+        Between <b>{{$patient->usual_weight_in_pounds_min}}</b>
+        and <b>{{$patient->usual_weight_in_pounds_max}}</b>
+      @else
+      <span>-</span>
+      @endif
     </div>
 </div>
 
 <div class="mb-3 d-flex align-items-baseline">
     <span class="text-secondary text-nowrap">BMI (usual):</span>
     <div class="ml-2">
-        Between <span class="text-nowrap"><b><?= vsValue('usual_bmi_min', $patient) ?></b> <span class="text-secondary text-sm"><?= vsValue('usual_bmi_min_category', $patient) ?></span></span>
-        and <span class="text-nowrap"><b><?= vsValue('usual_bmi_max', $patient) ?></b> <span class="text-secondary text-sm"><?= vsValue('usual_bmi_max_category', $patient) ?></span></span>
+      @if($patient->usual_bmi_min)
+        Between <span class="text-nowrap"><b>{{$patient->usual_bmi_min}}</b> {{$patient->usual_bmi_min_category}}</span>
+        and <span class="text-nowrap"><b>{{$patient->usual_bmi_max}}</b> {{$patient->usual_bmi_max_category}}</span>
+      @else
+      <span>-</span>
+      @endif
     </div>
 </div>
 
 <div class="mb-1 d-flex align-items-baseline">
     <span class="text-secondary text-nowrap">Weight (ideal):</span>
     <div class="ml-2">
-        <b><?= vsValue('ideal_weight_in_pounds', $patient) ?></b>
+        <b>{{$patient->ideal_weight_in_pounds ?? '-'}}</b>
     </div>
 </div>
 
 <div class="mb-3 d-flex align-items-baseline">
     <span class="text-secondary text-nowrap">BMI (ideal):</span>
     <div class="ml-2">
-        <b><?= vsValue('ideal_bmi', $patient) ?></b>
-        <span class="text-secondary text-sm"><?= vsValue('ideal_bmi_category', $patient) ?></span>
+        <b>{{$patient->ideal_bmi ?? '-'}}</b>
+        <span class="text-secondary text-sm">{{$patient->ideal_bmi_category}}</span>
     </div>
 </div>
 
 <div class="mb-3 d-flex align-items-baseline">
     <span class="text-secondary mr-2">Goal:</span>
-    <div class="flex-grow-1"><?= vsValue('weight_management_goal_category', $patient) ?></div>
+    <div class="flex-grow-1">{{$patient->weight_management_goal_category ?? '-'}}</div>
 </div>
 
 <div class="mb-3 d-flex align-items-baseline">
     <span class="text-secondary mr-2">CHF?</span>
-    <div class="flex-grow-1"><?= vsValue('has_heart_failure_dx', $patient) ?></div>
+    <div class="flex-grow-1">{{$patient->has_heart_failure_dx ?? '-'}}</div>
 </div>
 
 <div class="mb-3 d-flex align-items-baseline">
     <span class="text-secondary mr-2">Weight monitoring prescribed?</span>
-    <div class="flex-grow-1">
-        <?= vsValue('is_weight_monitoring_needed', $patient) ?>
-    </div>
+    <div class="flex-grow-1">{{$patient->is_weight_monitoring_needed ?? '-'}}</div>
 </div>
 
 <div class="mb-3 d-flex align-items-baseline">
     <span class="text-secondary mr-2">Remarks:</span>
-    <div class="flex-grow-1">
-        <?= vsValue('why_is_weight_monitoring_needed', $patient) ?>
-    </div>
+    <div class="flex-grow-1">{{$patient->why_is_weight_monitoring_needed ?? '-'}}</div>
 </div>

+ 5 - 5
resources/views/app/patient/vitals-settings/bp-management-form.blade.php

@@ -5,7 +5,7 @@
         <p class="text-secondary font-weight-bold font-size-14">BP Management</p>
 
         <div id="bpManagementComponent" class="row mx-0" v-cloak>
-            <div class="col-7 border-right">
+            <div class="col-6 border-right">
                 <div class="text-secondary font-weight-bold mb-3">Blood Pressure & Pulse:</div>
                 <div class="pl-3">
                     <h6 class="text-secondary mb-3"><b>Usual:</b></h6>
@@ -64,8 +64,8 @@
 
                             </div>
 
-                            <div>
-                                <div class="form-check mb-2">
+                            <div class="d-flex align-items-start">
+                                <div class="form-check mr-2">
                                     <input type="checkbox" class="form-check-input" id="amPmVariation" name="doesUsualBpHaveAmPmVariation" v-model="form.doesUsualBpHaveAmPmVariation">
                                     <label class="form-check-label" for="amPmVariation">AM/PM Variation</label>
                                 </div>
@@ -142,7 +142,7 @@
                     </div>
                 </div>
             </div>
-            <div class="col-5">
+            <div class="col-6">
                 <div class="mb-2 d-flex align-items-start">
                     <span class="text-secondary min-width-140px w-50">Reports prehypertension?</span>
                     <div class="w-50">
@@ -308,4 +308,4 @@
         addMCInitializer('bp-management-settings', init, '#bp-management-settings');
 
     }).call(window);
-</script>
+</script>

+ 129 - 77
resources/views/app/patient/vitals-settings/bp-management-summary.blade.php

@@ -1,171 +1,223 @@
 
-<div class="row">
-    <div class="col-6 border-right">
+<div class="flex-container">
+    <div>
         <h6 class="text-secondary font-weight-bold mb-3">Usual:</h6>
         <div class="d-flex mb-3">
             <div class="pl-3">
                 @if($patient->does_usual_bp_have_am_pm_variation)
                     <div class="text-secondary font-weight-bold mb-2"><i class="fa fa-sun"></i> AM</div>
                 @endif
-                <div class="d-flex align-items-center">
+                <div class="d-flex align-items-center mb-2">
                     @if($patient->does_usual_bp_have_range)
                         <h6 class="mb-0 mr-2">LOWEST:</h6>
                     @endif
                     <h6 class="mb-0 mr-2">BP:</h6>
-                    <span><b><?= vsValue('usual_am_resting_sbp_min', $patient) ?></b></span>
+                    <span><b>{{$patient->usual_am_resting_sbp_min ?? '-'}}</b></span>
+                    @if($patient->usual_am_resting_dbp_min)
                     <span>/</span>
-                    <span class="mr-2"><b><?= vsValue('usual_am_resting_dbp_min', $patient) ?></b></span>
-                    <span class="mr-2">mm Hg Pulse:</span>
-                    <span><b><?= vsValue('usual_am_resting_pulse_min', $patient) ?></b></span>
+                    <span class="mr-2"><b>{{$patient->usual_am_resting_dbp_min}}</b></span>
+                    @endif
+                    @if($patient->usual_am_resting_pulse_min)
+                    <span class="mr-2">Pulse:</span>
+                    <span><b>{{$patient->usual_am_resting_pulse_min}}</b></span>
                     <span class="ml-2">BPM</span>
+                    @endif
                 </div>
                 @if($patient->does_usual_bp_have_range)
-                    <div class="d-flex align-items-center">
+                    <div class="d-flex align-items-center mb-2">
                         <h6 class="mb-0 mr-2">HIGHEST:</h6>
                         <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('usual_am_resting_sbp_max', $patient) ?></b></span>
+                        <span><b>{{$patient->usual_am_resting_sbp_max ?? '-'}}</b></span>
+                        @if($patient->usual_am_resting_dbp_max)
                         <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('usual_am_resting_dbp_max', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('usual_am_resting_pulse_max', $patient) ?></b></span>
+                        <span class="mr-2"><b>{{$patient->usual_am_resting_dbp_max}}</b></span>
+                        @endif
+                        @if($patient->usual_am_resting_pulse_max)
+                        <span class="mr-2">Pulse:</span>
+                        <span><b>{{$patient->usual_am_resting_pulse_max}}</b></span>
                         <span class="ml-2">BPM</span>
+                        @endif
                     </div>
                 @endif
                 @if($patient->does_usual_bp_have_am_pm_variation)
                     <div class="text-secondary font-weight-bold my-2"><i class="fa fa-moon"></i> PM</div>
-                    <div class="d-flex align-items-center">
+                    <div class="d-flex align-items-center mb-2">
                         @if($patient->does_usual_bp_have_range)
                             <h6 class="mb-0 mr-2">LOWEST:</h6>
                         @endif
                         <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('usual_pm_resting_sbp_min', $patient) ?></b></span>
+                        <span><b>{{$patient->usual_pm_resting_sbp_min ?? '-'}}</b></span>
+                        @if($patient->usual_pm_resting_dbp_min)
                         <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('usual_pm_resting_dbp_min', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('usual_pm_resting_pulse_min', $patient) ?></b></span>
+                        <span class="mr-2"><b>{{$patient->usual_pm_resting_dbp_min}}</b></span>
+                        @endif
+                        @if($patient->usual_pm_resting_pulse_min)
+                        <span class="mr-2">Pulse:</span>
+                        <span><b>{{$patient->usual_pm_resting_pulse_min}}</b></span>
                         <span class="ml-2">BPM</span>
+                        @endif
                     </div>
                 @endif
                 @if($patient->does_usual_bp_have_range)
-                    <div class="d-flex align-items-center">
+                    <div class="d-flex align-items-center mb-2">
                         @if($patient->does_usual_bp_have_range)
                             <h6 class="mb-0 mr-2">HIGHEST:</h6>
                         @endif
                         <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('usual_pm_resting_sbp_max', $patient) ?></b></span>
+                        <span><b>{{$patient->usual_pm_resting_sbp_max ?? '-'}}</b></span>
+                        @if($patient->usual_pm_resting_dbp_max)
                         <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('usual_pm_resting_dbp_max', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('usual_pm_resting_pulse_max', $patient) ?></b></span>
+                        <span class="mr-2"><b>{{$patient->usual_pm_resting_dbp_max}}</b></span>
+                        @endif
+                        @if($patient->usual_pm_resting_pulse_max)
+                        <span class="mr-2">Pulse:</span>
+                        <span><b>{{$patient->usual_pm_resting_pulse_max}}</b></span>
                         <span class="ml-2">BPM</span>
+                        @endif
                     </div>
                 @endif
             </div>
         </div>
+        @if($patient->ideal_am_resting_sbp_min)
         <div class="mb-3">
             <h6 class="text-secondary font-weight-bold">Ideal BP</h6>
             <div class="pl-3">
                 <div class="d-flex align-items-center">
                     <h6 class="mb-0 mr-2">Target:</h6>
                     <h6 class="mb-0 mr-2">BP:</h6>
-                    <span><b><?= vsValue('ideal_am_resting_sbp_min', $patient) ?></b></span>
+                    <span><b>{{$patient->ideal_am_resting_sbp_min ?? '-'}}</b></span>
+                    @if($patient->ideal_am_resting_dbp_min)
                     <span>/</span>
-                    <span class="mr-2"><b><?= vsValue('ideal_am_resting_dbp_min', $patient) ?></b></span>
-                    <span class="mr-2">mm Hg Pulse:</span>
-                    <span><b><?= vsValue('ideal_am_resting_pulse', $patient) ?></b></span>
+                    <span class="mr-2"><b>{{$patient->ideal_am_resting_dbp_min}}</b></span>
+                    @endif
+                    @if($patient->ideal_am_resting_pulse)
+                    <span class="mr-2">Pulse:</span>
+                    <span><b>{{$patient->ideal_am_resting_pulse}}</b></span>
                     <span class="ml-2">BPM</span>
+                    @endif
                 </div>
             </div>
         </div>
+        @endif
 
         <div class="mb-3">
             <h6 class="text-secondary font-weight-bold mb-3">Alerts</h6>
             <div class="pl-3">
-                <div class="mb-3">
-                    <div class="mb-2"><i class="fa fa-circle text-danger"></i> Red</div>
-                    <div class="d-flex align-items-center">
-                        <h6 class="mb-0 mr-2">Above:</h6>
-                        <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('red_alert_when_sbp_above', $patient) ?></b></span>
-                        <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('red_alert_when_dbp_above', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('red_alert_when_pulse_above', $patient) ?></b></span>
-                        <span class="ml-2">BPM</span>
-                    </div>
-                    <div class="d-flex align-items-center">
-                        <h6 class="mb-0 mr-2">Below:</h6>
-                        <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('red_alert_when_sbp_below', $patient) ?></b></span>
-                        <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('red_alert_when_dbp_below', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('red_alert_when_pulse_below', $patient) ?></b></span>
-                        <span class="ml-2">BPM</span>
+                <div class="d-flex align-items-start mb-3">
+                  <?php
+                    $redAlertHasContent = $patient->red_alert_when_sbp_above || $patient->red_alert_when_sbp_below;
+                   ?>
+                    <div class="mr-2"><i class="fa fa-circle text-danger"></i> @if(!$redAlertHasContent)<span class="ml-2">-</span> @endif</div>
+                    <div>
+                      @if($redAlertHasContent)
+                      <div class="d-flex align-items-center">
+                          <h6 class="mb-0 mr-2">Above:</h6>
+                          <h6 class="mb-0 mr-2">BP:</h6>
+                          <span><b>{{$patient->red_alert_when_sbp_above ?? '-'}}</b></span>
+                          @if($patient->red_alert_when_dbp_above)
+                          <span>/</span>
+                          <span class="mr-2"><b>{{$patient->red_alert_when_dbp_above}}</b></span>
+                          @endif
+                          @if($patient->red_alert_when_pulse_above)
+                          <span class="mr-2">Pulse:</span>
+                          <span><b>{{$patient->red_alert_when_pulse_above}}</b></span>
+                          <span class="ml-2">BPM</span>
+                          @endif
+                      </div>
+                      <div class="d-flex align-items-center">
+                          <h6 class="mb-0 mr-2">Below:</h6>
+                          <h6 class="mb-0 mr-2">BP:</h6>
+                          <span><b>{{$patient->red_alert_when_sbp_below ?? '-'}}</b></span>
+                          @if($patient->red_alert_when_dbp_below)
+                          <span>/</span>
+                          <span class="mr-2"><b>{{$patient->red_alert_when_dbp_below}}</b></span>
+                          @endif
+                          @if($patient->red_alert_when_pulse_below)
+                          <span class="mr-2">Pulse:</span>
+                          <span><b>{{$patient->red_alert_when_pulse_below}}</b></span>
+                          <span class="ml-2">BPM</span>
+                          @endif
+                      </div>
+                      @endif
                     </div>
                 </div>
-                <div class="mb-3">
-                    <div class="mb-2"><i class="fa fa-circle text-warning-mellow"></i> Yellow</div>
-                    <div class="d-flex align-items-center">
-                        <h6 class="mb-0 mr-2">Above:</h6>
-                        <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('yellow_alert_when_sbp_above', $patient) ?></b></span>
-                        <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('yellow_alert_when_dbp_above', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('yellow_alert_when_pulse_above', $patient) ?></b></span>
-                        <span class="ml-2">BPM</span>
-                    </div>
-                    <div class="d-flex align-items-center">
-                        <h6 class="mb-0 mr-2">Below:</h6>
-                        <h6 class="mb-0 mr-2">BP:</h6>
-                        <span><b><?= vsValue('yellow_alert_when_sbp_below', $patient) ?></b></span>
-                        <span>/</span>
-                        <span class="mr-2"><b><?= vsValue('yellow_alert_when_dbp_below', $patient) ?></b></span>
-                        <span class="mr-2">mm Hg Pulse:</span>
-                        <span><b><?= vsValue('yellow_alert_when_pulse_below', $patient) ?></b></span>
-                        <span class="ml-2">BPM</span>
+                <div class="d-flex align-items-start mb-3">
+                    <?php
+                      $yellowAlertHasContent = $patient->yellow_alert_when_sbp_above || $patient->yellow_alert_when_sbp_below;
+                     ?>
+                    <div class="mr-2"><i class="fa fa-circle text-warning-mellow"></i> @if(!$yellowAlertHasContent)<span class="ml-2">-</span> @endif</div>
+                    <div>
+                      @if($yellowAlertHasContent)
+                      <div class="d-flex align-items-center">
+                          <h6 class="mb-0 mr-2">Above:</h6>
+                          <h6 class="mb-0 mr-2">BP:</h6>
+                          <span><b>{{$patient->yellow_alert_when_sbp_above ?? '-'}}</b></span>
+                          @if($patient->yellow_alert_when_dbp_above)
+                          <span>/</span>
+                          <span class="mr-2"><b>{{$patient->yellow_alert_when_dbp_above}}</b></span>
+                          @endif
+                          @if($patient->yellow_alert_when_pulse_above)
+                          <span class="mr-2">Pulse:</span>
+                          <span><b>{{$patient->yellow_alert_when_pulse_above}}</b></span>
+                          <span class="ml-2">BPM</span>
+                          @endif
+                      </div>
+                      <div class="d-flex align-items-center">
+                          <h6 class="mb-0 mr-2">Below:</h6>
+                          <h6 class="mb-0 mr-2">BP:</h6>
+                          <span><b>{{$patient->yellow_alert_when_sbp_below ?? '-'}}</b></span>
+                          @if($patient->yellow_alert_when_dbp_below)
+                          <span>/</span>
+                          <span class="mr-2"><b>{{$patient->yellow_alert_when_dbp_below}}</b></span>
+                          @endif
+                          @if($patient->yellow_alert_when_pulse_below)
+                          <span class="mr-2">Pulse:</span>
+                          <span><b>{{$patient->yellow_alert_when_pulse_below}}</b></span>
+                          <span class="ml-2">BPM</span>
+                          @endif
+                      </div>
+                      @endif
                     </div>
                 </div>
             </div>
         </div>
 
     </div>
-    <div class="col-6">
+    <div class="">
         <div class="table-responsive">
             <table class="table table-sm table-striped table-bordered">
                 <tbody>
                     <tr>
                         <td>Reports prehypertension?</td>
-                        <td><?= vsValue('has_prehypertension_dx', $patient) ?></td>
+                        <td>{{$patient->has_prehypertension_dx ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>Reports hypertension?</td>
-                        <td><?= vsValue('has_hypertension_dx', $patient) ?></td>
+                        <td>{{$patient->has_hypertension_dx ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>Reports hypertension medicine?</td>
-                        <td><?= vsValue('is_prescribed_hypertension_medicine', $patient) ?></td>
+                        <td>{{$patient->is_prescribed_hypertension_medicine ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>Is it a goal to reduce<br>hypertension medicine?</td>
-                        <td><?= vsValue('is_goal_to_reduce_hypertension_medicine', $patient) ?></td>
+                        <td>{{$patient->is_goal_to_reduce_hypertension_medicine ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>Describe the goal</td>
-                        <td><?= vsValue('goal_to_reduce_hypertension_medicine_memo', $patient) ?></td>
+                        <td>{{$patient->goal_to_reduce_hypertension_medicine_memo ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>BP monitoring prescribed?</td>
-                        <td><?= vsValue('is_bp_monitoring_needed', $patient) ?></td>
+                        <td>{{$patient->is_bp_monitoring_needed ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>BP monitoring prescribed?</td>
-                        <td><?= vsValue('is_bp_monitoring_needed', $patient) ?></td>
+                        <td>{{$patient->is_bp_monitoring_needed ?? '-'}}</td>
                     </tr>
                     <tr>
                         <td>Remarks</td>
-                        <td><?= vsValue('why_is_bp_monitoring_needed', $patient) ?></td>
+                        <td>{{$patient->why_is_bp_monitoring_needed ?? '-'}}</td>
                     </tr>
                 </tbody>
             </table>