Explorar el Código

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

Samson Mutunga hace 3 años
padre
commit
ba422170e6
Se han modificado 46 ficheros con 414 adiciones y 236 borrados
  1. 17 0
      app/Helpers/helpers.php
  2. 3 4
      public/css/style.css
  3. 7 5
      public/js/mc.js
  4. 3 0
      public/js/stag-popup.js
  5. 0 0
      public/js/yemi.js
  6. 16 4
      resources/views/app/patient/allergies-center.blade.php
  7. 1 1
      resources/views/app/patient/care-month/_create-bill.blade.php
  8. 1 1
      resources/views/app/patient/care-month/dashboard.blade.php
  9. 16 4
      resources/views/app/patient/careteam-center.blade.php
  10. 19 7
      resources/views/app/patient/goals-center.blade.php
  11. 23 17
      resources/views/app/patient/medications-center.blade.php
  12. 93 17
      resources/views/app/patient/medications-reconcile.blade.php
  13. 4 1
      resources/views/app/patient/note/segment_script.blade.php
  14. 22 20
      resources/views/app/patient/note/sign-confirmation.blade.php
  15. 6 6
      resources/views/app/patient/prescriptions-popup/list-popup.blade.php
  16. 17 36
      resources/views/app/patient/problems-center.blade.php
  17. 3 3
      resources/views/app/patient/segment-templates/_child_plan/last-plan.php
  18. 2 2
      resources/views/app/patient/segment-templates/_child_review/edit-review.php
  19. 3 3
      resources/views/app/patient/segment-templates/_child_review/last-review.php
  20. 2 2
      resources/views/app/patient/segment-templates/intake_allergies/edit.blade.php
  21. 2 2
      resources/views/app/patient/segment-templates/intake_allergies/summary.blade.php
  22. 2 2
      resources/views/app/patient/segment-templates/intake_care_team/edit.blade.php
  23. 2 2
      resources/views/app/patient/segment-templates/intake_care_team/summary.blade.php
  24. 2 2
      resources/views/app/patient/segment-templates/intake_goals/edit.blade.php
  25. 2 2
      resources/views/app/patient/segment-templates/intake_goals/summary.blade.php
  26. 2 2
      resources/views/app/patient/segment-templates/intake_interventions/edit.blade.php
  27. 1 1
      resources/views/app/patient/segment-templates/intake_interventions/summary.blade.php
  28. 2 2
      resources/views/app/patient/segment-templates/intake_medications/edit.blade.php
  29. 2 2
      resources/views/app/patient/segment-templates/intake_medications/edit_old.blade.php
  30. 2 2
      resources/views/app/patient/segment-templates/intake_medications/summary.blade.php
  31. 2 2
      resources/views/app/patient/segment-templates/intake_problems/edit.blade.php
  32. 1 1
      resources/views/app/patient/segment-templates/intake_problems/summary.blade.php
  33. 2 2
      resources/views/app/patient/segment-templates/intake_supplements/summary.blade.php
  34. 2 2
      resources/views/app/patient/segment-templates/plan_allergies/edit.blade.php
  35. 2 2
      resources/views/app/patient/segment-templates/plan_care_team/edit.blade.php
  36. 2 2
      resources/views/app/patient/segment-templates/plan_goals/edit.blade.php
  37. 2 2
      resources/views/app/patient/segment-templates/plan_interventions/edit.blade.php
  38. 2 2
      resources/views/app/patient/segment-templates/plan_medications/edit.blade.php
  39. 2 2
      resources/views/app/patient/segment-templates/plan_problems/edit.blade.php
  40. 7 7
      resources/views/app/patient/supplements-center.blade.php
  41. 1 1
      resources/views/app/patient/supplements-reconcile.blade.php
  42. 49 43
      resources/views/app/patient/wizard-partials/common-fields.blade.php
  43. 6 16
      resources/views/app/patient/wizard-partials/common-script.blade.php
  44. 28 0
      resources/views/app/patient/wizard-partials/show-plan.blade.php
  45. 28 0
      resources/views/app/patient/wizard-partials/show-review.blade.php
  46. 1 0
      yemi.js

+ 17 - 0
app/Helpers/helpers.php

@@ -326,6 +326,23 @@ if(!function_exists('friendlier_date')) {
     }
 }
 
