Browse Source

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

= 3 years ago
parent
commit
287cdcc033
100 changed files with 2349 additions and 3274 deletions
  1. 1 1
      app/Http/Controllers/AdminController.php
  2. 3 3
      app/Http/Controllers/FDBPGController.php
  3. 18 3
      app/Models/Pro.php
  4. 1 1
      config/app.php
  5. 84 2
      public/css/style.css
  6. 3 0
      public/js/mc.js
  7. 1 0
      resources/views/app/dashboard-mcp.blade.php
  8. 26 26
      resources/views/app/intake-templates/default.blade.php
  9. 53 1
      resources/views/app/mcp/bills_pending_signature.blade.php
  10. 62 2
      resources/views/app/patient/allergies-center.blade.php
  11. 213 32
      resources/views/app/patient/behavior-center.blade.php
  12. 1 1
      resources/views/app/patient/canvas-sections/fhx/form.blade.php
  13. 1 1
      resources/views/app/patient/canvas-sections/fhx/summary.php
  14. 2 2
      resources/views/app/patient/canvas-sections/pmhx/summary.php
  15. 2 2
      resources/views/app/patient/canvas-sections/pshx/summary.php
  16. 2 2
      resources/views/app/patient/canvas-sections/sochx/summary.php
  17. 42 37
      resources/views/app/patient/care-month/dashboard.blade.php
  18. 220 31
      resources/views/app/patient/exercise-center.blade.php
  19. 67 3
      resources/views/app/patient/medications-center.blade.php
  20. 185 0
      resources/views/app/patient/note/_OLD_segment.blade.php
  21. 45 0
      resources/views/app/patient/note/_PREVIOUS_note-segment-list.blade.php
  22. 3 3
      resources/views/app/patient/note/dashboard-univ.blade.php
  23. 112 112
      resources/views/app/patient/note/dashboard.blade.php
  24. 1 1
      resources/views/app/patient/note/lhs-tree.blade.php
  25. 11 20
      resources/views/app/patient/note/note-segment-list.blade.php
  26. 1 1
      resources/views/app/patient/note/pdf.blade.php
  27. 8 8
      resources/views/app/patient/note/rhs-sidebar.blade.php
  28. 10 19
      resources/views/app/patient/note/segment.blade.php
  29. 2 2
      resources/views/app/patient/note/segment_script.blade.php
  30. 2 2
      resources/views/app/patient/note/sign-confirmation.blade.php
  31. 109 35
      resources/views/app/patient/nutrition-center.blade.php
  32. 68 2
      resources/views/app/patient/problems-center.blade.php
  33. 6 106
      resources/views/app/patient/segment-templates/_child_plan/behavior/CRAVINGS/edit-plan.php
  34. 6 105
      resources/views/app/patient/segment-templates/_child_plan/behavior/FOOD_TRIGGERS/edit-plan.php
  35. 62 169
      resources/views/app/patient/segment-templates/_child_plan/behavior/SELF_MONITORING/edit-plan.php
  36. 11 105
      resources/views/app/patient/segment-templates/_child_plan/behavior/SLEEP_HABITS/edit-plan.php
  37. 15 0
      resources/views/app/patient/segment-templates/_child_plan/delete-plan.php
  38. 1 1
      resources/views/app/patient/segment-templates/_child_plan/edit-plan.php
  39. 181 311
      resources/views/app/patient/segment-templates/_child_plan/exercise/AEROBIC_ACTIVITY/edit-plan.php
  40. 1 1
      resources/views/app/patient/segment-templates/_child_plan/exercise/AEROBIC_ACTIVITY/last-plan.php
  41. 32 130
      resources/views/app/patient/segment-templates/_child_plan/exercise/NEAT/edit-plan.php
  42. 1 1
      resources/views/app/patient/segment-templates/_child_plan/exercise/NEAT/last-plan.php
  43. 35 134
      resources/views/app/patient/segment-templates/_child_plan/exercise/STRENGTH_TRAINING/edit-plan.php
  44. 1 1
      resources/views/app/patient/segment-templates/_child_plan/exercise/STRENGTH_TRAINING/last-plan.php
  45. 1 1
      resources/views/app/patient/segment-templates/_child_plan/last-plan.php
  46. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CALORIES/edit-plan.php
  47. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CALORIES/last-plan.php
  48. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CARBOHYDRATES/edit-plan.php
  49. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CARBOHYDRATES/last-plan.php
  50. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/FAST_FOOD/edit-plan.php
  51. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/FAST_FOOD/last-plan.php
  52. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/HIGH_SUGAR_BEVERAGES/edit-plan.php
  53. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/HIGH_SUGAR_BEVERAGES/last-plan.php
  54. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/PORTION_SIZES/edit-plan.php
  55. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/PORTION_SIZES/last-plan.php
  56. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/SNACKS/edit-plan.php
  57. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/SNACKS/last-plan.php
  58. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/VEGETABLES/edit-plan.php
  59. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/VEGETABLES/last-plan.php
  60. 8 41
      resources/views/app/patient/segment-templates/_child_plan/nutrition/WATER_INTAKE/edit-plan.php
  61. 1 1
      resources/views/app/patient/segment-templates/_child_plan/nutrition/WATER_INTAKE/last-plan.php
  62. 42 142
      resources/views/app/patient/segment-templates/_child_review/behavior/CRAVINGS/edit-review.php
  63. 1 1
      resources/views/app/patient/segment-templates/_child_review/behavior/CRAVINGS/last-review.php
  64. 46 145
      resources/views/app/patient/segment-templates/_child_review/behavior/FOOD_TRIGGERS/edit-review.php
  65. 1 1
      resources/views/app/patient/segment-templates/_child_review/behavior/FOOD_TRIGGERS/last-review.php
  66. 62 169
      resources/views/app/patient/segment-templates/_child_review/behavior/SELF_MONITORING/edit-review.php
  67. 1 1
      resources/views/app/patient/segment-templates/_child_review/behavior/SELF_MONITORING/last-review.php
  68. 11 106
      resources/views/app/patient/segment-templates/_child_review/behavior/SLEEP_HABITS/edit-review.php
  69. 1 1
      resources/views/app/patient/segment-templates/_child_review/behavior/SLEEP_HABITS/last-review.php
  70. 15 0
      resources/views/app/patient/segment-templates/_child_review/delete-review.php
  71. 1 1
      resources/views/app/patient/segment-templates/_child_review/edit-review.php
  72. 181 311
      resources/views/app/patient/segment-templates/_child_review/exercise/AEROBIC_ACTIVITY/edit-review.php
  73. 1 1
      resources/views/app/patient/segment-templates/_child_review/exercise/AEROBIC_ACTIVITY/last-review.php
  74. 32 130
      resources/views/app/patient/segment-templates/_child_review/exercise/NEAT/edit-review.php
  75. 1 1
      resources/views/app/patient/segment-templates/_child_review/exercise/NEAT/last-review.php
  76. 35 134
      resources/views/app/patient/segment-templates/_child_review/exercise/STRENGTH_TRAINING/edit-review.php
  77. 1 1
      resources/views/app/patient/segment-templates/_child_review/exercise/STRENGTH_TRAINING/last-review.php
  78. 1 1
      resources/views/app/patient/segment-templates/_child_review/last-review.php
  79. 9 42
      resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CALORIES/edit-review.php
  80. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CALORIES/last-review.php
  81. 9 42
      resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CARBOHYDRATES/edit-review.php
  82. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CARBOHYDRATES/last-review.php
  83. 8 48
      resources/views/app/patient/segment-templates/_child_review/nutrition/FAST_FOOD/edit-review.php
  84. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/FAST_FOOD/last-review.php
  85. 9 42
      resources/views/app/patient/segment-templates/_child_review/nutrition/HIGH_SUGAR_BEVERAGES/edit-review.php
  86. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/HIGH_SUGAR_BEVERAGES/last-review.php
  87. 9 42
      resources/views/app/patient/segment-templates/_child_review/nutrition/PORTION_SIZES/edit-review.php
  88. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/PORTION_SIZES/last-review.php
  89. 8 48
      resources/views/app/patient/segment-templates/_child_review/nutrition/SNACKS/edit-review.php
  90. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/SNACKS/last-review.php
  91. 9 42
      resources/views/app/patient/segment-templates/_child_review/nutrition/VEGETABLES/edit-review.php
  92. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/VEGETABLES/last-review.php
  93. 9 42
      resources/views/app/patient/segment-templates/_child_review/nutrition/WATER_INTAKE/edit-review.php
  94. 1 1
      resources/views/app/patient/segment-templates/_child_review/nutrition/WATER_INTAKE/last-review.php
  95. 1 1
      resources/views/app/patient/segment-templates/_simple_text_segment/edit.php
  96. 30 2
      resources/views/app/patient/segment-templates/history_family/edit.blade.php
  97. 5 3
      resources/views/app/patient/segment-templates/history_family/summary.blade.php
  98. 2 1
      resources/views/app/patient/segment-templates/history_screenings/edit.blade.php
  99. 14 8
      resources/views/app/patient/segment-templates/history_screenings/summary.blade.php
  100. 2 1
      resources/views/app/patient/segment-templates/history_social/edit.blade.php

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

