ソースを参照

Lift table as-is from centers and use in summary (minus rel, edit, and icons)

Vijayakrishnan 3 年 前
コミット
3fe0a3020e
21 ファイル変更228 行追加638 行削除
  1. 1 1
      app/Helpers/helpers.php
  2. 5 1
      app/Models/Point.php
  3. 40 12
      resources/views/app/patient/allergies-center.blade.php
  4. 8 5
      resources/views/app/patient/behavior-center.blade.php
  5. 19 6
      resources/views/app/patient/careteam-center.blade.php
  6. 8 11
      resources/views/app/patient/exercise-center.blade.php
  7. 19 6
      resources/views/app/patient/goals-center.blade.php
  8. 37 12
      resources/views/app/patient/medications-center.blade.php
  9. 9 7
      resources/views/app/patient/nutrition-center.blade.php
  10. 38 21
      resources/views/app/patient/problems-center.blade.php
  11. 17 8
      resources/views/app/patient/segment-templates/_child_plan/last-plan.php
  12. 18 9
      resources/views/app/patient/segment-templates/_child_review/last-review.php
  13. 1 87
      resources/views/app/patient/segment-templates/allergies/summary.blade.php
  14. 1 41
      resources/views/app/patient/segment-templates/behavior/summary.blade.php
  15. 1 77
      resources/views/app/patient/segment-templates/care_team/summary.blade.php
  16. 1 43
      resources/views/app/patient/segment-templates/exercise/summary.blade.php
  17. 1 77
      resources/views/app/patient/segment-templates/goals/summary.blade.php
  18. 1 83
      resources/views/app/patient/segment-templates/medications/summary.blade.php
  19. 1 52
      resources/views/app/patient/segment-templates/nutrition/summary.blade.php
  20. 1 78
      resources/views/app/patient/segment-templates/problems/summary.blade.php
  21. 1 1
      resources/views/app/patient/wizard-partials/state-badge.blade.php

+ 1 - 1
app/Helpers/helpers.php

@@ -331,7 +331,7 @@ if(!function_exists('relative_friendly_date')) {
         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));
+            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';

+ 5 - 1
app/Models/Point.php

@@ -246,11 +246,15 @@ class Point extends Model
             ->count();
     }
 