+if(!function_exists('relative_friendly_date')) {
+    function relative_friendly_date($value) {
+        if(!$value || empty($value)) return '';
+        try {
+            $result = date_diff(date_create($value), date_create('now'))->days;
+            if ($result > 30) $result = date('F, Y', strtotime($value));
+            else if ($result > 1) $result .= ' days ago';
+            else if ($result === 1) $result = 'yesterday';
+            else if ($result === 0) $result = 'today';
+            return $result;
+        }
+        catch (Exception $e) {
+            return $value;
+        }
+    }
+}
+
 if(!function_exists('unfriendly_date')) {
     function unfriendly_date($value) {
         if(!$value || empty($value)) return '';

+ 3 - 4
public/css/style.css

@@ -45,7 +45,7 @@
     color: #d8a714!important;
 }
 .bg-warning-mellow {
-    background-color: #ffc10777 !important;
+    background-color: #ffc10755 !important;
 }
 .text-link {
     color: rgb(13, 89, 175) !important;
@@ -435,13 +435,13 @@ body>nav.navbar {
 .mcp-theme-1 .ql-editor[contenteditable] {
     min-height: 100px;
 }
+body [note-rte][slim-rte]:not(.border-0),
 body [note-rte][data-field-name="reviewValue"],
-body [note-rte][data-field-name="corePlanValue"],
 body [note-rte][data-field-name="planValue"] {
     border: 1px solid #ced4da !important;
 }
+body [note-rte][slim-rte] .ql-editor[contenteditable],
 body [note-rte][data-field-name="reviewValue"] .ql-editor[contenteditable],
-body [note-rte][data-field-name="corePlanValue"] .ql-editor[contenteditable],
 body [note-rte][data-field-name="planValue"] .ql-editor[contenteditable] {
     min-height: 28px !important;
     padding: .25rem .5rem !important;
@@ -479,7 +479,6 @@ body [note-rte][data-field-name="planValue"] .ql-editor[contenteditable] {
 }
 .rte-holder .ql-container p {
     margin-top: 0;
-    margin-bottom: 0.3rem;
 }
 
 .note-section:not(.edit) .if-not-edit {

+ 7 - 5
public/js/mc.js

@@ -605,11 +605,13 @@ window.initSegmentMoes = function(_parent) {
         .off('keydown.visit-moe-escape')
         .on('keydown.visit-moe-escape', function (e) {
             if(e.which === 27) {
-                let visibleMoes = $('[visit-moe] [url]:not([show]):visible');
-                if (visibleMoes.length) {
-                    visibleMoes.hide();
-                    markEventAsConsumed(e);
-                    return false;
+                if(!isEventConsumed(e)) {
+                    let visibleMoes = $('[visit-moe] [url]:not([show]):visible');
+                    if (visibleMoes.length) {
+                        visibleMoes.hide();
+                        markEventAsConsumed(e);
+                        return false;
+                    }
                 }
             }
         });

+ 3 - 0
public/js/stag-popup.js

@@ -205,6 +205,9 @@ function hasResponseError(_data) {
                 if(e.which === 27) {
                     if(!isEventConsumed(e)) {
                         if(stagPopupsQueue.length) {
+                            if($('.stag-popup.show [moe] [url]:visible').length || $('.stag-popup.show [visit-moe] [url]:visible').length) {
+                                return;
+                            }
                             closeStagPopup();
                             markEventAsConsumed(e);
                             return false;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
public/js/yemi.js


+ 16 - 4
resources/views/app/patient/allergies-center.blade.php

@@ -21,7 +21,7 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
                 <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary w-25">Review</th>
+                <th class="border-bottom-0 text-secondary w-25">Subjective</th>
                 <th class="border-bottom-0 text-secondary w-25">Plan</th>
                 <th class="border-bottom-0 text-secondary">Active?</th>
                 <th class="border-bottom-0 text-secondary">Started</th>
@@ -59,14 +59,20 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($allergy->data->name) ? ' for ' . @($allergy->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($allergy->data->name) ? ' for ' . @($allergy->data->name) : '' ?>"
                                href="/point/review-log/<?= $allergy->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_allergies');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>
@@ -78,7 +84,7 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
@@ -86,6 +92,12 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
                                href="/point/plan-log/<?= $allergy->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_allergies');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>

+ 1 - 1
resources/views/app/patient/care-month/_create-bill.blade.php

@@ -17,7 +17,7 @@
             </div>
 
             <div class="my-3">
-                <input type="checkbox" name="signAndCloseBilling" checked>&nbsp;Sign and Mark Billing Done
+                <input type="checkbox" name="signAndMarkBillingDone" checked>&nbsp;Sign and Mark Billing Done
             </div>
 
             <div class="">

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

@@ -230,7 +230,7 @@
                     <form url="/api/careMonth/assignRmePro" class="mcp-theme-1">
                         <input type="hidden" name="uid" value="{{$careMonth->uid}}">
                         <div class="mb-2">
-                            <label class="text-secondary text-sm">RMM Pro</label>
+                            <label class="text-secondary text-sm">RME Pro</label>
                             <select provider-search data-pro-uid="{{ $careMonth->rmePro ? $careMonth->rmePro->uid : '' }}"
                                     name="rmeProUid"
                                     class="form-control form-control-sm">

+ 16 - 4
resources/views/app/patient/careteam-center.blade.php

@@ -21,7 +21,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                 <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary w-25">Review</th>
+                <th class="border-bottom-0 text-secondary w-25">Subjective</th>
                 <th class="border-bottom-0 text-secondary w-25">Plan</th>
                 <th class="border-bottom-0 text-secondary">Details</th>
                 <th class="border-bottom-0 text-secondary">Contact</th>
@@ -59,14 +59,20 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($careTeamMember->data->name) ? ' for ' . @($careTeamMember->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($careTeamMember->data->name) ? ' for ' . @($careTeamMember->data->name) : '' ?>"
                                href="/point/review-log/<?= $careTeamMember->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_care_team');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>
@@ -78,7 +84,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
@@ -86,6 +92,12 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                                href="/point/plan-log/<?= $careTeamMember->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_care_team');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>

+ 19 - 7
resources/views/app/patient/goals-center.blade.php

@@ -21,8 +21,8 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                 <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Goal</th>
-                <th class="border-bottom-0 text-secondary w-25">Review</th>
-                <th class="border-bottom-0 text-secondary w-25">Directions/Plan</th>
+                <th class="border-bottom-0 text-secondary w-25">Subjective</th>
+                <th class="border-bottom-0 text-secondary w-25">Plan</th>
                 <th class="border-bottom-0 text-secondary">Active?</th>
                 <th class="border-bottom-0 text-secondary">Started</th>
                 <th class="border-bottom-0 text-secondary">Ended</th>
@@ -59,14 +59,20 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($goal->data->goal) ? ' for ' . @($goal->data->goal) : '' ?>"
+                               title="Subjective log<?= !!@($goal->data->goal) ? ' for ' . @($goal->data->goal) : '' ?>"
                                href="/point/review-log/<?= $goal->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_goals');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>
@@ -78,7 +84,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
@@ -86,6 +92,12 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                                href="/point/plan-log/<?= $goal->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_goals');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>
@@ -142,7 +154,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'goal', 'point' => $goal, 'planLabel' => 'Directions/Plan'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'goal', 'point' => $goal])
 
                             <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                 <button type="submit" class="btn-save-goal btn btn-sm btn-primary mr-2">Save</button>
@@ -180,7 +192,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'goal', 'planLabel' => 'Directions/Plan'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'goal'])
 
                         </div>
                         <div class="col-3 border-left">

+ 23 - 17
resources/views/app/patient/medications-center.blade.php

@@ -22,8 +22,8 @@ list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDI
                 <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary w-25">Directions/Plan</th>
-                <th class="border-bottom-0 text-secondary w-25">Review</th>
+                <th class="border-bottom-0 text-secondary w-25">Subjective</th>
+                <th class="border-bottom-0 text-secondary w-25">Plan</th>
                 <th class="border-bottom-0 text-secondary">Active?</th>
                 <th class="border-bottom-0 text-secondary">Started</th>
                 <th class="border-bottom-0 text-secondary">Ended</th>
@@ -55,23 +55,24 @@ list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDI
                         <div class="d-flex align-items-start">
                             <div class="flex-grow-1">
                                 <?php
-                                include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
+                                $point = $medication;
+                                include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                                 ?>
                             </div>
                             <div class="d-inline-flex flex-nowrap">
-                                <a class="pl-2 view-review-log"
+                                <a class="px-2 view-review-log"
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Plan log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
-                                   href="/point/plan-log/<?= $medication->uid ?>?popupmode=1">
+                                   title="Subjective log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
+                                   href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>
                                 <?php
-                                /*$segment = $note->getSegmentByInternalName('plan_medications');
+                                $segment = $note->getSegmentByInternalName('intake_medications');
                                 if($segment) {
-                                    include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
-                                }*/
+                                    include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
+                                }
                                 ?>
                             </div>
                         </div>
@@ -80,19 +81,24 @@ list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDI
                         <div class="d-flex align-items-start">
                             <div class="flex-grow-1">
                                 <?php
-                                $point = $medication;
-                                include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
+                                include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                                 ?>
                             </div>
                             <div class="d-inline-flex flex-nowrap">
-                                <a class="pl-2 view-review-log"
+                                <a class="px-2 view-review-log"
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
-                                   href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
+                                   title="Plan log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
+                                   href="/point/plan-log/<?= $medication->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>
+                                <?php
+                                $segment = $note->getSegmentByInternalName('plan_medications');
+                                if($segment) {
+                                    include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
+                                }
+                                ?>
                             </div>
                         </div>
                     </td>
@@ -156,7 +162,7 @@ list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDI
 
                                 @endif
 
-                                @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'point' => $medication, 'addVerbPT' => 'Prescribed', 'planLabel' => 'Directions/Plan'])
+                                @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'point' => $medication, 'addVerbPT' => 'Prescribed'])
 
                                 <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                     <button type="submit" class="btn-save-medication btn btn-sm btn-primary mr-2">Save</button>
@@ -199,7 +205,7 @@ list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDI
                         </div>
 
                         <?php $point = null; ?>
-                        @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'addVerbPT' => 'Prescribed', 'planLabel' => 'Directions/Plan'])
+                        @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'addVerbPT' => 'Prescribed'])
 
                     </div>
                     <div class="col-4 border-left">