@@ -38,7 +38,7 @@ class AdminController extends Controller
     public function patients(Request $request)
     {
         $filters = $request->all();
-        $patients = Client::whereNull('shadow_pro_id')->where('mcp_pro_id', $this->performer->pro->id);
+        $patients = Client::whereNull('shadow_pro_id');
 
         // filters
         /*

+ 3 - 3
app/Http/Controllers/FDBPGController.php

@@ -95,7 +95,7 @@ FROM rmiid1_med r_med
 WHERE r_med.med_status_cd = '0'
   AND r_med.med_medid_desc ILIKE :term
 ORDER BY r_route.med_routed_med_id_desc, r_med.med_medid_desc",
-            ['term' => '%' . $term . '%']
+            ['term' => $term . '%']
         );
         return json_encode([
             "success" => true,
@@ -254,7 +254,7 @@ FROM rdamca0_concept r1
 WHERE (r1.dam_concept_id_desc ILIKE :term)
 ORDER BY r1.dam_concept_id_desc
 ",
-            ['term' => '%' . $term . '%']
+            ['term' => $term . '%']
         );
         return view('app.fdb-pg.fdb-allergy-suggest', compact('matches'));
     }
@@ -271,7 +271,7 @@ FROM rdamca0_concept r1 join rdamcd0_picklist_con_typ_desc r2 on r1.dam_concept_
 WHERE (r1.dam_concept_id_desc ILIKE :term)
 ORDER BY r1.dam_concept_id_desc
 ",
-            ['term' => '%' . $term . '%']
+            ['term' => $term . '%']
         );
         return json_encode([
             "success" => true,

+ 18 - 3
app/Models/Pro.php

@@ -334,6 +334,21 @@ class Pro extends Model
             ->get();
     }
 
+    public function favoritesByCategoryDecoded($_category) {
+        $favorites = ProFavorite::where('pro_id', $this->id)
+            ->where('is_removed', false)
+            ->where('category', $_category)
+            ->orderBy('category', 'asc')
+            ->orderBy('position_index', 'asc')
+            ->get();
+        foreach ($favorites as $favorite) {
+            if ($favorite->data) {
+                $favorite->data = json_decode($favorite->data);
+            }
+        }
+        return $favorites;
+    }
+
     function get_patients_count_as_mcp() {
         $query = Client::whereNull('shadow_pro_id');
         return $query->where('mcp_pro_id', $this->id)->count();
@@ -520,21 +535,21 @@ WHERE mcp_pro_id = :pro_id
     public function getAppointmentsPendingStatusChangeAck() {
         return Appointment::where('pro_id', $this->id)
             ->where('is_status_acknowledgement_from_appointment_pro_pending', true)
-            ->where('raw_date', '>=', DB::raw('NOW()'))
+            //->where('raw_date', '>=', DB::raw('NOW()'))
             ->orderBy('raw_date', 'asc')
             ->get();
     }
     public function getAppointmentsPendingDecisionAck() {
         return Appointment::where('pro_id', $this->id)
             ->where('is_decision_acknowledgement_from_appointment_pro_pending', true)
-            ->where('raw_date', '>=', DB::raw('NOW()'))
+            //->where('raw_date', '>=', DB::raw('NOW()'))
             ->orderBy('raw_date', 'asc')
             ->get();
     }
     public function getAppointmentsPendingTimeChangeAck() {
         return Appointment::where('pro_id', $this->id)
             ->where('is_time_change_acknowledgement_from_appointment_pro_pending', true)
-            ->where('raw_date', '>=', DB::raw('NOW()'))
+            //->where('raw_date', '>=', DB::raw('NOW()'))
             ->orderBy('raw_date', 'asc')
             ->get();
     }

+ 1 - 1
config/app.php

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

+ 84 - 2
public/css/style.css

@@ -881,7 +881,7 @@ a.ui-button:active,
     color: #a91e1e !important;
 }
 .rspace {
-    width: 20px;
+    width: 16px;
     display: inline-flex;
     text-align: center;
     justify-content: center;
@@ -2079,6 +2079,12 @@ body.in-iframe .main-row > .sidebar {
     top: 0;
     height: 100%;
 }
+.hide-outside-popup {
+    display: none !important;
+}
+.stag-popup .hide-outside-popup {
+    display: block !important;
+}
 .stag-popup .hide-inside-popup {
     display: none !important;
 }
@@ -2470,4 +2476,80 @@ td.row-selection-highlight:after {
 }
 .icon-nutrition-rx-row-sm {
     max-height: 14px;
-}
+}
+
+.table td.fit, 
+.table th.fit {
+    white-space: nowrap;
+    width: 1%;
+}
+
+table.table-cage {
+    border: 0px;
+    color: #2b4259;
+}
+
+table.table-cage tr:first-child td {
+	border-top: 0px;
+}
+
+table.table-cage tr:last-child td {
+	border-bottom: 0px;
+}
+
+table.table-cage tr td:first-child {
+	border-left: 0px;
+}
+
+table.table-cage tr td:last-child {
+	border-right: 0px;
+}
+table.table-xs tr td {
+	padding: 0.15rem;
+}
+
+[if-edit-mode], [if-read-mode] {
+    display: none;
+}
+.edit [if-edit-mode] {
+    display: block;
+}
+.read [if-read-mode] {
+    display: block;
+}
+.rspace input[type="radio"]:checked {
+    position: relative;
+}
+.rspace input[type="radio"]:checked:before,
+.rspace input[type="radio"]:checked:after {
+    content: '';
+    position: absolute;
+    border-radius: 100%;
+    background:#fff;
+}
+
+/* colored radios */
+.rspace input[type="radio"]:checked:before {
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+}
+.rspace input[type="radio"]:checked:after {
+    top: 3px;
+    left: 3px;
+    width: calc(100% - 6px);
+    height: calc(100% - 6px);
+}
+.rspace input[type="radio"][value="-"]:checked:before {
+    border: 1px solid #e7848f;
+}
+.rspace input[type="radio"][value="+"]:checked:before {
+    border: 1px solid #2d9f2d91;
+}
+.rspace input[type="radio"][value="-"]:checked:after {
+    background-color: #e7848f;
+}
+.rspace input[type="radio"][value="+"]:checked:after {
+    background-color: #2d9f2d91;
+}

+ 3 - 0
public/js/mc.js

@@ -455,6 +455,9 @@ function initPatientPresenceIndicator() {
 // find a better place to put this
 window.fillJsonDataField = function(form, field = "data") {
     // add [data-name] values to payload
+    if(form.is('[data-field-name]')) {
+        field = form.attr('data-field-name');
+    }
     let dataField = form.find('[name="' + field + '"]').first();
     let parsed = null;
     if(dataField.val()) {

+ 1 - 0
resources/views/app/dashboard-mcp.blade.php

@@ -81,6 +81,7 @@
                                         <a href="{{ route('mcp.bills_pending_signature') }}"
                                            native target="_blank"
                                            open-in-stag-popup
+                                           update-parent
                                            popup-style="tall"
                                            title="Bills Pending Signature">
                                             Bills Pending Signature

+ 26 - 26
resources/views/app/intake-templates/default.blade.php

@@ -30,11 +30,11 @@ $theirName = implode(" ", $theirName);
             <ul >
                 <li>
                     <label>Height</label>
-                    <input type=number> <span>inches</span>
+                    <input type="text" class="number"> <span>inches</span>
                 </li>
                 <li>
                     <label>Weight</label>
-                    <input type=number> <span>lbs.</span>
+                    <input type="text" class="number"> <span>lbs.</span>
                 </li>
             </ul>
         </div>
@@ -43,7 +43,7 @@ $theirName = implode(" ", $theirName);
             <ul >
                 <li>
                     <label>Weight at 20</label>
-                    <input type=number> <span>lbs.</span>
+                    <input type="text" class="number"> <span>lbs.</span>
                 </li>
             </ul>
         </div>
@@ -52,7 +52,7 @@ $theirName = implode(" ", $theirName);
             <ul >
                 <li>
                     <label>Waistline</label>
-                    <input type=number> <span>inches</span>
+                    <input type="text" class="number"> <span>inches</span>
                 </li>
             </ul>
         </div>
@@ -61,7 +61,7 @@ $theirName = implode(" ", $theirName);
             <ul >
                 <li>
                     <label>Waistline at 20</label>
-                    <input type=number> <span>inches</span>
+                    <input type="text" class="number"> <span>inches</span>
                 </li>
             </ul>
         </div>
@@ -79,7 +79,7 @@ $theirName = implode(" ", $theirName);
                 <li><input></li>
                 <li><input></li>
                 <li><input></li>
-                <li><button class=add>Add</button></li>
+                <li><button class="add btn btn-sm btn-primary">Add</button></li>
             </ul>
         </div>
         <div>
@@ -102,18 +102,18 @@ $theirName = implode(" ", $theirName);
             <ul class=gappers >
                 <li>
                     <span>3 months?</span>
-                    <label>Weight</label> <input type=number> <span>lbs.</span>
-                    <label>Waistline</label> <input type=number> <span>inches</span>
+                    <label>Weight</label> <input type="text" class="number"> <span>lbs.</span>
+                    <label>Waistline</label> <input type="text" class="number"> <span>inches</span>
                 </li>
                 <li>
                     <span>6 months?</span>
-                    <label>Weight</label> <input type=number> <span>lbs.</span>
-                    <label>Waistline</label> <input type=number> <span>inches</span>
+                    <label>Weight</label> <input type="text" class="number"> <span>lbs.</span>
+                    <label>Waistline</label> <input type="text" class="number"> <span>inches</span>
                 </li>
                 <li>
                     <span>1 year?</span>
-                    <label>Weight</label> <input type=number> <span>lbs.</span>
-                    <label>Waistline</label> <input type=number> <span>inches</span>
+                    <label>Weight</label> <input type="text" class="number"> <span>lbs.</span>
+                    <label>Waistline</label> <input type="text" class="number"> <span>inches</span>
                 </li>
             </ul>
         </div>
@@ -122,18 +122,18 @@ $theirName = implode(" ", $theirName);
             <ul >
                 <li><input></li>
                 <li><input></li>
-                <li><button class=add>Add</button></li>
+                <li><button class="add btn btn-sm btn-primary">Add</button></li>
             </ul>
         </div>
         <div>
             <p>12. What is the highest your weight or waistline has ever been?</p>
             <ul class=gappers >
                 <li>
-                    <label>Weight</label> <input type=number> <span>lbs.</span>
+                    <label>Weight</label> <input type="text" class="number"> <span>lbs.</span>
                     <label>When was that?</label> <input>
                 </li>
                 <li>
-                    <label>Waistline</label> <input type=number> <span>inches</span>
+                    <label>Waistline</label> <input type="text" class="number"> <span>inches</span>
                     <label>When was that?</label> <input>
                 </li>
             </ul>
@@ -142,15 +142,15 @@ $theirName = implode(" ", $theirName);
             <p>13. What is your most recent?</p>
             <ul class=gappers >
                 <li>
-                    <label>A1c</label> <input type=number>
+                    <label>A1c</label> <input type="text" class="number">
                     <label>When was that?</label> <input>
                 </li>
                 <li>
-                    <label>BP (S/D)</label> <input type=number>/<input type=number> <span>mmHg</span>
+                    <label>BP (S/D)</label> <input type="text" class="number">/<input type="text" class="number"> <span>mmHg</span>
                     <label>When was that?</label> <input>
                 </li>
                 <li>
-                    <label>LDL</label> <input type=number> <span>mg/dL</span>
+                    <label>LDL</label> <input type="text" class="number"> <span>mg/dL</span>
                     <label>When was that?</label> <input>
                 </li>
             </ul>
@@ -159,15 +159,15 @@ $theirName = implode(" ", $theirName);
             <p>14. Do you recall your highest ever recorded?</p>
             <ul class=gappers >
                 <li>
-                    <label>A1c</label> <input type=number>
+                    <label>A1c</label> <input type="text" class="number">
                     <label>When was that?</label> <input>
                 </li>
                 <li>
-                    <label>BP (S/D)</label> <input type=number>/<input type=number> <span>mmHg</span>
+                    <label>BP (S/D)</label> <input type="text" class="number">/<input type="text" class="number"> <span>mmHg</span>
                     <label>When was that?</label> <input>
                 </li>
                 <li>
-                    <label>LDL</label> <input type=number> <span>mg/dL</span>
+                    <label>LDL</label> <input type="text" class="number"> <span>mg/dL</span>
                     <label>When was that?</label> <input>
                 </li>
             </ul>
@@ -197,15 +197,15 @@ $theirName = implode(" ", $theirName);
         <div>
             <p>17. ACTIVITY ASSESSMENT:</p>
             <ul >
-                <li><label>How many minutes of walking or movement do you typically get in a day</label> <input type=number></li>
+                <li><label>How many minutes of walking or movement do you typically get in a day</label> <input type="text" class="number"></li>
                 <li><label>How many days per week do you exercise to the point where your heart rate goes up</label> <input></li>
                 <li><label>How many days per week do you exercise to the point where your muscles feel like they've had a work out</label> <input></li>
             </ul>
         </div>
     </div>
 
-    <button>Save</button>
-    <button id="sign-and-submit">Sign & Submit</button>
+    <button class="btn btn-sm btn-primary">Save</button>
+    <button id="sign-and-submit" class="btn btn-sm btn-success">Sign & Submit</button>
 </section>
 
 <style>
@@ -226,9 +226,9 @@ $theirName = implode(" ", $theirName);
             width: 50%;
         } .intake input[type=checkbox] {
               margin-right: 10px;
-          } .intake input[type=number] {
+          } .intake input.number {
                 text-align: center;
-                width: 60px;
+                width: 150px;
             } .intake input::-webkit-inner-spin-button {
                   -webkit-appearance: none;
               } .intake label:after {

+ 53 - 1
resources/views/app/mcp/bills_pending_signature.blade.php

@@ -18,6 +18,7 @@
                     <th class="border-0">Context</th>
                     <th class="border-0">Minutes</th>
                     <th class="border-0">Amount</th>
+                    <th class="border-0">Sign</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -25,14 +26,65 @@
                     <tr>
                         <td>{{ friendly_date_time($row->effective_date, false) }}</td>
                         <td>
+                            @if($row->client)
                             <a target="_blank" native href="{{route('patients.view.dashboard', $row->client)}}">
                                 {{$row->client->displayName()}}
                             </a>
+                            @else 
+                            --
+                            @endif
                         </td>
                         <td>{{ $row->code }}</td>
                         <td>{{ $row->generic_target_entity_type ?: '-' }}</td>
                         <td>{{ round(floor($row->number_of_units * 60)) }} m</td>
-                        <td>{{ $row->hcp_expected_payment_amount ? '$'.$row->hcp_expected_payment_amount : '' }}</td>
+                        <td>
+                            @if($row->generic_pro_id === $pro->id)
+                                {{ $row->generic_pro_expected_payment_amount ? '$'.round($row->generic_pro_expected_payment_amount, 2) : '' }}
+                            @elseif($row->hcp_pro_id === $pro->id)
+                                {{ $row->hcp_expected_payment_amount ? '$'.round($row->hcp_expected_payment_amount, 2) : '' }}
+                            @endif
+                        </td>
+                        <td>
+                            @if($row->generic_pro_id === $pro->id)
+                                @if($row->is_signed_by_generic_pro)
+                                    <div class="d-block text-secondary text-nowrap">
+                                        <i class="fa fa-check"></i>
+                                        Signed
+                                    </div>
+                                @else
+                                    <div moe relative>
+                                        <a class="text-nowrap" href="" show start>Sign</a>
+                                        <form url="/api/bill/signAsGenericPro" right>
+                                            <input type="hidden" name="uid" value="{{$row->uid}}">
+                                            <p>Sign this bill?</p>
+                                            <div class="mb-0">
+                                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                @endif
+                            @elseif($row->hcp_pro_id === $pro->id)
+                                @if($row->is_signed_by_hcp)
+                                    <div class="d-block text-secondary text-nowrap">
+                                        <i class="fa fa-check"></i>
+                                        Signed
+                                    </div>
+                                @else
+                                    <div moe relative>
+                                        <a class="" href="" show start>Sign</a>
+                                        <form url="/api/bill/signAsHcp" right>
+                                            <input type="hidden" name="uid" value="{{$row->uid}}">
+                                            <p>Sign this bill as HCP?</p>
+                                            <div class="mb-0">
+                                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                @endif
+                            @endif
+                        </td>
                     </tr>
                 @endforeach
                 </tbody>

+ 62 - 2
resources/views/app/patient/allergies-center.blade.php

@@ -3,13 +3,21 @@
 use App\Models\Point;
 use App\Models\Client;
 use App\Models\Note;
-use App\Models\Segment;
+use App\Models\Pro;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var Pro $pro */
 
 list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERGY', $note);
 $numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
+$favorites = $pro->favoritesByCategoryDecoded('allergy');
+function isFavoriteAllergy($_allergy, $_favorites) {
+    foreach($_favorites as $favorite) {
+        if($favorite->data->name === $_allergy->data->name) return $favorite->uid;
+    }
+    return false;
+}
 ?>
 
 <div class="mt-3 p-3 border-top" id="allergies-center-{{$note->id}}">
@@ -49,6 +57,7 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
             <?php $prevRowState = -1; ?>
             <?php foreach($allergies as $allergy): ?>
             <?php $point = $allergy; ?>
+            <?php $favoriteUid = isFavoriteAllergy($allergy, $favorites); ?>
             @if($prevRowState !== $allergy->state)
                 @include('app.patient.wizard-partials.state-row', ['point' => $allergy])
             @endif
@@ -69,6 +78,27 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
                             <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
                             @include('app.patient.wizard-partials.state-badge', ['point' => $allergy, 'addedVerb' => 'Diagnosed'])
                         </div>
+                        <div class="ml-auto mr-1">
+                            <div moe>
+                                @if(!$favoriteUid)
+                                    <form show url="/api/proFavorite/create">
+                                        <input type="hidden" name="proUid" value="{{$pro->uid}}">
+                                        <input type="hidden" name="category" value="allergy">
+                                        <textarea class="d-none" name="data">{!! json_encode(["name" => @($allergy->data->name), "damConceptId" => @($allergy->data->damConceptId), "damConceptIdType" => @($allergy->data->damConceptIdType),]) !!}</textarea>
+                                        <button submit class="outline-0 shadow-none border-0 bg-transparent p-0 text-secondary-light" title="Add to common">
+                                            <i class="fa fa-bookmark"></i>
+                                        </button>
+                                    </form>
+                                @else
+                                    <form show url="/api/proFavorite/remove">
+                                        <input type="hidden" name="uid" value="{{$favoriteUid}}">
+                                        <button submit class="outline-0 shadow-none border-0 bg-transparent p-0 text-info" title="Remove from common">
+                                            <i class="fa fa-bookmark"></i>
+                                        </button>
+                                    </form>
+                                @endif
+                            </div>
+                        </div>
                     </div>
                 </td>
                 <td>
@@ -203,7 +233,27 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
 
                     <div class="row">
                         <div class="col-8">
-                            <p class="mb-2"><b>Add Allergy</b></p>
+                            <div class="d-flex align-items-baseline mb-2">
+                                <b>Add Allergy</b>
+                                @if(count($favorites))
+                                    <div class="d-inline position-relative on-click-menu ml-4">
+                                        <span class="text-primary c-pointer">
+                                            <i class="fa fa-bookmark text-info mr-1"></i> Common Allergies <i class="ml-1 fa fa-caret-down"></i>
+                                        </span>
+                                        <div menu right class="bg-white border">
+                                            @foreach($favorites as $favorite)
+                                                <a native target="_blank" href="#"
+                                                   data-name="{{@($favorite->data->name)}}"
+                                                   data-damConceptId="{{@($favorite->data->damConceptId)}}"
+                                                   data-damConceptIdType="{{@($favorite->data->damConceptIdType)}}"
+                                                   class="px-2 py-1 d-block text-nowrap text-sm favorite-item">
+                                                    {{$favorite->data->name}}
+                                                </a>
+                                            @endforeach
+                                        </div>
+                                    </div>
+                                @endif
+                            </div>
                             <div class="mb-2">
                                 <label class="text-sm mb-0 font-weight-bold">Name</label>
                                 <input type="text" data-name="name" class="form-control form-control-sm"
@@ -265,6 +315,16 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
             @if($numActiveItems && $tracker && @($tracker->data->no_known_allergies_of_any_type))
                 parentSegment.find('[data-field-name="no_known_allergies_of_any_type"]').prop('checked', false).trigger('change');
             @endif
+
+            parentSegment.find('.favorite-item')
+                .off('click.add-from-favorite')
+                .on('click.add-from-favorite', function () {
+                    $('#frm-add-allergy').find('input[data-name="name"]').val($(this).attr('data-name'));
+                    $('#frm-add-allergy').find('input[data-name="damConceptId"]').val($(this).attr('data-damConceptId'));
+                    $('#frm-add-allergy').find('input[data-name="damConceptIdType"]').val($(this).attr('data-damConceptIdType'));
+                    $(this).closest('.on-click-menu').find('[menu]').hide();
+                    return false;
+                });
         }
         addMCInitializer('allergies-center-{{$note->id}}', init, '#allergies-center-{{$note->id}}');
     }).call(window);

+ 213 - 32
resources/views/app/patient/behavior-center.blade.php

@@ -24,7 +24,7 @@ $points = [
 <div class="mt-3 p-3 border-top-behavior-rx" id="behavior-center-{{$note->id}}">
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table">
+        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
 
             @foreach($points as $p)
                 <?php $point = $p['point']; ?>
@@ -42,45 +42,153 @@ $points = [
                         </div>
                     </td>
                     <td class="w-40">
-                        <div class="d-flex align-items-start position-relative">
-                            <div class="flex-grow-1">
-                                @if($point)
-                                    <?php
-                                    include resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/last-review.php');
-                                    ?>
-                                @else
-                                    -
-                                @endif
-                            </div>
-                            <div class="d-inline-flex flex-column ml-1">
+                        <div if-read-mode>
+                            @if($point)
                                 <?php
-                                $segment = $note->getSegmentByInternalName('intake_behavior');
-                                if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/edit-review.php');
+                                include resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/last-review.php');
+                                ?>
+                            @else
+                                -
+                            @endif
+                        </div>
+                        <div if-edit-mode>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_behavior');
+                            if($segment) {
+                                $currentValue = '';
+                                $previousValue = '';
+                                $previousChildReview = null;
+                                if (@$point) {
+                                    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
+                                        $currentValue = json_decode($point->lastChildReview->data);
+                                        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
+                                            ->where('category', 'REVIEW')
+                                            ->where('parent_point_id', $point->id)
+                                            ->orderBy('id', 'DESC')
+                                            ->first();
+                                        if($previousChildReview && $previousChildReview->data) {
+                                            $previousValue = json_decode($previousChildReview->data);
+                                        }
+                                    }
+                                    else {
+                                        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
+                                            ->where('category', 'REVIEW')
+                                            ->orderBy('id', 'DESC')
+                                            ->first();
+                                        if($previousChildReview && $previousChildReview->data) {
+                                            $previousValue = json_decode($previousChildReview->data);
+                                        }
+                                    }
                                 }
                                 ?>
-                            </div>
+                                <div visit-moe relative class="d-block">
+                                    <form show url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
+                                          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
+
+                                        @if($point)
+                                            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                                            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                                            <input type="hidden" name="data">
+                                        @else
+                                            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+                                            <input type="hidden" name="category" value="<?= $p['category'] ?>">
+                                            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
+                                            <input type="hidden" name="childReviewData">
+                                        @endif
+
+                                        @if($previousValue)
+                                            <div class="mb-2">
+                                                <div class="d-flex align-items-baseline mb-1">
+                                                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
+                                                </div>
+                                                <div class="p-2 bg-light border inline-html-container">
+                                                    <?php $review = $previousValue; ?>
+                                                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/view-review.php')); ?>
+                                                </div>
+                                            </div>
+                                        @endif
+                                        <?php include resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/edit-review.php'); ?>
+                                    </form>
+                                </div>
+                                @if(!empty($currentValue))
+                                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/delete-review.php')); ?>
+                                @endif
+                                <?php
+                            }
+                            ?>
                         </div>
                     </td>
                     <td class="w-40">
-                        <div class="d-flex align-items-start position-relative">
-                            <div class="flex-grow-1">
-                                @if($point)
-                                    <?php
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/last-plan.php');
-                                    ?>
-                                @else
-                                    -
-                                @endif
-                            </div>
-                            <div class="d-inline-flex flex-column ml-1">
-                                <?php
-                                $segment = $note->getSegmentByInternalName('plan_behavior');
-                                if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/edit-plan.php');
+                        <div if-read-mode>
+                            @if($point)
+                                <?php include resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/last-plan.php'); ?>
+                            @else
+                                -
+                            @endif
+                        </div>
+                        <div if-edit-mode>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_behavior');
+                            if($segment) {
+                                $currentValue = '';
+                                $previousValue = '';
+                                $previousChildPlan = null;
+                                if (@$point) {
+                                    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
+                                        $currentValue = json_decode($point->lastChildPlan->data);
+                                        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
+                                            ->where('category', 'PLAN')
+                                            ->where('parent_point_id', $point->id)
+                                            ->orderBy('id', 'DESC')
+                                            ->first();
+                                        if($previousChildPlan && $previousChildPlan->data) {
+                                            $previousValue = json_decode($previousChildPlan->data);
+                                        }
+                                    }
+                                    else {
+                                        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
+                                            ->where('category', 'PLAN')
+                                            ->orderBy('id', 'DESC')
+                                            ->first();
+                                        if($previousChildPlan && $previousChildPlan->data) {
+                                            $previousValue = json_decode($previousChildPlan->data);
+                                        }
+                                    }
                                 }
                                 ?>
-                            </div>
+                                <div visit-moe relative class="d-block">
+                                    <form show url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
+                                          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
+                                        @if($point)
+                                            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                                            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                                            <input type="hidden" name="data">
+                                        @else
+                                            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+                                            <input type="hidden" name="category" value="<?= $p['category'] ?>">
+                                            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
+                                            <input type="hidden" name="childPlanData">
+                                        @endif
+                                        @if($previousValue)
+                                            <div class="mb-2">
+                                                <div class="d-flex align-items-baseline mb-1">
+                                                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
+                                                </div>
+                                                <div class="p-2 bg-light border inline-html-container">
+                                                    <?php $plan = $previousValue; ?>
+                                                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
+                                                </div>
+                                            </div>
+                                        @endif
+                                        <?php include resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/edit-plan.php'); ?>
+                                    </form>
+                                </div>
+                                @if(!empty($currentValue))
+                                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/delete-plan.php')); ?>
+                                @endif
+                                <?php
+                            }
+                            ?>
                         </div>
                     </td>
                 </tr>
@@ -93,10 +201,83 @@ $points = [
 <script>
     (function() {
         function init() {
+
+            let mode = 'read';
+
             let parentSegment = $('#behavior-center-{{$note->id}}');
             @include('app.patient.wizard-partials.common-script', ['label' => 'behavior', 'segment_part' => 'behavior'])
             initSegmentMoes(parentSegment);
             __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
+
+            // custom buttons on title bar
+            $('.button-container').remove();
+            let buttonContainer = $('<div/>').addClass('button-container ml-4 mr-auto');
+            let titleElem = $('#behavior-center-{{$note->id}}').closest('.stag-popup').find('.stag-popup-title>span');
+            titleElem.next().removeClass('ml-auto');
+            titleElem.parent().addClass('align-items-center');
+
+            // add button for "Edit Mode"
+            $('.btn-toggle-edit-mode').remove();
+            let button = $('<a href="#" native target="_blank" data-mode="read" ' +
+                'class="btn-toggle-edit-mode btn btn-sm mr-2 btn-info text-white font-weight-bold shadow-none">Switch to Edit Mode</a>')
+                .appendTo(buttonContainer);
+
+            $('<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">' +
+                '<i class="fa fa-check"></i>' +
+                ' Saved' +
+                '</span>' +
+                '</div>').appendTo(buttonContainer);
+
+            buttonContainer.insertAfter(titleElem);
+
+            button
+                .off('click.toggle-edit')
+                .on('click.toggle-edit', function () {
+                    if (mode === 'read') {
+                        mode = 'edit';
+                        $(this).text('Back to Read Mode');
+                        $('#behavior-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
+                    } else {
+                        refreshDynamicStagPopup();
+                    }
+                    return false;
+                });
+
+            // HACK: create empty top-level points if not existing
+            let createCalls = [];
+
+            <?php
+            $missing = [];
+            foreach ($points as $p) {
+                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
+            }
+            ?>
+            Promise.all(createCalls).then(() => {
+                refreshDynamicStagPopup();
+            });
+            <?php
+            }
+            ?>
         }
         addMCInitializer('behavior-center-{{$note->id}}', init, '#behavior-center-{{$note->id}}');
     }).call(window);

+ 1 - 1
resources/views/app/patient/canvas-sections/fhx/form.blade.php

@@ -14,7 +14,7 @@ $formID = rand(0, 100000);
     <div class="border border-secondary rounded mb-2 p-2">
         <label class="my-0 d-flex align-items-center">
             <input type="checkbox" class="my-0 mr-2" v-model="unknown" name="unknown">
-            <span>Family history is unknown/unavailable</span>
+            <span>-</span>
         </label>
     </div>
 

+ 1 - 1
resources/views/app/patient/canvas-sections/fhx/summary.php

@@ -73,7 +73,7 @@ if((isset($contentData['unknown']) && !$contentData['unknown']) && !!$contentDat
 }
 else {
     ?>
-    <div class="text-secondary">Family History is unknown/unavailable</div>
+    <div class="text-secondary"></div>
     <?php
 }
 ?>

+ 2 - 2
resources/views/app/patient/canvas-sections/pmhx/summary.php

@@ -117,8 +117,8 @@ else {
     endif;
 
     if(isset($contentData['comments'])) { ?>
-        <div class="mt-2 mb-1">
-            <div class="font-weight-bold">Comments:</div>
+        <div class="d-flex align-items-start mt-2 mb-1">
+            <div class="font-weight-bold mr-2">Comments:</div>
             <div class="click-to-copy"><?= $contentData['comments'] ?></div>
         </div>
     <?php }

+ 2 - 2
resources/views/app/patient/canvas-sections/pshx/summary.php

@@ -91,8 +91,8 @@ else {
     endif;
 
     if(isset($contentData['comments'])) { ?>
-        <div class="mt-2 mb-1">
-            <div class="font-weight-bold">Comments:</div>
+        <div class="d-flex align-items-start mt-2 mb-1">
+            <div class="font-weight-bold mr-2">Comments:</div>
             <div class="click-to-copy"><?= $contentData['comments'] ?></div>
         </div>
     <?php }

+ 2 - 2
resources/views/app/patient/canvas-sections/sochx/summary.php

@@ -91,8 +91,8 @@ else {
     endif;
 
     if(isset($contentData['comments'])) { ?>
-        <div class="mt-2 mb-1">
-            <div class="font-weight-bold">Comments:</div>
+        <div class="d-flex align-items-start mt-2 mb-1">
+            <div class="font-weight-bold mr-2">Comments:</div>
             <div class="click-to-copy"><?= $contentData['comments'] ?></div>
         </div>
     <?php }

+ 42 - 37
resources/views/app/patient/care-month/dashboard.blade.php

@@ -752,43 +752,48 @@
             <div class="pb-3 screen-only">
                 <div class="ml-auto d-flex align-items-center">
 
-                    <div class="d-inline-flex align-items-center">
-                        <span class="text-secondary font-weight-bold">Company Pro:&nbsp;</span>
-                        <b>{{$careMonth->companyPro && $careMonth->companyPro->company ? $careMonth->companyPro->pro->displayName() . ' / ' . $careMonth->companyPro->company->name : '-'}}</b>
-                        @if($careMonth->companyPro && $careMonth->companyPro->company)
-                            <div moe class="ml-1">
-                                <a class="text-danger" href="" show start><i class="fa fa-trash-alt"></i></a>
-                                <form url="/api/careMonth/wipeCompanyPro">
-                                    <input type="hidden" name="uid" value="{{$careMonth->uid}}">
-                                    <p>Wipe company pro from this care month?</p>
-                                    <div class="mb-0">
-                                        <button class="btn btn-primary btn-sm" submit>Submit</button>
-                                        <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                    </div>
-                                </form>
-                            </div>
-                        @else
-                            <div moe class="ml-1">
-                                <a class="text-primary" href="" show start><i class="fa fa-edit"></i></a>
-                                <form url="/api/careMonth/putCompanyPro">
-                                    <input type="hidden" name="uid" value="{{$careMonth->uid}}">
-                                    <div class="mb-2">
-                                        <select name="companyProUid" class="form-control form-control-sm">
-                                            <option value="">-- select --</option>
-                                            @foreach($careMonth->mcp->companyPros as $companyPro)
-                                                <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
-                                            @endforeach
-                                        </select>
-                                    </div>
-                                    <div class="mb-0">
-                                        <button class="btn btn-success btn-sm" submit>Submit</button>
-                                        <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                    </div>
-                                </form>
-                            </div>
-                        @endif
-                    </div>
-
+		    @if($careMonth->mcp)
+		            <div class="d-inline-flex align-items-center">
+		                <span class="text-secondary font-weight-bold">Company Pro:&nbsp;</span>
+		                <b>{{$careMonth->companyPro && $careMonth->companyPro->company ? $careMonth->companyPro->pro->displayName() . ' / ' . $careMonth->companyPro->company->name : '-'}}</b>
+		                @if($careMonth->companyPro && $careMonth->companyPro->company)
+		                    <div moe class="ml-1">
+		                        <a class="text-danger" href="" show start><i class="fa fa-trash-alt"></i></a>
+		                        <form url="/api/careMonth/wipeCompanyPro">
+		                            <input type="hidden" name="uid" value="{{$careMonth->uid}}">
+		                            <p>Wipe company pro from this care month?</p>
+		                            <div class="mb-0">
+		                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+		                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+		                            </div>
+		                        </form>
+		                    </div>
+		                @else
+		                  
+		                    <div moe class="ml-1">
+		                        <a class="text-primary" href="" show start><i class="fa fa-edit"></i></a>
+		                        <form url="/api/careMonth/putCompanyPro">
+		                            <input type="hidden" name="uid" value="{{$careMonth->uid}}">
+		                            <div class="mb-2">
+		                                <select name="companyProUid" class="form-control form-control-sm">
+		                                    <option value="">-- select --</option>
+		                                    @foreach($careMonth->mcp->companyPros as $companyPro)
+		                                        <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
+		                                    @endforeach
+		                                </select>
+		                            </div>
+		                            <div class="mb-0">
+		                                <button class="btn btn-success btn-sm" submit>Submit</button>
+		                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+		                            </div>
+		                        </form>
+		                    </div>
+		                   
+		                @endif
+		            </div>
+			 @else 
+	            	<div class="alert alert-info">MCP has not been set on the care month.</div>
+	            @endif
                     @if($careMonth->companyPro && $careMonth->companyPro->company)
                         <span class="mx-2 text-secondary">|</span>
                         <div class="d-inline-flex align-items-center">

+ 220 - 31
resources/views/app/patient/exercise-center.blade.php

@@ -22,7 +22,7 @@ $points = [
 <div class="mt-3 p-3 border-top-exercise-rx" id="exercise-center-{{$note->id}}">
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table">
+        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
 
             @foreach($points as $p)
                 <?php $point = $p['point']; ?>
@@ -38,50 +38,165 @@ $points = [
                         </div>
                     </td>
                     <td class="w-40">
-                        <div class="d-flex align-items-start position-relative">
-                            <div class="flex-grow-1">
-                                @if($point)
-                                    <?php
-                                    include resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/last-review.php');
-                                    ?>
-                                @else
-                                    -
-                                @endif
-                            </div>
-                            <div class="d-inline-flex flex-column ml-1">
+                        <div if-read-mode>
+                            @if($point)
                                 <?php
-                                $segment = $note->getSegmentByInternalName('intake_exercise');
-                                if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/edit-review.php');
-                                }
+                                include resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/last-review.php');
                                 ?>
+                            @else
+                                -
+                            @endif
+                        </div>
+                        <div if-edit-mode>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_exercise');
+                            if($segment) {
+                            $currentValue = '';
+                            $previousValue = '';
+                            $previousChildReview = null;
+                            if (@$point) {
+                                if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
+                                    $currentValue = json_decode($point->lastChildReview->data);
+                                    $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
+                                        ->where('category', 'REVIEW')
+                                        ->where('parent_point_id', $point->id)
+                                        ->orderBy('id', 'DESC')
+                                        ->first();
+                                    if ($previousChildReview && $previousChildReview->data) {
+                                        $previousValue = json_decode($previousChildReview->data);
+                                    }
+                                } else {
+                                    $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
+                                        ->where('category', 'REVIEW')
+                                        ->orderBy('id', 'DESC')
+                                        ->first();
+                                    if ($previousChildReview && $previousChildReview->data) {
+                                        $previousValue = json_decode($previousChildReview->data);
+                                    }
+                                }
+                            }
+                            ?>
+                            <div visit-moe relative class="d-block">
+                                <form show url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
+                                      class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
+
+                                    @if($point)
+                                        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                                        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                                        <input type="hidden" name="data">
+                                    @else
+                                        <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+                                        <input type="hidden" name="category" value="<?= $p['category'] ?>">
+                                        <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
+                                        <input type="hidden" name="childReviewData">
+                                    @endif
+
+                                    @if($previousValue)
+                                        <div class="mb-2">
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
+                                            </div>
+                                            <div class="p-2 bg-light border inline-html-container">
+                                                <?php $review = $previousValue; ?>
+                                                <?php include(resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/view-review.php')); ?>
+                                            </div>
+                                        </div>
+                                    @endif
+                                    <?php include resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/edit-review.php'); ?>
+                                </form>
                             </div>
+                            @if(!empty($currentValue))
+                                <?php include(resource_path('views/app/patient/segment-templates/_child_review/delete-review.php')); ?>
+                            @endif
+                            <?php
+                            }
+                            ?>
                         </div>
                     </td>
                     <td class="w-40">
-                        <div class="d-flex align-items-start position-relative">
-                            <div class="flex-grow-1">
-                                @if($point)
-                                    <?php
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/last-plan.php');
-                                    ?>
-                                @else
-                                    -
-                                @endif
-                            </div>
-                            <div class="d-inline-flex flex-column ml-1">
+                        <div if-read-mode>
+                            @if($point)
                                 <?php
-                                $segment = $note->getSegmentByInternalName('plan_exercise');
-                                if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/edit-plan.php');
-                                }
+                                include resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/last-plan.php');
                                 ?>
+                            @else
+                                -
+                            @endif
+                        </div>
+                        <div if-edit-mode>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_exercise');
+                            if($segment) {
+                            $currentValue = '';
+                            $previousValue = '';
+                            $previousChildPlan = null;
+                            if (@$point) {
+                                if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
+                                    $currentValue = json_decode($point->lastChildPlan->data);
+                                    $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
+                                        ->where('category', 'PLAN')
+                                        ->where('parent_point_id', $point->id)
+                                        ->orderBy('id', 'DESC')
+                                        ->first();
+                                    if($previousChildPlan && $previousChildPlan->data) {
+                                        $previousValue = json_decode($previousChildPlan->data);
+                                    }
+                                }
+                                else {
+                                    $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
+                                        ->where('category', 'PLAN')
+                                        ->orderBy('id', 'DESC')
+                                        ->first();
+                                    if($previousChildPlan && $previousChildPlan->data) {
+                                        $previousValue = json_decode($previousChildPlan->data);
+                                    }
+                                }
+                            }
+                            ?>
+                            <div visit-moe relative class="d-block">
+                                <form show url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
+                                      class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
+                                    @if($point)
+                                        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                                        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                                        <input type="hidden" name="data">
+                                    @else
+                                        <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+                                        <input type="hidden" name="category" value="<?= $p['category'] ?>">
+                                        <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
+                                        <input type="hidden" name="childPlanData">
+                                    @endif
+                                    @if($previousValue)
+                                        <div class="mb-2">
+                                            <div class="d-flex align-items-baseline mb-1">
+                                                <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
+                                            </div>
+                                            <div class="p-2 bg-light border inline-html-container">
+                                                <?php $plan = $previousValue; ?>
+                                                <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
+                                            </div>
+                                        </div>
+                                    @endif
+                                    <?php include resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/edit-plan.php'); ?>
+                                </form>
                             </div>
+                            @if(!empty($currentValue))
+                                <?php include(resource_path('views/app/patient/segment-templates/_child_plan/delete-plan.php')); ?>
+                            @endif
+                            <?php
+                            }
+                            ?>
                         </div>
                     </td>
                 </tr>
             @endforeach
 
+            @if(!count($points))
+                <tr>
+                    <td>-</td>
+                </tr>
+            @endif
+
         </table>
 
     </div>
@@ -89,10 +204,84 @@ $points = [
 <script>
     (function() {
         function init() {
+
+            let mode = 'read';
+
             let parentSegment = $('#exercise-center-{{$note->id}}');
             @include('app.patient.wizard-partials.common-script', ['label' => 'exercise', 'segment_part' => 'exercise'])
             initSegmentMoes(parentSegment);
             __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
+
+            // custom buttons on title bar
+            $('.button-container').remove();
+            let buttonContainer = $('<div/>').addClass('button-container ml-4 mr-auto');
+            let titleElem = $('#exercise-center-{{$note->id}}').closest('.stag-popup').find('.stag-popup-title>span');
+            titleElem.next().removeClass('ml-auto');
+            titleElem.parent().addClass('align-items-center');
+
+            // add button for "Edit Mode"
+            $('.btn-toggle-edit-mode').remove();
+            let button = $('<a href="#" native target="_blank" data-mode="read" ' +
+                'class="btn-toggle-edit-mode btn btn-sm mr-2 btn-info text-white font-weight-bold shadow-none">Switch to Edit Mode</a>')
+                .appendTo(buttonContainer);
+
+            $('<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">' +
+                '<i class="fa fa-check"></i>' +
+                ' Saved' +
+                '</span>' +
+                '</div>').appendTo(buttonContainer);
+
+            buttonContainer.insertAfter(titleElem);
+
+            button
+                .off('click.toggle-edit')
+                .on('click.toggle-edit', function () {
+                    if (mode === 'read') {
+                        mode = 'edit';
+                        $(this).text('Back to Read Mode');
+                        $('#exercise-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
+                    } else {
+                        refreshDynamicStagPopup();
+                    }
+                    return false;
+                });
+
+            // HACK: create empty top-level points if not existing
+            let createCalls = [];
+
+            <?php
+            $missing = [];
+            foreach ($points as $p) {
+                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
+            }
+            ?>
+            Promise.all(createCalls).then(() => {
+                refreshDynamicStagPopup();
+            });
+            <?php
+            }
+            ?>
+
         }
         addMCInitializer('exercise-center-{{$note->id}}', init, '#exercise-center-{{$note->id}}');
     }).call(window);

+ 67 - 3
resources/views/app/patient/medications-center.blade.php

@@ -3,14 +3,21 @@
 use App\Models\Point;
 use App\Models\Client;
 use App\Models\Note;
-use App\Models\Segment;
+use App\Models\Pro;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var Pro $pro */
 
 list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDICATION', $note);
 $numActiveItems = Point::getNumPointsOfCategory($patient, 'MEDICATION');
-
+$favorites = $pro->favoritesByCategoryDecoded('medication');
+function isFavoriteMedication($_medication, $_favorites) {
+    foreach($_favorites as $favorite) {
+        if($favorite->data->name === $_medication->data->name) return $favorite->uid;
+    }
+    return false;
+}
 ?>
 
 <div class="mt-3 p-3 border-top" id="medications-center-{{$note->id}}">
@@ -44,6 +51,7 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'MEDICATION');
             <?php $prevRowState = -1; ?>
             <?php foreach($medications as $medication): ?>
                 <?php $point = $medication; ?>
+                <?php $favoriteUid = isFavoriteMedication($medication, $favorites); ?>
                 @if($prevRowState !== $medication->state)
                     @include('app.patient.wizard-partials.state-row', ['point' => $medication])
                 @endif
@@ -64,6 +72,28 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'MEDICATION');
                                 <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
                                 @include('app.patient.wizard-partials.state-badge', ['point' => $medication, 'addedVerb' => 'Prescribed', 'removedVerb' => 'Discontinued'])
                             </div>
+                            <div class="ml-auto mr-1">
+                                <div moe>
+                                    @if(!$favoriteUid)
+                                        <form show url="/api/proFavorite/create">
+                                            <input type="hidden" name="proUid" value="{{$pro->uid}}">
+                                            <input type="hidden" name="category" value="medication">
+                                            <textarea class="d-none"
+                                                      name="data">{!! json_encode(["name" => @($medication->data->name), "medId" => @($medication->data->medId), "routedMedId" => @($medication->data->routedMedId), "routedDosageFormMedId" => @($medication->data->routedDosageFormMedId), "gcnSeqno" => @($medication->data->gcnSeqno)]) !!}</textarea>
+                                            <button submit class="outline-0 shadow-none border-0 bg-transparent p-0 text-secondary-light" title="Add to common">
+                                                <i class="fa fa-bookmark"></i>
+                                            </button>
+                                        </form>
+                                    @else
+                                        <form show url="/api/proFavorite/remove">
+                                            <input type="hidden" name="uid" value="{{$favoriteUid}}">
+                                            <button submit class="outline-0 shadow-none border-0 bg-transparent p-0 text-info" title="Remove from common">
+                                                <i class="fa fa-bookmark"></i>
+                                            </button>
+                                        </form>
+                                    @endif
+                                </div>
+                            </div>
                         </div>
                     </td>
                     <td>
@@ -204,7 +234,29 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'MEDICATION');
 
                     <div class="row">
                         <div class="col-8">
-                            <p class="mb-2"><b>Add Medication</b></p>
+                            <div class="d-flex align-items-baseline mb-2">
+                                <b>Add Medication</b>
+                                @if(count($favorites))
+                                    <div class="d-inline position-relative on-click-menu ml-4">
+                                        <span class="text-primary c-pointer">
+                                            <i class="fa fa-bookmark text-info mr-1"></i> Common Medications <i class="ml-1 fa fa-caret-down"></i>
+                                        </span>
+                                        <div menu right class="bg-white border">
+                                            @foreach($favorites as $favorite)
+                                                <a native target="_blank" href="#"
+                                                   data-name="{{@($favorite->data->name)}}"
+                                                   data-medId="{{@($favorite->data->medId)}}"
+                                                   data-routedMedId="{{@($favorite->data->routedMedId)}}"
+                                                   data-routedDosageFormMedId="{{@($favorite->data->routedDosageFormMedId)}}"
+                                                   data-gcnSeqno="{{@($favorite->data->gcnSeqno)}}"
+                                                   class="px-2 py-1 d-block text-nowrap text-sm favorite-item">
+                                                    {{$favorite->data->name}}
+                                                </a>
+                                            @endforeach
+                                        </div>
+                                    </div>
+                                @endif
+                            </div>
                             <div class="mb-2">
                                 <label class="mb-0 font-weight-bold">Name</label>
                                 <input type="text"
@@ -321,6 +373,18 @@ $numActiveItems = Point::getNumPointsOfCategory($patient, 'MEDICATION');
         @if($numActiveItems && $tracker && @($tracker->data->no_known_medications))
             parentSegment.find('[data-field-name="no_known_medications"]').prop('checked', false).trigger('change');
         @endif
+
+        parentSegment.find('.favorite-item')
+            .off('click.add-from-favorite')
+            .on('click.add-from-favorite', function () {
+                $('#frm-add-medication').find('input[data-name="name"]').val($(this).attr('data-name'));
+                $('#frm-add-medication').find('input[data-name="medId"]').val($(this).attr('data-medId'));
+                $('#frm-add-medication').find('input[data-name="routedMedId"]').val($(this).attr('data-routedMedId'));
+                $('#frm-add-medication').find('input[data-name="routedDosageFormMedId"]').val($(this).attr('data-routedDosageFormMedId'));
+                $('#frm-add-medication').find('input[data-name="gcnSeqno"]').val($(this).attr('data-gcnSeqno'));
+                $(this).closest('.on-click-menu').find('[menu]').hide();
+                return false;
+            });
     }
     addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}');
 }).call(window);