-    public static function getPointsOfCategoryExtended(Client $_patient, String $_category, Note $_note) {
+    public static function getPointsOfCategoryExtended(Client $_patient, String $_category, Note $_note, $excludeEntryError = false) {
         $points = Point
             ::where('client_id', $_patient->id)
             ->where('category', $_category);
 
+        if($excludeEntryError) {
+            $points = $points->where('is_removed_due_to_entry_error', FALSE);
+        }
+
         if($_category !== 'GOAL') {
             $points = $points->orderByRaw("((data)::json->'name')::text ASC");
         }

+ 40 - 12
resources/views/app/patient/allergies-center.blade.php

@@ -8,22 +8,26 @@ use App\Models\Pro;
 /** @var Client $patient */
 /** @var Note $note */
 /** @var Pro $pro */
+/** @var $summaryView */
 
-list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERGY', $note);
+list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERGY', $note, !!@$summaryView);
 $numActiveItems = Point::getNumPointsOfCategory($patient, 'ALLERGY');
-$favorites = $pro->favoritesByCategoryDecoded('allergy');
-function isFavoriteAllergy($_allergy, $_favorites) {
-    foreach($_favorites as $favorite) {
-        if($favorite->data->name === $_allergy->data->name) return $favorite->uid;
+if(!@$summaryView) {
+    $favorites = $pro->favoritesByCategoryDecoded('allergy');
+    function isFavoriteAllergy($_allergy, $_favorites) {
+        foreach($_favorites as $favorite) {
+            if($favorite->data->name === $_allergy->data->name) return $favorite->uid;
+        }
+        return false;
     }
-    return false;
 }
 ?>
 
-<div class="mt-3 p-3 border-top" id="allergies-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="allergies-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
         <?php $tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER'); ?>
+        @if(!@$summaryView)
         <textarea class="no_known_tracker d-none">{!! $tracker && @($tracker->data) ? json_encode($tracker->data) : '{}' !!}</textarea>
         <div class="d-flex align-items-center mb-3">
             <label class="border border-info d-inline-flex align-items-center my-0 mr-3 p-2 rounded">
@@ -40,21 +44,31 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                 <span>No Known Allergies of Any Type</span>
             </label>
         </div>
+        @else
+            @if($tracker && @($tracker->data->no_known_drug_allergies))
+                <div>• No Known Drug Allergies</div>
+            @endif
+            @if($tracker && @($tracker->datano_known_allergies_of_any_typeno_known_drug_allergies))
+                <div>• No Known Allergies of Any Type</div>
+            @endif
+        @endif
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
             <thead>
             <tr class="">
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary width-50px">Edit</th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-50px">Edit</th> @endif
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>
                 <th class="border-bottom-0 text-secondary w-30">Plan</th>
-                <th class="border-bottom-0 text-secondary width-30px"></th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-30px"></th> @endif
             </tr>
             </thead>
             <?php $prevRowState = -1; ?>
             <?php foreach($allergies as $allergy): ?>
             <?php $point = $allergy; ?>
-            <?php $favoriteUid = isFavoriteAllergy($allergy, $favorites); ?>
+            @if(!@$summaryView)
+                <?php $favoriteUid = isFavoriteAllergy($allergy, $favorites); ?>
+            @endif
             @if($prevRowState !== $allergy->state)
                 @include('app.patient.wizard-partials.state-row', ['point' => $allergy])
             @endif
@@ -72,6 +86,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                             <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
                             @include('app.patient.wizard-partials.state-badge', ['point' => $allergy, 'addedVerb' => 'Diagnosed'])
                         </div>
+                        @if(!@$summaryView)
                         <div class="ml-auto mr-1">
                             <div moe>
                                 @if(!$favoriteUid)
@@ -93,8 +108,10 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                                 @endif
                             </div>
                         </div>
+                        @endif
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div moe huge relative>
                         <a start show href="#" title="Edit">Edit</a>
@@ -142,6 +159,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                         </form>
                     </div>
                 </td>
+                @endif
                 <td>
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_allergies');
@@ -155,6 +173,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                                 include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -170,6 +189,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -192,6 +212,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                                 include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -207,6 +228,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -217,6 +239,7 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                         ?>
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div class="position-relative c-pointer stag-tooltip">
                         <i class="fa fa-info-circle"></i>
@@ -233,10 +256,12 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                         </div>
                     </div>
                 </td>
+                @endif
             </tr>
             <?php endforeach; ?>
         </table>
 
+        @if(!@$summaryView)
         <div class="d-flex align-items-center">
             <div class="mt-1 w-100 border p-3 bg-aliceblue border-info rounded">
                 <form action="/api/visitPoint/addTopLevel" class="mcp-theme-1 w-100" id="frm-add-allergy" novalidate>
@@ -298,10 +323,12 @@ function isFavoriteAllergy($_allergy, $_favorites) {
                 </form>
             </div>
         </div>
+        @endif
 
     </div>
 </div>
 
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -384,4 +411,5 @@ function isFavoriteAllergy($_allergy, $_favorites) {
         }
         addMCInitializer('allergies-center-{{$note->id}}', init, '#allergies-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>
+@endif

+ 8 - 5
resources/views/app/patient/behavior-center.blade.php

@@ -7,6 +7,7 @@ use App\Models\Segment;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var $summaryView */
 
 $selfMonitoring = Point::getOnlyPointOfCategory($patient, 'SELF_MONITORING');
 $foodTriggers = Point::getOnlyPointOfCategory($patient, 'FOOD_TRIGGERS');
@@ -21,10 +22,10 @@ $points = [
 ];
 ?>
 
-<div class="mt-3 p-3 border-top-behavior-rx" id="behavior-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="behavior-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
 
             @foreach($points as $p)
                 <?php $point = $p['point']; ?>
@@ -32,13 +33,13 @@ $points = [
                     <td>
                         <div class="d-flex align-items-center">
                             <b class="mr-2">{{$p['name']}}</b>
+                            @if(!@$summaryView)
                             @if($p['category'] === 'CRAVINGS')
                                 <img src="/img/behavior-rx/cravings.png" class="icon-nutrition-rx-row" alt="">
                             @elseif($p['category'] === 'SLEEP_HABITS')
                                 <img src="/img/behavior-rx/sleep.png" class="icon-nutrition-rx-row" alt="">
                             @endif
-                        </div>
-                        <div class="text-sm mt-1">
+                            @endif
                         </div>
                     </td>
                     <td class="w-40">
@@ -200,6 +201,7 @@ $points = [
 
     </div>
 </div>
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -283,4 +285,5 @@ $points = [
         }
         addMCInitializer('behavior-center-{{$note->id}}', init, '#behavior-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>
+@endif

+ 19 - 6
resources/views/app/patient/careteam-center.blade.php

@@ -7,22 +7,23 @@ use App\Models\Segment;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var $summaryView */
 
-list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, 'CARE_TEAM_MEMBER', $note);
+list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, 'CARE_TEAM_MEMBER', $note, !!@$summaryView);
 ?>
 
-<div class="mt-3 p-3 border-top min-height-500px" id="careteam-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="careteam-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
             <thead>
             <tr class="">
                 <th class="border-bottom-0 text-secondary">Name/Details</th>
-                <th class="border-bottom-0 text-secondary width-50px">Edit</th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-50px">Edit</th> @endif
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>
                 <th class="border-bottom-0 text-secondary w-30">Plan</th>
                 <th class="border-bottom-0 text-secondary">Contact</th>
-                <th class="border-bottom-0 text-secondary width-30px"></th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-30px"></th> @endif
             </tr>
             </thead>
             <?php $prevRowState = -1; ?>
@@ -49,6 +50,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                         </div>
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div moe huge relative>
                         <a start show href="#" title="Edit">Edit</a>
@@ -146,6 +148,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                         </form>
                     </div>
                 </td>
+                @endif
                 <td>
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_care_team');
@@ -159,6 +162,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                                 include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -174,6 +178,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -199,6 +204,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                                 include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -214,6 +220,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -228,6 +235,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                     <?= '<span class="text-secondary">Ph: </span>' . (!!@($careTeamMember->data->phone) ? @($careTeamMember->data->phone) : '-') ?><br>
                     <?= '<span class="text-secondary">Fax: </span>' . (!!@($careTeamMember->data->fax) ? @($careTeamMember->data->fax) : '-') ?>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div class="position-relative c-pointer stag-tooltip">
                         <i class="fa fa-info-circle"></i>
@@ -244,10 +252,12 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                         </div>
                     </div>
                 </td>
+                @endif
             </tr>
             <?php endforeach; ?>
         </table>
 
+        @if(!@$summaryView)
         <div class="d-flex align-items-center">
             <div class="mt-1 w-100 border p-3 bg-aliceblue border-info rounded">
                 <form action="/api/visitPoint/addTopLevel" class="mcp-theme-1 w-100" id="frm-add-care-team-member" novalidate>
@@ -332,9 +342,11 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                 </form>
             </div>
         </div>
+        @endif
     </div>
 </div>
 
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -393,4 +405,5 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
         }
         addMCInitializer('careteam-center-{{$note->id}}', init, '#careteam-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>
+@endif

+ 8 - 11
resources/views/app/patient/exercise-center.blade.php

@@ -7,6 +7,7 @@ use App\Models\Segment;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var $summaryView */
 
 $aerobicActivity = Point::getOnlyPointOfCategory($patient, 'AEROBIC_ACTIVITY');
 $strengthTraining = Point::getOnlyPointOfCategory($patient, 'STRENGTH_TRAINING');
@@ -19,10 +20,10 @@ $points = [
 ];
 ?>
 
-<div class="mt-3 p-3 border-top-exercise-rx" id="exercise-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="exercise-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
 
             @foreach($points as $p)
                 <?php $point = $p['point']; ?>
@@ -30,11 +31,11 @@ $points = [
                     <td>
                         <div class="d-flex align-items-center">
                             <b class="mr-2">{{$p['name']}}</b>
+                            @if(!@$summaryView)
                             @if($p['category'] === 'STRENGTH_TRAINING')
                                 <img src="/img/exercise-rx/strength.png" class="icon-nutrition-rx-row" alt="">
                             @endif
-                        </div>
-                        <div class="text-sm mt-1">
+                            @endif
                         </div>
                     </td>
                     <td class="w-40">
@@ -193,16 +194,11 @@ $points = [
                 </tr>
             @endforeach
 
-            @if(!count($points))
-                <tr>
-                    <td>-</td>
-                </tr>
-            @endif
-
         </table>
 
     </div>
 </div>
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -287,4 +283,5 @@ $points = [
         }
         addMCInitializer('exercise-center-{{$note->id}}', init, '#exercise-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>
+@endif

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

@@ -7,21 +7,22 @@ use App\Models\Segment;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var $summaryView */
 
-list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $note);
+list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $note, !!@$summaryView);
 ?>
 
-<div class="mt-3 p-3 border-top min-height-500px" id="goals-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="goals-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
             <thead>
             <tr class="">
                 <th class="border-bottom-0 text-secondary">Goal</th>
-                <th class="border-bottom-0 text-secondary width-50px">Edit</th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-50px">Edit</th> @endif
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>
                 <th class="border-bottom-0 text-secondary w-30">Plan</th>
-                <th class="border-bottom-0 text-secondary width-30px"></th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-30px"></th> @endif
             </tr>
             </thead>
             <?php $prevRowState = -1; ?>
@@ -46,6 +47,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                         </div>
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div moe huge relative>
                         <a start show href="#" title="Edit">Edit</a>
@@ -89,6 +91,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                         </form>
                     </div>
                 </td>
+                @endif
                 <td>
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_goals');
@@ -102,6 +105,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                                 include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -117,6 +121,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -139,6 +144,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                                 include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -154,6 +160,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -164,6 +171,7 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                         ?>
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div class="position-relative c-pointer stag-tooltip">
                         <i class="fa fa-info-circle"></i>
@@ -180,10 +188,12 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                         </div>
                     </div>
                 </td>
+                @endif
             </tr>
             <?php endforeach; ?>
         </table>
 
+        @if(!@$summaryView)
         <div class="d-flex align-items-center">
             <div class="mt-1 w-100 border p-3 bg-aliceblue border-info rounded">
                 <form action="/api/visitPoint/addTopLevel" class="mcp-theme-1 w-100" id="frm-add-goal" novalidate>
@@ -224,9 +234,11 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
                 </form>
             </div>
         </div>
+        @endif
     </div>
 </div>
 
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -285,4 +297,5 @@ list($goals, $counts) = Point::getPointsOfCategoryExtended($patient, 'GOAL', $no
         }
         addMCInitializer('goals-center-{{$note->id}}', init, '#goals-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>
+@endif

+ 37 - 12
resources/views/app/patient/medications-center.blade.php

@@ -8,22 +8,26 @@ use App\Models\Pro;
 /** @var Client $patient */
 /** @var Note $note */
 /** @var Pro $pro */
+/** @var $summaryView */
 
-list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDICATION', $note);
+list($medications, $counts) = Point::getPointsOfCategoryExtended($patient, 'MEDICATION', $note, !!@$summaryView);
 $numActiveItems = Point::getNumPointsOfCategory($patient, 'MEDICATION');
-$favorites = $pro->favoritesByCategoryDecoded('medication');
-function isFavoriteMedication($_medication, $_favorites) {
-    foreach($_favorites as $favorite) {
-        if($favorite->data->name === $_medication->data->name) return $favorite->uid;
+if(!@$summaryView) {
+    $favorites = $pro->favoritesByCategoryDecoded('medication');
+    function isFavoriteMedication($_medication, $_favorites) {
+        foreach($_favorites as $favorite) {
+            if($favorite->data->name === $_medication->data->name) return $favorite->uid;
+        }
+        return false;
     }
-    return false;
 }
 ?>
 
-<div class="mt-3 p-3 border-top" id="medications-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="medications-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
         <?php $tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER'); ?>
+        @if(!@$summaryView)
         <textarea class="no_known_tracker d-none">{!! $tracker && @($tracker->data) ? json_encode($tracker->data) : '{}' !!}</textarea>
         <div class="d-flex align-items-center mb-3">
             <label class="border border-info d-inline-flex align-items-center my-0 mr-3 p-2 rounded">
@@ -34,21 +38,28 @@ function isFavoriteMedication($_medication, $_favorites) {
                 <span>No Known Medications</span>
             </label>
         </div>
+        @else
+            @if($tracker && @($tracker->data->no_known_medications))
+                <div>• No Known Medications</div>
+            @endif
+        @endif
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
             <thead>
             <tr class="">
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary width-50px">Edit</th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-50px">Edit</th> @endif
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>
                 <th class="border-bottom-0 text-secondary w-30">Plan</th>
-                <th class="border-bottom-0 text-secondary width-30px"></th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-30px"></th> @endif
             </tr>
             </thead>
             <?php $prevRowState = -1; ?>
             <?php foreach($medications as $medication): ?>
                 <?php $point = $medication; ?>
-                <?php $favoriteUid = isFavoriteMedication($medication, $favorites); ?>
+                @if(!@$summaryView)
+                    <?php $favoriteUid = isFavoriteMedication($medication, $favorites); ?>
+                @endif
                 @if($prevRowState !== $medication->state)
                     @include('app.patient.wizard-partials.state-row', ['point' => $medication])
                 @endif
@@ -66,6 +77,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                                 <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
                                 @include('app.patient.wizard-partials.state-badge', ['point' => $medication, 'addedVerb' => 'Prescribed', 'removedVerb' => 'Discontinued'])
                             </div>
+                            @if(!@$summaryView)
                             <div class="ml-auto mr-1">
                                 <div moe>
                                     @if(!$favoriteUid)
@@ -88,8 +100,10 @@ function isFavoriteMedication($_medication, $_favorites) {
                                     @endif
                                 </div>
                             </div>
+                            @endif
                         </div>
                     </td>
+                    @if(!@$summaryView)
                     <td>
                         <div moe huge relative>
                             <a start show href="#" title="Edit">Edit</a>
@@ -140,6 +154,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                             </form>
                         </div>
                     </td>
+                    @endif
                     <td>
                         <?php
                         $segment = $note->getSegmentByInternalName('intake_medications');
@@ -153,6 +168,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                                     include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                                     ?>
                                 </div>
+                                @if(!@$summaryView)
                                 <div class="d-inline-flex flex-column ml-1">
                                     <a class="px-1 view-review-log"
                                        native target="_blank"
@@ -168,6 +184,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                                     }
                                     ?>
                                 </div>
+                                @endif
                             </div>
                         </div>
                         <div if-edit-mode>
@@ -190,6 +207,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                                     include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                                     ?>
                                 </div>
+                                @if(!@$summaryView)
                                 <div class="d-inline-flex flex-column ml-1">
                                     <a class="px-1 view-review-log"
                                        native target="_blank"
@@ -205,6 +223,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                                     }
                                     ?>
                                 </div>
+                                @endif
                             </div>
                         </div>
                         <div if-edit-mode>
@@ -215,6 +234,7 @@ function isFavoriteMedication($_medication, $_favorites) {
                             ?>
                         </div>
                     </td>
+                    @if(!@$summaryView)
                     <td>
                         <div class="position-relative c-pointer stag-tooltip">
                             <i class="fa fa-info-circle"></i>
@@ -231,10 +251,12 @@ function isFavoriteMedication($_medication, $_favorites) {
                             </div>
                         </div>
                     </td>
+                    @endif
                 </tr>
             <?php endforeach; ?>
         </table>
 
+        @if(!@$summaryView)
         <div class="d-flex align-items-center">
             <div class="mt-1 w-100 border p-3 bg-aliceblue border-info rounded">
                 <!--<a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add new medication, prescribed during this visit</a>-->
@@ -320,10 +342,12 @@ function isFavoriteMedication($_medication, $_favorites) {
                 </form>
             </div>
         </div>
+        @endif
 
     </div>
 </div>
 
+@if(!@$summaryView)
 <script>
 (function() {
     function init() {
@@ -437,4 +461,5 @@ function isFavoriteMedication($_medication, $_favorites) {
     }
     addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}');
 }).call(window);
-</script>
+</script>
+@endif

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

@@ -7,6 +7,7 @@ use App\Models\Segment;
 
 /** @var Client $patient */
 /** @var Note $note */
+/** @var $summaryView */
 
 $highSugarBeverages = Point::getOnlyPointOfCategory($patient, 'HIGH_SUGAR_BEVERAGES');
 $waterIntake = Point::getOnlyPointOfCategory($patient, 'WATER_INTAKE');
@@ -29,21 +30,17 @@ $points = [
 ];
 ?>
 
-<div class="mt-3 p-3 border-top-nutrition-rx" id="nutrition-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="nutrition-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
-		<tr class="point-row">
-			<td></td>
-			<td>Subjective</td>
-			<td>Plan</td>
-		</tr>
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
             @foreach($points as $p)
                 <?php $point = $p['point']; ?>
                 <tr class="point-row" data-uid="{{$point ? $point->uid : ''}}">
                     <td>
                         <div class="d-flex align-items-center">
                             <b class="mr-2">{{$p['name']}}</b>
+                            @if(!@$summaryView)
                             @if($p['category'] === 'HIGH_SUGAR_BEVERAGES')
                                 <img src="/img/nutrition-rx/hsb.png" class="icon-nutrition-rx-row" alt="">
                             @elseif($p['category'] === 'WATER_INTAKE')
@@ -53,7 +50,9 @@ $points = [
                             @elseif($p['category'] === 'DAILY_INTAKE_CARBOHYDRATES' || $p['category'] === 'DAILY_INTAKE_CALORIES')
                                 <img src="/img/nutrition-rx/ig.png" class="icon-nutrition-rx-row" alt="">
                             @endif
+                            @endif
                         </div>
+                        @if(!@$summaryView)
                         <div class="text-sm mt-1">
                             @if($p['category'] === 'HIGH_SUGAR_BEVERAGES')
                                 E.g. soda, sweet tea, coffee, juice, etc.
@@ -67,6 +66,7 @@ $points = [
 
                             @endif
                         </div>
+                        @endif
                     </td>
                     <td class="w-40">
                         <div if-read-mode>
@@ -115,6 +115,7 @@ $points = [
 
     </div>
 </div>
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -200,3 +201,4 @@ $points = [
         addMCInitializer('nutrition-center-{{$note->id}}', init, '#nutrition-center-{{$note->id}}');
     }).call(window);
 </script>
+@endif

+ 38 - 21
resources/views/app/patient/problems-center.blade.php

@@ -8,23 +8,26 @@ use App\Models\Pro;
 /** @var Client $patient */
 /** @var Note $note */
 /** @var Pro $pro */
-
-list($problems, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
-$ccSegment = $note->getSegmentByInternalName('chief_complaint');
-$ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
-$favorites = $pro->favoritesByCategoryDecoded('problem');
-function isFavoriteProblem($_problem, $_favorites) {
-    foreach($_favorites as $favorite) {
-        if($favorite->data->name === $_problem->data->name) return $favorite->uid;
+/** @var $summaryView */
+
+list($problems, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note, !!@$summaryView);
+if(!@$summaryView) {
+    $ccSegment = $note->getSegmentByInternalName('chief_complaint');
+    $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
+    $favorites = $pro->favoritesByCategoryDecoded('problem');
+    function isFavoriteProblem($_problem, $_favorites) {
+        foreach($_favorites as $favorite) {
+            if($favorite->data->name === $_problem->data->name) return $favorite->uid;
+        }
+        return false;
     }
-    return false;
 }
 ?>
 
-<div class="mt-3 p-3 border-top min-height-500px" id="problems-center-{{$note->id}}">
+<div @if(!@$summaryView) class="mt-3 p-3 border-top" id="problems-center-{{$note->id}}" @else class="mt-2 pr-2" @endif>
     <div class="point-table-container">
 
-        @if($patient->core_note_id !== $note->id)
+        @if(!@$summaryView && $patient->core_note_id !== $note->id)
         <div class="d-flex align-items-baseline">
             <div class="mb-2 font-weight-bold font-size-14 text-secondary">Chief Complaint</div>
             <span class="mx-2 text-secondary">|</span>
@@ -54,21 +57,26 @@ function isFavoriteProblem($_problem, $_favorites) {
         <hr class="m-neg-3 my-3">
         @endif
 
+        @if(!@$summaryView)
         <div class="mb-2 font-weight-bold font-size-14 text-secondary">Problems</div>
-        <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
+        @endif
+
+        <table class="table table-sm table-bordered bg-white mb-2 point-table read">
             <thead>
             <tr class="">
                 <th class="border-bottom-0 text-secondary">Name</th>
-                <th class="border-bottom-0 text-secondary width-50px">Edit</th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-50px">Edit</th> @endif
                 <th class="border-bottom-0 text-secondary w-30">Subjective/HPI</th>
                 <th class="border-bottom-0 text-secondary w-30">Plan</th>
-                <th class="border-bottom-0 text-secondary width-30px"></th>
+                @if(!@$summaryView) <th class="border-bottom-0 text-secondary width-30px"></th> @endif
             </tr>
             </thead>
             <?php $prevRowState = -1; ?>
             <?php foreach($problems as $problem): ?>
             <?php $point = $problem; ?>
-            <?php $favoriteUid = isFavoriteProblem($problem, $favorites); ?>
+            @if(!@$summaryView)
+                <?php $favoriteUid = isFavoriteProblem($problem, $favorites); ?>
+            @endif
             @if($prevRowState !== $problem->state)
                 @include('app.patient.wizard-partials.state-row', ['point' => $problem])
             @endif
@@ -88,12 +96,8 @@ function isFavoriteProblem($_problem, $_favorites) {
                                 <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
                             </div>
                             @include('app.patient.wizard-partials.state-badge', ['point' => $problem, 'addedVerb' => 'Diagnosed'])
-                            @if($rel)
-                                <div class="mt-1">
-                                    <span class="text-sm text-white bg-info rounded px-2 py-1 font-weight-bold">Visit reason</span>
-                                </div>
-                            @endif
                         </div>
+                        @if(!@$summaryView)
                         <div class="ml-auto mr-1">
                             <div moe>
                                 @if(!$favoriteUid)
@@ -118,8 +122,10 @@ function isFavoriteProblem($_problem, $_favorites) {
                                 @endif
                             </div>
                         </div>
+                        @endif
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div moe huge relative>
                         <a start show href="#" title="Edit">Edit</a>
@@ -179,6 +185,7 @@ function isFavoriteProblem($_problem, $_favorites) {
                         </form>
                     </div>
                 </td>
+                @endif
                 <td>
                     <?php
                     $segment = $note->getSegmentByInternalName('intake_problems');
@@ -192,6 +199,7 @@ function isFavoriteProblem($_problem, $_favorites) {
                                 include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -207,6 +215,7 @@ function isFavoriteProblem($_problem, $_favorites) {
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -229,6 +238,7 @@ function isFavoriteProblem($_problem, $_favorites) {
                                 include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                                 ?>
                             </div>
+                            @if(!@$summaryView)
                             <div class="d-inline-flex flex-column ml-1">
                                 <a class="px-1 view-review-log"
                                    native target="_blank"
@@ -244,6 +254,7 @@ function isFavoriteProblem($_problem, $_favorites) {
                                 }
                                 ?>
                             </div>
+                            @endif
                         </div>
                     </div>
                     <div if-edit-mode>
@@ -254,6 +265,7 @@ function isFavoriteProblem($_problem, $_favorites) {
                         ?>
                     </div>
                 </td>
+                @if(!@$summaryView)
                 <td>
                     <div class="position-relative c-pointer stag-tooltip">
                         <i class="fa fa-info-circle"></i>
@@ -270,10 +282,12 @@ function isFavoriteProblem($_problem, $_favorites) {
                         </div>
                     </div>
                 </td>
+                @endif
             </tr>
             <?php endforeach; ?>
         </table>
 
+        @if(!@$summaryView)
         <div class="d-flex align-items-center">
             <div class="mt-1 w-100 border p-3 bg-aliceblue border-info rounded">
                 <form action="/api/visitPoint/addTopLevel" class="mcp-theme-1 w-100" id="frm-add-problem" novalidate>
@@ -366,9 +380,11 @@ function isFavoriteProblem($_problem, $_favorites) {
                 </form>
             </div>
         </div>
+        @endif
     </div>
 </div>
 
+@if(!@$summaryView)
 <script>
     (function() {
         function init() {
@@ -473,4 +489,5 @@ function isFavoriteProblem($_problem, $_favorites) {
         }
         addMCInitializer('problems-center-{{$note->id}}', init, '#problems-center-{{$note->id}}');
     }).call(window);
-</script>
+</script>
+@endif

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

@@ -10,19 +10,28 @@
             <?php if ($point->last_child_plan_point_scoped_note_id === $note->id): ?>
                 <span class="text-sm">(updated on this note)</span>
             <?php else: ?>
-                <div class="d-inline position-relative on-click-menu">
-                    <span class="text-sm text-primary c-pointer">
+                <?php if(!@$summaryView): ?>
+                    <div class="d-inline position-relative on-click-menu">
+                        <span class="text-sm text-primary c-pointer">
+                            <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
+                            <?php if($point->lastChildPlan->creatorPro): ?>
+                                by <?= $point->lastChildPlan->creatorPro->displayName() ?>
+                            <?php endif; ?>
+                        </span>
+                        <div menu right class="bg-white border">
+                            <a native target="_blank"
+                               href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildPlanNote]) ?>"
+                               class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
+                        </div>
+                    </div>
+                <?php else: ?>
+                    <span class="text-sm text-secondary">
                         <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
                         <?php if($point->lastChildPlan->creatorPro): ?>
                             by <?= $point->lastChildPlan->creatorPro->displayName() ?>
                         <?php endif; ?>
                     </span>
-                    <div menu right class="bg-white border">
-                        <a native target="_blank"
-                           href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildPlanNote]) ?>"
-                           class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
-                    </div>
-                </div>
+                <?php endif; ?>
             <?php endif; ?>
         <?php endif; ?>
 

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

@@ -9,19 +9,28 @@
             <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
                 <span class="text-sm">(updated on this note)</span>
             <?php else: ?>
-                <div class="d-inline position-relative on-click-menu">
-                    <span class="text-sm text-primary c-pointer">
+                <?php if(!@$summaryView): ?>
+                    <div class="d-inline position-relative on-click-menu">
+                        <span class="text-sm text-primary c-pointer">
+                            <?= relative_friendly_date($point->last_child_review_effective_date) ?>
+                            <?php if($point->lastChildReview->creatorPro): ?>
+                            by <?= $point->lastChildReview->creatorPro->displayName() ?>
+                            <?php endif; ?>
+                        </span>
+                        <div menu right class="bg-white border">
+                            <a native target="_blank"
+                               href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>"
+                               class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
+                        </div>
+                    </div>
+                <?php else: ?>
+                    <span class="text-sm text-secondary">
                         <?= relative_friendly_date($point->last_child_review_effective_date) ?>
                         <?php if($point->lastChildReview->creatorPro): ?>
-                        by <?= $point->lastChildReview->creatorPro->displayName() ?>
+                            by <?= $point->lastChildReview->creatorPro->displayName() ?>
                         <?php endif; ?>
                     </span>
-                    <div menu right class="bg-white border">
-                        <a native target="_blank"
-                           href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>"
-                           class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
-                    </div>
-                </div>
+                <?php endif; ?>
             <?php endif; ?>
         <?php endif; ?>
 

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

@@ -1,87 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$points = Point::getUnifiedPointsOfCategory($patient, 'ALLERGY', $note);
-$tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
-$numRelevant = 0;
-$numVisible = 0;
-$plural = 'Allergies';
-?>
-
-<?php if($tracker && @($tracker->data->no_known_drug_allergies)): ?>
-    <div class="text-secondary mb-2"><span>-</span></div>
-<?php endif; ?>
-<?php if($tracker && @($tracker->data->no_known_allergies_of_any_type)): ?>
-    <div class="text-secondary mb-2"><span>-</span></div>
-<?php endif; ?>
-
-<?php if(!$tracker || !@($tracker->data->no_known_allergies_of_any_type)): ?>
-<?php if (!count($points)): ?>
-    <div class="text-secondary">-</div>
-<?php else: ?>
-    <table class="table table-bordered table-xs table-cage mb-0">
-    <?php $j = 0; foreach ($points as $point): $j++; ?>
-        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
-        <?php $rel = $point->relevanceToNote($note); ?>
-        <?php $plan = $point->lastChildPlan; ?>
-        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-        <?php $review = $point->lastChildReview; ?>
-        <?php if($review && @($review->data)) $review->data = json_decode($review->data); ?>
-        <?php $numVisible++; ?>
-        <tr>
-            <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
-                @if($rel)
-                    <?php $numRelevant++; ?>
-                    {{ $j }}.*
-                @else
-                    {{ $j }}.
-                @endif
-            </td>
-            <td class="px-2 width-300px">
-                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
-                    <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
-                </div>
-            </td>
-            <td class="px-2 width-300px">
-                <div>
-                    <?php if(!!$review): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Subj:</b><span>{!! $review->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                    <?php if(!!$plan): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Plan:</b><span>{!! $plan->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                </div>
-                <div class="d-flex align-items-baseline">
-                    <?php if ($point->is_removed): ?>
-                        @if($point->removal_reason_category === 'DURING_VISIT')
-                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
-                        @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-                        @endif
-                    <?php elseif ($point->added_in_note_id === $note->id): ?>
-                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
-                            <span class="ml-2 text-sm text-success">* Diagnosed during visit</span>
-                        <?php else: ?>
-                            <span class="ml-2 text-sm text-info">* Added on intake</span>
-                        <?php endif;?>
-                    <?php endif; ?>
-                </div>
-            </td>
-            <td></td>
-        </tr>
-    <?php endforeach; ?>
-    </table>
-    @if(!$numVisible)
-        <div class="d-flex align-items-baseline mr-1">
-            <span class="text-secondary">-</span>
-        </div>
-    @endif
-<?php endif; ?>
-<?php endif; ?>
+@include('app.patient.allergies-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,41 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$selfMonitoring = Point::getOnlyPointOfCategory($patient, 'SELF_MONITORING');
-$foodTriggers = Point::getOnlyPointOfCategory($patient, 'FOOD_TRIGGERS');
-$cravings = Point::getOnlyPointOfCategory($patient, 'CRAVINGS');
-$sleepHabits = Point::getOnlyPointOfCategory($patient, 'SLEEP_HABITS');
-
-$points = [
-    ["category" => 'SELF_MONITORING', "name" => 'Self Monitoring', "point" => $selfMonitoring],
-    ["category" => 'FOOD_TRIGGERS', "name" => 'Food Triggers', "point" => $foodTriggers],
-    ["category" => 'CRAVINGS', "name" => 'Cravings', "point" => $cravings],
-    ["category" => 'SLEEP_HABITS', "name" => 'Sleep Habits', "point" => $sleepHabits],
-];
-?>
-<table class="table table-bordered table-sm mb-0 table-cage">
-    <?php foreach ($points as $p): ?>
-    <?php $point = $p['point']; ?>
-    <?php if(!!$point): ?>
-    <?php $plan = $point->lastChildPlan; ?>
-    <?php if ($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-    <tr>
-        <td class="width-300px">
-            <?= $p['name'] ?>
-        </td>
-        <td class="width-300px">
-            <?php if(!!$plan): ?>
-            <div class="ml-3 inline-html-container">
-                <?php $plan = $plan->data; ?>
-                <?php include(resource_path('views/app/patient/segment-templates/_child_plan/behavior/' . $p['category'] . '/view-plan.php')); ?>
-            </div>
-            <?php endif; ?>
-        </td>
-        <td></td>
-    </tr>
-    <?php endif; ?>
-    <?php endforeach; ?>
-</table>
+@include('app.patient.behavior-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,77 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$points = Point::getUnifiedPointsOfCategory($patient, 'CARE_TEAM_MEMBER', $note);
-$numRelevant = 0;
-$numVisible = 0;
-$plural = 'Care team members';
-?>
-
-<?php if (!count($points)): ?>
-    <div class="text-secondary">-</div>
-<?php else: ?>
-    <table class="table table-bordered table-xs table-cage mb-0">
-    <?php $j = 0; foreach ($points as $point): $j++; ?>
-        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
-        <?php $rel = $point->relevanceToNote($note); ?>
-        <?php $plan = $point->lastChildPlan; ?>
-        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-        <?php $numVisible++; ?>
-        <tr>
-            <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
-                @if($rel)
-                    <?php $numRelevant++; ?>
-                    {{ $j }}.*
-                @else
-                    {{ $j }}.
-                @endif
-            </td>
-            <td class="px-2 width-300px">
-                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
-                    <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
-                    <?= !!@($point->data->specialty) ? '/&nbsp;' . @($point->data->specialty) . '' : '' ?>
-                    <?= !!@($point->data->organization) ? '/&nbsp;' . @($point->data->organization) . '' : '' ?><br>
-                    <?= !!@($point->data->phone) ? 'Ph: ' . @($point->data->phone) . '' : '' ?>
-                    <?= !!@($point->data->fax) ? '&nbsp;/&nbsp;Fax: ' . @($point->data->fax) . '<br>' : '' ?>
-                    <?= !!@($point->data->date) ? '&nbsp;/&nbsp;Date: ' . @($point->data->date) : '' ?>
-                </div>
-            </td>
-            <td class="px-2 width-300px">
-                <div class="pl-3">
-                    <?php if(!!$plan): ?>
-                        <div class="mt-1 d-flex align-items-baseline">
-                            <span>{!! $plan->data->value !!}</span>
-                        </div>
-                    <?php elseif($rel): ?>
-                        <div class="relevant-without-plan text-warning-mellow text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Plan missing</div>
-                    <?php endif; ?>
-                </div>
-                <div class="pl-3 d-flex align-items-baseline">
-                    <?php if ($point->is_removed): ?>
-                        @if($point->removal_reason_category === 'DURING_VISIT')
-                            <span class="mt-1 text-sm text-secondary">Removed during visit</span>
-                        @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="mt-1 text-sm text-secondary">Removed on intake</span>
-                        @endif
-                    <?php elseif ($point->added_in_note_id === $note->id): ?>
-                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
-                            <span class="mt-1 text-sm text-success">* Added during visit</span>
-                        <?php else: ?>
-                            <span class="mt-1 text-sm text-info">* Added on intake</span>
-                        <?php endif;?>
-                    <?php endif; ?>
-                </div>
-            </td>
-            <td></td>
-        </tr>
-    <?php endforeach; ?>
-    </table>
-    @if(!$numVisible)
-        <div class="d-flex align-items-baseline mr-1">
-            <span class="text-secondary">-</span>
-        </div>
-    @endif
-<?php endif; ?>
+@include('app.patient.careteam-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,43 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$aerobicActivity = Point::getOnlyPointOfCategory($patient, 'AEROBIC_ACTIVITY');
-$strengthTraining = Point::getOnlyPointOfCategory($patient, 'STRENGTH_TRAINING');
-$neat = Point::getOnlyPointOfCategory($patient, 'NEAT');
-
-$points = [
-    ["category" => 'AEROBIC_ACTIVITY', "name" => 'Aerobic Activity', "point" => $aerobicActivity],
-    ["category" => 'STRENGTH_TRAINING', "name" => 'Strength Training', "point" => $strengthTraining],
-    ["category" => 'NEAT', "name" => 'Non-Exercise Activity Time (NEAT)', "point" => $neat],
-];
-?>
-
-<?php if(!count($points)): ?>
-    <span>-</span>
-<?php endif ?>
-<table class="table table-bordered table-sm mb-0 table-cage">
-    <?php foreach ($points as $p): ?>
-    <?php $point = $p['point']; ?>
-    <?php if(!!$point): ?>
-    <?php $plan = $point->lastChildPlan; ?>
-    <?php if ($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-    <tr>
-        <td class="width-300px">
-            <?= $p['name'] ?>
-        </td>
-        <td class="width-300px">
-            <?php if(!!$plan): ?>
-            <div class="ml-3 inline-html-container">
-                <?php $plan = $plan->data; ?>
-                <?php include(resource_path('views/app/patient/segment-templates/_child_plan/exercise/' . $p['category'] . '/view-plan.php')); ?>
-            </div>
-            <?php endif; ?>
-        </td>
-        <td></td>
-    </tr>
-    <?php endif; ?>
-    <?php endforeach; ?>
-</table>
+@include('app.patient.exercise-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,77 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$points = Point::getUnifiedPointsOfCategory($patient, 'GOAL', $note);
-$numRelevant = 0;
-$numVisible = 0;
-$plural = 'Goals';
-?>
-
-<?php if (!count($points)): ?>
-    <div class="text-secondary">-</div>
-<?php else: ?>
-    <table class="table table-bordered table-xs table-cage mb-0">
-    <?php $j = 0; foreach ($points as $point): $j++; ?>
-        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
-        <?php $rel = $point->relevanceToNote($note); ?>
-        <?php $plan = $point->lastChildPlan; ?>
-        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-        <?php $review = $point->lastChildReview; ?>
-        <?php if($review && @($review->data)) $review->data = json_decode($review->data); ?>
-        <?php $numVisible++; ?>
-        <tr>
-            <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
-                @if($rel)
-                    <?php $numRelevant++; ?>
-                    {{ $j }}.*
-                @else
-                    {{ $j }}.
-                @endif
-            </td>
-            <td class="px-2 width-300px">
-                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
-                    <b><?= !!@($point->data->goal) ? @($point->data->goal) : '-' ?></b>
-                </div>
-            </td>
-            <td class="px-2 width-300px">
-                <div>
-                    <?php if(!!$review): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Subj:</b><span>{!! $review->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                    <?php if(!!$plan): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Plan:</b><span>{!! $plan->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                </div>
-                <div class="d-flex align-items-baseline">
-                    <?php if ($point->is_removed): ?>
-                        @if($point->removal_reason_category === 'DURING_VISIT')
-                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
-                        @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-                        @endif
-                    <?php elseif ($point->added_in_note_id === $note->id): ?>
-                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
-                            <span class="ml-2 text-sm text-success">* Prescribed during visit</span>
-                        <?php else: ?>
-                            <span class="ml-2 text-sm text-info">* Added on intake</span>
-                        <?php endif;?>
-                    <?php endif; ?>
-                </div>
-            </td>
-            <td></td>
-        </tr>
-    <?php endforeach; ?>
-    </table>
-    @if(!$numVisible)
-        <div class="d-flex align-items-baseline mr-1">
-            <span class="text-secondary">-</span>
-        </div>
-    @endif
-<?php endif; ?>
+@include('app.patient.goals-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,83 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$points = Point::getUnifiedPointsOfCategory($patient, 'MEDICATION', $note);
-$tracker = Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
-$numRelevant = 0;
-$numVisible = 0;
-$plural = 'Medications';
-?>
-
-<?php if($tracker && @($tracker->data->no_known_medications)): ?>
-    <div class="text-secondary"><span>-</span></div>
-<?php endif; ?>
-<?php if(!$tracker || !@($tracker->data->no_known_medications)): ?>
-<?php if (!count($points)): ?>
-    <div class="text-secondary">-</div>
-<?php else: ?>
-    <table class="table table-bordered table-xs table-cage mb-0">
-        <?php $j = 0; foreach ($points as $point): $j++; ?>
-        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
-        <?php $rel = $point->relevanceToNote($note); ?>
-        <?php $plan = $point->lastChildPlan; ?>
-        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-        <?php $review = $point->lastChildReview; ?>
-        <?php if($review && @($review->data)) $review->data = json_decode($review->data); ?>
-        <?php $numVisible++; ?>
-        <tr>
-            <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
-                @if($rel)
-                    <?php $numRelevant++; ?>
-                    {{ $j }}.*
-                @else
-                    {{ $j }}.
-                @endif
-            </td>
-            <td class="px-2 width-300px">
-                <div class="font-weight-bold <?= $point->is_removed ? 'strike-through' : '' ?>">
-                    <?= !!@($point->data->name) ? @($point->data->name) : '-' ?>
-                </div>
-            </td>
-            <td class="px-2 width-300px">
-                <div>
-                    <?php if(!!$review): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Subj:</b><span>{!! $review->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                    <?php if(!!$plan): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Plan:</b><span>{!! $plan->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                </div>
-                <div class="d-flex align-items-baseline">                
-                    <?php if ($point->is_removed): ?>
-                        @if($point->removal_reason_category === 'DURING_VISIT')
-                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
-                        @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-                        @endif
-                    <?php elseif ($point->added_in_note_id === $note->id): ?>
-                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
-                            <span class="ml-2 text-sm text-success">* Prescribed during visit</span>
-                        <?php else: ?>
-                            <span class="ml-2 text-sm text-info">* Added on intake</span>
-                        <?php endif;?>
-                    <?php endif; ?>
-                </div>
-            </td>
-            <td></td>
-        </tr>
-    <?php endforeach; ?>
-    </table>
-    @if(!$numVisible)
-        <div class="d-flex align-items-baseline mr-1">
-            <span class="text-secondary">-</span>
-        </div>
-    @endif
-<?php endif; ?>
-<?php endif; ?>
+@include('app.patient.medications-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,52 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$highSugarBeverages = Point::getOnlyPointOfCategory($patient, 'HIGH_SUGAR_BEVERAGES');
-$waterIntake = Point::getOnlyPointOfCategory($patient, 'WATER_INTAKE');
-$fastFood = Point::getOnlyPointOfCategory($patient, 'FAST_FOOD');
-$snacks = Point::getOnlyPointOfCategory($patient, 'SNACKS');
-$vegetables = Point::getOnlyPointOfCategory($patient, 'VEGETABLES');
-$portionSizes = Point::getOnlyPointOfCategory($patient, 'PORTION_SIZES');
-$dailyIntakeCarbohydrates = Point::getOnlyPointOfCategory($patient, 'DAILY_INTAKE_CARBOHYDRATES');
-$dailyIntakeCalories = Point::getOnlyPointOfCategory($patient, 'DAILY_INTAKE_CALORIES');
-
-$points = [
-    ["category" => 'HIGH_SUGAR_BEVERAGES', "name" => 'High Sugar Beverages', "point" => $highSugarBeverages],
-    ["category" => 'WATER_INTAKE', "name" => 'Water Intake', "point" => $waterIntake],
-    ["category" => 'FAST_FOOD', "name" => 'Fast Food', "point" => $fastFood],
-    ["category" => 'SNACKS', "name" => 'Snacks', "point" => $snacks],
-    ["category" => 'VEGETABLES', "name" => 'Vegetables', "point" => $vegetables],
-    ["category" => 'PORTION_SIZES', "name" => 'Portion Sizes', "point" => $portionSizes],
-    ["category" => 'DAILY_INTAKE_CARBOHYDRATES', "name" => 'Daily Intake Carbohydrates', "point" => $dailyIntakeCarbohydrates],
-    ["category" => 'DAILY_INTAKE_CALORIES', "name" => 'Daily Intake Calories', "point" => $dailyIntakeCalories],
-];
-?>
-
-<?php if(!count($points)): ?>
-    <span>-</span>
-<?php endif ?>
-<table class="table table-bordered table-sm mb-0 table-cage">
-    <?php foreach ($points as $p): ?>
-    <?php $point = $p['point']; ?>
-    <?php if(!!$point): ?>
-    <?php $plan = $point->lastChildPlan; ?>
-    <?php if ($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-    <tr>
-        <td class="width-300px">
-            <?= $p['name'] ?>
-        </td>
-        <td class="width-300px">
-            <?php if(!!$plan): ?>
-            <div class="ml-3">
-                <span>{!! $plan->data->value ? strip_tags($plan->data->value) : '-' !!}</span>
-            </div>
-            <?php endif; ?>
-        </td>
-        <td></td>
-    </tr>
-    <?php endif; ?>
-    <?php endforeach; ?>
-</table>
+@include('app.patient.nutrition-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

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

@@ -1,78 +1 @@
-<?php
-
-use App\Models\Point;
-
-/** @var \App\Models\Client $patient */
-
-$points = Point::getUnifiedPointsOfCategory($patient, 'PROBLEM', $note);
-$numRelevant = 0;
-$numVisible = 0;
-$plural = 'Problems';
-?>
-
-<?php if (!count($points)): ?>
-    <div class="text-secondary">-</div>
-<?php else: ?>
-    <table class="table table-bordered table-xs table-cage mb-0">
-    <?php $j = 0; foreach ($points as $point): $j++; ?>
-        <?php if($point->is_removed && $point->is_removed_due_to_entry_error) continue; ?>
-        <?php $rel = $point->relevanceToNote($note); ?>
-        <?php $plan = $point->lastChildPlan; ?>
-        <?php if($plan && @($plan->data)) $plan->data = json_decode($plan->data); ?>
-        <?php $review = $point->lastChildReview; ?>
-        <?php if($review && @($review->data)) $review->data = json_decode($review->data); ?>
-        <?php $numVisible++; ?>
-        <tr>
-            <td class="width-40px px-2 {{ $rel ? 'font-weight-bold text-info':'' }}">
-                @if($rel)
-                    <?php $numRelevant++; ?>
-                    {{ $j }}.*
-                @else
-                    {{ $j }}.
-                @endif
-            </td>
-            <td class="px-2 width-300px">
-                <div class="<?= $point->is_removed ? 'strike-through' : '' ?>">
-                    <b><?= !!@($point->data->name) ? @($point->data->name) : '-' ?></b>
-                </div>
-            </td>
-            <td class="px-2 width-300px">
-                <div>
-                    <?php if(!!$review): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Subj:</b><span>{!! $review->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                    <?php if(!!$plan): ?>
-                    <div class="pl-3 mt-1 d-flex align-items-baseline">
-                        <b class="text-secondary mr-1">Plan:</b><span>{!! $plan->data->value !!}</span>
-                    </div>
-                    <?php endif; ?>
-                </div>
-                <div class="d-flex align-items-baseline">
-                    <?php if ($point->is_removed): ?>
-                        @if($point->removal_reason_category === 'DURING_VISIT')
-                            <span class="ml-2 text-sm text-secondary">Removed during visit</span>
-                        @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
-                        @endif
-                    <?php elseif ($point->added_in_note_id === $note->id): ?>
-                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>
-                            <span class="ml-2 text-sm text-success">* Diagnosed during visit</span>
-                        <?php else: ?>
-                            <span class="ml-2 text-sm text-info">* Added on intake</span>
-                        <?php endif;?>
-                    <?php endif; ?>
-                </div>
-            </td>
-            <td></td>
-        </tr>
-    <?php endforeach; ?>
-    </table>
-    @if(!$numVisible)
-        <div class="d-flex align-items-baseline mr-1">
-            <span class="text-secondary">-</span>
-        </div>
-    @endif
-<?php endif; ?>
-
+@include('app.patient.problems-center', ['patient' => $patient, 'note' => $note, 'summaryView' => true])

+ 1 - 1
resources/views/app/patient/wizard-partials/state-badge.blade.php

@@ -4,7 +4,7 @@
     @elseif($point->added_in_note_id === $note->id && $point->addition_reason_category === 'ON_INTAKE')
         <div class="text-sm text-secondary">New Record - Pre-existing</div>
     @elseif($point->added_in_note_id !== $note->id)
-        <div class="text-sm text-secondary">Record Present Before Visit</div>
+        <!--<div class="text-sm text-secondary">Record Present Before Visit</div>-->
     @endif
 @elseif($point->state === 'HISTORIC')
     @if($point->removed_in_note_id === $note->id && $point->removal_reason_category === 'DURING_VISIT')