@@ -280,7 +286,7 @@ list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDI
                 'update-parent ' +
                 'open-in-stag-popup ' +
                 'mc-initer="medications-reconcile-{{$note->id}}" ' +
-                'popup-style="stag-popup-md" ' +
+                'popup-style="medium" ' +
                 'class="btn-reconcile-active btn btn-sm mr-2 btn-info text-white font-weight-bold">Reconcile Active Medications</a>')
                 .appendTo(buttonContainer);
         }

+ 93 - 17
resources/views/app/patient/medications-reconcile.blade.php

@@ -10,7 +10,6 @@ use App\Models\Note;
 $points = Point
     ::where('client_id', $patient->id)
     ->where('category', 'MEDICATION')
-    ->where('is_removed_due_to_entry_error', false)
     ->where('is_removed', false)
     ->orderBy('created_at')
     ->get();
@@ -27,17 +26,55 @@ $medications = $points;
     <table class="table table-sm table-striped table-bordered">
         <thead>
         <tr>
-            <th class="border-bottom-0">Medication</th>
-            <th class="border-bottom-0">Review</th>
+            <th class="text-secondary bg-light border-bottom-0 w-25">Medication</th>
+            <th class="text-secondary bg-light border-bottom-0 w-25">Previous Subjective</th>
+            <th class="text-secondary bg-light border-bottom-0 w-25">Previous Plan</th>
+            <th class="text-secondary bg-light border-bottom-0 w-25">New Subjective</th>
         </tr>
         </thead>
         @foreach($medications as $medication)
-        <tr>
-            <td class="w-50">{{$medication->data->name}}</td>
-            <td class="p-0">
-                <input type="text" class="form-control form-control-sm border-0 rounded-0 shadow-none" data-point-uid="{{$medication->uid}}" value="Reconciled">
-            </td>
-        </tr>
+            <?php
+            $default = '';
+
+            // get most recent child plan for this point that was created before this note
+            $mostRecentPlanBeforeThisNote = Point::where('parent_point_id', $medication->id)
+                ->where('category', 'PLAN')
+                ->where('added_in_note_id', '<', $note->id)
+                ->orderBy('id', 'DESC')
+                ->first();
+
+            // get most recent child review for this point that was created before this note
+            $mostRecentReviewBeforeThisNote = Point::where('parent_point_id', $medication->id)
+                ->where('category', 'REVIEW')
+                ->where('added_in_note_id', '<', $note->id)
+                ->orderBy('id', 'DESC')
+                ->first();
+
+            // get child review for this point created on this note
+            $newReview = Point::where('parent_point_id', $medication->id)
+                ->where('category', 'REVIEW')
+                ->where('added_in_note_id', $note->id)
+                ->orderBy('id', 'DESC')
+                ->first();
+            if($newReview && $newReview->data) {
+                $newReview->data = json_decode($newReview->data);
+                $default = $newReview->data->value;
+            }
+            ?>
+            <tr>
+                <td class="bg-light font-weight-bold">{{$medication->data->name}}</td>
+                <td class="bg-light">
+                    @include('app/patient/wizard-partials/show-review', ['point' => $medication, 'review' => $mostRecentReviewBeforeThisNote])
+                </td>
+                <td class="bg-light">
+                    @include('app/patient/wizard-partials/show-plan', ['point' => $medication, 'plan' => $mostRecentPlanBeforeThisNote])
+                </td>
+                <td class="p-0 bg-white">
+                    <div note-rte slim-rte ignore-changes
+                         data-point-uid="{{$medication->uid}}"
+                         class="form-group rte-holder mb-0 bg-white border-0 rounded-0"><?= $default ?></div>
+                </td>
+            </tr>
         @endforeach
     </table>
     <div class="d-flex align-items-center justify-content-center">