+ 185 - 0
resources/views/app/patient/note/_OLD_segment.blade.php

@@ -0,0 +1,185 @@
+<?php $iName = $segment->segmentTemplate->internal_name; ?>
+<div class="p-3 border-bottom note-section visit-segment {{$note->is_signed_by_hcp ? '' : 'edit-trigger'}} {{strpos($iName, 'lifestyle_') === 0 && $iName !== 'lifestyle_general' ? 'zero-height' : ''}}"
+     data-segment-uid="{{ $segment->uid }}"
+     data-segment-template-uid="{{ $segment->segmentTemplate->uid }}"
+     data-segment-template-name="{{ $segment->segmentTemplate->internal_name }}">
+
+    <?php $isLSSegment = strpos($iName, 'lifestyle_') === 0; ?>
+
+    <div class="d-flex align-items-baseline">
+
+        <!-- show hierarchy -->
+        {{--@if($segment->heading)
+            <span class="text-secondary">{{$segment->heading}}</span>
+            <i class="text-secondary text-sm fa fa-arrow-right mx-2"></i>
+        @endif
+        @if($segment->subheading)
+            <span class="text-secondary">{{$segment->subheading}}</span>
+            <i class="text-secondary text-sm fa fa-arrow-right mx-2"></i>
+        @endif--}}
+
+    <!-- title -->
+
+        @if($iName === 'medrisk_vigilence')
+            <div class="font-weight-bold text-center flex-grow-1">
+                <div class="on-hover-hide font-weight-normal text-info font-weight-bold text-center pt-2 font-size-11">MRV</div>
+                <span class="on-hover-only text-left">MedRisk Vigilence</span>
+            </div>
+        @else
+            <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'mb-2'}}">
+                @if($isLSSegment && $iName === 'lifestyle_general')
+                    Lifestyle
+                @else
+                    {{$segment->display_title}}
+                @endif
+
+                @if($segment->heading && $iName !== 'medrisk_vigilence')
+                    <span class="text-secondary ml-2 text-sm font-weight-normal">({{$segment->heading}})</span>
+                @endif
+            </span>
+        @endif
+
+        @if($isLSSegment)
+            @if($iName === 'lifestyle_general')
+                <a href="#" class="ls-segment-trigger ml-2" data-target="lifestyle_general">General</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_nutrition">Nutrition</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_physical_activity">Physical Act.</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_sleep">Sleep</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_social">Social Relns.</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_substances">Subst. Use</a>
+                <span class="mx-2 text-secondary text-sm">|</span>
+                <a href="#" class="ls-segment-trigger" data-target="lifestyle_stress">Stress</a>
+            @else
+                <span class="text-info ml-auto font-weight-normal">(click to view)</span>
+            @endif
+        @endif
+
+        @if(!$note->is_signed_by_hcp && !$isLSSegment)
+            <a class="edit-trigger d-none if-edit c-pointer ml-3">
+                <i class="fas fa-caret-up font-size-16"></i>
+            </a>
+
+            <!-- refresh -->
+            <a class="ml-3 font-weight-normal refresh-segment c-pointer {{$iName === 'medrisk_vigilence' ? 'on-hover-only' : ''}}"
+               data-segment-uid="{{$segment->uid}}"
+               title="Update with latest patient data">
+                <i class="fa fa-sync"></i>
+            </a>
+
+            <!-- if intake - link to plan segment-->
+            <?php
+            $isIntake = strpos($iName, 'intake_') === 0;
+            ?>
+            @if($isIntake)
+                <?php
+                $targetSegment = 'plan_' . substr($iName, 7);
+                ?>
+                <a class="segment-trigger ml-3"
+                   href="#"
+                   data-target="{{$targetSegment}}">
+                    Changes During this Visit (Plan)
+                </a>
+            @endif
+
+            <!-- if plan - link to intake segment-->
+            <?php
+            $isPlan = strpos($iName, 'plan_') === 0 && $iName !== 'plan_free_text';
+            ?>
+            @if($isPlan)
+                <?php
+                $targetSegment = 'intake_' . substr($iName, 5);
+                ?>
+                <a class="segment-trigger ml-3"
+                   href="#"
+                   data-target="{{$targetSegment}}">
+                    Back to Intake (Subjective)
+                </a>
+            @endif
+
+            @include('app/patient/note/_templates-v2-index', ['sectionInternalName' => $segment->segmentTemplate->internal_name])
+
+        @endif
+
+    </div>
+
+    <?php if(!$isLSSegment): ?>
+
+    <div class="d-none if-not-edit inset-comment summary-container {{$iName === 'medrisk_vigilence' ? 'px-0' : ''}}">
+        {!! $segment->summary_html !!}
+    </div>
+
+    <?php
+    $wizardPowered = [
+        'intake_medications',
+        'plan_medications',
+        'intake_problems',
+        'plan_problems',
+        'intake_goals',
+        'plan_goals',
+        'intake_allergies',
+        'plan_allergies',
+        'intake_care_team',
+        'plan_care_team',
+        'intake_supplements',
+        'plan_supplements',
+    ];
+    if(!in_array($iName, $wizardPowered)) { ?>
+    <div class="d-none if-edit edit-container">
+        {!! $segment->edit_html !!}
+    </div>
+    <?php } ?>
+
+    <?php endif ?>
+
+    <!-- popup hack for LS segments -->
+    <?php if($isLSSegment): ?>
+    <div class="stag-popup stag-popup-md"
+         stag-popup-key="segment-popup-<?= $segment->segmentTemplate->internal_name ?>">
+        <div class="stag-popup-content">
+            <h3 class="stag-popup-title m-neg-3 px-3 mt-0 pb-3 border-bottom mb-3 pt-1">
+                <span class="d-inline-flex align-items-center">
+                    @if($segment->subheading)
+                        {{$segment->subheading}}
+                        <i class="text-secondary text-sm fa fa-arrow-right mx-2"></i>
+                    @endif
+                    {{$segment->display_title}}
+                </span>
+                <a href="#" class="ml-auto text-secondary" onclick="event.stopPropagation(); return closeStagPopup()">
+                    <i class="fa fa-times-circle"></i>
+                </a>
+            </h3>
+            <div class="ls-segment-edit-html">
+                {!! $segment->edit_html !!}
+            </div>
+        </div>
+    </div>
+    <?php endif ?>
+
+    {{-- popup trigger --}}
+    {{--
+    <div class="d-none">
+        <a native="" target="_blank"
+           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none <?= $segment->segmentTemplate->internal_name ?>-trigger"
+           open-in-stag-popup="" update-parent=""
+           mc-initer="<?= $segment->segmentTemplate->internal_name ?>_{{$patient->id}}"
+           title="{{$segment->subheading ? $segment->subheading . ' / ' : ''}}{{$segment->display_title}}"
+           popup-style="wide overflow-visible"
+           href="/note-segment-view/{{$patient->uid}}/{{$note->uid}}/{{$segment->uid}}/<?= $segment->segmentTemplate->internal_name ?>/edit">
+            <i class="fa fa-bolt mr-1"></i>
+            <span>Manage</span>
+        </a>
+        <script>
+        addMCInitializer('<?= $segment->segmentTemplate->internal_name ?>_{{$patient->id}}', function() {
+            window.segmentInitializers['<?= $segment->segmentTemplate->internal_name ?>'].call(window);
+        }, '.<?= $segment->segmentTemplate->internal_name ?>-trigger');
+        </script>
+    </div>
+    --}}
+
+</div>
+

+ 45 - 0
resources/views/app/patient/note/_PREVIOUS_note-segment-list.blade.php

@@ -0,0 +1,45 @@
+<div class="segments-list" id="note-segments-list">
+
+    <?php
+    $previousHeading = null;
+    $previousSubHeading = null;
+    ?>
+    @foreach($note->segments as $segment)
+        <?php
+//        if ($segment->subheading !== $previousSubHeading) {
+//            if (!empty($previousSubHeading)) {
+//                echo '</div></div>'; // <!-- end the previous parent section -->
+//            }
+//            if (!empty($segment->subheading)) {
+//                echo '<div class="note-content-node note-content-heading">' .
+//                    '<a class="c-pointer">' . $segment->subheading . '</a>' .
+//                    '<div class="note-content-children">'; // <!-- open new node -->
+//            }
+//            $previousSubHeading = $segment->subheading;
+//        }
+        if ($segment->heading !== $previousHeading) {
+            if (!empty($previousHeading)) {
+                echo '</div></div>'; // <!-- end the previous parent section -->
+            }
+            if (!empty($segment->heading)) {
+                echo '<div class="note-content-node note-content-heading">' .
+                    '<div class="py-2 px-3 border-bottom font-size-16 font-weight-bold bg-light text-secondary ' . ($previousHeading ? 'mt-4 border-top' : '') . '">' . $segment->heading . '</div>' .
+                    '<div class="note-content-children ml-5 border-left">'; // <!-- open new node -->
+            }
+            $previousHeading = $segment->heading;
+        }
+        ?>
+        <div class="{{$segment->segmentTemplate->internal_name === 'medrisk_vigilence' ? 'd-none' : ''}}">
+            @include('app.patient.note.segment')
+        </div>
+    @endforeach
+    <?php
+//    if (!empty($previousSubHeading)) {
+//        echo '</div></div>'; // <!-- close any open parent section -->
+//    }
+    if (!empty($previousHeading)) {
+        echo '</div></div>'; // <!-- close any open parent section -->
+    }
+    ?>
+</div>
+@include('app.patient.note.segment_script')

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

@@ -610,7 +610,7 @@
                                                 </tbody>
                                             </table>
                                         @else
-                                            <div class="text-secondary">None</div>
+                                            <div class="text-secondary">-</div>
                                         @endif
                                     </div>
 
@@ -802,7 +802,7 @@
                                                 </tbody>
                                             </table>
                                         @else
-                                            <div class="text-secondary">None</div>
+                                            <div class="text-secondary">-</div>
                                         @endif
                                     </div>
 
@@ -852,7 +852,7 @@
                                             </tbody>
                                         </table>
                                     @else
-                                        <div class="text-secondary">None</div>
+                                        <div class="text-secondary">-</div>
                                     @endif
 
                                 </div>

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

@@ -790,116 +790,6 @@
                     @include('app.patient.note.rm-setup')
                 </div>
 
-                <div class="p-3 border-bottom screen-only" data-non-segment-section="Vitals Settings">
-                    <div class="d-flex align-items-center mb-3">
-                        <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="d-flex align-items-baseline">
-                                <b>BMI/Weight Management</b>
-                                <span class="mx-2 text-secondary">|</span>
-                                @include('app.patient.vitals-settings.bmi-management-form')
-                            </div>
-                            <div class="pt-3">
-                                @include('app.patient.vitals-settings.bmi-management-summary')
-                            </div>
-                        </div>
-                        <div class="col-8">
-                            <div class="d-flex align-items-baseline">
-                                <b>BP Management</b>
-                                <span class="mx-2 text-secondary">|</span>
-                                @include('app.patient.vitals-settings.bp-management-form')
-                            </div>
-                            <div class="pt-3">
-                                @include('app.patient.vitals-settings.bp-management-summary')
-                            </div>
-                        </div>
-                    </div>
-                    <script>
-                        (function () {
-                            function calculateUsualBmi() {
-                                let h = $('#bmi-management-settings [name="currentHeightInInches"]').val(),
-                                    wMin = $('#bmi-management-settings [name="usualWeightInPoundsMin"]').val(),
-                                    wMax = $('#bmi-management-settings [name="usualWeightInPoundsMax"]').val();
-                                let bmiMinElem = $('#bmi-management-settings [name="usualBmiMin"]').val(''),
-                                    bmiMinCategoryElem = $('#bmi-management-settings [name="usualBmiMinCategory"]').val(''),
-                                    bmiMaxElem = $('#bmi-management-settings [name="usualBmiMax"]').val(''),
-                                    bmiMaxCategoryElem = $('#bmi-management-settings [name="usualBmiMaxCategory"]').val('');
-                                calculateBmi(h, wMin, bmiMinElem, bmiMinCategoryElem);
-                                calculateBmi(h, wMax, bmiMaxElem, bmiMaxCategoryElem);
-                                return false;
-                            }
-
-                            function calculateIdealBmi() {
-                                let h = $('#bmi-management-settings [name="currentHeightInInches"]').val(),
-                                    w = $('#bmi-management-settings [name="idealWeightInPounds"]').val();
-                                let bmiElem = $('#bmi-management-settings [name="idealBmi"]').val(''),
-                                    bmiCategoryElem = $('#bmi-management-settings [name="idealBmiCategory"]').val('');
-                                calculateBmi(h, w, bmiElem, bmiCategoryElem);
-                                return false;
-                            }
-
-                            function calculateBmi(h, w, bmiElem, bmiCategoryElem) {
-                                let bmi = 0,
-                                    bmiCategory = '';
-                                try {
-                                    h = +h;
-                                    w = +w;
-                                    bmi = (w / (h * h)) * 703;
-                                    bmiElem.val(bmi.toFixed(1));
-                                    if (bmi < 18.5) {
-                                        bmiCategory = '(Underweight)';
-                                    }
-                                    if (bmi >= 18.5 && bmi < 25) {
-                                        bmiCategory = '(Healthy)';
-                                    }
-                                    if (bmi >= 25 && bmi < 30) {
-                                        bmiCategory = '(Overweight)';
-                                    }
-                                    if (bmi >= 30) {
-                                        bmiCategory = '(Obese)';
-                                    }
-                                    bmiCategoryElem.val(bmiCategory);
-                                } catch (e) {
-                                    return false;
-                                }
-                            }
-
-                            function init() {
-                                $(document)
-                                    .off('change input paste keyup',
-                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="usualWeightInPoundsMin"],  #bmi-management-settings [name="usualWeightInPoundsMax"]')
-                                    .on('change input paste keyup',
-                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="usualWeightInPoundsMin"],  #bmi-management-settings [name="usualWeightInPoundsMax"]', function () {
-                                            return calculateUsualBmi();
-                                        });
-                                $(document)
-                                    .off('change input paste keyup',
-                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="idealWeightInPounds"]')
-                                    .on('change input paste keyup',
-                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="idealWeightInPounds"]', function () {
-                                            return calculateIdealBmi();
-                                        });
-
-                                $('#bmi-management-settings [name="currentHeightInInches"]').trigger('change');
-
-                                let parentSegment = $('#bmi-management-settings');
-                                parentSegment.find('[heightFeetInput], [heightInchesInput]').off('change input paste');
-                                parentSegment.find('[heightFeetInput], [heightInchesInput]').on('change input paste', function () {
-                                    let inches = 0;
-                                    let ft = +(parentSegment.find('[heightFeetInput]').val()),
-                                        inc = +(parentSegment.find('[heightInchesInput]').val());
-                                    inches = Math.round(ft * 12 + inc);
-                                    parentSegment.find('[name="currentHeightInInches"]').val(inches).trigger('change');
-                                });
-                            }
-
-                            addMCInitializer('vitals-settings-{{$patient->uid}}', init, '#vitals-settings-{{$patient->uid}}')
-                        }).call(window);
-                    </script>
-                </div>
-
                 <div class="p-3 border-bottom screen-only" data-non-segment-section="Supply Orders Summary">
                     <div class="">
                         <div class="d-flex align-items-center mb-2">
@@ -963,7 +853,7 @@
                                         </tbody>
                                     </table>
                                 @else
-                                    <div class="text-secondary">None</div>
+                                    <div class="text-secondary">-</div>
                                 @endif
                             </div>
 
@@ -1013,13 +903,123 @@
                                     </tbody>
                                 </table>
                             @else
-                                <div class="text-secondary">None</div>
+                                <div class="text-secondary">-</div>
                             @endif
 
                         </div>
                     </div>
                 </div>
 
+                <div class="p-3 border-bottom screen-only" data-non-segment-section="Vitals Settings">
+                    <div class="d-flex align-items-center mb-3">
+                        <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="d-flex align-items-baseline">
+                                <b>BMI/Weight Management</b>
+                                <span class="mx-2 text-secondary">|</span>
+                                @include('app.patient.vitals-settings.bmi-management-form')
+                            </div>
+                            <div class="pt-3">
+                                @include('app.patient.vitals-settings.bmi-management-summary')
+                            </div>
+                        </div>
+                        <div class="col-8">
+                            <div class="d-flex align-items-baseline">
+                                <b>BP Management</b>
+                                <span class="mx-2 text-secondary">|</span>
+                                @include('app.patient.vitals-settings.bp-management-form')
+                            </div>
+                            <div class="pt-3">
+                                @include('app.patient.vitals-settings.bp-management-summary')
+                            </div>
+                        </div>
+                    </div>
+                    <script>
+                        (function () {
+                            function calculateUsualBmi() {
+                                let h = $('#bmi-management-settings [name="currentHeightInInches"]').val(),
+                                    wMin = $('#bmi-management-settings [name="usualWeightInPoundsMin"]').val(),
+                                    wMax = $('#bmi-management-settings [name="usualWeightInPoundsMax"]').val();
+                                let bmiMinElem = $('#bmi-management-settings [name="usualBmiMin"]').val(''),
+                                    bmiMinCategoryElem = $('#bmi-management-settings [name="usualBmiMinCategory"]').val(''),
+                                    bmiMaxElem = $('#bmi-management-settings [name="usualBmiMax"]').val(''),
+                                    bmiMaxCategoryElem = $('#bmi-management-settings [name="usualBmiMaxCategory"]').val('');
+                                calculateBmi(h, wMin, bmiMinElem, bmiMinCategoryElem);
+                                calculateBmi(h, wMax, bmiMaxElem, bmiMaxCategoryElem);
+                                return false;
+                            }
+
+                            function calculateIdealBmi() {
+                                let h = $('#bmi-management-settings [name="currentHeightInInches"]').val(),
+                                    w = $('#bmi-management-settings [name="idealWeightInPounds"]').val();
+                                let bmiElem = $('#bmi-management-settings [name="idealBmi"]').val(''),
+                                    bmiCategoryElem = $('#bmi-management-settings [name="idealBmiCategory"]').val('');
+                                calculateBmi(h, w, bmiElem, bmiCategoryElem);
+                                return false;
+                            }
+
+                            function calculateBmi(h, w, bmiElem, bmiCategoryElem) {
+                                let bmi = 0,
+                                    bmiCategory = '';
+                                try {
+                                    h = +h;
+                                    w = +w;
+                                    bmi = (w / (h * h)) * 703;
+                                    bmiElem.val(bmi.toFixed(1));
+                                    if (bmi < 18.5) {
+                                        bmiCategory = '(Underweight)';
+                                    }
+                                    if (bmi >= 18.5 && bmi < 25) {
+                                        bmiCategory = '(Healthy)';
+                                    }
+                                    if (bmi >= 25 && bmi < 30) {
+                                        bmiCategory = '(Overweight)';
+                                    }
+                                    if (bmi >= 30) {
+                                        bmiCategory = '(Obese)';
+                                    }
+                                    bmiCategoryElem.val(bmiCategory);
+                                } catch (e) {
+                                    return false;
+                                }
+                            }
+
+                            function init() {
+                                $(document)
+                                    .off('change input paste keyup',
+                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="usualWeightInPoundsMin"],  #bmi-management-settings [name="usualWeightInPoundsMax"]')
+                                    .on('change input paste keyup',
+                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="usualWeightInPoundsMin"],  #bmi-management-settings [name="usualWeightInPoundsMax"]', function () {
+                                            return calculateUsualBmi();
+                                        });
+                                $(document)
+                                    .off('change input paste keyup',
+                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="idealWeightInPounds"]')
+                                    .on('change input paste keyup',
+                                        '#bmi-management-settings [name="currentHeightInInches"], #bmi-management-settings [name="idealWeightInPounds"]', function () {
+                                            return calculateIdealBmi();
+                                        });
+
+                                $('#bmi-management-settings [name="currentHeightInInches"]').trigger('change');
+
+                                let parentSegment = $('#bmi-management-settings');
+                                parentSegment.find('[heightFeetInput], [heightInchesInput]').off('change input paste');
+                                parentSegment.find('[heightFeetInput], [heightInchesInput]').on('change input paste', function () {
+                                    let inches = 0;
+                                    let ft = +(parentSegment.find('[heightFeetInput]').val()),
+                                        inc = +(parentSegment.find('[heightInchesInput]').val());
+                                    inches = Math.round(ft * 12 + inc);
+                                    parentSegment.find('[name="currentHeightInInches"]').val(inches).trigger('change');
+                                });
+                            }
+
+                            addMCInitializer('vitals-settings-{{$patient->uid}}', init, '#vitals-settings-{{$patient->uid}}')
+                        }).call(window);
+                    </script>
+                </div>
+
                 <div class="p-3 border-bottom" data-non-segment-section="ICDs">
                     <div class="">
                         <div class="d-flex align-items-center mb-2">

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

@@ -50,8 +50,8 @@
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Prescriptions" href="#">ERx &amp; Orders</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="CM Setup" href="#">Chronic Care Management</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="RM Setup" href="#">RM Setup</a></div>
-    <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Vitals Settings" href="#">Vitals Settings</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Supply Orders Summary" href="#">Supply Orders Summary</a></div>
+    <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Vitals Settings" href="#">Vitals Settings</a></div>
     <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="ICDs" href="#">ICDs</a></div>
     @if($pro->pro_type === 'ADMIN')
         <div class="note-tree-node"><a native="" target="_top" data-non-segment-target="Bills & Claims Summary" href="#">Bills & Claims Summary</a></div>

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

@@ -1,31 +1,25 @@
 <div class="segments-list" id="note-segments-list">
-
     <?php
     $previousHeading = null;
     $previousSubHeading = null;
     ?>
     @foreach($note->segments as $segment)
         <?php
-//        if ($segment->subheading !== $previousSubHeading) {
-//            if (!empty($previousSubHeading)) {
-//                echo '</div></div>'; // <!-- end the previous parent section -->
-//            }
-//            if (!empty($segment->subheading)) {
-//                echo '<div class="note-content-node note-content-heading">' .
-//                    '<a class="c-pointer">' . $segment->subheading . '</a>' .
-//                    '<div class="note-content-children">'; // <!-- open new node -->
-//            }
-//            $previousSubHeading = $segment->subheading;
-//        }
         if ($segment->heading !== $previousHeading) {
             if (!empty($previousHeading)) {
                 echo '</div></div>'; // <!-- end the previous parent section -->
             }
             if (!empty($segment->heading)) {
-                echo '<div class="note-content-node note-content-heading">' .
-                    '<div class="py-2 px-3 border-bottom font-size-16 font-weight-bold bg-light text-secondary ' . ($previousHeading ? 'mt-4 border-top' : '') . '">' . $segment->heading . '</div>' .
-                    '<div class="note-content-children ml-5 border-left">'; // <!-- open new node -->
-            }
+
+	?>
+	<div class="note-content-node note-content-heading">
+		<div class="py-2 px-3 border-bottom font-size-16 font-weight-bold bg-light text-secondary {{ $previousHeading ? 'mt-4 border-top' : '' }}">
+			{{ $segment->heading }}
+		</div>
+		<div class="note-content-children ml-5 border-left">
+			<!-- open new node -->
+        <?php
+	    }
             $previousHeading = $segment->heading;
         }
         ?>
@@ -34,12 +28,9 @@
         </div>
     @endforeach
     <?php
-//    if (!empty($previousSubHeading)) {
-//        echo '</div></div>'; // <!-- close any open parent section -->
-//    }
     if (!empty($previousHeading)) {
         echo '</div></div>'; // <!-- close any open parent section -->
     }
     ?>
 </div>
-@include('app.patient.note.segment_script')
+@include('app.patient.note.segment_script')

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

@@ -239,7 +239,7 @@
     <div style="padding: 1rem; padding-bottom: 0;">
         <p><b style="font-size: 18px">Chief Complaint</b></p>
         @if(!$ccSegment || empty(trim($ccSegment->summary_html)))
-            Unavailable
+            -
         @else
             {!! $ccSegment->summary_html !!}
         @endif

+ 8 - 8
resources/views/app/patient/note/rhs-sidebar.blade.php

@@ -19,10 +19,10 @@
             <i class="fa fa-bolt text-primary ml-1"></i>
         </div>
         @if($tracker && @($tracker->data->no_known_drug_allergies))
-            <div class="text-secondary mb-2"><span>No Known Drug Allergies</span></div>
+            <div class="text-secondary mb-2"><span>-</span></div>
         @endif
         @if($tracker && @($tracker->data->no_known_allergies_of_any_type))
-            <div class="text-secondary mb-2"><span>No Known Allergies of Any Type</span></div>
+            <div class="text-secondary mb-2"><span>-</span></div>
         @endif
         @if(!$tracker || !@($tracker->data->no_known_allergies_of_any_type))
             @if($allergies && count($allergies))
@@ -34,7 +34,7 @@
                     </div>
                 @endforeach
             @else
-                <span class="px-1 text-secondary">None</span>
+                <span class="px-1 text-secondary">-</span>
             @endif
         @endif
     </div>
@@ -49,7 +49,7 @@
             <i class="fa fa-bolt text-primary ml-1"></i>
         </div>
         @if($tracker && @($tracker->data->no_known_medications))
-            <div class="text-secondary mb-2"><span>No Known Medications</span></div>
+            <div class="text-secondary mb-2"><span>-</span></div>
         @endif
         @if(!$tracker || !@($tracker->data->no_known_medications))
             @if($medications && count($medications))
@@ -61,7 +61,7 @@
                     </div>
                 @endforeach
             @else
-                <span class="px-1 text-secondary">None</span>
+                <span class="px-1 text-secondary">-</span>
             @endif
         @endif
     </div>
@@ -84,7 +84,7 @@
                 </div>
             @endforeach
         @else
-            <span class="px-1 text-secondary">None</span>
+            <span class="px-1 text-secondary">-</span>
         @endif
     </div>
     <div id="active-goals" class="p-2 border-bottom c-pointer on-hover-aliceblue"
@@ -106,7 +106,7 @@
                 </div>
             @endforeach
         @else
-            <span class="px-1 text-secondary">None</span>
+            <span class="px-1 text-secondary">-</span>
         @endif
     </div>
     <div id="note-prescriptions" class="p-2 border-bottom c-pointer on-hover-aliceblue" data-non-segment-target="Prescriptions">
@@ -146,7 +146,7 @@
             </div>
         @endforeach
     @else
-        <span class="px-1 text-secondary">None</span>
+        <span class="px-1 text-secondary">-</span>
     @endif
 </div>
 </div>

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

@@ -1,22 +1,12 @@
 <?php $iName = $segment->segmentTemplate->internal_name; ?>
-<div class="p-3 border-bottom note-section visit-segment {{$note->is_signed_by_hcp ? '' : 'edit-trigger'}} {{strpos($iName, 'lifestyle_') === 0 && $iName !== 'lifestyle_general' ? 'zero-height' : ''}}"
+<?php $isLSSegment = strpos($iName, 'lifestyle_') === 0; ?>
+
+<div class="border-bottom note-section visit-segment {{$note->is_signed_by_hcp ? '' : 'edit-trigger'}} {{strpos($iName, 'lifestyle_') === 0 && $iName !== 'lifestyle_general' ? 'zero-height' : ''}}"
      data-segment-uid="{{ $segment->uid }}"
      data-segment-template-uid="{{ $segment->segmentTemplate->uid }}"
      data-segment-template-name="{{ $segment->segmentTemplate->internal_name }}">
 
-    <?php $isLSSegment = strpos($iName, 'lifestyle_') === 0; ?>
-
-    <div class="d-flex align-items-baseline">
-
-        <!-- show hierarchy -->
-        {{--@if($segment->heading)
-            <span class="text-secondary">{{$segment->heading}}</span>
-            <i class="text-secondary text-sm fa fa-arrow-right mx-2"></i>
-        @endif
-        @if($segment->subheading)
-            <span class="text-secondary">{{$segment->subheading}}</span>
-            <i class="text-secondary text-sm fa fa-arrow-right mx-2"></i>
-        @endif--}}
+    <div class="d-flex align-items-baseline bg-light text-secondary p-2" style="border-bottom: 1px solid #dee2e6;">
 
     <!-- title -->
 
@@ -26,13 +16,14 @@
                 <span class="on-hover-only text-left">MedRisk Vigilence</span>
             </div>
         @else
-            <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'mb-2'}}">
-                @if($isLSSegment && $iName === 'lifestyle_general')
+            <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'xxxmb-2'}}" style="">
+                <span style="color: black; text-decoration: underline; font-size: 13px;">
+		@if($isLSSegment && $iName === 'lifestyle_general')
                     Lifestyle
                 @else
                     {{$segment->display_title}}
                 @endif
-
+		</span>
                 @if($segment->heading && $iName !== 'medrisk_vigilence')
                     <span class="text-secondary ml-2 text-sm font-weight-normal">({{$segment->heading}})</span>
                 @endif
@@ -101,7 +92,7 @@
                 </a>
             @endif
 
-            @include('app/patient/note/_templates-v2-index', ['sectionInternalName' => $segment->segmentTemplate->internal_name])
+            {{--@include('app/patient/note/_templates-v2-index', ['sectionInternalName' => $segment->segmentTemplate->internal_name])--}}
 
         @endif
 
@@ -109,7 +100,7 @@
 
     <?php if(!$isLSSegment): ?>
 
-    <div class="d-none if-not-edit inset-comment summary-container {{$iName === 'medrisk_vigilence' ? 'px-0' : ''}}">
+    <div class="d-none if-not-edit inset-comment summary-container {{$iName === 'medrisk_vigilence' ? 'px-0' : 'p-2 pl-4'}}">
         {!! $segment->summary_html !!}
     </div>
 

+ 2 - 2
resources/views/app/patient/note/segment_script.blade.php

@@ -327,8 +327,8 @@
                 $(_trigger).closest('.visit-segment').find('.autosave-indicator').removeClass('show');
                 $(_trigger).closest('.visit-segment').find('.autosave-indicator.saving').addClass('show');
                 saveVisitForm(_trigger, true, false, () => {
-                    $('.autosave-indicator').removeClass('show');
-                    $('.autosave-indicator.saved').addClass('show');
+                    $(_trigger).closest('.visit-segment').find('.autosave-indicator').removeClass('show');
+                    $(_trigger).closest('.visit-segment').find('.autosave-indicator.saved').addClass('show');
                     /*window.setTimeout(() => {
                         $('.autosave-indicator').removeClass('show');
                     }, 1000);*/

+ 2 - 2
resources/views/app/patient/note/sign-confirmation.blade.php

@@ -161,13 +161,13 @@
 
         function init() {
 
-            let blockSigningMarker = $('.relevant-without-review-critical[data-target-segment]').first();
+            /*let blockSigningMarker = $('.relevant-without-review-critical[data-target-segment]').first();
             if(blockSigningMarker.length) {
                 toastr.error('A relevant problem does not contain an updated HPI/Subjective.');
                 closeStagPopup(true);
                 $('.note-tree-node [data-segment-internal-name="' + blockSigningMarker.attr('data-target-segment') + '"]').trigger('click');
                 return false;
-            }
+            }*/
 
             $('#note-sign-confirmation-{{$note->id}} .btn-sign')
                 .off('click')

+ 109 - 35
resources/views/app/patient/nutrition-center.blade.php

@@ -32,8 +32,12 @@ $points = [
 <div class="mt-3 p-3 border-top-nutrition-rx" id="nutrition-center-{{$note->id}}">
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table">
-
+        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+		<tr class="point-row">
+			<td></td>
+			<td>Subjective</td>
+			<td>Plan</td>
+		</tr>
             @foreach($points as $p)
                 <?php $point = $p['point']; ?>
                 <tr class="point-row" data-uid="{{$point ? $point->uid : ''}}">
@@ -65,45 +69,41 @@ $points = [
                         </div>
                     </td>
                     <td class="w-40">
-                        <div class="d-flex align-items-start position-relative">
-                            <div class="flex-grow-1">
-                                @if($point)
-                                    <?php
-                                    include resource_path('views/app/patient/segment-templates/_child_review/nutrition/' . $p['category'] . '/last-review.php');
-                                    ?>
-                                @else
-                                    -
-                                @endif
-                            </div>
-                            <div class="d-inline-flex flex-column ml-1">
+                        <div if-read-mode>
+                            @if($point)
                                 <?php
-                                $segment = $note->getSegmentByInternalName('intake_nutrition');
-                                if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_review/nutrition/' . $p['category'] . '/edit-review.php');
-                                }
+                                include resource_path('views/app/patient/segment-templates/_child_review/nutrition/' . $p['category'] . '/last-review.php');
                                 ?>
-                            </div>
+                            @else
+                                -
+                            @endif
+                        </div>
+                        <div if-edit-mode>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_nutrition');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_review/nutrition/' . $p['category'] . '/edit-review.php');
+                            }
+                            ?>
                         </div>
                     </td>
                     <td class="w-40">
-                        <div class="d-flex align-items-start position-relative">
-                            <div class="flex-grow-1">
-                                @if($point)
-                                    <?php
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/nutrition/' . $p['category'] . '/last-plan.php');
-                                    ?>
-                                @else
-                                    -
-                                @endif
-                            </div>
-                            <div class="d-inline-flex flex-column ml-1">
+                        <div if-read-mode>
+                            @if($point)
                                 <?php
-                                $segment = $note->getSegmentByInternalName('plan_nutrition');
-                                if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/nutrition/' . $p['category'] . '/edit-plan.php');
-                                }
+                                include resource_path('views/app/patient/segment-templates/_child_plan/nutrition/' . $p['category'] . '/last-plan.php');
                                 ?>
-                            </div>
+                            @else
+                                -
+                            @endif
+                        </div>
+                        <div if-edit-mode>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_nutrition');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_plan/nutrition/' . $p['category'] . '/edit-plan.php');
+                            }
+                            ?>
                         </div>
                     </td>
                 </tr>
@@ -116,11 +116,85 @@ $points = [
 <script>
     (function() {
         function init() {
+
+            let mode = 'read';
+
             let parentSegment = $('#nutrition-center-{{$note->id}}');
             @include('app.patient.wizard-partials.common-script', ['label' => 'nutrition', 'segment_part' => 'nutrition'])
             initSegmentMoes(parentSegment);
             __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
+
+            // custom buttons on title bar
+            $('.button-container').remove();
+            let buttonContainer = $('<div/>').addClass('button-container ml-4 mr-auto');
+            let titleElem = $('#nutrition-center-{{$note->id}}').closest('.stag-popup').find('.stag-popup-title>span');
+            titleElem.next().removeClass('ml-auto');
+            titleElem.parent().addClass('align-items-center');
+
+            // add button for "Edit Mode"
+            $('.btn-toggle-edit-mode').remove();
+            let button = $('<a href="#" native target="_blank" data-mode="read" ' +
+                'class="btn-toggle-edit-mode btn btn-sm mr-2 btn-info text-white font-weight-bold shadow-none">Switch to Edit Mode</a>')
+                .appendTo(buttonContainer);
+
+            $('<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">' +
+                    '<i class="fa fa-check"></i>' +
+                    ' Saved' +
+                '</span>' +
+            '</div>').appendTo(buttonContainer);
+
+            buttonContainer.insertAfter(titleElem);
+
+            button
+                .off('click.toggle-edit')
+                .on('click.toggle-edit', function () {
+                    if (mode === 'read') {
+                        mode = 'edit';
+                        $(this).text('Back to Read Mode');
+                        $('#nutrition-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
+                    } else {
+                        refreshDynamicStagPopup();
+                    }
+                    return false;
+                });
+
+            // HACK: create empty top-level points if not existing
+            let createCalls = [];
+
+            <?php
+            $missing = [];
+            foreach ($points as $p) {
+                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
+                }
+                ?>
+                Promise.all(createCalls).then(() => {
+                    refreshDynamicStagPopup();
+                });
+                <?php
+            }
+            ?>
+
         }
         addMCInitializer('nutrition-center-{{$note->id}}', init, '#nutrition-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>

+ 68 - 2
resources/views/app/patient/problems-center.blade.php

@@ -3,14 +3,22 @@
 use App\Models\Point;
 use App\Models\Client;
 use App\Models\Note;
-use App\Models\Segment;
+use App\Models\Pro;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var Pro $pro */
 
 list($problems, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
 $ccSegment = $note->getSegmentByInternalName('chief_complaint');
 $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
+$favorites = $pro->favoritesByCategoryDecoded('problem');
+function isFavoriteProblem($_problem, $_favorites) {
+    foreach($_favorites as $favorite) {
+        if($favorite->data->name === $_problem->data->name) return $favorite->uid;
+    }
+    return false;
+}
 ?>
 
 <div class="mt-3 p-3 border-top min-height-500px" id="problems-center-{{$note->id}}">
@@ -44,6 +52,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
             <?php $prevRowState = -1; ?>
             <?php foreach($problems as $problem): ?>
             <?php $point = $problem; ?>
+            <?php $favoriteUid = isFavoriteProblem($problem, $favorites); ?>
             @if($prevRowState !== $problem->state)
                 @include('app.patient.wizard-partials.state-row', ['point' => $problem])
             @endif
@@ -72,6 +81,30 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                                 </div>
                             @endif
                         </div>
+                        <div class="ml-auto mr-1">
+                            <div moe>
+                                @if(!$favoriteUid)
+                                    <form show url="/api/proFavorite/create">
+                                        <input type="hidden" name="proUid" value="{{$pro->uid}}">
+                                        <input type="hidden" name="category" value="problem">
+                                        <input type="hidden" data-name="dxid" value="{{@$problem->data->dxid}}">
+                                        <input type="hidden" data-name="icd" value="{{@$problem->data->icd}}">
+                                        <input type="hidden" data-name="icd-type" value="{{@$problem->data->{'icd-type'} }}">
+                                        <textarea class="d-none" name="data">{!! json_encode(["name" => @($problem->data->name), "dxid" => @($problem->data->dxid), "icd" => @($problem->data->icd), "icd-type" => @($problem->data->{'icd-type'})]) !!}</textarea>
+                                        <button submit class="outline-0 shadow-none border-0 bg-transparent p-0 text-secondary-light" title="Add to common">
+                                            <i class="fa fa-bookmark"></i>
+                                        </button>
+                                    </form>
+                                @else
+                                    <form show url="/api/proFavorite/remove">
+                                        <input type="hidden" name="uid" value="{{$favoriteUid}}">
+                                        <button submit class="outline-0 shadow-none border-0 bg-transparent p-0 text-info" title="Remove from common">
+                                            <i class="fa fa-bookmark"></i>
+                                        </button>
+                                    </form>
+                                @endif
+                            </div>
+                        </div>
                     </div>
                 </td>
                 <td>
@@ -218,7 +251,28 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
 
                     <div class="row">
                         <div class="col-8">
-                            <p class="mb-2"><b>Add Problem</b></p>
+                            <div class="d-flex align-items-baseline mb-2">
+                                <b>Add Problem</b>
+                                @if(count($favorites))
+                                    <div class="d-inline position-relative on-click-menu ml-4">
+                                        <span class="text-primary c-pointer">
+                                            <i class="fa fa-bookmark text-info mr-1"></i> Common Problems <i class="ml-1 fa fa-caret-down"></i>
+                                        </span>
+                                        <div menu right class="bg-white border">
+                                            @foreach($favorites as $favorite)
+                                                <a native target="_blank" href="#"
+                                                   data-name="{{@($favorite->data->name)}}"
+                                                   data-dxid="{{@($favorite->data->dxid)}}"
+                                                   data-icd="{{@($favorite->data->icd)}}"
+                                                   data-icd-type="{{@($favorite->data->{'icd-type'})}}"
+                                                   class="px-2 py-1 d-block text-nowrap text-sm favorite-item">
+                                                    {{$favorite->data->name}}
+                                                </a>
+                                            @endforeach
+                                        </div>
+                                    </div>
+                                @endif
+                            </div>
                             <div class="row mb-2">
                                 <div class="col-8 pr-0">
                                     <label class="text-sm mb-0 font-weight-bold">Name</label>
@@ -331,6 +385,18 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
             @if(trim(request()->input('dx')))
                 parentSegment.find('input[stag-suggest][data-name="name"]').focus().trigger('keydown')[0].scrollIntoView();
             @endif
+
+
+            parentSegment.find('.favorite-item')
+                .off('click.add-from-favorite')
+                .on('click.add-from-favorite', function () {
+                    $('#frm-add-problem').find('input[data-name="name"]').val($(this).attr('data-name'));
+                    $('#frm-add-problem').find('input[data-name="dxid"]').val($(this).attr('data-dxid'));
+                    $('#frm-add-problem').find('input[data-name="icd"]').val($(this).attr('data-icd')).removeAttr('readonly');
+                    $('#frm-add-problem').find('input[data-name="icd-type"]').val($(this).attr('data-icd-type'));
+                    $(this).closest('.on-click-menu').find('[menu]').hide();
+                    return false;
+                });
         }
         addMCInitializer('problems-center-{{$note->id}}', init, '#problems-center-{{$note->id}}');
     }).call(window);

+ 6 - 106
resources/views/app/patient/segment-templates/_child_plan/behavior/CRAVINGS/edit-plan.php

@@ -1,108 +1,8 @@
-<?php
+<p class="mb-2"><b>Change Goal</b></p>
 
-/*
-Format:
-{
-    sugar: bool,
-    starches: bool,
-    friedFood: bool,
-    sweetDrinks: bool,
-    other: bool,
-    otherDetail: text
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Change Goal</b></p>
-
-        <div class="mb-2">
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
-        </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
+<div class="mb-2">
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this plan?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
-    </div>
-<?php endif; ?>
-

+ 6 - 105
resources/views/app/patient/segment-templates/_child_plan/behavior/FOOD_TRIGGERS/edit-plan.php

@@ -1,107 +1,8 @@
-<?php
+<p class="mb-2"><b>Change Goal</b></p>
 
-/*
-Format:
-{
-    stress: bool,
-    work: bool,
-    social: bool,
-    reward: bool,
-    relaxation: bool,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Change Goal</b></p>
-
-        <div class="mb-2">
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
-        </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
+<div class="mb-2">
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this plan?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
-    </div>
-<?php endif; ?>
-

+ 62 - 169
resources/views/app/patient/segment-templates/_child_plan/behavior/SELF_MONITORING/edit-plan.php

@@ -1,180 +1,73 @@
-<?php
+<p class="mb-2"><b>Self Monitoring</b></p>
 
-/*
-Format:
-{
-    weighInsPerWeek: number,
-    tracking: {
-        calorieIntake: bool,
-        dailyCarbIntake: bool,
-        portionSize: bool,
-        eatingSpeed: bool,
-        other: bool
-        otherDetail: text
-    },
-    foodMonitoring: {
-        phoneTracker: bool,
-        dailyFoodLog: bool
-    }
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Self Monitoring</b></p>
+<div class="mb-2 d-flex align-items-center">
+    <label class="my-0 mr-2">Number of weigh-ins per week:</label>
+    <input type="text" data-name="weighInsPerWeek" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->weighInsPerWeek) ?>">
+</div>
 
-        <div class="mb-2 d-flex align-items-center">
-            <label class="my-0 mr-2">Number of weigh-ins per week:</label>
-            <input type="text" data-name="weighInsPerWeek" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->weighInsPerWeek) ?>">
+<div class="mb-2">
+    <label class="mb-2 font-weight-bold text-secondary">Track the following:</label>
+    <div class="row mb-1">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->calorieIntake" <?= @($currentValue->tracking->calorieIntake) ? 'checked' : ''?>>
+                <span class="ml-2">Calorie Intake</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label class="mb-2 font-weight-bold text-secondary">Track the following:</label>
-            <div class="row mb-1">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->calorieIntake" <?= @($currentValue->tracking->calorieIntake) ? 'checked' : ''?>>
-                        <span class="ml-2">Calorie Intake</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->dailyCarbIntake" <?= @($currentValue->tracking->dailyCarbIntake) ? 'checked' : ''?>>
-                        <span class="ml-2">Daily Carb Intake</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->portionSize" <?= @($currentValue->tracking->portionSize) ? 'checked' : ''?>>
-                        <span class="ml-2">Portion Size</span>
-                    </label>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->eatingSpeed" <?= @($currentValue->tracking->eatingSpeed) ? 'checked' : ''?>>
-                        <span class="ml-2">Eating Speed</span>
-                    </label>
-                </div>
-                <div class="col-8">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->other" <?= @($currentValue->tracking->other) ? 'checked' : ''?>>
-                        <span class="ml-2">Other</span>
-                        <input if-tracking-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="tracking->otherDetail" value="<?= @($currentValue->tracking->otherDetail) ?>">
-                    </label>
-                </div>
-            </div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->dailyCarbIntake" <?= @($currentValue->tracking->dailyCarbIntake) ? 'checked' : ''?>>
+                <span class="ml-2">Daily Carb Intake</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label class="mb-2 font-weight-bold text-secondary">Food monitoring:</label>
-            <div class="row">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="foodMonitoring->phoneTracker" <?= @($currentValue->foodMonitoring->phoneTracker) ? 'checked' : ''?>>
-                        <img src="/img/behavior-rx/phone-tracker.png" class="icon-nutrition-rx-md mx-2">
-                        <span class="">Phone Tracker</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="foodMonitoring->dailyFoodLog" <?= @($currentValue->foodMonitoring->dailyFoodLog) ? 'checked' : ''?>>
-                        <img src="/img/behavior-rx/food-log.png" class="icon-nutrition-rx-md mx-2">
-                        <span class="">Daily Food Log</span>
-                    </label>
-                </div>
-            </div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->portionSize" <?= @($currentValue->tracking->portionSize) ? 'checked' : ''?>>
+                <span class="ml-2">Portion Size</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
+    </div>
+    <div class="row">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->eatingSpeed" <?= @($currentValue->tracking->eatingSpeed) ? 'checked' : ''?>>
+                <span class="ml-2">Eating Speed</span>
+            </label>
         </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        <div class="col-8">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->other" <?= @($currentValue->tracking->other) ? 'checked' : ''?>>
+                <span class="ml-2">Other</span>
+                <input if-tracking-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="tracking->otherDetail" value="<?= @($currentValue->tracking->otherDetail) ?>">
+            </label>
         </div>
-    </form>
+    </div>
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this plan?</p>
 
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
+<div class="mb-2">
+    <label class="mb-2 font-weight-bold text-secondary">Food monitoring:</label>
+    <div class="row">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="foodMonitoring->phoneTracker" <?= @($currentValue->foodMonitoring->phoneTracker) ? 'checked' : ''?>>
+                <img src="/img/behavior-rx/phone-tracker.png" class="icon-nutrition-rx-md mx-2">
+                <span class="">Phone Tracker</span>
+            </label>
+        </div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="foodMonitoring->dailyFoodLog" <?= @($currentValue->foodMonitoring->dailyFoodLog) ? 'checked' : ''?>>
+                <img src="/img/behavior-rx/food-log.png" class="icon-nutrition-rx-md mx-2">
+                <span class="">Daily Food Log</span>
+            </label>
+        </div>
     </div>
-<?php endif; ?>
+</div>
 
+<div class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
+</div>

+ 11 - 105
resources/views/app/patient/segment-templates/_child_plan/behavior/SLEEP_HABITS/edit-plan.php

@@ -1,109 +1,15 @@
-<?php
+<p class="mb-2"><b>Sleep Habits</b></p>
 
-/*
-Format:
-{
-    hoursOfSleep: number,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Sleep Habits</b></p>
-
-        <div class="mb-2 d-flex align-items-center">
-            <label class="my-0 mr-2">Hours of sleep:</label>
-            <input type="text" data-name="hoursOfSleep" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->hoursOfSleep) ?>">
-        </div>
-
-        <div class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
-        </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
+<div class="mb-2 d-flex align-items-center">
+    <label class="my-0 mr-2">Hours of sleep:</label>
+    <input type="text" data-name="hoursOfSleep" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->hoursOfSleep) ?>">
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
-            <p class="mb-2">Delete this plan?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
-    </div>
-<?php endif; ?>
+<div class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
+</div>
 

+ 15 - 0
resources/views/app/patient/segment-templates/_child_plan/delete-plan.php

@@ -0,0 +1,15 @@
+<div visit-moe relative class="d-block">
+    <a start show href="#" class="px-1 text-left" title="Delete Plan">
+        Delete Plan
+    </a>
+    <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
+        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+
+        <p class="mb-2">Delete this plan?</p>
+
+        <div>
+            <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>

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

@@ -44,7 +44,7 @@ else {
         <?php if($previousValue): ?>
         <div class="mb-2">
             <div class="d-flex align-items-baseline mb-1">
-                <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
             </div>
             <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
         </div>

+ 181 - 311
resources/views/app/patient/segment-templates/_child_plan/exercise/AEROBIC_ACTIVITY/edit-plan.php

@@ -1,315 +1,185 @@
-<?php
+<p class="mb-2"><b>Change Goal:</b></p>
 
-/*
-Format:
-{
-    active: true/false,
-    walk: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    jog: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    elliptical: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    swim: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    bike: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    memo: text
-}
- */
+<label class="mb-2 d-flex align-items-center">
+    <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
+    <span class="ml-2">Prescribe aerobic activities?</span>
+</label>
 
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
+<table if-active class="table table-sm table-bordered">
+    <tbody>
+    <tr class="bg-light">
+        <td class="align-bottom">Activity</td>
+        <td class="align-bottom">Frequency<br>(days/wk)</td>
+        <td class="align-bottom">Intensity</td>
+        <td class="align-bottom">Time<br>(mins/day)</td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="walk->active" <?= @($currentValue->walk->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Walk</span>
+                <img src="/img/exercise-rx/walk.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-walk-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="walk->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->walk->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->walk->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->walk->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->walk->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->walk->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->walk->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->walk->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-walk-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="walk->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->walk->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->walk->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->walk->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-walk-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="walk->time" value="<?= @($currentValue->walk->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="jog->active" <?= @($currentValue->jog->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Jog</span>
+                <img src="/img/exercise-rx/jog.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-jog-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="jog->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->jog->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->jog->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->jog->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->jog->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->jog->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->jog->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->jog->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-jog-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="jog->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->jog->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->jog->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->jog->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-jog-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="jog->time" value="<?= @($currentValue->jog->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="elliptical->active" <?= @($currentValue->elliptical->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Elliptical</span>
+                <img src="/img/exercise-rx/elliptical.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="elliptical->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->elliptical->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->elliptical->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->elliptical->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->elliptical->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->elliptical->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->elliptical->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->elliptical->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="elliptical->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->elliptical->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->elliptical->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->elliptical->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-elliptical-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="elliptical->time" value="<?= @($currentValue->elliptical->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="swim->active" <?= @($currentValue->swim->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Swim</span>
+                <img src="/img/exercise-rx/swim.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-swim-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="swim->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->swim->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->swim->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->swim->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->swim->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->swim->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->swim->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->swim->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-swim-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="swim->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->swim->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->swim->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->swim->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-swim-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="swim->time" value="<?= @($currentValue->swim->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="bike->active" <?= @($currentValue->bike->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Bike</span>
+                <img src="/img/exercise-rx/bike.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-bike-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="bike->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->bike->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->bike->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->bike->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->bike->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->bike->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->bike->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->bike->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-bike-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="bike->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->bike->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->bike->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->bike->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-bike-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="bike->time" value="<?= @($currentValue->bike->time) ?>">
+        </td>
+    </tr>
+    </tbody>
+</table>
 
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Change Goal:</b></p>
-
-        <label class="mb-2 d-flex align-items-center">
-            <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
-            <span class="ml-2">Prescribe aerobic activities?</span>
-        </label>
-
-        <table if-active class="table table-sm table-bordered" style="table-layout: fixed">
-            <tbody>
-            <tr>
-                <td class="align-middle">Activity</td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="walk->active" <?= @($currentValue->walk->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/walk.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->walk->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="walk" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->walk->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Walk
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="jog->active" <?= @($currentValue->jog->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/jog.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->jog->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="jog" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->jog->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Jog
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="elliptical->active" <?= @($currentValue->elliptical->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/elliptical.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->elliptical->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="elliptical" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->elliptical->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Elliptical
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="swim->active" <?= @($currentValue->swim->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/swim.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->swim->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="swim" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->swim->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Swim
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="bike->active" <?= @($currentValue->bike->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/bike.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->bike->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="bike" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->bike->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Bike
-                        </button>
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td>Frequency (days/wk)</td>
-                <td>
-                    <select if-walk-active class="form-control form-control-sm min-width-unset px-0" data-name="walk->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->walk->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->walk->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->walk->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->walk->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->walk->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->walk->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->walk->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-jog-active class="form-control form-control-sm min-width-unset px-0" data-name="jog->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->jog->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->jog->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->jog->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->jog->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->jog->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->jog->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->jog->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0" data-name="elliptical->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->elliptical->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->elliptical->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->elliptical->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->elliptical->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->elliptical->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->elliptical->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->elliptical->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-swim-active class="form-control form-control-sm min-width-unset px-0" data-name="swim->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->swim->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->swim->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->swim->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->swim->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->swim->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->swim->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->swim->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-bike-active class="form-control form-control-sm min-width-unset px-0" data-name="bike->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->bike->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->bike->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->bike->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->bike->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->bike->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->bike->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->bike->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-            </tr>
-            <tr>
-                <td>Intensity</td>
-                <td>
-                    <select if-walk-active class="form-control form-control-sm min-width-unset px-0" data-name="walk->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->walk->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->walk->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->walk->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-jog-active class="form-control form-control-sm min-width-unset px-0" data-name="jog->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->jog->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->jog->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->jog->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0" data-name="elliptical->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->elliptical->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->elliptical->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->elliptical->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-swim-active class="form-control form-control-sm min-width-unset px-0" data-name="swim->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->swim->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->swim->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->swim->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-bike-active class="form-control form-control-sm min-width-unset px-0" data-name="bike->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->bike->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->bike->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->bike->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-            </tr>
-            <tr>
-                <td>Time (mins/day)</td>
-                <td>
-                    <input if-walk-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="walk->time" value="<?= @($currentValue->walk->time) ?>">
-                </td>
-                <td>
-                    <input if-jog-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="jog->time" value="<?= @($currentValue->jog->time) ?>">
-                </td>
-                <td>
-                    <input if-elliptical-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="elliptical->time" value="<?= @($currentValue->elliptical->time) ?>">
-                </td>
-                <td>
-                    <input if-swim-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="swim->time" value="<?= @($currentValue->swim->time) ?>">
-                </td>
-                <td>
-                    <input if-bike-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="bike->time" value="<?= @($currentValue->bike->time) ?>">
-                </td>
-            </tr>
-            </tbody>
-        </table>
-
-        <div if-active class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
-        </div>
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
+<div if-active class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this plan?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
-    </div>
-<?php endif; ?>
-

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/exercise/AEROBIC_ACTIVITY/last-plan.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 32 - 130
resources/views/app/patient/segment-templates/_child_plan/exercise/NEAT/edit-plan.php

@@ -1,132 +1,34 @@
-<?php
-
-/*
-Format:
-{
-    active: true/false,
-    parkAway: true/false,
-    stairsInsteadOfElevators: true/false,
-    standInsteadOfSit: true/false,
-    stepsGoals: number,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Change Goal:</b></p>
-
-        <label class="mb-2 d-flex align-items-center">
-            <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
-            <span class="ml-2">Prescribe Non-Exercise Activity Time (NEAT) Instructions?</span>
-        </label>
-
-        <div if-active>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="parkAway" <?= @($currentValue->parkAway) ? 'checked' : ''?>>
-                <span class="ml-2">Park away from entrances</span>
-            </label>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="stairsInsteadOfElevators" <?= @($currentValue->stairsInsteadOfElevators) ? 'checked' : ''?>>
-                <span class="ml-2">Take the stairs instead of elevator/escalator</span>
-            </label>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="standInsteadOfSit" <?= @($currentValue->standInsteadOfSit) ? 'checked' : ''?>>
-                <span class="ml-2">Prefer standing over sitting</span>
-            </label>
-            <div class="row mb-2">
-                <div class="col-6">
-                    <label class="mb-1">Steps/day goal</label>
-                    <input type="text" data-name="stepsGoals" class="form-control form-control-sm" value="<?= @($currentValue->stepsGoals) ?>">
-                </div>
-            </div>
-            <div class="mb-2">
-                <label for="" class="mb-1">Other</label>
-                <div note-rte slim-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                     data-field-name="memo"><?= @($currentValue->memo) ?></div>
-            </div>
+<p class="mb-2"><b>Change Goal:</b></p>
+
+<label class="mb-2 d-flex align-items-center">
+    <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
+    <span class="ml-2">Prescribe Non-Exercise Activity Time (NEAT) Instructions?</span>
+</label>
+
+<div if-active>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="parkAway" <?= @($currentValue->parkAway) ? 'checked' : ''?>>
+        <span class="ml-2">Park away from entrances</span>
+    </label>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="stairsInsteadOfElevators" <?= @($currentValue->stairsInsteadOfElevators) ? 'checked' : ''?>>
+        <span class="ml-2">Take the stairs instead of elevator/escalator</span>
+    </label>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="standInsteadOfSit" <?= @($currentValue->standInsteadOfSit) ? 'checked' : ''?>>
+        <span class="ml-2">Prefer standing over sitting</span>
+    </label>
+    <div class="row mb-2">
+        <div class="col-6">
+            <label class="mb-1">Steps/day goal</label>
+            <input type="text" data-name="stepsGoals" class="form-control form-control-sm" value="<?= @($currentValue->stepsGoals) ?>">
         </div>
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
-</div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this plan?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     </div>
-<?php endif; ?>
-
+    <div class="mb-2">
+        <label for="" class="mb-1">Other</label>
+        <div note-rte slim-rte
+             class="form-group mb-2 border-left border-right rte-holder"
+             data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+             data-field-name="memo"><?= @($currentValue->memo) ?></div>
+    </div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/exercise/NEAT/last-plan.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 35 - 134
resources/views/app/patient/segment-templates/_child_plan/exercise/STRENGTH_TRAINING/edit-plan.php

@@ -1,137 +1,38 @@
-<?php
-
-/*
-Format:
-{
-    active: true/false,
-    muscleStrengthening: true/false,
-    allMajorMuscleGroups: true/false,
-    reps: number,
-    sets: number,
-    resistanceBandsBodyWeight: true/false,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildPlan = null;
-if (@$point) {
-    if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildPlan->data);
-        $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
-            ->where('category', 'PLAN')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-    else {
-        $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'PLAN')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildPlan && $previousChildPlan->data) {
-            $previousValue = json_decode($previousChildPlan->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildPlan' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="DURING_VISIT">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childPlanData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $plan = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Change Goal:</b></p>
-
-        <label class="mb-2 d-flex align-items-center">
-            <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
-            <span class="ml-2">Prescribe strength training?</span>
-        </label>
-
-        <div if-active>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="muscleStrengthening" <?= @($currentValue->muscleStrengthening) ? 'checked' : ''?>>
-                <span class="ml-2">Do muscle strengthening exercises on moderate or greater intensity at least two days per week</span>
-            </label>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="allMajorMuscleGroups" <?= @($currentValue->allMajorMuscleGroups) ? 'checked' : ''?>>
-                <span class="ml-2">Do exercises to strengthen all major muscle groups: legs, hips, back, chest, abdomen, shoulders and arms</span>
-            </label>
-            <div class="row mb-2">
-                <div class="col-6">
-                    <label class="mb-1">Number of sets for each exercise</label>
-                    <input type="text" data-name="sets" class="form-control form-control-sm" value="<?= @($currentValue->sets) ?>">
-                </div>
-                <div class="col-6">
-                    <label class="mb-1">Number of repetitions per set</label>
-                    <input type="text" data-name="reps" class="form-control form-control-sm" value="<?= @($currentValue->reps) ?>">
-                </div>
-            </div>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="resistanceBandsBodyWeight" <?= @($currentValue->resistanceBandsBodyWeight) ? 'checked' : ''?>>
-                <span class="ml-2">Use resistance bands or using body weight to do exercises</span>
-            </label>
-            <div if-active class="mb-2">
-                <label for="" class="mb-1">Memo</label>
-                <div note-rte slim-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
-                     data-field-name="memo"><?= @($currentValue->memo) ?></div>
-            </div>
+<p class="mb-2"><b>Change Goal:</b></p>
+
+<label class="mb-2 d-flex align-items-center">
+    <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
+    <span class="ml-2">Prescribe strength training?</span>
+</label>
+
+<div if-active>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="muscleStrengthening" <?= @($currentValue->muscleStrengthening) ? 'checked' : ''?>>
+        <span class="ml-2">Do muscle strengthening exercises on moderate or greater intensity at least two days per week</span>
+    </label>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="allMajorMuscleGroups" <?= @($currentValue->allMajorMuscleGroups) ? 'checked' : ''?>>
+        <span class="ml-2">Do exercises to strengthen all major muscle groups: legs, hips, back, chest, abdomen, shoulders and arms</span>
+    </label>
+    <div class="row mb-2">
+        <div class="col-6">
+            <label class="mb-1">Number of sets for each exercise</label>
+            <input type="text" data-name="sets" class="form-control form-control-sm" value="<?= @($currentValue->sets) ?>">
         </div>
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        <div class="col-6">
+            <label class="mb-1">Number of repetitions per set</label>
+            <input type="text" data-name="reps" class="form-control form-control-sm" value="<?= @($currentValue->reps) ?>">
         </div>
-    </form>
-</div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this plan?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     </div>
-<?php endif; ?>
-
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="resistanceBandsBodyWeight" <?= @($currentValue->resistanceBandsBodyWeight) ? 'checked' : ''?>>
+        <span class="ml-2">Use resistance bands or using body weight to do exercises</span>
+    </label>
+    <div if-active class="mb-2">
+        <label for="" class="mb-1">Memo</label>
+        <div note-rte slim-rte
+             class="form-group mb-2 border-left border-right rte-holder"
+             data-container-name="<?= $point ? 'data' : 'childPlanData' ?>"
+             data-field-name="memo"><?= @($currentValue->memo) ?></div>
+    </div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/exercise/STRENGTH_TRAINING/last-plan.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/last-plan.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CALORIES/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CALORIES/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CARBOHYDRATES/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/DAILY_INTAKE_CARBOHYDRATES/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/FAST_FOOD/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/FAST_FOOD/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/HIGH_SUGAR_BEVERAGES/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/HIGH_SUGAR_BEVERAGES/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/PORTION_SIZES/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/PORTION_SIZES/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/SNACKS/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/SNACKS/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/VEGETABLES/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/VEGETABLES/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 41
resources/views/app/patient/segment-templates/_child_plan/nutrition/WATER_INTAKE/edit-plan.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Change goal:</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-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>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
 
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Change goal:</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="planValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Plan">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Plan">
+            Delete Plan
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this plan?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_plan/nutrition/WATER_INTAKE/last-plan.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 42 - 142
resources/views/app/patient/segment-templates/_child_review/behavior/CRAVINGS/edit-review.php

@@ -1,147 +1,47 @@
-<?php
-
-/*
-Format:
-{
-    sugar: bool,
-    starches: bool,
-    friedFood: bool,
-    sweetDrinks: bool,
-    other: bool,
-    otherDetail: text
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Current Cravings</b></p>
-
-        <div class="mb-2">
-            <div class="row mb-1">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="sugar" <?= @($currentValue->sugar) ? 'checked' : ''?>>
-                        <span class="mx-2">Sugar</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="starches" <?= @($currentValue->starches) ? 'checked' : ''?>>
-                        <span class="mx-2">Starches</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="friedFood" <?= @($currentValue->friedFood) ? 'checked' : ''?>>
-                        <span class="mx-2">Fried Food</span>
-                    </label>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="sweetDrinks" <?= @($currentValue->sweetDrinks) ? 'checked' : ''?>>
-                        <span class="mx-2">Sweet Drinks</span>
-                    </label>
-                </div>
-                <div class="col-8">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="other" <?= @($currentValue->other) ? 'checked' : ''?>>
-                        <span class="ml-2">Other</span>
-                        <input if-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="otherDetail" value="<?= @($currentValue->otherDetail) ?>">
-                    </label>
-                </div>
-            </div>
+<p class="mb-2"><b>Current Cravings</b></p>
+
+<div class="mb-2">
+    <div class="row mb-1">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="sugar" <?= @($currentValue->sugar) ? 'checked' : ''?>>
+                <span class="mx-2">Sugar</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="starches" <?= @($currentValue->starches) ? 'checked' : ''?>>
+                <span class="mx-2">Starches</span>
+            </label>
         </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="friedFood" <?= @($currentValue->friedFood) ? 'checked' : ''?>>
+                <span class="mx-2">Fried Food</span>
+            </label>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="sweetDrinks" <?= @($currentValue->sweetDrinks) ? 'checked' : ''?>>
+                <span class="mx-2">Sweet Drinks</span>
+            </label>
+        </div>
+        <div class="col-8">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="other" <?= @($currentValue->other) ? 'checked' : ''?>>
+                <span class="ml-2">Other</span>
+                <input if-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="otherDetail" value="<?= @($currentValue->otherDetail) ?>">
+            </label>
         </div>
-    </form>
-</div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     </div>
-<?php endif; ?>
+</div>
 
+<div class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/behavior/CRAVINGS/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 46 - 145
resources/views/app/patient/segment-templates/_child_review/behavior/FOOD_TRIGGERS/edit-review.php

@@ -1,150 +1,51 @@
-<?php
-
-/*
-Format:
-{
-    stress: bool,
-    work: bool,
-    social: bool,
-    reward: bool,
-    relaxation: bool,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Current Food Triggers</b></p>
-
-        <div class="mb-2">
-            <div class="row mb-1">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="stress" <?= @($currentValue->stress) ? 'checked' : ''?>>
-                        <span class="mx-2">Stress</span>
-                        <img src="/img/behavior-rx/stress.png" class="icon-nutrition-rx-row">
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="work" <?= @($currentValue->work) ? 'checked' : ''?>>
-                        <span class="mx-2">Work</span>
-                        <img src="/img/behavior-rx/work.png" class="icon-nutrition-rx-row">
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="social" <?= @($currentValue->social) ? 'checked' : ''?>>
-                        <span class="mx-2">Social</span>
-                        <img src="/img/behavior-rx/social.png" class="icon-nutrition-rx-row">
-                    </label>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="reward" <?= @($currentValue->reward) ? 'checked' : ''?>>
-                        <span class="mx-2">Reward</span>
-                        <img src="/img/behavior-rx/reward.png" class="icon-nutrition-rx-row">
-                    </label>
-                </div>
-                <div class="col-8">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="relaxation" <?= @($currentValue->relaxation) ? 'checked' : ''?>>
-                        <span class="mx-2">Relaxation</span>
-                        <img src="/img/behavior-rx/relaxation.png" class="icon-nutrition-rx-row">
-                    </label>
-                </div>
-            </div>
+<p class="mb-2"><b>Current Food Triggers</b></p>
+
+<div class="mb-2">
+    <div class="row mb-1">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="stress" <?= @($currentValue->stress) ? 'checked' : ''?>>
+                <span class="mx-2">Stress</span>
+                <img src="/img/behavior-rx/stress.png" class="icon-nutrition-rx-row">
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="work" <?= @($currentValue->work) ? 'checked' : ''?>>
+                <span class="mx-2">Work</span>
+                <img src="/img/behavior-rx/work.png" class="icon-nutrition-rx-row">
+            </label>
         </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="social" <?= @($currentValue->social) ? 'checked' : ''?>>
+                <span class="mx-2">Social</span>
+                <img src="/img/behavior-rx/social.png" class="icon-nutrition-rx-row">
+            </label>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="reward" <?= @($currentValue->reward) ? 'checked' : ''?>>
+                <span class="mx-2">Reward</span>
+                <img src="/img/behavior-rx/reward.png" class="icon-nutrition-rx-row">
+            </label>
+        </div>
+        <div class="col-8">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="relaxation" <?= @($currentValue->relaxation) ? 'checked' : ''?>>
+                <span class="mx-2">Relaxation</span>
+                <img src="/img/behavior-rx/relaxation.png" class="icon-nutrition-rx-row">
+            </label>
         </div>
-    </form>
-</div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     </div>
-<?php endif; ?>
+</div>
 
+<div class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/behavior/FOOD_TRIGGERS/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 62 - 169
resources/views/app/patient/segment-templates/_child_review/behavior/SELF_MONITORING/edit-review.php

@@ -1,180 +1,73 @@
-<?php
+<p class="mb-2"><b>Self Monitoring</b></p>
 
-/*
-Format:
-{
-    weighInsPerWeek: number,
-    tracking: {
-        calorieIntake: bool,
-        dailyCarbIntake: bool,
-        portionSize: bool,
-        eatingSpeed: bool,
-        other: bool
-        otherDetail: text
-    },
-    foodMonitoring: {
-        phoneTracker: bool,
-        dailyFoodLog: bool
-    }
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Self Monitoring</b></p>
+<div class="mb-2 d-flex align-items-center">
+    <label class="my-0 mr-2">Current number of weigh-ins per week:</label>
+    <input type="text" data-name="weighInsPerWeek" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->weighInsPerWeek) ?>">
+</div>
 
-        <div class="mb-2 d-flex align-items-center">
-            <label class="my-0 mr-2">Current number of weigh-ins per week:</label>
-            <input type="text" data-name="weighInsPerWeek" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->weighInsPerWeek) ?>">
+<div class="mb-2">
+    <label class="mb-2 font-weight-bold text-secondary">Currently tracking:</label>
+    <div class="row mb-1">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->calorieIntake" <?= @($currentValue->tracking->calorieIntake) ? 'checked' : ''?>>
+                <span class="ml-2">Calorie Intake</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label class="mb-2 font-weight-bold text-secondary">Currently tracking:</label>
-            <div class="row mb-1">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->calorieIntake" <?= @($currentValue->tracking->calorieIntake) ? 'checked' : ''?>>
-                        <span class="ml-2">Calorie Intake</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->dailyCarbIntake" <?= @($currentValue->tracking->dailyCarbIntake) ? 'checked' : ''?>>
-                        <span class="ml-2">Daily Carb Intake</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->portionSize" <?= @($currentValue->tracking->portionSize) ? 'checked' : ''?>>
-                        <span class="ml-2">Portion Size</span>
-                    </label>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->eatingSpeed" <?= @($currentValue->tracking->eatingSpeed) ? 'checked' : ''?>>
-                        <span class="ml-2">Eating Speed</span>
-                    </label>
-                </div>
-                <div class="col-8">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="tracking->other" <?= @($currentValue->tracking->other) ? 'checked' : ''?>>
-                        <span class="ml-2">Other</span>
-                        <input if-tracking-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="tracking->otherDetail" value="<?= @($currentValue->tracking->otherDetail) ?>">
-                    </label>
-                </div>
-            </div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->dailyCarbIntake" <?= @($currentValue->tracking->dailyCarbIntake) ? 'checked' : ''?>>
+                <span class="ml-2">Daily Carb Intake</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label class="mb-2 font-weight-bold text-secondary">Current food monitoring:</label>
-            <div class="row">
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="foodMonitoring->phoneTracker" <?= @($currentValue->foodMonitoring->phoneTracker) ? 'checked' : ''?>>
-                        <img src="/img/behavior-rx/phone-tracker.png" class="icon-nutrition-rx-md mx-2">
-                        <span class="">Phone Tracker</span>
-                    </label>
-                </div>
-                <div class="col-4">
-                    <label class="d-flex align-items-center mb-1">
-                        <input type="checkbox" data-name="foodMonitoring->dailyFoodLog" <?= @($currentValue->foodMonitoring->dailyFoodLog) ? 'checked' : ''?>>
-                        <img src="/img/behavior-rx/food-log.png" class="icon-nutrition-rx-md mx-2">
-                        <span class="">Daily Food Log</span>
-                    </label>
-                </div>
-            </div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->portionSize" <?= @($currentValue->tracking->portionSize) ? 'checked' : ''?>>
+                <span class="ml-2">Portion Size</span>
+            </label>
         </div>
-
-        <div class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
+    </div>
+    <div class="row">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->eatingSpeed" <?= @($currentValue->tracking->eatingSpeed) ? 'checked' : ''?>>
+                <span class="ml-2">Eating Speed</span>
+            </label>
         </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        <div class="col-8">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="tracking->other" <?= @($currentValue->tracking->other) ? 'checked' : ''?>>
+                <span class="ml-2">Other</span>
+                <input if-tracking-other type="text" class="form-control form-control-sm min-width-unset flex-grow-1 ml-2" data-name="tracking->otherDetail" value="<?= @($currentValue->tracking->otherDetail) ?>">
+            </label>
         </div>
-    </form>
+    </div>
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
 
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
+<div class="mb-2">
+    <label class="mb-2 font-weight-bold text-secondary">Current food monitoring:</label>
+    <div class="row">
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="foodMonitoring->phoneTracker" <?= @($currentValue->foodMonitoring->phoneTracker) ? 'checked' : ''?>>
+                <img src="/img/behavior-rx/phone-tracker.png" class="icon-nutrition-rx-md mx-2">
+                <span class="">Phone Tracker</span>
+            </label>
+        </div>
+        <div class="col-4">
+            <label class="d-flex align-items-center mb-1">
+                <input type="checkbox" data-name="foodMonitoring->dailyFoodLog" <?= @($currentValue->foodMonitoring->dailyFoodLog) ? 'checked' : ''?>>
+                <img src="/img/behavior-rx/food-log.png" class="icon-nutrition-rx-md mx-2">
+                <span class="">Daily Food Log</span>
+            </label>
+        </div>
     </div>
-<?php endif; ?>
+</div>
 
+<div class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/behavior/SELF_MONITORING/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 11 - 106
resources/views/app/patient/segment-templates/_child_review/behavior/SLEEP_HABITS/edit-review.php

@@ -1,109 +1,14 @@
-<?php
+<p class="mb-2"><b>Sleep Habits</b></p>
 
-/*
-Format:
-{
-    hoursOfSleep: number,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-behavior" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/behavior/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Sleep Habits</b></p>
-
-        <div class="mb-2 d-flex align-items-center">
-            <label class="my-0 mr-2">Current hours of sleep:</label>
-            <input type="text" data-name="hoursOfSleep" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->hoursOfSleep) ?>">
-        </div>
-
-        <div class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
-        </div>
-
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
+<div class="mb-2 d-flex align-items-center">
+    <label class="my-0 mr-2">Current hours of sleep:</label>
+    <input type="text" data-name="hoursOfSleep" class="form-control form-control-sm min-width-unset width-100px" value="<?= @($currentValue->hoursOfSleep) ?>">
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
-    </div>
-<?php endif; ?>
 
+<div class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/behavior/SLEEP_HABITS/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 15 - 0
resources/views/app/patient/segment-templates/_child_review/delete-review.php

@@ -0,0 +1,15 @@
+<div visit-moe relative class="d-block">
+    <a start show href="#" class="px-1" title="Delete Subjective">
+        Delete Subjective
+    </a>
+    <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
+        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+
+        <p class="mb-2">Delete this subjective?</p>
+
+        <div>
+            <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>

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

@@ -48,7 +48,7 @@ else {
         <?php if($previousValue): ?>
             <div class="mb-2">
                 <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                 </div>
                 <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
             </div>

+ 181 - 311
resources/views/app/patient/segment-templates/_child_review/exercise/AEROBIC_ACTIVITY/edit-review.php

@@ -1,315 +1,185 @@
-<?php
+<p class="mb-2"><b>Current Aerobic Activity</b></p>
 
-/*
-Format:
-{
-    active: true/false,
-    walk: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    jog: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    elliptical: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    swim: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    bike: {
-        active: true/false,
-        frequency: 1..7,
-        intensity: light/moderate/vigorous,
-        time: number,
-    },
-    memo: text
-}
- */
+<label class="mb-2 d-flex align-items-center">
+    <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
+    <span class="ml-2">Any current aerobic activities?</span>
+</label>
 
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
+<table if-active class="table table-sm table-bordered">
+    <tbody>
+    <tr class="bg-light">
+        <td class="align-bottom">Activity</td>
+        <td class="align-bottom">Frequency<br>(days/wk)</td>
+        <td class="align-bottom">Intensity</td>
+        <td class="align-bottom">Time<br>(mins/day)</td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="walk->active" <?= @($currentValue->walk->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Walk</span>
+                <img src="/img/exercise-rx/walk.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-walk-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="walk->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->walk->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->walk->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->walk->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->walk->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->walk->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->walk->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->walk->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-walk-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="walk->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->walk->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->walk->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->walk->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-walk-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="walk->time" value="<?= @($currentValue->walk->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="jog->active" <?= @($currentValue->jog->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Jog</span>
+                <img src="/img/exercise-rx/jog.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-jog-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="jog->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->jog->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->jog->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->jog->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->jog->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->jog->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->jog->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->jog->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-jog-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="jog->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->jog->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->jog->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->jog->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-jog-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="jog->time" value="<?= @($currentValue->jog->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="elliptical->active" <?= @($currentValue->elliptical->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Elliptical</span>
+                <img src="/img/exercise-rx/elliptical.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="elliptical->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->elliptical->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->elliptical->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->elliptical->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->elliptical->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->elliptical->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->elliptical->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->elliptical->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="elliptical->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->elliptical->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->elliptical->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->elliptical->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-elliptical-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="elliptical->time" value="<?= @($currentValue->elliptical->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="swim->active" <?= @($currentValue->swim->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Swim</span>
+                <img src="/img/exercise-rx/swim.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-swim-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="swim->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->swim->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->swim->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->swim->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->swim->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->swim->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->swim->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->swim->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-swim-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="swim->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->swim->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->swim->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->swim->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-swim-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="swim->time" value="<?= @($currentValue->swim->time) ?>">
+        </td>
+    </tr>
+    <tr>
+        <td class="text-left align-middle">
+            <label class="d-flex align-items-center m-0">
+                <input type="checkbox" data-name="bike->active" <?= @($currentValue->bike->active) ? 'checked' : '' ?>>
+                <span class="ml-2">Bike</span>
+                <img src="/img/exercise-rx/bike.png" class="icon-nutrition-rx-row-sm ml-2">
+            </label>
+        </td>
+        <td class="p-0">
+            <select if-bike-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="bike->frequency">
+                <option value="">-- select --</option>
+                <option value="1" <?= @($currentValue->bike->frequency) == 1 ? 'selected' : ''?>>1 day</option>
+                <option value="2" <?= @($currentValue->bike->frequency) == 2 ? 'selected' : ''?>>2 days</option>
+                <option value="3" <?= @($currentValue->bike->frequency) == 3 ? 'selected' : ''?>>3 days</option>
+                <option value="4" <?= @($currentValue->bike->frequency) == 4 ? 'selected' : ''?>>4 days</option>
+                <option value="5" <?= @($currentValue->bike->frequency) == 5 ? 'selected' : ''?>>5 days</option>
+                <option value="6" <?= @($currentValue->bike->frequency) == 6 ? 'selected' : ''?>>6 days</option>
+                <option value="7" <?= @($currentValue->bike->frequency) == 7 ? 'selected' : ''?>>7 days</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <select if-bike-active class="form-control form-control-sm min-width-unset px-0 border-0" data-name="bike->intensity">
+                <option value="">-- select --</option>
+                <option value="Light" <?= @($currentValue->bike->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
+                <option value="Moderate" <?= @($currentValue->bike->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
+                <option value="Vigorous" <?= @($currentValue->bike->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
+            </select>
+        </td>
+        <td class="p-0">
+            <input if-bike-active class="form-control form-control-sm min-width-unset px-1 border-0" type="text" data-name="bike->time" value="<?= @($currentValue->bike->time) ?>">
+        </td>
+    </tr>
+    </tbody>
+</table>
 
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Current Aerobic Activity</b></p>
-
-        <label class="mb-2 d-flex align-items-center">
-            <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
-            <span class="ml-2">Any current aerobic activities?</span>
-        </label>
-
-        <table if-active class="table table-sm table-bordered" style="table-layout: fixed">
-            <tbody>
-            <tr>
-                <td class="align-middle">Activity</td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="walk->active" <?= @($currentValue->walk->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/walk.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->walk->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="walk" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->walk->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Walk
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="jog->active" <?= @($currentValue->jog->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/jog.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->jog->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="jog" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->jog->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Jog
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="elliptical->active" <?= @($currentValue->elliptical->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/elliptical.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->elliptical->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="elliptical" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->elliptical->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Elliptical
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="swim->active" <?= @($currentValue->swim->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/swim.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->swim->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="swim" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->swim->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Swim
-                        </button>
-                    </div>
-                </td>
-                <td class="text-left">
-                    <div class="d-flex align-items-center">
-                        <input type="checkbox" class="d-none" data-name="bike->active" <?= @($currentValue->bike->active) ? 'checked' : '' ?>>
-                        <img src="/img/exercise-rx/bike.png" class="icon-nutrition-rx-row mx-1 <?= @($currentValue->bike->active) ? '' : 'opacity-35' ?>">
-                        <button data-type="bike" class="btn-toggle-activity flex-grow-1 shadow-none btn btn-sm <?= @($currentValue->bike->active) ? 'btn-info' : 'btn-default border' ?>">
-                            Bike
-                        </button>
-                    </div>
-                </td>
-            </tr>
-            <tr>
-                <td>Frequency (days/wk)</td>
-                <td>
-                    <select if-walk-active class="form-control form-control-sm min-width-unset px-0" data-name="walk->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->walk->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->walk->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->walk->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->walk->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->walk->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->walk->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->walk->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-jog-active class="form-control form-control-sm min-width-unset px-0" data-name="jog->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->jog->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->jog->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->jog->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->jog->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->jog->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->jog->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->jog->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0" data-name="elliptical->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->elliptical->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->elliptical->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->elliptical->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->elliptical->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->elliptical->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->elliptical->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->elliptical->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-swim-active class="form-control form-control-sm min-width-unset px-0" data-name="swim->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->swim->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->swim->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->swim->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->swim->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->swim->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->swim->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->swim->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-bike-active class="form-control form-control-sm min-width-unset px-0" data-name="bike->frequency">
-                        <option value="">-- select --</option>
-                        <option value="1" <?= @($currentValue->bike->frequency) == 1 ? 'selected' : ''?>>1 day</option>
-                        <option value="2" <?= @($currentValue->bike->frequency) == 2 ? 'selected' : ''?>>2 days</option>
-                        <option value="3" <?= @($currentValue->bike->frequency) == 3 ? 'selected' : ''?>>3 days</option>
-                        <option value="4" <?= @($currentValue->bike->frequency) == 4 ? 'selected' : ''?>>4 days</option>
-                        <option value="5" <?= @($currentValue->bike->frequency) == 5 ? 'selected' : ''?>>5 days</option>
-                        <option value="6" <?= @($currentValue->bike->frequency) == 6 ? 'selected' : ''?>>6 days</option>
-                        <option value="7" <?= @($currentValue->bike->frequency) == 7 ? 'selected' : ''?>>7 days</option>
-                    </select>
-                </td>
-            </tr>
-            <tr>
-                <td>Intensity</td>
-                <td>
-                    <select if-walk-active class="form-control form-control-sm min-width-unset px-0" data-name="walk->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->walk->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->walk->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->walk->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-jog-active class="form-control form-control-sm min-width-unset px-0" data-name="jog->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->jog->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->jog->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->jog->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-elliptical-active class="form-control form-control-sm min-width-unset px-0" data-name="elliptical->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->elliptical->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->elliptical->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->elliptical->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-swim-active class="form-control form-control-sm min-width-unset px-0" data-name="swim->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->swim->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->swim->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->swim->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-                <td>
-                    <select if-bike-active class="form-control form-control-sm min-width-unset px-0" data-name="bike->intensity">
-                        <option value="">-- select --</option>
-                        <option value="Light" <?= @($currentValue->bike->intensity) == 'Light' ? 'selected' : ''?>>Light</option>
-                        <option value="Moderate" <?= @($currentValue->bike->intensity) == 'Moderate' ? 'selected' : ''?>>Moderate</option>
-                        <option value="Vigorous" <?= @($currentValue->bike->intensity) == 'Vigorous' ? 'selected' : ''?>>Vigorous</option>
-                    </select>
-                </td>
-            </tr>
-            <tr>
-                <td>Time (mins/day)</td>
-                <td>
-                    <input if-walk-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="walk->time" value="<?= @($currentValue->walk->time) ?>">
-                </td>
-                <td>
-                    <input if-jog-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="jog->time" value="<?= @($currentValue->jog->time) ?>">
-                </td>
-                <td>
-                    <input if-elliptical-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="elliptical->time" value="<?= @($currentValue->elliptical->time) ?>">
-                </td>
-                <td>
-                    <input if-swim-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="swim->time" value="<?= @($currentValue->swim->time) ?>">
-                </td>
-                <td>
-                    <input if-bike-active class="form-control form-control-sm min-width-unset px-1" type="text" data-name="bike->time" value="<?= @($currentValue->bike->time) ?>">
-                </td>
-            </tr>
-            </tbody>
-        </table>
-
-        <div if-active class="mb-2">
-            <label for="" class="mb-1">Memo</label>
-            <div note-rte slim-rte
-                 class="form-group mb-2 border-left border-right rte-holder"
-                 data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                 data-field-name="memo"><?= @($currentValue->memo) ?></div>
-        </div>
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
+<div if-active class="mb-2">
+    <label for="" class="mb-1">Memo</label>
+    <div note-rte slim-rte
+         class="form-group mb-2 border-left border-right rte-holder"
+         data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+         data-field-name="memo"><?= @($currentValue->memo) ?></div>
 </div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
-    </div>
-<?php endif; ?>
-

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/exercise/AEROBIC_ACTIVITY/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 32 - 130
resources/views/app/patient/segment-templates/_child_review/exercise/NEAT/edit-review.php

@@ -1,132 +1,34 @@
-<?php
-
-/*
-Format:
-{
-    active: true/false,
-    parkAway: true/false,
-    stairsInsteadOfElevators: true/false,
-    standInsteadOfSit: true/false,
-    stepsGoals: number,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Current Non-Exercise Activity Time (NEAT)</b></p>
-
-        <label class="mb-2 d-flex align-items-center">
-            <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
-            <span class="ml-2">Record Non-Exercise Activity Time (NEAT)</span>
-        </label>
-
-        <div if-active>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="parkAway" <?= @($currentValue->parkAway) ? 'checked' : ''?>>
-                <span class="ml-2">Currently parks away from entrances</span>
-            </label>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="stairsInsteadOfElevators" <?= @($currentValue->stairsInsteadOfElevators) ? 'checked' : ''?>>
-                <span class="ml-2">Currently takes the stairs instead of elevator/escalator</span>
-            </label>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="standInsteadOfSit" <?= @($currentValue->standInsteadOfSit) ? 'checked' : ''?>>
-                <span class="ml-2">Currently prefers standing over sitting</span>
-            </label>
-            <div class="row mb-2">
-                <div class="col-6">
-                    <label class="mb-1">Current steps/day</label>
-                    <input type="text" data-name="stepsGoals" class="form-control form-control-sm" value="<?= @($currentValue->stepsGoals) ?>">
-                </div>
-            </div>
-            <div class="mb-2">
-                <label for="" class="mb-1">Other</label>
-                <div note-rte slim-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                     data-field-name="memo"><?= @($currentValue->memo) ?></div>
-            </div>
+<p class="mb-2"><b>Current Non-Exercise Activity Time (NEAT)</b></p>
+
+<label class="mb-2 d-flex align-items-center">
+    <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
+    <span class="ml-2">Record Non-Exercise Activity Time (NEAT)</span>
+</label>
+
+<div if-active>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="parkAway" <?= @($currentValue->parkAway) ? 'checked' : ''?>>
+        <span class="ml-2">Currently parks away from entrances</span>
+    </label>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="stairsInsteadOfElevators" <?= @($currentValue->stairsInsteadOfElevators) ? 'checked' : ''?>>
+        <span class="ml-2">Currently takes the stairs instead of elevator/escalator</span>
+    </label>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="standInsteadOfSit" <?= @($currentValue->standInsteadOfSit) ? 'checked' : ''?>>
+        <span class="ml-2">Currently prefers standing over sitting</span>
+    </label>
+    <div class="row mb-2">
+        <div class="col-6">
+            <label class="mb-1">Current steps/day</label>
+            <input type="text" data-name="stepsGoals" class="form-control form-control-sm" value="<?= @($currentValue->stepsGoals) ?>">
         </div>
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
-        </div>
-    </form>
-</div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     </div>
-<?php endif; ?>
-
+    <div class="mb-2">
+        <label for="" class="mb-1">Other</label>
+        <div note-rte slim-rte
+             class="form-group mb-2 border-left border-right rte-holder"
+             data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+             data-field-name="memo"><?= @($currentValue->memo) ?></div>
+    </div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/exercise/NEAT/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 35 - 134
resources/views/app/patient/segment-templates/_child_review/exercise/STRENGTH_TRAINING/edit-review.php

@@ -1,137 +1,38 @@
-<?php
-
-/*
-Format:
-{
-    active: true/false,
-    muscleStrengthening: true/false,
-    allMajorMuscleGroups: true/false,
-    reps: number,
-    sets: number,
-    resistanceBandsBodyWeight: true/false,
-    memo: text
-}
- */
-
-$currentValue = '';
-$previousValue = '';
-$previousChildReview = null;
-if (@$point) {
-    if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
-        $currentValue = json_decode($point->lastChildReview->data);
-        $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
-            ->where('category', 'REVIEW')
-            ->where('parent_point_id', $point->id)
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-    else {
-        $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
-            ->where('category', 'REVIEW')
-            ->orderBy('id', 'DESC')
-            ->first();
-        if($previousChildReview && $previousChildReview->data) {
-            $previousValue = json_decode($previousChildReview->data);
-        }
-    }
-}
-?>
-<div visit-moe fixed-center largest relative class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
-    <form url="/api/visitPoint/<?= $point ? 'upsertChildReview' : 'addTopLevel' ?>"
-          class="mcp-theme-1 frm-review-plan-lifestyle frm-review-plan-exercise" right>
-
-        <?php if($point): ?>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
-        <?php else: ?>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-        <?php endif; ?>
-
-        <?php if ($point): ?>
-            <input type="hidden" name="data">
-        <?php else: ?>
-            <input type="hidden" name="childReviewData">
-        <?php endif; ?>
-
-        <?php if($previousValue): ?>
-            <div class="mb-2">
-                <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>)</span>
-                </div>
-                <div class="p-2 bg-light border inline-html-container">
-                    <?php $review = $previousValue; ?>
-                    <?php include(resource_path('views/app/patient/segment-templates/_child_review/exercise/' . $p['category'] . '/view-review.php')); ?>
-                </div>
-            </div>
-        <?php endif; ?>
-
-        <p class="mb-2"><b>Current Strength Training</b></p>
-
-        <label class="mb-2 d-flex align-items-center">
-            <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
-            <span class="ml-2">Currently doing strength training?</span>
-        </label>
-
-        <div if-active>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="muscleStrengthening" <?= @($currentValue->muscleStrengthening) ? 'checked' : ''?>>
-                <span class="ml-2">Currently doing muscle strengthening exercises on moderate or greater intensity at least two days per week</span>
-            </label>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="allMajorMuscleGroups" <?= @($currentValue->allMajorMuscleGroups) ? 'checked' : ''?>>
-                <span class="ml-2">Currently doing exercises to strengthen all major muscle groups: legs, hips, back, chest, abdomen, shoulders and arms</span>
-            </label>
-            <div class="row mb-2">
-                <div class="col-6">
-                    <label class="mb-1">Number of sets for each exercise</label>
-                    <input type="text" data-name="sets" class="form-control form-control-sm" value="<?= @($currentValue->sets) ?>">
-                </div>
-                <div class="col-6">
-                    <label class="mb-1">Number of repetitions per set</label>
-                    <input type="text" data-name="reps" class="form-control form-control-sm" value="<?= @($currentValue->reps) ?>">
-                </div>
-            </div>
-            <label class="mb-2 d-flex align-items-baseline">
-                <input type="checkbox" data-name="resistanceBandsBodyWeight" <?= @($currentValue->resistanceBandsBodyWeight) ? 'checked' : ''?>>
-                <span class="ml-2">Currently using resistance bands or using body weight to do exercises</span>
-            </label>
-            <div if-active class="mb-2">
-                <label for="" class="mb-1">Memo</label>
-                <div note-rte slim-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
-                     data-field-name="memo"><?= @($currentValue->memo) ?></div>
-            </div>
+<p class="mb-2"><b>Current Strength Training</b></p>
+
+<label class="mb-2 d-flex align-items-center">
+    <input type="checkbox" data-name="active" <?= @($currentValue->active) ? 'checked' : ''?>>
+    <span class="ml-2">Currently doing strength training?</span>
+</label>
+
+<div if-active>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="muscleStrengthening" <?= @($currentValue->muscleStrengthening) ? 'checked' : ''?>>
+        <span class="ml-2">Currently doing muscle strengthening exercises on moderate or greater intensity at least two days per week</span>
+    </label>
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="allMajorMuscleGroups" <?= @($currentValue->allMajorMuscleGroups) ? 'checked' : ''?>>
+        <span class="ml-2">Currently doing exercises to strengthen all major muscle groups: legs, hips, back, chest, abdomen, shoulders and arms</span>
+    </label>
+    <div class="row mb-2">
+        <div class="col-6">
+            <label class="mb-1">Number of sets for each exercise</label>
+            <input type="text" data-name="sets" class="form-control form-control-sm" value="<?= @($currentValue->sets) ?>">
         </div>
-        <div>
-            <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        <div class="col-6">
+            <label class="mb-1">Number of repetitions per set</label>
+            <input type="text" data-name="reps" class="form-control form-control-sm" value="<?= @($currentValue->reps) ?>">
         </div>
-    </form>
-</div>
-<?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
-        </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
-            <input type="hidden" name="uid" value="<?= $point->uid ?>">
-
-            <p class="mb-2">Delete this subjective?</p>
-
-            <div>
-                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     </div>
-<?php endif; ?>
-
+    <label class="mb-2 d-flex align-items-baseline">
+        <input type="checkbox" data-name="resistanceBandsBodyWeight" <?= @($currentValue->resistanceBandsBodyWeight) ? 'checked' : ''?>>
+        <span class="ml-2">Currently using resistance bands or using body weight to do exercises</span>
+    </label>
+    <div if-active class="mb-2">
+        <label for="" class="mb-1">Memo</label>
+        <div note-rte slim-rte
+             class="form-group mb-2 border-left border-right rte-holder"
+             data-container-name="<?= $point ? 'data' : 'childReviewData' ?>"
+             data-field-name="memo"><?= @($currentValue->memo) ?></div>
+    </div>
+</div>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/exercise/STRENGTH_TRAINING/last-review.php

@@ -31,5 +31,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/last-review.php

@@ -27,5 +27,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 9 - 42
resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CALORIES/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Current Daily Calories</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-rte
                      <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
-                     class="form-group mb-2 border-left border-right rte-holder"
+                     class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
 
-            <p class="mb-2"><b>Current Daily Calories</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CALORIES/last-review.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 9 - 42
resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CARBOHYDRATES/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Current Carbohydrate Intake (grams)</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-rte
                      <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
-                     class="form-group mb-2 border-left border-right rte-holder"
+                     class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
 
-            <p class="mb-2"><b>Current Carbohydrate Intake (grams)</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/DAILY_INTAKE_CARBOHYDRATES/last-review.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 48
resources/views/app/patient/segment-templates/_child_review/nutrition/FAST_FOOD/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentMealsPerWeek) || !empty($currentSelfPreparedMealsPerWeek) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentMealsPerWeek) || !empty($currentSelfPreparedMealsPerWeek) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -65,58 +62,21 @@ if (@$point) {
             <p class="mb-2"><b>Self prepared meals per week</b></p>
 
             <div class="mb-2">
-                <div note-rte slim-rte class="form-group mb-2 border-left border-right rte-holder"
+                <div note-rte slim-rte class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="selfPrepMealsPerWeek"><?= $currentSelfPreparedMealsPerWeek ?></div>
             </div>
 
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Current Consumption (meals per week)</b></p>
 
-            <div class="mb-2">
-                <div note-rte slim-rte class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue__mealsPerWeek"></div>
-            </div>
-
-            <p class="mb-2"><b>Self prepared meals per week</b></p>
-
-            <div class="mb-2">
-                <div note-rte slim-rte class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue__selfPrepMealsPerWeek"></div>
-            </div>
-
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentMealsPerWeek) || !empty($currentSelfPreparedMealsPerWeek)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/FAST_FOOD/last-review.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 9 - 42
resources/views/app/patient/segment-templates/_child_review/nutrition/HIGH_SUGAR_BEVERAGES/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Current Consumption (soda, sweet-tea, coffee, juice, etc.)</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-rte
                      <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
-                     class="form-group mb-2 border-left border-right rte-holder"
+                     class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
 
-            <p class="mb-2"><b>Current Consumption (soda, sweet-tea, coffee, juice, etc.)</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/HIGH_SUGAR_BEVERAGES/last-review.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 9 - 42
resources/views/app/patient/segment-templates/_child_review/nutrition/PORTION_SIZES/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Current average number of servings/meal</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-rte
                      <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
-                     class="form-group mb-2 border-left border-right rte-holder"
+                     class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
 
-            <p class="mb-2"><b>Current average number of servings/meal</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/PORTION_SIZES/last-review.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 8 - 48
resources/views/app/patient/segment-templates/_child_review/nutrition/SNACKS/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentUnhealthySnacks) || !empty($currentHealthySnacks) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentUnhealthySnacks) || !empty($currentHealthySnacks) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -65,58 +62,21 @@ if (@$point) {
 
             <p class="mb-1"><img class="icon-nutrition-rx-row-sm" src="/img/nutrition-rx/hs.png">&nbsp;Healthy Snacks</p>
             <div class="mb-2">
-                <div note-rte slim-rte class="form-group mb-2 border-left border-right rte-holder"
+                <div note-rte slim-rte class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="healthySnacks"><?= $currentHealthySnacks ?></div>
             </div>
 
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
-
-            <p class="mb-2"><b>Current Consumption</b></p>
 
-            <p class="mb-1"><img class="icon-nutrition-rx-row-sm" src="/img/nutrition-rx/us.png">&nbsp;Unhealthy Snacks</p>
-            <div class="mb-2">
-                <div note-rte slim-rte class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue__unhealthySnacks"></div>
-            </div>
-
-            <p class="mb-1"><img class="icon-nutrition-rx-row-sm" src="/img/nutrition-rx/hs.png">&nbsp;Healthy Snacks</p>
-            <div class="mb-2">
-                <div note-rte slim-rte class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue__healthySnacks"></div>
-            </div>
-
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentUnhealthySnacks) || !empty($currentHealthySnacks)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/SNACKS/last-review.php

@@ -29,5 +29,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 9 - 42
resources/views/app/patient/segment-templates/_child_review/nutrition/VEGETABLES/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Current Consumption</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-rte
                      <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
-                     class="form-group mb-2 border-left border-right rte-holder"
+                     class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
 
-            <p class="mb-2"><b>Current Consumption</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/VEGETABLES/last-review.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 9 - 42
resources/views/app/patient/segment-templates/_child_review/nutrition/WATER_INTAKE/edit-review.php

@@ -32,12 +32,9 @@ if (@$point) {
     }
 }
 ?>
-<div moe wide class="d-inline">
-    <a start show href="#" class="px-1 text-center d-block" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
-        <i class="fa <?= !empty($currentValue) ? 'fa-pencil-alt' : 'fa-plus-square'?>"></i>
-    </a>
+<div visit-moe wide class="d-block">
     <?php if($point): ?>
-        <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1 w-100 frm-upsert-review-plan-nutrition" left>
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="data">
@@ -49,7 +46,7 @@ if (@$point) {
             <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
                     </div>
                     <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
                 </div>
@@ -58,52 +55,22 @@ if (@$point) {
             <p class="mb-2"><b>Current Intake (ounces per day)</b></p>
 
             <div class="mb-2">
-                <div note-rte
+                <div note-rte slim-rte
                      <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
-                     class="form-group mb-2 border-left border-right rte-holder"
+                     class="form-group mb-0 border-left border-right rte-holder"
                      data-field-name="value"><?= $currentValue ?></div>
             </div>
-            <div>
-                <button type="submit"  class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
         </form>
     <?php else: ?>
-        <form url="/api/visitPoint/addTopLevel" class="mcp-theme-1 frm-add-review-plan-nutrition w-100" left>
-            <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
-            <input type="hidden" name="category" value="<?= $p['category'] ?>">
-            <input type="hidden" name="additionReasonCategory" value="ON_INTAKE">
-            <input type="hidden" name="data">
-
-            <?php if($previousValue): ?>
-                <div class="mb-2">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?>) (click to copy)</span>
-                    </div>
-                    <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
-                </div>
-            <?php endif; ?>
 
-            <p class="mb-2"><b>Current Intake (ounces per day)</b></p>
-
-            <div class="mb-2">
-                <div note-rte
-                     class="form-group mb-2 border-left border-right rte-holder"
-                     data-field-name="reviewValue"><?= $currentValue ?></div>
-            </div>
-            <div>
-                <button type="submit" class="btn btn-sm btn-primary mr-2">Save</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
-            </div>
-        </form>
     <?php endif; ?>
 </div>
 <?php if(!empty($currentValue)): ?>
-    <div visit-moe relative class="d-inline">
-        <a start show href="#" class="px-1 text-center d-block" title="Delete Subjective">
-            <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+    <div visit-moe relative class="d-block">
+        <a start show href="#" class="px-1 text-left" title="Delete Subjective">
+            Delete Subjective
         </a>
-        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
             <input type="hidden" name="uid" value="<?= $point->uid ?>">
 
             <p class="mb-2">Delete this subjective?</p>

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/nutrition/WATER_INTAKE/last-review.php

@@ -28,5 +28,5 @@
 
     </div>
 <?php else: ?>
-    <span class="text-secondary text-sm">None</span>
+    <span class="text-secondary text-sm">-</span>
 <?php endif; ?>

+ 1 - 1
resources/views/app/patient/segment-templates/_simple_text_segment/edit.php

@@ -17,7 +17,7 @@ if (!!@$point->data) {
              class="form-group mb-2 border-left border-right rte-holder"
              data-field-name="free_text"
         ><?= $parsed && @$parsed->free_text ? $parsed->free_text : '' ?></div>
-        <div>
+        <div class="m-2">
             <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></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>

+ 30 - 2
resources/views/app/patient/segment-templates/history_family/edit.blade.php

@@ -48,7 +48,8 @@ if(!$contentData) {
 
 ?>
 
-<div class="p-3 border-top mt-3 mcp-theme-1">
+<hr class="hide-outside-popup mt-3 mb-0">
+<div class="p-3 mcp-theme-1">
     <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1"
                     {{!$segment ? 'hook=onHxPopupClosure' : ''}}>
@@ -65,7 +66,7 @@ if(!$contentData) {
                 <div class="border border-secondary rounded mb-2 p-2">
                     <label class="my-0 d-flex align-items-center">
                         <input type="checkbox" class="my-0 mr-2" v-model="unknown" name="unknown">
-                        <span>Family history is unknown/unavailable</span>
+                        <span>-</span>
                     </label>
                 </div>
 
@@ -169,36 +170,43 @@ if(!$contentData) {
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_no_health_concern'" v-model="item.general_no_health_concern"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_no_health_concern'" v-model="item.general_no_health_concern"></div>
                                 <span class="ml-2">No Health Concern</span>
+                                <a href="#" v-show="item.general_no_health_concern" v-on:click.prevent="clearValue(item, 'general_no_health_concern')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_arthritis'" v-model="item.general_arthritis"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_arthritis'" v-model="item.general_arthritis"></div>
                                 <span class="ml-2">Arthritis</span>
+                                <a href="#" v-show="item.general_arthritis" v-on:click.prevent="clearValue(item, 'general_arthritis')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_asthma'" v-model="item.general_asthma"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_asthma'" v-model="item.general_asthma"></div>
                                 <span class="ml-2">Asthma</span>
+                                <a href="#" v-show="item.general_asthma" v-on:click.prevent="clearValue(item, 'general_asthma')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_bleeding_disorder'" v-model="item.general_bleeding_disorder"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_bleeding_disorder'" v-model="item.general_bleeding_disorder"></div>
                                 <span class="ml-2">Bleeding Disorder</span>
+                                <a href="#" v-show="item.general_bleeding_disorder" v-on:click.prevent="clearValue(item, 'general_bleeding_disorder')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_cad_lt_age_55'" v-model="item.general_cad_lt_age_55"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_cad_lt_age_55'" v-model="item.general_cad_lt_age_55"></div>
                                 <span class="ml-2">CAD < age 55</span>
+                                <a href="#" v-show="item.general_cad_lt_age_55" v-on:click.prevent="clearValue(item, 'general_cad_lt_age_55')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_copd'" v-model="item.general_copd"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_copd'" v-model="item.general_copd"></div>
                                 <span class="ml-2">COPD</span>
+                                <a href="#" v-show="item.general_copd" v-on:click.prevent="clearValue(item, 'general_copd')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_diabetes'" v-model="item.general_diabetes"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_diabetes'" v-model="item.general_diabetes"></div>
                                 <span class="ml-2">Diabetes</span>
+                                <a href="#" v-show="item.general_diabetes" v-on:click.prevent="clearValue(item, 'general_diabetes')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                         </div>
                         <div class="col-4">
@@ -206,36 +214,43 @@ if(!$contentData) {
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_heart_attack'" v-model="item.general_heart_attack"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_heart_attack'" v-model="item.general_heart_attack"></div>
                                 <span class="ml-2">Heart Attack</span>
+                                <a href="#" v-show="item.general_heart_attack" v-on:click.prevent="clearValue(item, 'general_heart_attack')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_heart_disease'" v-model="item.general_heart_disease"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_heart_disease'" v-model="item.general_heart_disease"></div>
                                 <span class="ml-2">Heart Disease</span>
+                                <a href="#" v-show="item.general_heart_disease" v-on:click.prevent="clearValue(item, 'general_heart_disease')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_high_cholesterol'" v-model="item.general_high_cholesterol"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_high_cholesterol'" v-model="item.general_high_cholesterol"></div>
                                 <span class="ml-2">High Cholesterol</span>
+                                <a href="#" v-show="item.general_high_cholesterol" v-on:click.prevent="clearValue(item, 'general_high_cholesterol')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_hypertension'" v-model="item.general_hypertension"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_hypertension'" v-model="item.general_hypertension"></div>
                                 <span class="ml-2">Hypertension</span>
+                                <a href="#" v-show="item.general_hypertension" v-on:click.prevent="clearValue(item, 'general_hypertension')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_mental_illness'" v-model="item.general_mental_illness"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_mental_illness'" v-model="item.general_mental_illness"></div>
                                 <span class="ml-2">Mental Illness</span>
+                                <a href="#" v-show="item.general_mental_illness" v-on:click.prevent="clearValue(item, 'general_mental_illness')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_osteoporosis'" v-model="item.general_osteoporosis"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_osteoporosis'" v-model="item.general_osteoporosis"></div>
                                 <span class="ml-2">Osteoporosis</span>
+                                <a href="#" v-show="item.general_osteoporosis" v-on:click.prevent="clearValue(item, 'general_osteoporosis')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_general_stroke'" v-model="item.general_stroke"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_general_stroke'" v-model="item.general_stroke"></div>
                                 <span class="ml-2">Stroke</span>
+                                <a href="#" v-show="item.general_stroke" v-on:click.prevent="clearValue(item, 'general_stroke')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                         </div>
                         <div class="col-4">
@@ -243,26 +258,31 @@ if(!$contentData) {
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_cancer_breast_ca'" v-model="item.cancer_breast_ca"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_cancer_breast_ca'" v-model="item.cancer_breast_ca"></div>
                                 <span class="ml-2">Breast CA</span>
+                                <a href="#" v-show="item.cancer_breast_ca" v-on:click.prevent="clearValue(item, 'cancer_breast_ca')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_cancer_colon_ca'" v-model="item.cancer_colon_ca"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_cancer_colon_ca'" v-model="item.cancer_colon_ca"></div>
                                 <span class="ml-2">Colon CA</span>
+                                <a href="#" v-show="item.cancer_colon_ca" v-on:click.prevent="clearValue(item, 'cancer_colon_ca')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_cancer_other_ca'" v-model="item.cancer_other_ca"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_cancer_other_ca'" v-model="item.cancer_other_ca"></div>
                                 <span class="ml-2">Other CA</span>
+                                <a href="#" v-show="item.cancer_other_ca" v-on:click.prevent="clearValue(item, 'cancer_other_ca')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_cancer_ovarian_ca'" v-model="item.cancer_ovarian_ca"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_cancer_ovarian_ca'" v-model="item.cancer_ovarian_ca"></div>
                                 <span class="ml-2">Ovarian CA</span>
+                                <a href="#" v-show="item.cancer_ovarian_ca" v-on:click.prevent="clearValue(item, 'cancer_ovarian_ca')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                             <div class="d-flex align-items-center">
                                 <div class="rspace"><input type="radio" value="yes" :name="'item_' + index + '_cancer_uterine_ca'" v-model="item.cancer_uterine_ca"></div>
                                 <div class="rspace"><input type="radio" value="no" :name="'item_' + index + '_cancer_uterine_ca'" v-model="item.cancer_uterine_ca"></div>
                                 <span class="ml-2">Uterine CA</span>
+                                <a href="#" v-show="item.cancer_uterine_ca" v-on:click.prevent="clearValue(item, 'cancer_uterine_ca')"><i class="text-danger on-hover-opaque fa fa-trash-alt ml-1"></i></a>
                             </div>
                         </div>
                     </div>
@@ -327,6 +347,14 @@ if(!$contentData) {
                     }
                 },
                 methods: {
+
+                    clearValue: function(_item, _key) {
+                        _item[_key] = null;
+                        Vue.nextTick(function() {
+                            $('#edit-univ_history_family-container').find('textarea').first().trigger('input');
+                        });
+                    },
+
                     addItem: function() {
                         this.items.push({
                             relationship: '',

+ 5 - 3
resources/views/app/patient/segment-templates/history_family/summary.blade.php

@@ -51,9 +51,11 @@ if(!$contentData['unknown'] && !!$contentData['count']) {
         <span class="ml-1 text-secondary">(<?= $contentData['items'][$i]['status'] ?>)</span>
         <?php endif; ?>
     </div>
-    <div class="ml-3">
+    <div class="d-flex ml-3">
         <?php foreach ($labels as $k => $v): ?>
-                    <?= isset($contentData['items'][$i][$k]) ? '<div>' . $v . ': <b>' . $contentData['items'][$i][$k] . '</b></div>' : '' ?>
+                    <?php if(isset($contentData['items'][$i][$k])): ?>
+                        <div class="mr-3"><b class="text-secondary"><?= $v ?></b> <?= $contentData['items'][$i][$k] ?></div>
+                    <?php endif; ?>
                 <?php endforeach; ?>
     </div>
     <?php if(isset($contentData['items'][$i]['comments']) && !empty($contentData['items'][$i]['comments'])): ?>
@@ -67,7 +69,7 @@ if(!$contentData['unknown'] && !!$contentData['count']) {
 }
 else {
 ?>
-<div class="text-secondary">Family History is unknown/unavailable</div>
+<div class="text-secondary">-</div>
 <?php
 }
 ?>

+ 2 - 1
resources/views/app/patient/segment-templates/history_screenings/edit.blade.php

@@ -25,7 +25,8 @@ if(!$contentData) {
 
 ?>
 
-<div class="p-3 border-top mt-3 mcp-theme-1">
+<hr class="hide-outside-popup mt-3 mb-0">
+<div class="p-3 mcp-theme-1">
     <div visit-moe close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">

+ 14 - 8
resources/views/app/patient/segment-templates/history_screenings/summary.blade.php

@@ -16,22 +16,28 @@ $point = Point::getGlobalSingletonOfCategory($patient, 'SCREENINGS_HISTORY', tru
 
 if ($point && @$point->data) {
     $contentData = $point->data;
+    ?>
+    <table class="table table-bordered table-sm mb-0">
+    <?php
     for ($i = 0; $i < $contentData['count']; $i++) {
     ?>
-    <div class="<?= $i > 0 ? 'mt-2' : '' ?>">
-        <div class="pb-1">
-            <b><?= isset($contentData['items'][$i]['screening']) ? $contentData['items'][$i]['screening'] : '--' ?></b>
-            <?php if(isset($contentData['items'][$i]['comments']) && !empty($contentData['items'][$i]['comments'])): ?>
+    <tr>
+    <td><b><?= isset($contentData['items'][$i]['screening']) ? $contentData['items'][$i]['screening'] : '--' ?></b></td>
+    <td>
+        <?php if(isset($contentData['items'][$i]['comments']) && !empty($contentData['items'][$i]['comments'])): ?>
             <span class="ml-1 text-secondary">(<?= $contentData['items'][$i]['comments'] ?>)</span>
-            <?php endif; ?>
-        </div>
-    </div>
+        <?php endif; ?>
+    </td>
+    </tr>
     <?php
     }
+    ?>
+    </table>
+    <?php
 }
 else {
 ?>
-<div class="text-secondary">Screenings History is unknown/unavailable</div>
+<div class="text-secondary">-</div>
 <?php
 }
 ?>

+ 2 - 1
resources/views/app/patient/segment-templates/history_social/edit.blade.php

@@ -57,7 +57,8 @@ for ($i = 0; $i < count($fields); $i++) {
 
 ?>
 
-<div class="p-3 border-top mt-3 mcp-theme-1">
+<hr class="hide-outside-popup mt-3 mb-0">
+<div class="p-3 mcp-theme-1">
     <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1"
                 {{!$segment ? 'hook=onHxPopupClosure' : ''}}>

Some files were not shown because too many files changed in this diff