@@ -48,7 +85,43 @@ $medications = $points;
 
 <script>
     (function() {
+        function __initRTEs(_collection) {
+            _collection.each(function() {
+                let noteRTE = $(this);
+                $(this).wrap(
+                    $('<div class="rte-holder"/>')
+                        .attr('data-shortcuts', '')
+                );
+                var editorID = Math.ceil(Math.random() * 99999),
+                    fieldName = $(this).attr('data-field-name') ? $(this).attr('data-field-name') : 'free_text';
+                var el = this;
+                var existingContent = $(el).html();
+                var quill = new Quill(el, {
+                    theme: 'snow',
+                    modules: {
+                        toolbar: false
+                    }
+                });
+                quill.root.innerHTML = existingContent;
+                $(quill.container)
+                    .find('.ql-editor[contenteditable]')
+                    .attr('data-field', fieldName)
+                    .attr('data-editor-id', editorID)
+                    .attr('with-shortcuts', 1);
+                $(el).data('quillInstance', quill);
+            });
+        }
         function init() {
+            $('#medications-reconcile-{{$note->id}} .copy-to-new-subjective')
+                .off('click')
+                .on('click', function() {
+                    let html = $.trim($(this).parent().prev('.inline-html-container').html());
+                    let quillInstance = $(this).closest('tr').find('[note-rte][data-point-uid]').first().data('quillInstance');
+                    // quillInstance.setContent(html);
+                    quillInstance.root.innerHTML = html;
+                    return false;
+                });
+
             $('#medications-reconcile-{{$note->id}} .btn-save-reviews')
                 .off('click')
                 .on('click', function() {
@@ -57,14 +130,16 @@ $medications = $points;
                         noteUid: '{{$note->uid}}',
                         reviews: []
                     }
-                    $('#medications-reconcile-{{$note->id}} [data-point-uid]').each(function() {
-                         payload.reviews.push({
-                             parentPointUid: $(this).attr('data-point-uid'),
-                             data: JSON.stringify({
-                                 isReconciled: true,
-                                 value: $(this).val()
-                             })
-                         });
+                    $('#medications-reconcile-{{$note->id}} [data-point-uid]').each(function () {
+                        if($.trim($('<div/>').html($(this).find('.ql-editor').html()).text())) {
+                            payload.reviews.push({
+                                parentPointUid: $(this).attr('data-point-uid'),
+                                data: JSON.stringify({
+                                    isReconciled: true,
+                                    value: $(this).find('.ql-editor').html()
+                                })
+                            });
+                        }
                     });
 
                     $.ajax({
@@ -83,6 +158,7 @@ $medications = $points;
                     });
 
                 });
+            __initRTEs($('#medications-reconcile-{{$note->id}} [note-rte]'))
         }
         addMCInitializer('medications-reconcile-{{$note->id}}', init, '#medications-reconcile-{{$note->id}}')
     }).call(window);

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

@@ -41,7 +41,10 @@
         }
 
         window.refreshRHSSidebar = function() {
-            $('#note-rhs-sidebar').load('/note-rhs-sidebar/{{$patient->uid}}/{{$note->uid}}');
+            $.get('/note-rhs-sidebar/{{$patient->uid}}/{{$note->uid}}', _data => {
+                $('#note-rhs-sidebar').replaceWith(_data);
+                $(window).trigger('scroll');
+            });
         };
 
         window.updateSegmentByUid = function(_uid, _summaryHtml, _editHtml, _updateOnlySummary) {

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

@@ -92,27 +92,29 @@
         </div>
     </div>
 
-    @if($patient->mcp_pro_id === $pro->id && !$patient->has_cm_setup_been_performed)
-    <hr class="m-neg-3">
-    <p class="mb-2 font-weight-bold font-size-13 text-secondary">CCM</p>
-    <div class="pl-3 border-left">
-        <div class="mb-2">
-            <i class="fa fa-exclamation-triangle text-warning-mellow"></i>
-            WARNING: You are the MCP and patient is not currently enrolled in CCM.
-        </div>
-        <div class="mb-2">Would you like to mark them as enrolled?</div>
-        <div moe class="d-block">
-            <a href="" show start><b>Yes, mark as enrolled</b></a>
-            <form url="/api/note/markCmSetupPerformedAsMcp">
-                <input type="hidden" name="uid" value="{{$note->uid}}">
-                <p>Mark as enrolled in CCM?</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>
+    @if($note->new_or_fu_or_na === "FU")
+        @if($patient->mcp_pro_id === $pro->id && !$patient->has_cm_setup_been_performed)
+        <hr class="m-neg-3">
+        <p class="mb-2 font-weight-bold font-size-13 text-secondary">CCM</p>
+        <div class="pl-3 border-left">
+            <div class="mb-2">
+                <i class="fa fa-exclamation-triangle text-warning-mellow"></i>
+                WARNING: You are the MCP and patient is not currently enrolled in CCM.
+            </div>
+            <div class="mb-2">Would you like to mark them as enrolled?</div>
+            <div moe class="d-block">
+                <a href="" show start><b>Yes, mark as enrolled</b></a>
+                <form url="/api/note/markCmSetupPerformedAsMcp">
+                    <input type="hidden" name="uid" value="{{$note->uid}}">
+                    <p>Mark as enrolled in CCM?</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>
         </div>
-    </div>
+        @endif
     @endif
 
     {{-- get problems(plan) and medications(plan) segments --}}

+ 6 - 6
resources/views/app/patient/prescriptions-popup/list-popup.blade.php

@@ -125,7 +125,7 @@
             </tr>
             </tbody>
         </table>
-        <div v-if="currentPrescription" class="min-width-700px ml-2 border align-self-stretch p-3">
+        <div v-if="currentPrescription" class="ml-2 border align-self-stretch p-3">
             <div class="d-flex align-items-center">
                 <h3 class="font-size-16 m-0">
                     <span class="mr-1 font-size-16">@{{ currentPrescription.erx_category }} / @{{ currentPrescription.created_at_friendly_short }}</span>
@@ -230,7 +230,7 @@
                     <label for="" class="text-secondary font-weight-bold m-0">Add From Existing Medications</label>
                     <a href="#" v-on:click.prevent="setAddMode('')" class="ml-auto">Close</a>
                 </div>
-                <table class="m-0 table table-sm border bg-white table-hover">
+                <table class="m-0 table table-sm border bg-white table-hover table-bordered">
                     <tr>
                         <th>Medication</th>
                         <th>Dispense</th>
@@ -239,8 +239,8 @@
                     </tr>
                     <tr v-for="drug in existingDrugs" v-if="notAlreadyAdded(drug.data.name)">
                         <td class="min-width-200px">@{{ drug.data.name }}</td>
-                        <td class="width-70px py-0 pr-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-top-0 border-bottom-0 border-right-0 shadow-none" v-model="drug.data.dispense"></td>
-                        <td class="width-70px py-0 pl-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-top-0 border-bottom-0 shadow-none" v-model="drug.data.refills"></td>
+                        <td class="width-70px bg-white py-0 pr-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.dispense"></td>
+                        <td class="width-70px bg-white py-0 pl-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.refills"></td>
                         <td class="text-right">
                             <a href="#" v-on:click.prevent="addExistingDrugToERx(drug.uid)" class="text-nowrap">Add to eRx</a>
                         </td>
@@ -351,7 +351,7 @@
                     <div v-else>-</div>
                 </div>
             </div>
-            <div class="pb-2 d-flex align-items-center">
+            <div class="pb-2 d-flex align-items-center" v-if="currentPrescription.has_hcp_pro_signed">
                 <span class="min-width-140px text-secondary text-sm">PDF</span>
                 <div class="d-inline-flex align-items-baseline">
                     <a class="pdf-viewer-trigger" native target="_blank"
@@ -366,7 +366,7 @@
             <div v-if="!currentPrescription.has_hcp_pro_signed">
                 <hr class="my-2">
                 <div v-if="currentPrescription.pro_declared_status === 'CANCELLED'" class="text-secondary font-weight-bold">CANCELLED</div>
-                <a v-else href="#" class="text-danger d-block" v-on:click.prevent="cancelItem()">Cancel</a>
+                <a v-else href="#" class="text-danger d-block" v-on:click.prevent="cancelItem()">Remove eRx</a>
             </div>
         </div>
     </div>

+ 17 - 36
resources/views/app/patient/problems-center.blade.php

@@ -81,47 +81,22 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
                                href="/point/review-log/<?= $problem->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('intake_problems');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
+                            }
+                            ?>
                         </div>
                     </div>
-                    {{--
-                    <div class="d-flex align-items-start">
-                        <div class="flex-grow-1">
-                            @include('app.patient.note.last-hpi')
-                        </div>
-                        <div>
-                            <div class="">
-                                <a class="pl-2 view-review-log"
-                                   native target="_blank"
-                                   open-in-stag-popup
-                                   popup-style="stag-popup-md"
-                                   title="HPI log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
-                                   href="/point/hpi-log/<?= $problem->uid ?>?popupmode=1">
-                                    <i class="fa fa-history"></i>
-                                </a>
-                            </div>
-                            <div class="">
-                                <a class="pl-2 view-review-log"
-                                   native target="_blank"
-                                   open-in-stag-popup
-                                   update-parent
-                                   mc-initer="edit-hpi-{{$problem->id}}"
-                                   popup-style="stag-popup-md"
-                                   title="HPI<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?> / <?= $patient->displayName() ?>"
-                                   href="/point/edit-hpi/<?= $note->uid ?>/<?= $problem->uid ?>?popupmode=1">
-                                    <i class="fa fa-plus-square"></i>
-                                </a>
-                            </div>
-                        </div>
-                    </div>
-                    --}}
                 </td>
                 <td>
                     <div class="d-flex align-items-start">
@@ -131,7 +106,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                             ?>
                         </div>
                         <div class="d-inline-flex flex-nowrap">
-                            <a class="pl-2 view-review-log"
+                            <a class="px-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
@@ -139,6 +114,12 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                                href="/point/plan-log/<?= $problem->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_problems');
+                            if($segment) {
+                                include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
+                            }
+                            ?>
                         </div>
                     </div>
                 </td>
@@ -211,7 +192,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'addVerbPT' => 'Diagnosed'])
 
                             <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                 <button type="submit" class="btn-save-problem btn btn-sm btn-primary mr-2">Save</button>
@@ -262,7 +243,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'addVerbPT' => 'Diagnosed'])
 
                         </div>
                         <div class="col-4 border-left">

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

@@ -1,7 +1,7 @@
 <?php if ($point->lastChildPlan): ?>
     <?php $parsedPlan = json_decode($point->lastChildPlan->data); ?>
     <div class="<?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
-        <div><?= $parsedPlan->value ?></div>
+        <div class="inline-html-container"><?= $parsedPlan->value ?></div>
         <div class="text-secondary text-sm"></div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>
@@ -10,9 +10,9 @@
             <?php if ($point->last_child_plan_point_scoped_note_id === $note->id): ?>
                 <span class="text-sm">(updated on this note)</span>
             <?php else: ?>
-                <a native target="_blank"
+                <a native target="_blank" class="text-sm"
                    href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildPlanNote]) ?>">
-                    <?= friendlier_date_time($point->last_child_plan_effective_date) ?>
+                   Updated <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
                 </a>
             <?php endif; ?>
         <?php endif; ?>

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

@@ -41,12 +41,12 @@ else {
             <div class="d-none disallow-if-value-same-as"><?= str_compact($previousValue) ?></div>
         <?php endif; ?>
 
-        <p class="mb-2"><b>Review</b></p>
+        <p class="mb-2"><b>Subjective</b></p>
 
         <?php if($previousValue): ?>
             <div class="mb-2">
                 <div class="d-flex align-items-baseline mb-1">
-                    <span class="text-sm text-secondary">Previous Review / <?= 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>

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

@@ -1,7 +1,7 @@
 <?php if ($point->lastChildReview): ?>
     <?php $parsedReview = json_decode($point->lastChildReview->data); ?>
     <div class="<?= $point->last_child_review_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
-        <div><?= @$parsedReview->value ?></div>
+        <div class="inline-html-container"><?= @$parsedReview->value ?></div>
 
         <?php if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id): ?>
             <span class="text-sm">(updated on the patient's chart)</span>
@@ -9,9 +9,9 @@
             <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
                 <span class="text-sm">(updated on this note)</span>
             <?php else: ?>
-                <a native target="_blank"
+                <a native target="_blank" class="text-sm"
                    href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>">
-                    <?= friendlier_date_time($point->last_child_review_effective_date) ?>
+                    Updated <?= relative_friendly_date($point->last_child_review_effective_date) ?>
                 </a>
             <?php endif; ?>
         <?php endif; ?>

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

@@ -19,7 +19,7 @@ $allergies = Point::getIntakePointsOfCategory($patient, 'ALLERGY', $note);
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Allergy</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -95,7 +95,7 @@ $allergies = Point::getIntakePointsOfCategory($patient, 'ALLERGY', $note);
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($allergy->data->name) ? ' for ' . @($allergy->data->name) : '' ?>"
+                                   title="Subjective log<?= !!@($allergy->data->name) ? ' for ' . @($allergy->data->name) : '' ?>"
                                    href="/point/review-log/<?= $allergy->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>

+ 2 - 2
resources/views/app/patient/segment-templates/intake_allergies/summary.blade.php

@@ -39,11 +39,11 @@ $numRelevant = 0;
             <?php $review = $allergy->childReviewAddedInNote($note); ?>
             <?php if(!!$review): ?>
                 <div class="pl-3 mt-1">
-                    <div class="text-secondary font-weight-bold">Review</div>
+                    <div class="text-secondary font-weight-bold">Subjective</div>
                     <div>{!! $review->data->value !!}</div>
                 </div>
             <?php elseif($rel): ?>
-                <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>
+                <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Subjective missing</div>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

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

@@ -20,7 +20,7 @@ $careTeamMembers = Point::getIntakePointsOfCategory($patient, 'CARE_TEAM_MEMBER'
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Care Team Member</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -118,7 +118,7 @@ $careTeamMembers = Point::getIntakePointsOfCategory($patient, 'CARE_TEAM_MEMBER'
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($careTeamMember->data->name) ? ' for ' . @($careTeamMember->data->name) : '' ?>"
+                                   title="Subjective log<?= !!@($careTeamMember->data->name) ? ' for ' . @($careTeamMember->data->name) : '' ?>"
                                    href="/point/review-log/<?= $careTeamMember->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>

+ 2 - 2
resources/views/app/patient/segment-templates/intake_care_team/summary.blade.php

@@ -44,11 +44,11 @@ $numRelevant = 0;
             <?php $review = $careTeamMember->childReviewAddedInNote($note); ?>
             <?php if(!!$review): ?>
             <div class="pl-3 mt-1">
-                <div class="text-secondary font-weight-bold">Review</div>
+                <div class="text-secondary font-weight-bold">Subjective</div>
                 <div>{!! $review->data->value !!}</div>
             </div>
             <?php elseif($rel): ?>
-            <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>
+            <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Subjective missing</div>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

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

@@ -21,7 +21,7 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Category</th>
                 <th class="border-bottom-0">Goal</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -171,7 +171,7 @@ $goals = Point::getIntakePointsOfCategory($patient, 'GOAL', $note);
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($goal->data->name) ? ' for ' . @($goal->data->name) : '' ?>"
+                                   title="Subjective log<?= !!@($goal->data->name) ? ' for ' . @($goal->data->name) : '' ?>"
                                    href="/point/review-log/<?= $goal->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>

+ 2 - 2
resources/views/app/patient/segment-templates/intake_goals/summary.blade.php

@@ -39,11 +39,11 @@ $numRelevant = 0;
                 <?php $review = $goal->childReviewAddedInNote($note); ?>
                 <?php if(!!$review): ?>
                 <div class="pl-3 mt-1">
-                    <div class="text-secondary font-weight-bold">Review</div>
+                    <div class="text-secondary font-weight-bold">Subjective</div>
                     <div>{!! $review->data->value !!}</div>
                 </div>
                 <?php elseif($rel): ?>
-                <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>
+                <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Subjective missing</div>
                 <?php endif; ?>
             </div>
         <?php endforeach; ?>

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

@@ -20,7 +20,7 @@ $interventions = Point::getIntakePointsOfCategory($patient, 'INTERVENTION', $not
             <tr class="">
                 <th class="border-bottom-0">Category</th>
                 <th class="border-bottom-0">Intervention</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -108,7 +108,7 @@ $interventions = Point::getIntakePointsOfCategory($patient, 'INTERVENTION', $not
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($intervention->data->intervention) ? ' for ' . @($intervention->data->intervention) : '' ?>"
+                               title="Subjective log<?= !!@($intervention->data->intervention) ? ' for ' . @($intervention->data->intervention) : '' ?>"
                                href="/point/review-log/<?= $intervention->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

+ 1 - 1
resources/views/app/patient/segment-templates/intake_interventions/summary.blade.php

@@ -41,7 +41,7 @@ foreach($interventions as $intervention) {
                 <?php $review = $intervention->childReviewAddedInNote($note); ?>
                 <?php if(!!$review): ?>
                 <div class="pl-3 mt-1">
-                    <div class="text-secondary font-weight-bold">Review</div>
+                    <div class="text-secondary font-weight-bold">Subjective</div>
                     <div>{!! $review->data->value !!}</div>
                 </div>
                 <?php endif; ?>

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

@@ -20,7 +20,7 @@ $medications = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Medication</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -124,7 +124,7 @@ $medications = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
+                                   title="Subjective log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
                                    href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>

+ 2 - 2
resources/views/app/patient/segment-templates/intake_medications/edit_old.blade.php

@@ -19,7 +19,7 @@ $medications = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
             <thead>
             <tr class="">
                 <th class="border-bottom-0">Medication</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -57,7 +57,7 @@ $medications = Point::getIntakePointsOfCategory($patient, 'MEDICATION', $note);
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
                                href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

+ 2 - 2
resources/views/app/patient/segment-templates/intake_medications/summary.blade.php

@@ -40,11 +40,11 @@ $numRelevant = 0;
             <?php $review = $medication->childReviewAddedInNote($note); ?>
             <?php if(!!$review): ?>
             <div class="pl-3 mt-1">
-                <div class="text-secondary font-weight-bold">Review</div>
+                <div class="text-secondary font-weight-bold">Subjective</div>
                 <div>{!! $review->data->value !!}</div>
             </div>
             <?php elseif($rel): ?>
-            <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>
+            <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Subjective missing</div>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

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

@@ -20,7 +20,7 @@ $problems = Point::getIntakePointsOfCategory($patient, 'PROBLEM', $note);
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Problem</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -107,7 +107,7 @@ $problems = Point::getIntakePointsOfCategory($patient, 'PROBLEM', $note);
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
                                href="/point/review-log/<?= $problem->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

+ 1 - 1
resources/views/app/patient/segment-templates/intake_problems/summary.blade.php

@@ -44,7 +44,7 @@ $numRelevant = 0;
                 <div>{!! $hpi->data && @($hpi->data->value) ? $hpi->data->value : '-' !!}</div>
             </div>
             <?php elseif($rel): ?>
-            <div class="relevant-without-review block-signing text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>
+            <div class="relevant-without-review block-signing text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Subjective missing</div>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

+ 2 - 2
resources/views/app/patient/segment-templates/intake_supplements/summary.blade.php

@@ -40,11 +40,11 @@ $numRelevant = 0;
             <?php $review = $supplement->childReviewAddedInNote($note); ?>
             <?php if(!!$review): ?>
             <div class="pl-3 mt-1">
-                <div class="text-secondary font-weight-bold">Review</div>
+                <div class="text-secondary font-weight-bold">Subjective</div>
                 <div>{!! $review->data->value !!}</div>
             </div>
             <?php elseif($rel): ?>
-            <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>
+            <div class="relevant-without-review text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Subjective missing</div>
             <?php endif; ?>
         </div>
     <?php endforeach; ?>

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

@@ -20,7 +20,7 @@ $intakeOrVisit = 'PLAN';
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Allergy</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -96,7 +96,7 @@ $intakeOrVisit = 'PLAN';
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($allergy->data->name) ? ' for ' . @($allergy->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($allergy->data->name) ? ' for ' . @($allergy->data->name) : '' ?>"
                                href="/point/review-log/<?= $allergy->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

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

@@ -20,7 +20,7 @@ $intakeOrVisit = 'PLAN';
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Care Team Member</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -118,7 +118,7 @@ $intakeOrVisit = 'PLAN';
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($careTeamMember->data->name) ? ' for ' . @($careTeamMember->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($careTeamMember->data->name) ? ' for ' . @($careTeamMember->data->name) : '' ?>"
                                href="/point/review-log/<?= $careTeamMember->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

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

@@ -21,7 +21,7 @@ $intakeOrVisit = 'PLAN';
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Category</th>
                 <th class="border-bottom-0">Goal</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -171,7 +171,7 @@ $intakeOrVisit = 'PLAN';
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($goal->data->name) ? ' for ' . @($goal->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($goal->data->name) ? ' for ' . @($goal->data->name) : '' ?>"
                                href="/point/review-log/<?= $goal->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

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

@@ -21,7 +21,7 @@ $intakeOrVisit = 'PLAN';
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Category</th>
                 <th class="border-bottom-0">Intervention</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -116,7 +116,7 @@ $intakeOrVisit = 'PLAN';
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($intervention->data->intervention) ? ' for ' . @($intervention->data->intervention) : '' ?>"
+                               title="Subjective log<?= !!@($intervention->data->intervention) ? ' for ' . @($intervention->data->intervention) : '' ?>"
                                href="/point/review-log/<?= $intervention->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

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

@@ -20,7 +20,7 @@ $intakeOrVisit = 'PLAN';
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Medication</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -100,7 +100,7 @@ $intakeOrVisit = 'PLAN';
                                native target="_blank"
                                open-in-stag-popup
                                popup-style="stag-popup-md"
-                               title="Review log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
+                               title="Subjective log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
                                href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>

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

@@ -20,7 +20,7 @@ $intakeOrVisit = 'PLAN';
             <tr class="">
                 <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
                 <th class="border-bottom-0">Problem</th>
-                <th class="border-bottom-0">Most Recent Review</th>
+                <th class="border-bottom-0">Most Recent Subjective</th>
                 <th class="border-bottom-0">Most Recent Plan</th>
             </tr>
             </thead>
@@ -106,7 +106,7 @@ $intakeOrVisit = 'PLAN';
                            native target="_blank"
                            open-in-stag-popup
                            popup-style="stag-popup-md"
-                           title="Review log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
+                           title="Subjective log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
                            href="/point/review-log/<?= $problem->uid ?>?popupmode=1">
                             <i class="fa fa-history"></i>
                         </a>

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

@@ -22,8 +22,8 @@ list($supplements, $counts) = Point::getPointsOfCategoryExtended($patient, 'SUPP
                 <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary w-25">Review</th>
-                <th class="border-bottom-0 text-secondary w-25">Directions/Plan</th>
+                <th class="border-bottom-0 text-secondary w-25">Subjective</th>
+                <th class="border-bottom-0 text-secondary w-25">Plan</th>
                 <th class="border-bottom-0 text-secondary">Active?</th>
                 <th class="border-bottom-0 text-secondary">Started</th>
                 <th class="border-bottom-0 text-secondary">Ended</th>
@@ -60,11 +60,11 @@ list($supplements, $counts) = Point::getPointsOfCategoryExtended($patient, 'SUPP
                                 ?>
                             </div>
                             <div class="d-inline-flex flex-nowrap">
-                                <a class="pl-2 view-review-log"
+                                <a class="px-2 view-review-log"
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
-                                   title="Review log<?= !!@($supplement->data->name) ? ' for ' . @($supplement->data->name) : '' ?>"
+                                   title="Subjective log<?= !!@($supplement->data->name) ? ' for ' . @($supplement->data->name) : '' ?>"
                                    href="/point/review-log/<?= $supplement->uid ?>?popupmode=1">
                                     <i class="fa fa-history"></i>
                                 </a>
@@ -79,7 +79,7 @@ list($supplements, $counts) = Point::getPointsOfCategoryExtended($patient, 'SUPP
                                 ?>
                             </div>
                             <div class="d-inline-flex flex-nowrap">
-                                <a class="pl-2 view-review-log"
+                                <a class="px-2 view-review-log"
                                    native target="_blank"
                                    open-in-stag-popup
                                    popup-style="stag-popup-md"
@@ -156,7 +156,7 @@ list($supplements, $counts) = Point::getPointsOfCategoryExtended($patient, 'SUPP
 
                                 @endif
 
-                                @include('app.patient.wizard-partials.common-fields', ['label' => 'supplement', 'point' => $supplement, 'addVerbPT' => 'Prescribed', 'planLabel' => 'Directions/Plan'])
+                                @include('app.patient.wizard-partials.common-fields', ['label' => 'supplement', 'point' => $supplement, 'addVerbPT' => 'Prescribed'])
 
                                 <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                     <button type="submit" class="btn-save-supplement btn btn-sm btn-primary mr-2">Save</button>
@@ -199,7 +199,7 @@ list($supplements, $counts) = Point::getPointsOfCategoryExtended($patient, 'SUPP
                         </div>
 
                         <?php $point = null; ?>
-                        @include('app.patient.wizard-partials.common-fields', ['label' => 'supplement', 'addVerbPT' => 'Prescribed', 'planLabel' => 'Directions/Plan'])
+                        @include('app.patient.wizard-partials.common-fields', ['label' => 'supplement', 'addVerbPT' => 'Prescribed'])
 
                     </div>
                     <div class="col-4 border-left">

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

@@ -28,7 +28,7 @@ $supplements = $points;
         <thead>
         <tr>
             <th class="border-bottom-0">Supplement</th>
-            <th class="border-bottom-0">Review</th>
+            <th class="border-bottom-0">Subjective</th>
         </tr>
         </thead>
         @foreach($supplements as $supplement)

+ 49 - 43
resources/views/app/patient/wizard-partials/common-fields.blade.php

@@ -18,20 +18,31 @@
 
     <div class="mb-2">
         <span class="font-weight-bold">Is this pre-existing, or being {{@$addVerbPT ? strtolower($addVerbPT) : 'added'}} during this visit?</span>
-        <div class="d-flex align-items-baseline mt-1">
-            <label class="my-0 d-inline-flex align-items-center">
-                <input type="radio" name="additionReasonCategory" value="ON_INTAKE"
-                        {{$point && $point->addition_reason_category === 'ON_INTAKE' ? 'checked' : ''}}
-                        {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
-                <span class="ml-1">Pre-existing</span>
-            </label>
-            <label class="ml-3 my-0 d-inline-flex align-items-center">
-                <input type="radio" name="additionReasonCategory" value="DURING_VISIT"
-                        {{$point && $point->addition_reason_category === 'DURING_VISIT' ? 'checked' : ''}}
-                        {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
-                <span class="ml-1">{{@$addVerbPT ? ucwords($addVerbPT) : 'Added'}} during this visit (as part of my plan)</span>
-            </label>
-        </div>
+        @if($point && $point->added_in_note_id !== $note->id)
+            <div class="mt-1">
+                @if($point->addition_reason_category === 'ON_INTAKE')
+                    Added as pre-existing on {{friendly_date($point->note->effective_dateest)}}
+                @else
+                    Added during visit on {{friendly_date($point->note->effective_dateest)}}
+                @endif
+                <input type="radio" name="additionReasonCategory" value="{{$point->addition_reason_category}}" checked class="d-none">
+            </div>
+        @else
+            <div class="d-flex align-items-baseline mt-1">
+                <label class="my-0 d-inline-flex align-items-center">
+                    <input type="radio" name="additionReasonCategory" value="ON_INTAKE"
+                            {{$point && $point->addition_reason_category === 'ON_INTAKE' ? 'checked' : ''}}
+                            {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
+                    <span class="ml-1">Pre-existing</span>
+                </label>
+                <label class="ml-3 my-0 d-inline-flex align-items-center">
+                    <input type="radio" name="additionReasonCategory" value="DURING_VISIT"
+                            {{$point && $point->addition_reason_category === 'DURING_VISIT' ? 'checked' : ''}}
+                            {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
+                    <span class="ml-1">{{@$addVerbPT ? ucwords($addVerbPT) : 'Added'}} during this visit (as part of my plan)</span>
+                </label>
+            </div>
+        @endif
     </div>
 
 </div>
@@ -60,16 +71,27 @@
 
         <div class="mb-2">
             <span class="font-weight-bold">Was this {{$label}} removed PRIOR to this visit or DURING this visit?</span>
-            <div class="d-flex align-items-baseline mt-1">
-                <label class="my-0 d-inline-flex align-items-center">
-                    <input type="radio" name="removalReasonCategory" value="ON_INTAKE" {{$point && $point->removal_reason_category === 'ON_INTAKE' ? 'checked' : ''}}>
-                    <span class="ml-1">Prior to visit</span>
-                </label>
-                <label class="ml-3 my-0 d-inline-flex align-items-center">
-                    <input type="radio" name="removalReasonCategory" value="DURING_VISIT" {{$point && $point->removal_reason_category === 'DURING_VISIT' ? 'checked' : ''}}>
-                    <span class="ml-1">Removed during this visit (as part of my plan)</span>
-                </label>
-            </div>
+            @if($point && $point->added_in_note_id !== $note->id)
+                <div class="mt-1">
+                    @if($point->removal_reason_category === 'ON_INTAKE')
+                        Removed prior to the visit on {{friendly_date($point->note->effective_dateest)}}
+                    @else
+                        Removed during visit on {{friendly_date($point->note->effective_dateest)}}
+                    @endif
+                    <input type="radio" name="removalReasonCategory" value="{{$point->removal_reason_category}}" checked class="d-none">
+                </div>
+            @else
+                <div class="d-flex align-items-baseline mt-1">
+                    <label class="my-0 d-inline-flex align-items-center">
+                        <input type="radio" name="removalReasonCategory" value="ON_INTAKE" {{$point && $point->removal_reason_category === 'ON_INTAKE' ? 'checked' : ''}}>
+                        <span class="ml-1">Prior to visit</span>
+                    </label>
+                    <label class="ml-3 my-0 d-inline-flex align-items-center">
+                        <input type="radio" name="removalReasonCategory" value="DURING_VISIT" {{$point && $point->removal_reason_category === 'DURING_VISIT' ? 'checked' : ''}}>
+                        <span class="ml-1">Removed during this visit (as part of my plan)</span>
+                    </label>
+                </div>
+            @endif
         </div>
 
     </div>
@@ -124,21 +146,6 @@
 
     @if(1 || $patient->core_note_id !== $note->id) {{-- allow review/plan from core note --}}
 
-        {{-- pre-existing plan (coreChildPlan) - show only when-adding OR when-editing-from-created-note --}}
-        <div if-active-and-pre-existing-or-not-active class="mb-2 d-none">
-            <?php
-            $currentValue = '';
-            if (@$point && $point->coreChildPlan) {
-                $parsedPlan = json_decode($point->coreChildPlan->data);
-                $currentValue = @($parsedPlan->value) ? $parsedPlan->value : '';
-            }
-            ?>
-            <label class="text-sm mb-0 font-weight-bold">Pre-existing {{@$planLabel ? $planLabel : 'Plan'}} (before this visit)</label>
-            <div note-rte
-                 class="form-group mb-2 rte-holder bg-white border rounded"
-                 data-field-name="corePlanValue"><?= $currentValue ?></div>
-        </div>
-
         @if(!@$noReview)
             <div class="mb-2">
                 <?php
@@ -176,14 +183,14 @@
                     }
                 }
             ?>
-                <label class="text-sm mb-0 font-weight-bold">{{@$reviewLabel ? $reviewLabel : 'Review'}}</label>
+                <label class="text-sm mb-0 font-weight-bold">{{@$reviewLabel ? $reviewLabel : 'Subjective'}}</label>
                 <div note-rte
                      class="form-group mb-2 rte-holder bg-white border rounded"
                      data-field-name="reviewValue"><?= $currentValue ?></div>
                 <?php if($previousValue): ?>
                 <div class="mb-2">
                     <div class="d-flex align-items-baseline mb-1">
-                        <span class="text-sm text-secondary">Previous {{@$reviewLabel ? $reviewLabel : 'Review'}} / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
+                        <span class="text-sm text-secondary">Previous {{@$reviewLabel ? $reviewLabel : '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>
@@ -223,8 +230,7 @@
                     }
                 }
                 ?>
-                <label if-active-and-pre-existing-or-not-active class="d-none text-sm mb-0 font-weight-bold">Changes to {{@$planLabel ? $planLabel : 'Plan'}} during this visit (as part of my plan)</label>
-                <label if-active-and-not-pre-existing class="d-none text-sm mb-0 font-weight-bold">{{@$planLabel ? $planLabel : 'Plan'}}</label>
+                <label class="text-sm mb-0 font-weight-bold">{{@$planLabel ? $planLabel : 'Plan'}}</label>
                 <div note-rte
                      class="form-group mb-2 rte-holder bg-white border rounded"
                      data-field-name="planValue"><?= $currentValue ?></div>

+ 6 - 16
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -62,7 +62,9 @@ function __initRTEs(_collection) {
             pElem.find('input[name=data]').val(v);
         };
 
-        quill.on('text-change', onTextChange);
+        if(!noteRTE.is('[ignore-changes]')) {
+            quill.on('text-change', onTextChange);
+        }
 
         $(quill.container)
             .find('.ql-editor[contenteditable]')
@@ -71,7 +73,9 @@ function __initRTEs(_collection) {
             .attr('with-shortcuts', 1);
 
         // set value initially
-        onTextChange();
+        if(!noteRTE.is('[ignore-changes]')) {
+            onTextChange();
+        }
     });
 }
 
@@ -201,14 +205,12 @@ parentSegment.find('#frm-add-{{$label}}')
 
         @if(1 || $patient->core_note_id !== $note->id)
         // store plan content
-        let corePlanContent = parsed && parsed.corePlanValue ? parsed.corePlanValue : '';
         let planContent = parsed && parsed.planValue ? parsed.planValue : '';
         let reviewContent = parsed && parsed.reviewValue ? parsed.reviewValue : '';
         // if(!$.trim($('<div/>').html(planContent).text())) {
         //     toastr.error('Directions cannot be empty');
         //     return false;
         // }
-        if(parsed.corePlanValue) delete parsed.corePlanValue;
         if(parsed.planValue) delete parsed.planValue;
         if(parsed.reviewValue) delete parsed.reviewValue;
         @endif
@@ -243,11 +245,6 @@ parentSegment.find('#frm-add-{{$label}}')
         let payload = {};
         form.serializeArray().map(x => {payload[x.name] = x.value;});
         @if(1 || $patient->core_note_id !== $note->id)
-        if(!!corePlanContent && $.trim($('<div/>').html(corePlanContent).text())) {
-            payload.corePlanData = JSON.stringify({
-                value: corePlanContent
-            })
-        }
         if(!!reviewContent && $.trim($('<div/>').html(reviewContent).text())) {
             payload.childReviewData = JSON.stringify({
                 value: reviewContent
@@ -296,7 +293,6 @@ parentSegment.find('.frm-edit-{{$label}}')
         }
 
         @if(1 || $patient->core_note_id !== $note->id)
-        let corePlanContent = parsed && parsed.corePlanValue ? parsed.corePlanValue : '';
 
         let reviewContent = parsed && parsed.reviewValue ? parsed.reviewValue : '';
 
@@ -326,7 +322,6 @@ parentSegment.find('.frm-edit-{{$label}}')
             }
         }
 
-        if(parsed.corePlanValue) delete parsed.corePlanValue;
         if(parsed.planValue) delete parsed.planValue;
         if(parsed.reviewValue) delete parsed.reviewValue;
         @endif
@@ -361,11 +356,6 @@ parentSegment.find('.frm-edit-{{$label}}')
         let payload = {};
         form.serializeArray().map(x => {payload[x.name] = x.value;});
         @if(1 || $patient->core_note_id !== $note->id)
-        if(!!corePlanContent && $.trim($('<div/>').html(corePlanContent).text())) {
-            payload.corePlanData = JSON.stringify({
-                value: corePlanContent
-            })
-        }
         if(!!reviewContent && $.trim($('<div/>').html(reviewContent).text())) {
             payload.childReviewData = JSON.stringify({
                 value: reviewContent

+ 28 - 0
resources/views/app/patient/wizard-partials/show-plan.blade.php

@@ -0,0 +1,28 @@
+@if($plan)
+    <?php $parsedPlan = json_decode($plan->data); ?>
+    @if($parsedPlan && !empty(trim(strip_tags($parsedPlan->value))))
+        <div class="inline-html-container <?= $point->last_child_plan_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+            <?= @$parsedPlan->value ?>
+        </div>
+        <div class="d-flex align-items-baseline pt-1 border-top mt-1 mb-2">
+            @if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id)
+                <span class="text-sm">(updated on the patient's chart)</span>
+            @else
+                @if ($point->last_child_plan_point_scoped_note_id === $note->id)
+                    <span class="text-sm">(updated on this note)</span>
+                @else
+                    <a native target="_blank" class="text-sm"
+                       href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $plan->note]) ?>">
+                       Updated <?= relative_friendly_date($plan->note->effective_dateest) ?>
+                    </a>
+                @endif
+            @endif
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a class="text-sm copy-to-new-subjective" href="#">Copy to new subjective</a>
+        </div>
+    @else
+        <span class="text-secondary text-sm">None</span>
+    @endif
+@else
+    <span class="text-secondary text-sm">None</span>
+@endif

+ 28 - 0
resources/views/app/patient/wizard-partials/show-review.blade.php

@@ -0,0 +1,28 @@
+@if($review)
+    <?php $parsedReview = json_decode($review->data); ?>
+    @if($parsedReview && !empty(trim(strip_tags($parsedReview->value))))
+        <div class="inline-html-container <?= $point->last_child_review_point_scoped_note_id === $note->id ? 'bg-warning-mellow p-2 rounded' : '' ?>">
+            <?= @$parsedReview->value ?>
+        </div>
+        <div class="d-flex align-items-baseline pt-1 border-top mt-1 mb-2">
+            @if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id)
+                <span class="text-sm">(updated on the patient's chart)</span>
+            @else
+                @if ($point->last_child_review_point_scoped_note_id === $note->id)
+                    <span class="text-sm">(updated on this note)</span>
+                @else
+                    <a native target="_blank" class="text-sm"
+                       href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $review->note]) ?>">
+                       Updated <?= relative_friendly_date($review->note->effective_dateest) ?>
+                    </a>
+                @endif
+            @endif
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a class="text-sm copy-to-new-subjective" href="#">Copy to new subjective</a>
+        </div>
+    @else
+        <span class="text-secondary text-sm">None</span>
+    @endif
+@else
+    <span class="text-secondary text-sm">None</span>
+@endif

+ 1 - 0
yemi.js

@@ -1115,6 +1115,7 @@ $(document).ready(function () {
         .off('keydown.moe-escape')
         .on('keydown.moe-escape', function (e) {
             if(e.which === 27) {
+                if(isEventConsumed(e)) return;
                 let visibleMoes = $('[moe] [url]:not([show]):visible');
                 if (visibleMoes.length) {
                     hideMoeFormMask();

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio