瀏覽代碼

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

Peter Muturi 3 年之前
父節點
當前提交
c803cd79dc
共有 47 個文件被更改,包括 741 次插入1393 次删除
  1. 47 20
      app/Http/Controllers/NoteController.php
  2. 12 0
      app/Models/Client.php
  3. 29 0
      public/css/style.css
  4. 3 0
      public/js/mc.js
  5. 1 1
      resources/views/app/patient/allergies-center.blade.php
  6. 2 80
      resources/views/app/patient/allergies.blade.php
  7. 10 0
      resources/views/app/patient/care-month/_matrix.blade.php
  8. 26 3
      resources/views/app/patient/care-month/dashboard.blade.php
  9. 1 1
      resources/views/app/patient/care-months.blade.php
  10. 3 82
      resources/views/app/patient/care-team.blade.php
  11. 1 1
      resources/views/app/patient/careteam-center.blade.php
  12. 31 574
      resources/views/app/patient/dashboard.blade.php
  13. 3 12
      resources/views/app/patient/dx-and-focus-areas.blade.php
  14. 5 486
      resources/views/app/patient/history.blade.php
  15. 3 49
      resources/views/app/patient/medications.blade.php
  16. 1 0
      resources/views/app/patient/note/custom-visit-with-layout.blade.php
  17. 1 4
      resources/views/app/patient/note/custom-visit.blade.php
  18. 10 3
      resources/views/app/patient/note/dashboard.blade.php
  19. 6 0
      resources/views/app/patient/note/dashboard_script.blade.php
  20. 143 0
      resources/views/app/patient/note/rhs-sidebar.blade.php
  21. 21 0
      resources/views/app/patient/note/segment.blade.php
  22. 10 0
      resources/views/app/patient/note/segment_script.blade.php
  23. 4 2
      resources/views/app/patient/notes.blade.php
  24. 35 0
      resources/views/app/patient/point-based-partials/allergies.blade.php
  25. 36 0
      resources/views/app/patient/point-based-partials/care-team.blade.php
  26. 36 0
      resources/views/app/patient/point-based-partials/dx.blade.php
  27. 26 0
      resources/views/app/patient/point-based-partials/fhx.blade.php
  28. 26 0
      resources/views/app/patient/point-based-partials/pmhx.blade.php
  29. 34 0
      resources/views/app/patient/point-based-partials/rx.blade.php
  30. 26 0
      resources/views/app/patient/point-based-partials/shx.blade.php
  31. 26 0
      resources/views/app/patient/point-based-partials/sochx.blade.php
  32. 31 33
      resources/views/app/patient/prescriptions/list.blade.php
  33. 13 4
      resources/views/app/patient/problems-center.blade.php
  34. 10 4
      resources/views/app/patient/segment-templates/history_family/edit.blade.php
  35. 9 3
      resources/views/app/patient/segment-templates/history_social/edit.blade.php
  36. 6 2
      resources/views/app/patient/segment-templates/history_surgical/edit.blade.php
  37. 9 4
      resources/views/app/patient/segment-templates/intake_problems/summary.blade.php
  38. 10 4
      resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php
  39. 6 1
      resources/views/app/patient/segment-templates/plan_problems/summary.blade.php
  40. 2 1
      resources/views/app/patient/settings.blade.php
  41. 3 3
      resources/views/app/patient/supply-orders.blade.php
  42. 4 4
      resources/views/app/patient/vitals-settings/bmi-management-summary.blade.php
  43. 2 0
      resources/views/app/patient/wizard-partials/common-fields.blade.php
  44. 14 10
      resources/views/app/patient/wizard-partials/common-script.blade.php
  45. 1 1
      resources/views/layouts/patient.blade.php
  46. 3 0
      routes/web.php
  47. 0 1
      storage/visit-template-ui-configs/mc_default_visit.json

+ 47 - 20
app/Http/Controllers/NoteController.php

@@ -92,32 +92,38 @@ class NoteController extends Controller
 
     public function getHtmlForSegment($segmentUid, $sessionKey){
 
-        $performer = AppSession::where('session_key', $sessionKey)->first();
-        if(!$performer || !$performer->is_active){
-            return response()->json([
-                'success'=>false,
-                'message'=>'Invalid session key'
-            ]);
-        }
-        $pro = $performer->pro;
+        $summaryHtml = '';
+        $editHtml = '';
 
-        $segment = Segment::where('uid', $segmentUid)->first();
-        $segmentTemplate = $segment->segmentTemplate;
+        try {
 
-        $note = $segment->note;
-        $patient = $note->client;
+            $performer = AppSession::where('session_key', $sessionKey)->first();
+            if (!$performer || !$performer->is_active) {
+                return response()->json([
+                    'success' => false,
+                    'message' => 'Invalid session key'
+                ]);
+            }
+            $pro = $performer->pro;
+
+            $segment = Segment::where('uid', $segmentUid)->first();
+            $segmentTemplate = $segment->segmentTemplate;
+
+            $note = $segment->note;
+            $patient = $note->client;
+
+            $data = compact('performer', 'pro', 'segment', 'segmentTemplate', 'note', 'patient');
 
-        $data = compact('performer', 'pro', 'segment', 'segmentTemplate', 'note', 'patient');
 
-        //try {
             $summaryHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/summary', $data)->render();
             $editHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/edit', $data)->render();
-      //  } catch (\Throwable $e) {
-//            return response()->json([
-//                'success'=>false,
-//                'message'=>$e->getMessage()
-//            ]);
-       // }
+
+        } catch (\Throwable $e) {
+            return response()->json([
+                'success' => false,
+                'message' => $e->getMessage()
+            ]);
+        }
 
         return response()->json([
             'success'=>true,
@@ -317,6 +323,27 @@ class NoteController extends Controller
         return '<div class="mrv-content border-top px-3 pt-2 mt-3">' . @$segment->summary_html . '</div>';
     }
 
+    public function chartSegmentView(Request $request, Client $patient, $segmentInternalName, $view) {
+        return view("app.patient.segment-templates.{$segmentInternalName}.{$view}", [
+            'patient' => $patient,
+            'note' => $patient->coreNote,
+            'segmentInternalName' => $segmentInternalName
+        ]);
+    }
+
+    public function noteSegmentView(Request $request, Client $patient, Note $note, Segment $segment, $segmentInternalName, $view) {
+        return view("app.patient.segment-templates.{$segmentInternalName}.{$view}", [
+            'patient' => $patient,
+            'note' => $patient->coreNote,
+            'segment' => $segment,
+            'segmentInternalName' => $segmentInternalName
+        ]);
+    }
+
+    public function rhsSidebar(Request $request, Client $patient, Note $note) {
+        return view('app.patient.note.rhs-sidebar', compact('patient', 'note'));
+    }
+
     public function medicationsCenter(Request $request, Client $patient, Note $note) {
         return view('app.patient.medications-center', compact('patient', 'note'));
     }

+ 12 - 0
app/Models/Client.php

@@ -108,6 +108,18 @@ class Client extends Model
             ->orderByRaw('note_id DESC NULLS LAST');
     }
 
+    public function prescriptionsCreatedInNote($note)
+    {
+        return Erx::where('client_id', $this->id)
+            ->where('note_id', $note->id)
+            ->orderBy('created_at', 'desc')
+            ->where(function ($q) {
+                $q->whereNull('pro_declared_status')
+                    ->orWhere('pro_declared_status', '<>', 'CANCELLED');
+            })
+            ->get();
+    }
+
     public function notesAscending()
     {
         return $this->hasMany(Note::class, 'client_id', 'id')

+ 29 - 0
public/css/style.css

@@ -313,6 +313,9 @@ body>nav.navbar {
 .mcp-theme-1 .width-90px {
     width: 90px !important;
 }
+.mcp-theme-1 .min-width-110px {
+    min-width: 110px !important;
+}
 .mcp-theme-1 .min-width-140px {
     min-width: 140px !important;
 }
@@ -2061,6 +2064,7 @@ body.in-iframe .main-row > .sidebar {
 }
 .note-container .note-lhs-tree.fixed ~ .note-rhs-content {
     margin-left: 220px;
+    margin-right: 180px;
 }
 .note-container .note-lhs-tree .note-tree-node.note-tree-heading>a {
 
@@ -2100,6 +2104,31 @@ body.in-iframe .main-row > .sidebar {
 .note-container .note-rhs-content {
     flex-grow: 1;
 }
+.note-container .note-rhs-sidebar {
+    min-width: 180px;
+    max-width: 180px;
+    align-self: stretch;
+    border-right: 1px solid #ddd;
+    padding-top: 0.85rem;
+    height: 300px;
+    overflow: hidden;
+    max-height: calc(100vh - 55px);
+    background-color: #fff;
+}
+.note-container .note-rhs-sidebar:hover {
+    overflow: overlay;
+}
+.note-container .note-rhs-sidebar.fixed {
+    position: fixed;
+    top: 55px;
+    right: 0;
+    max-height: calc(100vh - 55px) !important;
+    height: calc(100vh - 55px) !important;
+    z-index: 1;
+}
+.note-container .note-rhs-sidebar.fixed ~ .note-rhs-content {
+    margin-right: 180px;
+}
 .spot-highlight {
     background: aliceblue !important;
 }

+ 3 - 0
public/js/mc.js

@@ -485,6 +485,9 @@ window.saveVisitForm = function(_trigger, _silent = false, _close = false, _done
             if(typeof window.updateAllSegmentsInResponse !== 'undefined' && noteSection.length) {
                 window.updateAllSegmentsInResponse(_data, true, _silent);
             }
+            if(typeof window.refreshRHSSidebar !== 'undefined') {
+                window.refreshRHSSidebar();
+            }
             if(!_silent) {
                 hideMask();
                 if(noteSection.length) {

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

@@ -46,7 +46,7 @@ list($allergies, $counts) = Point::getPointsOfCategoryExtended($patient, 'ALLERG
                         @include('app.patient.wizard-partials.state-icon', ['point' => $allergy])
                         <div>
                             <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
-                            @include('app.patient.wizard-partials.state-badge', ['point' => $allergy, 'addedVerb' => 'Prescribed', 'removedVerb' => 'Discontinued'])
+                            @include('app.patient.wizard-partials.state-badge', ['point' => $allergy, 'addedVerb' => 'Diagnosed', 'removedVerb' => 'Discontinued'])
                         </div>
                     </div>
                 </td>

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

@@ -1,83 +1,5 @@
 @extends ('layouts.patient')
-
+<?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 @section('inner-content')
-    {{--<div class="">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="font-weight-bold m-0">Allergies</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="allergy">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Allergy"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary">Allergy</th>
-                <th class="px-2 text-secondary">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                <tr>
-                    <td class="px-2">{{$line->content_text}}</td>
-                    <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                    <td class="px-2 text-center delete-column">
-                        <span moe relative class="mr-2">
-                            <a class="on-hover-opaque" start show title="Edit">
-                                <i class="font-size-11 fa fa-edit"></i>
-                            </a>
-                            <form url="/api/clientInfoLine/updateContent" right>
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                <input type="hidden" name="category" value="allergy">
-                                <div class="mb-2">
-                                    <input type="text" class="form-control form-control-sm" name="contentText" placeholder="Allergy" value="{{$line->content_text}}">
-                                </div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </span>
-                        <span moe relative>
-                            <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                            <form url="/api/clientInfoLine/remove" right>
-                                <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                <p class="small">Are you sure you want to delete this entry?</p>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </span>
-                    </td>
-                </tr>
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    <hr>--}}
-    <div class="client-single-dashboard">
-        <div class="d-flex align-items-center pb-2">
-            <h6 class="my-0 font-weight-bold">Allergies</h6>
-            <span class="mx-2 text-secondary">|</span>
-            @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'allergies'])
-        </div>
-        <div class="bg-light border p-2 mb-3">
-            @include('app.patient.canvas-sections.allergies.summary')
-        </div>
-    </div>
+    @include('app.patient.point-based-partials.allergies')
 @endsection

+ 10 - 0
resources/views/app/patient/care-month/_matrix.blade.php

@@ -291,9 +291,19 @@ foreach ($days as $k => $day) {
     </tbody>
 </table>
 <div class="my-3 border p-3 d-none cm-tab" tab-key="bmi-summary">
+    <div class="d-flex align-items-baseline mb-2">
+        <b>BMI/Weight Management</b>
+        <span class="mx-2 text-secondary">|</span>
+        @include('app.patient.vitals-settings.bmi-management-form')
+    </div>
     @include('app.patient.vitals-settings.bmi-management-summary')
 </div>
 <div class="my-3 border p-3 d-none cm-tab" tab-key="bp-summary">
+    <div class="d-flex align-items-baseline mb-2">
+        <b>BP Management</b>
+        <span class="mx-2 text-secondary">|</span>
+        @include('app.patient.vitals-settings.bp-management-form')
+    </div>
     @include('app.patient.vitals-settings.bp-management-summary')
 </div>
     <div class="min-height-300px"></div>

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

@@ -65,7 +65,7 @@
                                         <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
                                         @foreach ($notes as $note)
                                             @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
-                                                <option value="{{$note->uid}}">{{$note->title}}</option>
+                                                <option value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
                                             @endif
                                         @endforeach
                                     </select>
@@ -166,8 +166,31 @@
 
         <div class="row m-negator bg-light py-1 text-sm-incl-children">
             <div class="col-3 pl-3-5">
-                <span class="text-secondary">MCP:</span>
-                <span class="text-nowrap">{{ $careMonth->mcp ? $careMonth->mcp->displayName() : '-' }}</span>
+                <div class="d-flex align-items-baseline">
+                    <span class="text-secondary">MCP:</span>
+                    <span class="ml-1">{{ $careMonth->mcp ? $careMonth->mcp->displayName() : '-' }}</span>
+                    <div moe class="ml-2 hide-inside-popup flex-grow-1">
+                        <a start show><i class="fa fa-edit"></i></a>
+                        <form url="/api/careMonth/assignMcpPro" class="mcp-theme-1">
+                            <input type="hidden" name="uid" value="{{$careMonth->uid}}">
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Physician Pro</label>
+                                <select provider-search data-pro-uid="{{ $careMonth->mcp ? $careMonth->mcp->uid : '' }}"
+                                        name="mcpProUid"
+                                        class="form-control form-control-sm">
+                                    <option value=""> --select--</option>
+                                </select>
+                            </div>
+                            <div>
+                                <button submit class="btn btn-sm btn-primary mr-1">Submit
+                                </button>
+                                <button cancel class="btn btn-sm btn-default border">
+                                    Cancel
+                                </button>
+                            </div>
+                        </form>
+                    </div>
+                </div>
             </div>
             <div class="col-3">
                 <span class="text-secondary">RMM:</span>

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

@@ -38,7 +38,7 @@
                                         <option value="">-- Visit Note --</option>
                                         @foreach ($notes as $note)
                                             @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
-                                                <option value="{{$note->uid}}">{{$note->title}}</option>
+                                                <option value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
                                             @endif
                                         @endforeach
                                     </select>

+ 3 - 82
resources/views/app/patient/care-team.blade.php

@@ -1,84 +1,5 @@
 @extends ('layouts.patient')
-
+<?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 @section('inner-content')
-    {{--<div class="">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="font-weight-bold m-0">Care Team</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="care_team">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Name"></div>
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Specialty" value="" placeholder="Specialty"></div>
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Organization" value="" placeholder="Organization"></div>
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Phone" value="" placeholder="Phone"></div>
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Fax" value="" placeholder="Fax"></div>
-                    <div class="mb-2"><input type="date" class="form-control form-control-sm" name="Next Appointment" value="" placeholder="Next Appointment"></div>
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Memo" value="" placeholder="Memo"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary">Name</th>
-                <th class="px-2 text-secondary">Specialty</th>
-                <th class="px-2 text-secondary">Organization</th>
-                <th class="px-2 text-secondary">Phone</th>
-                <th class="px-2 text-secondary">Fax</th>
-                <th class="px-2 text-secondary">Next Appointment</th>
-                <th class="px-2 text-secondary">Memo</th>
-                <th class="px-2 text-secondary">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                <tr>
-                    <td class="px-2">{{$line->content_text}}</td>
-                    <td class="px-2">{{ $line->contentDetail()->{"Specialty"} }}</td>
-                    <td class="px-2">{{ $line->contentDetail()->{"Organization"} }}</td>
-                    <td class="px-2">{{ $line->contentDetail()->{"Phone"} }}</td>
-                    <td class="px-2">{{ $line->contentDetail()->{"Fax"} }}</td>
-                    <td class="px-2">{{ $line->contentDetail()->{"Next Appointment"} }}</td>
-                    <td class="px-2">{{ $line->contentDetail()->{"Memo"} }}</td>
-                    <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                    <td class="px-2 text-center delete-column">
-                        <div moe relative>
-                            <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                            <form url="/api/clientInfoLine/remove" right>
-                                <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                <p class="small">Are you sure you want to delete this entry?</p>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    </td>
-                </tr>
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    <hr>--}}
-    <div class="client-single-dashboard">
-        <div class="d-flex align-items-center pb-2">
-            <h6 class="my-0 font-weight-bold text-secondary">Care Team</h6>
-            <span class="mx-2 text-secondary">|</span>
-            @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'care-team', 'class' => 'wide'])
-        </div>
-        <div class="bg-light border p-2 mb-3">
-            @include('app.patient.canvas-sections.care-team.summary')
-        </div>
-    </div>
-@endsection
+    @include('app.patient.point-based-partials.care-team')
+@endsection

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

@@ -46,7 +46,7 @@ list($careTeamMembers, $counts) = Point::getPointsOfCategoryExtended($patient, '
                         @include('app.patient.wizard-partials.state-icon', ['point' => $careTeamMember])
                         <div>
                             <b><?= !!@($careTeamMember->data->name) ? @($careTeamMember->data->name) : '-' ?></b>
-                            @include('app.patient.wizard-partials.state-badge', ['point' => $careTeamMember, 'addedVerb' => 'Prescribed', 'removedVerb' => 'Discontinued'])
+                            @include('app.patient.wizard-partials.state-badge', ['point' => $careTeamMember, 'removedVerb' => 'Discontinued'])
                         </div>
                     </div>
                 </td>

+ 31 - 574
resources/views/app/patient/dashboard.blade.php

@@ -47,41 +47,7 @@
                 @endif
 
                 <!-- allergies - point -->
-                <?php
-                $allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
-                ?>
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Allergies</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                        @if($patient->coreNote)
-                            <a native target="_blank"
-                               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
-                               open-in-stag-popup
-                               update-parent
-                               mc-initer="allergies-center-{{$patient->coreNote->id}}"
-                               title="Allergies Center"
-                               popup-style="wide overflow-visible"
-                               href="/allergies-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
-                                <i class="fa fa-bolt mr-1"></i>
-                                <span>Manage</span>
-                            </a>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @foreach($allergies as $allergy)
-                            <div class="mb-1">
-                                <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
-                                <?= !!@($allergy->data->description) ? '/&nbsp;' . @($allergy->data->description) : '' ?>
-                            </div>
-                        @endforeach
-                        @if(!count($allergies))
-                            <div class="text-secondary">Nothing here yet</div>
-                        @endif
-                    </div>
-                </div>
+                @include('app.patient.point-based-partials.allergies')
 
                 {{-- canvas based rx --}}
                 @if($isOldClient)
@@ -97,45 +63,7 @@
                 @endif
 
                 <!-- meds - point -->
-                <?php
-                $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
-                ?>
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Current Medications</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                        @if($patient->coreNote)
-                            <a native target="_blank"
-                               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
-                               open-in-stag-popup
-                               update-parent
-                               mc-initer="medications-center-{{$patient->coreNote->id}}"
-                               title="Medications Center"
-                               popup-style="wide overflow-visible"
-                               href="/medications-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
-                                <i class="fa fa-bolt mr-1"></i>
-                                <span>Manage</span>
-                            </a>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @foreach($medications as $medication)
-                            <div class="mb-1">
-                                <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
-                            </div>
-                        @endforeach
-                        @if(!count($medications))
-                            <div class="text-secondary">Nothing here yet</div>
-                        @endif
-                    </div>
-                </div>
-
-                {{-- rm reasons --}}
-                <div class="pt-2 mt-2 border-top">
-                    @include('app/patient/partials/rm-reasons')
-                </div>
+                @include('app.patient.point-based-partials.rx')
 
                 {{-- devices --}}
                 <?php
@@ -298,59 +226,37 @@
             </div>
             <div class="col-6">
 
-                {{-- medical-team --}}
-                @include('app/patient/partials/medical-team')
-
                 {{-- canvas based dx --}}
                 @if($isOldClient)
-                <div class="pt-2 mt-2 border-top">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.dx.summary')
+                    <div class="pt-2 mt-2 border-top">
+                        <div class="d-flex align-items-center pb-2">
+                            <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
+                            <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
+                        </div>
+                        <div class="bg-light border p-2 mb-3">
+                            @include('app.patient.canvas-sections.dx.summary')
+                        </div>
                     </div>
-                </div>
                 @endif
 
                 <!-- probs - point -->
-                <?php
-                $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
-                ?>
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                        @if($patient->coreNote)
-                            <a native target="_blank"
-                               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
-                               open-in-stag-popup
-                               update-parent
-                               mc-initer="problems-center-{{$patient->coreNote->id}}"
-                               title="Problems Center"
-                               popup-style="wide overflow-visible"
-                               href="/problems-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
-                                <i class="fa fa-bolt mr-1"></i>
-                                <span>Manage</span>
-                            </a>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @foreach($problems as $problem)
-                            <div class="mb-1">
-                                <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
-                                <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
-                                <?= !!@($problem->data->description) ? '/&nbsp;' . @($problem->data->description) : '' ?>
-                            </div>
-                        @endforeach
-                        @if(!count($problems))
-                            <div class="text-secondary">Nothing here yet</div>
-                        @endif
+                @include('app.patient.point-based-partials.dx')
+
+                {{-- canvas based careteam --}}
+                @if($isOldClient)
+                    <div class="pt-2 mt-2 border-top">
+                        <div class="d-flex align-items-center pb-2">
+                            <h6 class="my-0 font-weight-bold text-secondary">Care Team</h6>
+                            <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
+                        </div>
+                        <div class="bg-light border p-2 mb-3">
+                            @include('app.patient.canvas-sections.care-team.summary')
+                        </div>
                     </div>
-                </div>
+                @endif
+
+                <!-- careteam - point -->
+                @include('app.patient.point-based-partials.care-team')
 
                 {{-- history_medical --}}
                 @if($isOldClient)
@@ -366,17 +272,7 @@
                 @endif
 
                 <!-- pmhx - point -->
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Medical History</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.segment-templates.past_medical_history.summary', compact('patient'))
-                    </div>
-                </div>
+                @include('app.patient.point-based-partials.pmhx')
 
                 {{-- history_surgical --}}
                 @if($isOldClient)
@@ -392,17 +288,7 @@
                 @endif
 
                 <!-- pshx - point -->
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Surgical History</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.segment-templates.history_surgical.summary', compact('patient'))
-                    </div>
-                </div>
+                @include('app.patient.point-based-partials.shx')
 
                 {{-- history_family --}}
                 @if($isOldClient)
@@ -418,17 +304,7 @@
                 @endif
 
                 <!-- fhx - point -->
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Family History</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.segment-templates.history_family.summary', compact('patient'))
-                    </div>
-                </div>
+                @include('app.patient.point-based-partials.fhx')
 
                 {{-- history_social --}}
                 @if($isOldClient)
@@ -444,429 +320,9 @@
                 @endif
 
                 <!-- sochx - point -->
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Social History</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.segment-templates.history_social.summary', compact('patient'))
-                    </div>
-                </div>
-
-                {{-- history_ob_and_preg --}}
-                <div class="pl-2 mt-2 border-top pt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">OB & Pregnancy</h6>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="py-0 font-weight-normal">Add</a>
-                            <form url="/api/clientInfoLine/create">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_ob_and_preg">
-                                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="OB & Pregnancy History"></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="">Multi</a>
-                            <form url="/api/clientInfoLine/createMultiple">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_ob_and_preg">
-                                <div class="mb-2"><textarea class="form-control form-control-sm" rows="8" name="contentTexts" value="" placeholder="Lines..."></textarea></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    </div>
-                    <table class="table table-sm border-0 m-0">
-                        <tbody>
-                        @foreach($infoLines as $category => $lines)
-                            @if($category === "history_ob_and_preg")
-                                @foreach ($lines as $line)
-                                    <tr>
-                                        {{--<td class="px-2">{{$category}}</td>--}}
-                                        <td class="pl-4 py-0 border-0">
-                                            <div class="d-flex">
-                                                <span moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Delete"><i class="font-size-11 fa fa-trash-alt text-danger"></i></a>
-                                                    <form url="/api/clientInfoLine/remove">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </span>
-                                                <div moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Edit">
-                                                        <i class="font-size-11 fa fa-edit"></i>
-                                                    </a>
-                                                    <form url="/api/clientInfoLine/updateContent">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                                        <input type="hidden" name="category" value="history_ob_and_preg">
-                                                        <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="{{$line->contentText}}" placeholder="History"></div>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </div>
-                                                <span class="">{{$line->contentText}}</span>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                @endforeach
-                            @endif
-                        @endforeach
-                        </tbody>
-                    </table>
-                </div>
-
-                {{-- history_hospitalizations_procedures --}}
-                <div class="pl-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Hospitalizations / Procedures</h6>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="py-0 font-weight-normal">Add</a>
-                            <form url="/api/clientInfoLine/create">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_hospitalizations_procedures">
-                                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Hospitalizations / Procedures History"></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="">Multi</a>
-                            <form url="/api/clientInfoLine/createMultiple">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_hospitalizations_procedures">
-                                <div class="mb-2"><textarea class="form-control form-control-sm" rows="8" name="contentTexts" value="" placeholder="Lines..."></textarea></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    </div>
-                    <table class="table table-sm border-0 m-0">
-                        <tbody>
-                        @foreach($infoLines as $category => $lines)
-                            @if($category === "history_hospitalizations_procedures")
-                                @foreach ($lines as $line)
-                                    <tr>
-                                        {{--<td class="px-2">{{$category}}</td>--}}
-                                        <td class="pl-4 py-0 border-0">
-                                            <div class="d-flex">
-                                                <span moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Delete"><i class="font-size-11 fa fa-trash-alt text-danger"></i></a>
-                                                    <form url="/api/clientInfoLine/remove">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </span>
-                                                <div moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Edit">
-                                                        <i class="font-size-11 fa fa-edit"></i>
-                                                    </a>
-                                                    <form url="/api/clientInfoLine/updateContent">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                                        <input type="hidden" name="category" value="history_hospitalizations_procedures">
-                                                        <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="{{$line->contentText}}" placeholder="History"></div>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </div>
-                                                <span class="">{{$line->contentText}}</span>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                @endforeach
-                            @endif
-                        @endforeach
-                        </tbody>
-                    </table>
-                </div>
-
-                {{-- history_screenings --}}
-                <div class="pl-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Screenings</h6>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="py-0 font-weight-normal">Add</a>
-                            <form url="/api/clientInfoLine/create">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_screenings">
-                                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Screenings History"></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="">Multi</a>
-                            <form url="/api/clientInfoLine/createMultiple">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_screenings">
-                                <div class="mb-2"><textarea class="form-control form-control-sm" rows="8" name="contentTexts" value="" placeholder="Lines..."></textarea></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    </div>
-                    <table class="table table-sm border-0 m-0">
-                        <tbody>
-                        @foreach($infoLines as $category => $lines)
-                            @if($category === "history_screenings")
-                                @foreach ($lines as $line)
-                                    <tr>
-                                        {{--<td class="px-2">{{$category}}</td>--}}
-                                        <td class="pl-4 py-0 border-0">
-                                            <div class="d-flex">
-                                                <span moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Delete"><i class="font-size-11 fa fa-trash-alt text-danger"></i></a>
-                                                    <form url="/api/clientInfoLine/remove">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </span>
-                                                <div moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Edit">
-                                                        <i class="font-size-11 fa fa-edit"></i>
-                                                    </a>
-                                                    <form url="/api/clientInfoLine/updateContent">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                                        <input type="hidden" name="category" value="history_screenings">
-                                                        <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="{{$line->contentText}}" placeholder="History"></div>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </div>
-                                                <span class="">{{$line->contentText}}</span>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                @endforeach
-                            @endif
-                        @endforeach
-                        </tbody>
-                    </table>
-                </div>
-
-                {{-- history_colonoscopy --}}
-                <div class="pl-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Colonoscopy</h6>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="py-0 font-weight-normal">Add</a>
-                            <form url="/api/clientInfoLine/create">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_colonoscopy">
-                                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Colonoscopy History"></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    </div>
-                    <table class="table table-sm border-0 m-0">
-                        <tbody>
-                        @foreach($infoLines as $category => $lines)
-                            @if($category === "history_colonoscopy")
-                                @foreach ($lines as $line)
-                                    <tr>
-                                        {{--<td class="px-2">{{$category}}</td>--}}
-                                        <td class="pl-4 py-0 border-0">
-                                            <div class="d-flex">
-                                                <span moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Delete"><i class="font-size-11 fa fa-trash-alt text-danger"></i></a>
-                                                    <form url="/api/clientInfoLine/remove">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </span>
-                                                <div moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Edit">
-                                                        <i class="font-size-11 fa fa-edit"></i>
-                                                    </a>
-                                                    <form url="/api/clientInfoLine/updateContent">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                                        <input type="hidden" name="category" value="history_colonoscopy">
-                                                        <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="{{$line->contentText}}" placeholder="History"></div>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </div>
-                                                <span class="">{{$line->contentText}}</span>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                @endforeach
-                            @endif
-                        @endforeach
-                        </tbody>
-                    </table>
-                </div>
-
-                {{-- history_mammogram --}}
-                <div class="pl-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold">Mammogram</h6>
-                        <span class="mx-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show class="py-0 font-weight-normal">Add</a>
-                            <form url="/api/clientInfoLine/create">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="history_mammogram">
-                                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Mammogram History"></div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </div>
-                    </div>
-                    <table class="table table-sm border-0 m-0">
-                        <tbody>
-                        @foreach($infoLines as $category => $lines)
-                            @if($category === "history_mammogram")
-                                @foreach ($lines as $line)
-                                    <tr>
-                                        {{--<td class="px-2">{{$category}}</td>--}}
-                                        <td class="pl-4 py-0 border-0">
-                                            <div class="d-flex">
-                                                <span moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Delete"><i class="font-size-11 fa fa-trash-alt text-danger"></i></a>
-                                                    <form url="/api/clientInfoLine/remove">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </span>
-                                                <div moe relative class="mr-2">
-                                                    <a class="on-hover-opaque" start show title="Edit">
-                                                        <i class="font-size-11 fa fa-edit"></i>
-                                                    </a>
-                                                    <form url="/api/clientInfoLine/updateContent">
-                                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                                        <input type="hidden" name="category" value="history_mammogram">
-                                                        <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="{{$line->contentText}}" placeholder="History"></div>
-                                                        <div class="d-flex align-items-center">
-                                                            <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                        </div>
-                                                    </form>
-                                                </div>
-                                                <span class="">{{$line->contentText}}</span>
-                                            </div>
-                                        </td>
-                                    </tr>
-                                @endforeach
-                            @endif
-                        @endforeach
-                        </tbody>
-                    </table>
-                </div>
+                @include('app.patient.point-based-partials.sochx')
 
-                {{-- ROS --}}
-                <div class="pt-2 mt-2 border-top">
-                    <div class="note-section">
-                        <div class="d-flex align-items-center pb-2">
-                            <h6 class="my-0 font-weight-bold text-secondary">ROS</h6>
-                            <span class="mx-2 text-secondary">|</span>
-                            @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'ros'])
-                            @include('app.patient.note.section_script')
-                        </div>
-                        <div class="bg-light border p-2 mb-3">
-                            @include('app.patient.canvas-sections.ros.summary')
-                        </div>
-                    </div>
-                </div>
 
-                {{-- canvas based careteam --}}
-                @if($isOldClient)
-                <div class="pt-2 mt-2 border-top">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Care Team</h6>
-                        <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @include('app.patient.canvas-sections.care-team.summary')
-                    </div>
-                </div>
-                @endif
-
-                <!-- careteam - point -->
-                <?php
-                $careTeamMembers = \App\Models\Point::getPointsOfCategory($patient, "CARE_TEAM_MEMBER");
-                ?>
-                <div class="pt-2 mt-2">
-                    <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Care Team</h6>
-                        @if($isOldClient)
-                        <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
-                        @endif
-                    </div>
-                    <div class="bg-light border p-2 mb-3">
-                        @foreach($careTeamMembers as $careTeamMember)
-                            <div class="mb-1">
-                                <b><?= !!@($careTeamMember->data->name) ? @($careTeamMember->data->name) : '-' ?></b>
-                                <?= !!@($careTeamMember->data->spacialty) ? '/&nbsp;' . @($careTeamMember->data->spacialty) . '<br>' : '' ?>
-                                <?= !!@($careTeamMember->data->organization) ? '/&nbsp;' . @($careTeamMember->data->organization) . '<br>' : '' ?>
-                            </div>
-                        @endforeach
-                        @if(!count($careTeamMembers))
-                            <div class="text-secondary">Nothing here yet</div>
-                        @endif
-                    </div>
-                </div>
             </div>
         </div>
         <?php /* <div class="row my-3">
@@ -1221,6 +677,7 @@
 
             }
             addMCInitializer('patient-dashboard-devices', init, '#patient-dashboard-devices');
+
         }).call(window);
     </script>
 @endsection

+ 3 - 12
resources/views/app/patient/dx-and-focus-areas.blade.php

@@ -1,14 +1,5 @@
 @extends ('layouts.patient')
-
+<?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 @section('inner-content')
-    <div class="client-single-dashboard">
-        <div class="d-flex align-items-center pb-2">
-            <h6 class="my-0 font-weight-bold">Current Problems / Focus Areas</h6>
-            <span class="mx-2 text-secondary">|</span>
-            @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'dx', 'class' => 'wide'])
-        </div>
-        <div class="bg-light border p-2 mb-3">
-            @include('app.patient.canvas-sections.dx.summary')
-        </div>
-    </div>
-@endsection
+    @include('app.patient.point-based-partials.dx')
+@endsection

+ 5 - 486
resources/views/app/patient/history.blade.php

@@ -1,489 +1,8 @@
 @extends ('layouts.patient')
-
+<?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 @section('inner-content')
-    <div class="">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Medical History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_medical">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Medical History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_medical")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_surgical --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Surgical History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_surgical">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Surgical History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_surgical")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_family --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Family History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_family">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Family History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_family")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_social --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Social History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_social">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Social History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_social")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_ob_and_preg --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">OB & Pregnancy History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_ob_and_preg">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="OB & Pregnancy History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_ob_and_preg")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_hospitalizations_procedures --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Hospitalizations / Procedures History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_hospitalizations_procedures">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Hospitalizations / Procedures History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_hospitalizations_procedures")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_screenings --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Screenings History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_screenings">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Screenings History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_screenings")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_colonoscopy --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Colonoscopy History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_colonoscopy">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Colonoscopy History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_colonoscopy")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
-    {{-- history_mammogram --}}
-    <div class="mt-4">
-        <div class="d-flex align-items-center pb-2">
-            <h4 class="m-0 font-weight-bold">Mammogram History</h4>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe>
-                <a start show class="py-0 mb-3">Add</a>
-                <form url="/api/clientInfoLine/create">
-                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                    <input type="hidden" name="category" value="history_mammogram">
-                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Mammogram History"></div>
-                    <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                    </div>
-                </form>
-            </div>
-        </div>
-        <table class="table table-striped table-sm table-bordered">
-            <thead>
-            <tr>
-                <th class="px-2 text-secondary w-25">History</th>
-                <th class="px-2 text-secondary w-25">Created By</th>
-                <th class="px-2 text-secondary">Created At</th>
-                <th class="px-2 text-secondary delete-column">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            @foreach($infoLines as $line)
-                @if($line->category === "history_mammogram")
-                        <tr>
-                            <td class="px-2">{{$line->content_text}}</td>
-                            <td class="px-2">{{$line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                            <td class="px-2 text-center delete-column">
-                                <div moe relative>
-                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
-                                    <form url="/api/clientInfoLine/remove" right>
-                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                        <p class="small">Are you sure you want to delete this entry?</p>
-                                        <div class="d-flex align-items-center">
-                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
-                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                        </div>
-                                    </form>
-                                </div>
-                            </td>
-                        </tr>
-                @endif
-            @endforeach
-            </tbody>
-        </table>
-    </div>
-
+    @include('app.patient.point-based-partials.pmhx')
+    @include('app.patient.point-based-partials.shx')
+    @include('app.patient.point-based-partials.fhx')
+    @include('app.patient.point-based-partials.sochx')
 @endsection

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

@@ -1,51 +1,5 @@
 @extends ('layouts.patient')
+<?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
 @section('inner-content')
-    {{-- canvas based rx --}}
-    <div class="client-single-dashboard" id="client-rx-container">
-        <div class="d-flex align-items-center pb-2">
-            <h6 class="my-0 font-weight-bold">Current Medications</h6>
-            <span class="mx-2 text-secondary">|</span>
-            @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'rx', 'class' => 'wide'])
-            <span class="mx-2 text-secondary">|</span>
-            <a href="/patients/view/{{$patient->uid}}/tickets/erx?popupmode=1"
-               native target="_blank"
-               class="ticket-popup-trigger d-block text-nowrap mr-3">
-                Erx/Orders
-            </a>
-        </div>
-        <div class="bg-light border p-2 mb-3">
-            @include('app.patient.canvas-sections.rx.summary')
-        </div>
-    </div>
-    <div class="stag-popup stag-popup-lg ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
-
-    <script>
-        (function() {
-            function init() {
-                // refresh once ticket popup is closed
-                $('body').off('stag-popup-closed')
-                /*$('body').on('stag-popup-closed', function() {
-                    if($('#client-rx-container').length) {
-                        fastReload();
-                    }
-                });*/
-                // ticket-popup
-                $(document)
-                    .off('click', '.ticket-popup-trigger')
-                    .on('click', '.ticket-popup-trigger', function() {
-                        showMask();
-                        window.noMc = true;
-                        $.get(this.href, (_data) => {
-                            $('.ticket-popup').html(_data);
-                            showStagPopup('ticket-popup', true);
-                            // $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
-                            runMCInitializer('patient-tickets'); // run specific mc initer
-                            hideMask();
-                        });
-                        return false;
-                    });
-            }
-            addMCInitializer('client-erx-listing', init, '#client-rx-container');
-        }).call(window);
-    </script>
-@endsection
+    @include('app.patient.point-based-partials.rx')
+@endsection

+ 1 - 0
resources/views/app/patient/note/custom-visit-with-layout.blade.php

@@ -31,6 +31,7 @@
 
     function renderNoteTemplateLeaf($leaf, $segMap){
         $segment = $segMap[$leaf];
+        if(!$segment->edit_html && !$segment->summary_html) return;
          include('app/patient/note/segment/leaf.php');
          //echo($segment->summary_html);
     }

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

@@ -79,7 +79,7 @@
 </style>
 <div>
     <div class="row p-3">
-        <div class="col-md-8">
+        <div class="col-md-12">
             <div class="row segments-list" id="note-segments-list">
                 <div class="col-md-6 ">
                     <?php
@@ -96,9 +96,6 @@
                 </div>
             </div>
         </div>
-        <div class="col-md-4 border-left">
-            wizards here
-        </div>
     </div>
 </div>
 @include('app.patient.note.segment_script')

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

@@ -2276,7 +2276,7 @@
 
                 </div>
 
-                    @if($isVisitTemplateBased)
+                    @if($isVisitTemplateBased && !$note->is_signed_by_hcp)
                     <div class="position-sticky note-bottom-toolbar border-top border-info p-0 bg-aliceblue d-flex align-items-stretch">
                         <div class="nbt-container border-right border-info">
                             <!-- render mrv segment here -->
@@ -2391,6 +2391,9 @@
                     @endif
 
                 </div>
+                <div class="note-rhs-sidebar border-left" id="note-rhs-sidebar">
+                    @include('app.patient.note.rhs-sidebar')
+                </div>
             </div>
         </div>
     </div>
@@ -2432,7 +2435,7 @@
                          $(this).parent().find('>.note-tree-children>.note-tree-node>a[data-segment-uid]').first().trigger('click');
                          return false;
                     });
-                $('.note-tree-node>a[data-non-segment-target]')
+                $('[data-non-segment-target]')
                     .off('click.scroll-to-non-segment')
                     .on('click.scroll-to-non-segment', function() {
                         let section = $('div[data-non-segment-section="' + $(this).attr('data-non-segment-target') + '"]').first();
@@ -2453,16 +2456,20 @@
                     });
             }
             function fixTreeTopAndHeight() {
-                let tree = $('#note-lhs-tree'), noteCardHeader = $('#note-card-header');
+                let tree = $('#note-lhs-tree'), rhsSidebar = $('#note-rhs-sidebar'), noteCardHeader = $('#note-card-header');
                 if(!noteCardHeader.length) return;
                 let resultTop = (noteCardHeader.offset().top + noteCardHeader.outerHeight(true)) - $(window).scrollTop();
                 if(resultTop <= 55) {
                     tree.addClass('fixed');
+                    rhsSidebar.addClass('fixed');
                 }
                 else {
                     tree.removeClass('fixed');
                     tree.css('height', 'calc(100vh - ' + resultTop + 'px)');
                     tree.css('max-height', 'calc(100vh - ' + resultTop + 'px)');
+                    rhsSidebar.removeClass('fixed');
+                    rhsSidebar.css('height', 'calc(100vh - ' + resultTop + 'px)');
+                    rhsSidebar.css('max-height', 'calc(100vh - ' + resultTop + 'px)');
                 }
             }
             addMCInitializer('note-tree', init, '#note-lhs-tree');

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

@@ -150,6 +150,12 @@
                             return false;
                         }
 
+                        // OPEN popup for if note-segment-view exists
+                        if($('.' + editParent.attr('data-segment-template-name') + '-trigger').length) {
+                            $('.' + editParent.attr('data-segment-template-name') + '-trigger').trigger('click');
+                            return false;
+                        }
+
                         if(editParent.is('.edit')) {
                             editParent.removeClass('edit');
                         }

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

@@ -0,0 +1,143 @@
+<?php
+$allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
+$medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
+$problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
+$goals = \App\Models\Point::getPointsOfCategory($patient, "GOAL");
+$prescriptions = $patient->prescriptionsCreatedInNote($note);
+?>
+<div id="active-allergies" class="px-2 pb-2 border-bottom mb-2">
+    <div class="font-weight-bold mb-2">Allergies
+        <a native target="_blank"
+             class="c-pointer pl-1 text-primary"
+             open-in-stag-popup
+             mc-initer="allergies-center-{{$note->id}}"
+             title="Allergies Center"
+             popup-style="wide overflow-visible"
+             href="/allergies-center/{{$patient->uid}}/{{$note->uid}}">
+            <i class="fa fa-bolt mr-1"></i>
+        </a>
+    </div>
+    @if($allergies && count($allergies))
+        @foreach($allergies as $allergy)
+            <?php $rel = $allergy->relevanceToNote($note); ?>
+            <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                <span class="mr-1">•</span>
+                <span>{{$allergy->data->name}}</span>
+            </div>
+        @endforeach
+    @else
+        <span class="px-1 text-secondary">None</span>
+    @endif
+</div>
+<div id="active-medications" class="px-2 pb-2 border-bottom mb-2">
+    <div class="font-weight-bold mb-2">Medications
+        <a native target="_blank"
+           class="c-pointer pl-1 text-primary"
+           open-in-stag-popup
+           mc-initer="medications-center-{{$note->id}}"
+           title="Medications Center"
+           popup-style="wide overflow-visible"
+           href="/medications-center/{{$patient->uid}}/{{$note->uid}}">
+            <i class="fa fa-bolt mr-1"></i>
+        </a>
+    </div>
+    @if($medications && count($medications))
+        @foreach($medications as $medication)
+            <?php $rel = $medication->relevanceToNote($note); ?>
+            <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                <span class="mr-1">•</span>
+                <span>{{$medication->data->name}}</span>
+            </div>
+        @endforeach
+    @else
+        <span class="px-1 text-secondary">None</span>
+    @endif
+</div>
+<div id="active-problems" class="px-2 pb-2 border-bottom mb-2">
+    <div class="font-weight-bold mb-2">Problems
+        <a native target="_blank"
+           class="c-pointer pl-1 text-primary"
+           open-in-stag-popup
+           mc-initer="problems-center-{{$note->id}}"
+           title="Problems Center"
+           popup-style="wide overflow-visible"
+           href="/problems-center/{{$patient->uid}}/{{$note->uid}}">
+            <i class="fa fa-bolt mr-1"></i>
+        </a>
+    </div>
+    @if($problems && count($problems))
+        @foreach($problems as $problem)
+            <?php $rel = $problem->relevanceToNote($note); ?>
+            <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                <span class="mr-1">•</span>
+                <span>{{$problem->data->name}}</span>
+            </div>
+        @endforeach
+    @else
+        <span class="px-1 text-secondary">None</span>
+    @endif
+</div>
+<div id="active-goals" class="px-2 pb-2 border-bottom mb-2">
+    <div class="font-weight-bold mb-2">Goals
+        <a native target="_blank"
+           class="c-pointer pl-1 text-primary"
+           open-in-stag-popup
+           mc-initer="goals-center-{{$note->id}}"
+           title="Goals Center"
+           popup-style="wide overflow-visible"
+           href="/goals-center/{{$patient->uid}}/{{$note->uid}}">
+            <i class="fa fa-bolt mr-1"></i>
+        </a>
+    </div>
+    @if($goals && count($goals))
+        @foreach($goals as $goal)
+            <?php $rel = $goal->relevanceToNote($note); ?>
+            <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
+                <span class="mr-1">•</span>
+                <span>{{$goal->data->goal}}</span>
+            </div>
+        @endforeach
+    @else
+        <span class="px-1 text-secondary">None</span>
+    @endif
+</div>
+<div id="note-prescriptions" class="px-2 pb-2 border-bottom mb-2">
+    <div class="font-weight-bold mb-2">ERx &amp; Orders
+        <a native="" target="_top" data-non-segment-target="Prescriptions" href="#" class="font-weight-normal">View All</a>
+    </div>
+    @if($prescriptions && count($prescriptions))
+        @foreach($prescriptions as $prescription)
+            <div class="d-flex align-items-baseline px-1">
+                <span class="mr-2 text-secondary text-sm font-weight-bold">{{$prescription->erx_category}}</span>
+                <?php $parsed = json_decode($prescription->clinical_detail_json) ?>
+                <span class="flex-grow-1">
+                    <?php
+                    switch($prescription->erx_category) {
+                        case 'DRUG':
+                            if(@$parsed && @$parsed->items) {
+                                foreach ($parsed->items as $item) {
+                                    echo '<div>' . $item->medication . '</div>';
+                                }
+                            }
+                            break;
+                        case 'LAB':
+                        case 'IMAGING':
+                            if(@$parsed && @$parsed->items) {
+                                foreach ($parsed->items as $item) {
+                                    if(@$item->tests) {
+                                        foreach ($item->tests as $test) {
+                                            echo '<div>' . $test->desc . '</div>';
+                                        }
+                                    }
+                                }
+                            }
+                            break;
+                    }
+                    ?>
+                </span>
+            </div>
+        @endforeach
+    @else
+        <span class="px-1 text-secondary">None</span>
+    @endif
+</div>

+ 21 - 0
resources/views/app/patient/note/segment.blade.php

@@ -200,5 +200,26 @@
     </div>
     <?php endif ?>
 
+    {{-- popup trigger --}}
+    {{--
+    <div class="d-none">
+        <a native="" target="_blank"
+           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none <?= $segment->segmentTemplate->internal_name ?>-trigger"
+           open-in-stag-popup="" update-parent=""
+           mc-initer="<?= $segment->segmentTemplate->internal_name ?>_{{$patient->id}}"
+           title="{{$segment->subheading ? $segment->subheading . ' / ' : ''}}{{$segment->display_title}}"
+           popup-style="wide overflow-visible"
+           href="/note-segment-view/{{$patient->uid}}/{{$note->uid}}/{{$segment->uid}}/<?= $segment->segmentTemplate->internal_name ?>/edit">
+            <i class="fa fa-bolt mr-1"></i>
+            <span>Manage</span>
+        </a>
+        <script>
+        addMCInitializer('<?= $segment->segmentTemplate->internal_name ?>_{{$patient->id}}', function() {
+            window.segmentInitializers['<?= $segment->segmentTemplate->internal_name ?>'].call(window);
+        }, '.<?= $segment->segmentTemplate->internal_name ?>-trigger');
+        </script>
+    </div>
+    --}}
+
 </div>
 

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

@@ -9,6 +9,9 @@
                     updateSegmentByUid(_response.data.uid, _response.data.summaryHtml, _response.data.editHtml, _updateOnlySummary);
                 }
 
+                // refresh rhs-sidebar
+                window.refreshRHSSidebar();
+
                 // refresh listening segments
                 if(_updateListeners) {
                     if(_response.data && _response.data.listenerSegmentUids && _response.data.listenerSegmentUids.length) {
@@ -37,6 +40,10 @@
             }
         }
 
+        window.refreshRHSSidebar = function() {
+            $('#note-rhs-sidebar').load('/note-rhs-sidebar/{{$patient->uid}}/{{$note->uid}}');
+        };
+
         window.updateSegmentByUid = function(_uid, _summaryHtml, _editHtml, _updateOnlySummary) {
             let segment = $('.note-section[data-segment-uid="' + _uid + '"]');
             if(segment && segment.length) {
@@ -49,6 +56,9 @@
                     popupContainer.html(_editHtml);
                 }
 
+                // refresh rhs-sidebar
+                window.refreshRHSSidebar();
+
                 if(!_updateOnlySummary) {
                     initRTEs(segment);
                     initSegmentMoes(segment);

+ 4 - 2
resources/views/app/patient/notes.blade.php

@@ -2,13 +2,15 @@
 
 @section('inner-content')
 
+    <?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
+
     <div id="notes-list-{{$patient->id}}">
     <div class="pt-2 d-flex align-items-start">
         <h6 class="my-0 text-secondary d-flex align-items-center w-100">
             <span class="font-weight-bold text-secondary">Notes</span>
             @if(true || $patient->latestClientPrimaryCoverage->is_covered == 'YES')
+                @if($isOldClient)
                 <span class="mx-2 text-secondary">|</span>
-
                 <div moe>
                     <a start show class="py-0 mb-3">Add</a>
                     <form url="/api/note/createUsingTemplate"
@@ -58,8 +60,8 @@
                         </div>
                     </form>
                 </div>
+                @endif
                 <span class="mx-2 text-secondary">|</span>
-
                 <div moe>
                 <a start show class="py-0 mb-3 text-info font-weight-bold">Add Visit</a>
                 <form url="/api/visit/create"

+ 35 - 0
resources/views/app/patient/point-based-partials/allergies.blade.php

@@ -0,0 +1,35 @@
+<?php
+$allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
+?>
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Allergies</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        @if($patient->coreNote)
+            <a native target="_blank"
+               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
+               open-in-stag-popup
+               update-parent
+               mc-initer="allergies-center-{{$patient->coreNote->id}}"
+               title="Allergies Center"
+               popup-style="wide overflow-visible"
+               href="/allergies-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
+                <i class="fa fa-bolt mr-1"></i>
+                <span>Manage</span>
+            </a>
+        @endif
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @foreach($allergies as $allergy)
+            <div class="mb-1">
+                <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
+                <?= !!@($allergy->data->description) ? '/&nbsp;' . @($allergy->data->description) : '' ?>
+            </div>
+        @endforeach
+        @if(!count($allergies))
+            <div class="text-secondary">Nothing here yet</div>
+        @endif
+    </div>
+</div>

+ 36 - 0
resources/views/app/patient/point-based-partials/care-team.blade.php

@@ -0,0 +1,36 @@
+<?php
+$careTeamMembers = \App\Models\Point::getPointsOfCategory($patient, "CARE_TEAM_MEMBER");
+?>
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Care Team</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        @if($patient->coreNote)
+            <a native target="_blank"
+               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
+               open-in-stag-popup
+               update-parent
+               mc-initer="careteam-center-{{$patient->coreNote->id}}"
+               title="Care Team Center"
+               popup-style="wide overflow-visible"
+               href="/careteam-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
+                <i class="fa fa-bolt mr-1"></i>
+                <span>Manage</span>
+            </a>
+        @endif
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @foreach($careTeamMembers as $careTeamMember)
+            <div class="mb-1">
+                <b><?= !!@($careTeamMember->data->name) ? @($careTeamMember->data->name) : '-' ?></b>
+                <?= !!@($careTeamMember->data->spacialty) ? '/&nbsp;' . @($careTeamMember->data->spacialty) . '<br>' : '' ?>
+                <?= !!@($careTeamMember->data->organization) ? '/&nbsp;' . @($careTeamMember->data->organization) . '<br>' : '' ?>
+            </div>
+        @endforeach
+        @if(!count($careTeamMembers))
+            <div class="text-secondary">Nothing here yet</div>
+        @endif
+    </div>
+</div>

+ 36 - 0
resources/views/app/patient/point-based-partials/dx.blade.php

@@ -0,0 +1,36 @@
+<?php
+$problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
+?>
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        @if($patient->coreNote)
+            <a native target="_blank"
+               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
+               open-in-stag-popup
+               update-parent
+               mc-initer="problems-center-{{$patient->coreNote->id}}"
+               title="Problems Center"
+               popup-style="wide overflow-visible"
+               href="/problems-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
+                <i class="fa fa-bolt mr-1"></i>
+                <span>Manage</span>
+            </a>
+        @endif
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @foreach($problems as $problem)
+            <div class="mb-1">
+                <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
+                <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
+                <?= !!@($problem->data->description) ? '/&nbsp;' . @($problem->data->description) : '' ?>
+            </div>
+        @endforeach
+        @if(!count($problems))
+            <div class="text-secondary">Nothing here yet</div>
+        @endif
+    </div>
+</div>

+ 26 - 0
resources/views/app/patient/point-based-partials/fhx.blade.php

@@ -0,0 +1,26 @@
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Family History</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        <a native="" target="_blank"
+           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none fhx-trigger"
+           open-in-stag-popup="" update-parent=""
+           mc-initer="history_family_{{$patient->id}}"
+           title="Family History" popup-style="wide overflow-visible"
+           href="/chart-segment-view/{{$patient->uid}}/history_family/edit">
+            <i class="fa fa-bolt mr-1"></i>
+            <span>Manage</span>
+        </a>
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @include('app.patient.segment-templates.history_family.summary', compact('patient'))
+    </div>
+</div>
+<script>
+    if(!window.segmentInitializers) window.segmentInitializers = {};
+    addMCInitializer('history_family_{{$patient->id}}', function() {
+        window.segmentInitializers['history_family'].call(window);
+    }, '.fhx-trigger');
+</script>

+ 26 - 0
resources/views/app/patient/point-based-partials/pmhx.blade.php

@@ -0,0 +1,26 @@
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Medical History</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        <a native="" target="_blank"
+           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none pmhx-trigger"
+           open-in-stag-popup="" update-parent=""
+           mc-initer="past_medical_history_{{$patient->id}}"
+           title="Past Medical History" popup-style="wide overflow-visible"
+           href="/chart-segment-view/{{$patient->uid}}/past_medical_history/edit">
+            <i class="fa fa-bolt mr-1"></i>
+            <span>Manage</span>
+        </a>
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @include('app.patient.segment-templates.past_medical_history.summary', compact('patient'))
+    </div>
+</div>
+<script>
+    if(!window.segmentInitializers) window.segmentInitializers = {};
+    addMCInitializer('past_medical_history_{{$patient->id}}', function() {
+        window.segmentInitializers['past_medical_history'].call(window);
+    }, '.pmhx-trigger');
+</script>

+ 34 - 0
resources/views/app/patient/point-based-partials/rx.blade.php

@@ -0,0 +1,34 @@
+<?php
+$medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
+?>
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Current Medications</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        @if($patient->coreNote)
+            <a native target="_blank"
+               class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none"
+               open-in-stag-popup
+               update-parent
+               mc-initer="medications-center-{{$patient->coreNote->id}}"
+               title="Medications Center"
+               popup-style="wide overflow-visible"
+               href="/medications-center/{{$patient->uid}}/{{$patient->coreNote->uid}}">
+                <i class="fa fa-bolt mr-1"></i>
+                <span>Manage</span>
+            </a>
+        @endif
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @foreach($medications as $medication)
+            <div class="mb-1">
+                <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
+            </div>
+        @endforeach
+        @if(!count($medications))
+            <div class="text-secondary">Nothing here yet</div>
+        @endif
+    </div>
+</div>

+ 26 - 0
resources/views/app/patient/point-based-partials/shx.blade.php

@@ -0,0 +1,26 @@
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Surgical History</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        <a native="" target="_blank"
+           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none shx-trigger"
+           open-in-stag-popup="" update-parent=""
+           mc-initer="history_surgical_{{$patient->id}}"
+           title="Surgical History" popup-style="wide overflow-visible"
+           href="/chart-segment-view/{{$patient->uid}}/history_surgical/edit">
+            <i class="fa fa-bolt mr-1"></i>
+            <span>Manage</span>
+        </a>
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @include('app.patient.segment-templates.history_surgical.summary', compact('patient'))
+    </div>
+</div>
+<script>
+    if(!window.segmentInitializers) window.segmentInitializers = {};
+    addMCInitializer('history_surgical_{{$patient->id}}', function() {
+        window.segmentInitializers['history_surgical'].call(window);
+    }, '.shx-trigger');
+</script>

+ 26 - 0
resources/views/app/patient/point-based-partials/sochx.blade.php

@@ -0,0 +1,26 @@
+<div class="pt-2 mt-2">
+    <div class="d-flex align-items-center pb-2">
+        <h6 class="my-0 font-weight-bold text-secondary">Social History</h6>
+        @if($isOldClient)
+            <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
+        @endif
+        <a native="" target="_blank"
+           class="c-pointer d-inline-flex align-items-center ml-3 text-decoration-none sochx-trigger"
+           open-in-stag-popup="" update-parent=""
+           mc-initer="history_social_{{$patient->id}}"
+           title="Social History" popup-style="wide overflow-visible"
+           href="/chart-segment-view/{{$patient->uid}}/history_social/edit">
+            <i class="fa fa-bolt mr-1"></i>
+            <span>Manage</span>
+        </a>
+    </div>
+    <div class="bg-light border p-2 mb-3">
+        @include('app.patient.segment-templates.history_social.summary', compact('patient'))
+    </div>
+</div>
+<script>
+    if(!window.segmentInitializers) window.segmentInitializers = {};
+    addMCInitializer('history_social_{{$patient->id}}', function() {
+        window.segmentInitializers['history_social'].call(window);
+    }, '.sochx-trigger');
+</script>

+ 31 - 33
resources/views/app/patient/prescriptions/list.blade.php

@@ -48,7 +48,7 @@
                         @{{prescription.created_at_friendly_short}}
                     </a>
                     @if(@$note)
-                        <div v-if="prescription.note_id === {{$note->id}}" class="text-info mt-1">* Create on this note</div>
+                        <div v-if="prescription.note_id === {{$note->id}}" class="text-info mt-1 text-nowrap">* Created on this note</div>
                     @endif
                     <div v-if="prescription.pro_declared_status === 'CANCELLED'" class="text-secondary font-weight-bold mt-1 text-sm d-flex align-items-baseline">
                         <i class="fa fa-ban mr-1 text-sm"></i>
@@ -128,7 +128,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 flex-grow-1">
             <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>
@@ -139,22 +139,22 @@
             </div>
             <hr class="my-3">
             <div class="pb-2 d-flex align-items-start">
-                <span class="min-width-140px text-secondary text-sm">Created</span>
+                <span class="min-width-110px text-secondary text-sm">Created</span>
                 <div>
-                    <span>@{{currentPrescription.created_at_friendly}}</span>
+                    <span class="text-nowrap">@{{currentPrescription.created_at_friendly}}</span>
                     @if(@$note)
-                        <div v-if="currentPrescription.note_id === {{$note->id}}" class="text-info mt-1 font-weight-bold">* Create on this note</div>
+                        <div v-if="currentPrescription.note_id === {{$note->id}}" class="text-info mt-1 font-weight-bold text-nowrap">* Created on this note</div>
                     @endif
                 </div>
             </div>
             @if(!request()->input('erx_category'))
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Type</span>
+                <span class="min-width-110px text-secondary text-sm">Type</span>
                 <span>@{{currentPrescription.erx_category}}</span>
             </div>
             @endif
             <div class="pb-2 d-flex align-items-baseline" v-if="currentPrescription.erx_category !== 'DRUG'">
-                <span class="min-width-140px text-secondary text-sm">Clinical</span>
+                <span class="min-width-110px text-secondary text-sm">Clinical</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a v-if="!currentPrescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editClinicalDetails(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
@@ -197,7 +197,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'DRUG'">
-                <span class="min-width-140px text-secondary text-sm">Medications</span>
+                <span class="min-width-110px text-secondary text-sm">Medications</span>
                 <div class="flex-grow-1">
 
                     <div v-if="currentPrescription.clinical_detail_json">
@@ -221,10 +221,9 @@
                     </div>
 
                     @if(@$note)
-                    <div class="d-flex align-items-baseline" v-if="!currentPrescription.has_hcp_pro_signed">
-                        <a href="#" v-on:click.prevent="setAddMode('existing')">+ Existing Medication</a>
-                        <span class="mx-2">|</span>
-                        <a href="#" v-on:click.prevent="setAddMode('new')">+ New Medication</a>
+                    <div class="" v-if="!currentPrescription.has_hcp_pro_signed">
+                        <a href="#" class="d-block mb-1" v-on:click.prevent="setAddMode('existing')">+ Existing</a>
+                        <a href="#" class="d-block mb-1" v-on:click.prevent="setAddMode('new')">+ New</a>
                     </div>
                     @endif
                 </div>
@@ -239,12 +238,12 @@
                 <table class="m-0 table table-sm border bg-white table-hover">
                     <tr>
                         <th>Medication</th>
-                        <th>Dispense</th>
+                        <th>Disp.</th>
                         <th>Refills</th>
                         <th>&nbsp;</th>
                     </tr>
                     <tr v-for="drug in existingDrugs" v-if="notAlreadyAdded(drug.data.name)">
-                        <td class="min-width-200px">@{{ drug.data.name }}</td>
+                        <td class="">@{{ 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="text-right">
@@ -278,17 +277,17 @@
                     <div class="row mb-2">
                         <div class="col-12">
                             <label class="text-sm text-secondary mb-0">Name</label>
-                            <input type="text" data-name="name" class="form-control form-control-sm" stag-suggest="" stag-suggest-bottom-left="" stag-suggest-ep="/fdb-med-suggest-v2/json" required="" stag-suggest-initialized="1"><div class="stag-suggestions-container position-relative"><div class="suggestions-outer stag-suggestions position-absolute d-none"></div></div>
+                            <input type="text" data-name="name" class="form-control form-control-sm min-width-unset" stag-suggest="" stag-suggest-bottom-left="" stag-suggest-ep="/fdb-med-suggest-v2/json" required="" stag-suggest-initialized="1"><div class="stag-suggestions-container position-relative"><div class="suggestions-outer stag-suggestions position-absolute d-none"></div></div>
                         </div>
                     </div>
                     <div class="row mb-2">
                         <div class="col-4 pr-0">
                             <label class="text-sm text-secondary mb-0">Dispense</label>
-                            <input type="text" class="form-control form-control-sm" name="dispense" autocomplete="off">
+                            <input type="text" class="form-control form-control-sm min-width-unset" name="dispense" autocomplete="off">
                         </div>
                         <div class="col-4 pr-0">
                             <label class="text-sm text-secondary mb-0">Refills</label>
-                            <input type="text" class="form-control form-control-sm" name="refills" autocomplete="off">
+                            <input type="text" class="form-control form-control-sm min-width-unset" name="refills" autocomplete="off">
                         </div>
                     </div>
 
@@ -301,10 +300,10 @@
 
             <hr class="my-3">
             <div class="pb-2 d-flex align-items-center">
-                <span v-if="currentPrescription.erx_category === 'DRUG'" class="min-width-140px text-secondary text-sm">Pharmacy</span>
-                <span v-else-if="currentPrescription.erx_category === 'LAB'" class="min-width-140px text-secondary text-sm">Lab</span>
-                <span v-else-if="currentPrescription.erx_category === 'IMAGING'" class="min-width-140px text-secondary text-sm">Lab</span>
-                <span v-else class="min-width-140px text-secondary text-sm">Logistics</span>
+                <span v-if="currentPrescription.erx_category === 'DRUG'" class="min-width-110px text-secondary text-sm">Pharmacy</span>
+                <span v-else-if="currentPrescription.erx_category === 'LAB'" class="min-width-110px text-secondary text-sm">Lab</span>
+                <span v-else-if="currentPrescription.erx_category === 'IMAGING'" class="min-width-110px text-secondary text-sm">Lab</span>
+                <span v-else class="min-width-110px text-secondary text-sm">Logistics</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a class="mr-2" href="#" v-on:click.prevent="editLogisticsDetails(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.logistics_detail_json" class="d-flex align-items-baseline">
@@ -318,7 +317,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Prescribed By</span>
+                <span class="min-width-110px text-secondary text-sm">Prescribed By</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a v-if="!currentPrescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editHcpPro(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
@@ -326,7 +325,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Sign</span>
+                <span class="min-width-110px text-secondary text-sm">Sign</span>
                 <div v-if="currentPrescription.has_hcp_pro_signed" class="d-inline-flex align-items-baseline">
                     <i class="text-secondary fa fa-check mr-1"></i>
                     <span class="text-secondary">Signed</span>
@@ -339,7 +338,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Prescription Status</span>
+                <span class="min-width-110px text-secondary text-sm">Prescription Status</span>
                 <div class="d-inline-flex align-items-baseline">
                     <a class="mr-2" href="#" v-on:click.prevent="editProStatus(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.pro_declared_status" class="d-flex align-items-baseline">
@@ -349,7 +348,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Client Status</span>
+                <span class="min-width-110px text-secondary text-sm">Client Status</span>
                 <div class="d-inline-flex align-items-baseline">
                     <a class="mr-2" href="#" v-on:click.prevent="editClientStatus(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.client_declared_status" class="d-flex align-items-baseline">
@@ -358,16 +357,15 @@
                     <div v-else>-</div>
                 </div>
             </div>
-            <div class="pb-2 d-flex align-items-center">
-                <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"
+            <div class="pb-2 d-flex align-items-start">
+                <span class="min-width-110px text-secondary text-sm">PDF</span>
+                <div class="">
+                    <a class="pdf-viewer-trigger d-block mb-1" native target="_blank"
                        :href="'/prescription-download-as-pdf/' + currentPrescription.uid">View</a>
-                    <span class="mx-2 text-secondary">|</span>
-                    <a native target="_blank"
+                    <a native target="_blank" class="d-block mb-1"
                        :href="'/prescription-download-as-pdf/' + currentPrescription.uid">Download</a>
-                    <span class="mx-2 text-secondary">|</span>
-                    <a href="#" v-on:click.prevent="transmit(currentPrescription)">Transmit</a>
+                    <a href="#" class="d-block mb-1"
+                       v-on:click.prevent="transmit(currentPrescription)">Transmit</a>
                 </div>
             </div>
             <div v-if="!currentPrescription.has_hcp_pro_signed">

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

@@ -10,6 +10,7 @@ use App\Models\Segment;
 
 list($problems, $counts) = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
 $ccSegment = $note->getSegmentByInternalName('chief_complaint');
+$ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
 ?>
 
 <div class="mt-3 p-3 border-top min-height-500px" id="problems-center-{{$note->id}}">
@@ -62,7 +63,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
                                 <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
                                 <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
                             </div>
-                            @include('app.patient.wizard-partials.state-badge', ['point' => $problem, 'addedVerb' => 'Prescribed', 'removedVerb' => 'Discontinued'])
+                            @include('app.patient.wizard-partials.state-badge', ['point' => $problem, 'addedVerb' => 'Diagnosed', 'removedVerb' => 'Discontinued'])
                         </div>
                     </div>
                 </td>
@@ -110,7 +111,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
                             include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                             ?>
                         </div>
-                        <div class="d-inline-flex flex-nowrap">
+                        <div class="">
                             <a class="pl-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
@@ -119,6 +120,14 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
                                href="/point/plan-log/<?= $problem->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
+                            <div class="pl-2">
+                            <?php
+                            $segment = $note->getSegmentByInternalName('plan_problems');
+                            if($segment && $patient->core_note_id !== $note->id) {
+                                include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
+                            }
+                            ?>
+                            </div>
                         </div>
                     </div>
                 </td>
@@ -191,7 +200,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed', 'noReview' => true])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed', 'noReview' => true, 'noPlan' => true])
 
                             <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>
@@ -242,7 +251,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed', 'noReview' => true])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed', 'noReview' => true, 'noPlan' => true])
 
                         </div>
                         <div class="col-4 border-left">

+ 10 - 4
resources/views/app/patient/segment-templates/history_family/edit.blade.php

@@ -6,6 +6,8 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
+if(!@$segment) $segment = null;
+
 // try loading afresh - since base section might have gotten dynamically updated
 $point = Point::getGlobalSingletonOfCategory($patient, 'FAMILY_HISTORY', true);
 
@@ -47,9 +49,13 @@ if(!$contentData) {
 ?>
 
 <div class="p-3 border-top mt-3 mcp-theme-1">
-    <div visit-moe close-on-save close-on-cancel class="d-block">
+    <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="FAMILY_HISTORY">
             <input type="hidden" name="data">
 
@@ -273,7 +279,7 @@ if(!$contentData) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                <button cancel class="btn btn-sm btn-default border">Close</button>
             </div>
 
         </form>
@@ -282,7 +288,7 @@ if(!$contentData) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             new Vue({
                 el: '#edit-univ_history_family-container',

+ 9 - 3
resources/views/app/patient/segment-templates/history_social/edit.blade.php

@@ -7,6 +7,8 @@ use App\Models\Note;
 /** @var Note $note */
 /** @var Segment $segment */
 
+if(!@$segment) $segment = null;
+
 $fields = [
     [
         "Tobacco" => ["Current every day smoker", "Current some day smoker", "Former smoker", "Heavy tobacco smoker", "Light tobacco smoker", "Never smoker", "Smoker, current status unknown", "Unknown if ever smoked "],
@@ -56,9 +58,13 @@ for ($i = 0; $i < count($fields); $i++) {
 ?>
 
 <div class="p-3 border-top mt-3 mcp-theme-1">
-    <div visit-moe close-on-save close-on-cancel class="d-block">
+    <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="SOCIAL_HISTORY">
             <input type="hidden" name="data">
 
@@ -179,7 +185,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';

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

@@ -55,7 +55,11 @@ for ($i = 0; $i < count($fields); $i++) {
 <div class="p-3 border-top mt-3 mcp-theme-1">
     <div visit-moe close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="SURGICAL_HISTORY">
             <input type="hidden" name="data">
 
@@ -179,7 +183,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';

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

@@ -37,11 +37,16 @@ $numRelevant = 0;
                     <span class="ml-2 text-sm text-success">* Added on intake</span>
                 <?php endif; ?>
             </div>
-            <?php $review = $problem->childReviewAddedInNote($note); ?>
-            <?php if(!!$review): ?>
+            <?php $hpi = $problem->childReviewAddedInNote($note); ?>
+            <?php if(!!$hpi): ?>
             <div class="pl-3 mt-1">
-                <div class="text-secondary font-weight-bold">Review</div>
-                <div>{!! @$review->data->value !!}</div>
+                <div class="text-secondary font-weight-bold">HPI</div>
+                <?php
+                $point = $problem;
+                if(!@$template) $template = 'hpi/core.json';
+                $data = $hpi ? $hpi->data : null;
+                ?>
+                @include('app.dq-engine.read', compact('template', 'note', 'patient', 'point', 'data'))
             </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>

+ 10 - 4
resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php

@@ -7,6 +7,8 @@ use App\Models\Note;
 /** @var Note $note */
 /** @var Segment $segment */
 
+if(!@$segment) $segment = null;
+
 $fields = [
     [
         "Head" => ["Trauma"],
@@ -66,9 +68,13 @@ for ($i = 0; $i < count($fields); $i++) {
 ?>
 
 <div class="p-3 border-top mt-3 mcp-theme-1">
-    <div visit-moe close-on-save close-on-cancel class="d-block">
+    <div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
         <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
-            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @if(!!@$segment)
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            @else
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
+            @endif
             <input type="hidden" name="category" value="PAST_MEDICAL_HISTORY">
             <input type="hidden" name="data">
 
@@ -210,7 +216,7 @@ for ($i = 0; $i < count($fields); $i++) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                <button cancel class="btn btn-sm btn-default border">Close</button>
             </div>
 
         </form>
@@ -219,7 +225,7 @@ for ($i = 0; $i < count($fields); $i++) {
 <script>
     (function() {
 
-        window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function() {
+        window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
 
             let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
             model.newCustomItemLabel = '';

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

@@ -61,7 +61,12 @@ $numRelevantWithICD = 0;
             <?php if(!!$hpi): ?>
             <div class="pl-3 mt-1">
                 <div class="text-secondary font-weight-bold">HPI</div>
-                <div>{!! @$hpi->data->value !!}</div>
+                <?php
+                $point = $problem;
+                if(!@$template) $template = 'hpi/core.json';
+                $data = $hpi ? $hpi->data : null;
+                ?>
+                @include('app.dq-engine.read', compact('template', 'note', 'patient', 'point', 'data'))
             </div>
             <?php elseif($rel): ?>
             <div class="relevant-without-review block-signing text-danger text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>">

+ 2 - 1
resources/views/app/patient/settings.blade.php

@@ -191,6 +191,7 @@
                             </form>
                         </div>
                     </div>
+                </div>
 
                 <hr class="m-negator-3 my-3">
                 <div class="mt-3 mb-2">
@@ -1041,7 +1042,7 @@
                                     @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
                                         <option
                                             {{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
-                                            value="{{$note->uid}}">{{$note->title}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
+                                            value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
                                     @endif
                                 @endforeach
                                 {{--<option value="-- create --">-- Create Note --</option>--}}

+ 3 - 3
resources/views/app/patient/supply-orders.blade.php

@@ -9,9 +9,9 @@
                     <a start show href="#">Add</a>
                     <form url="/api/supplyOrder/create" redir="/patients/view/{{ $patient->uid }}/supply-orders/[data]">
 
-                        @if(!$patient->has_cm_setup_been_performed)
+                        {{--@if(!$patient->has_cm_setup_been_performed)
                             <p class="font-weight-bold alert alert-warning border-warning mb-0">You need to enroll this patient into CM before adding supply orders.</p>
-                        @else
+                        @else--}}
                             <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
                             <input type="hidden" name="noteUid" value="{{ request()->input('note-uid') }}">
                             <label class="text-secondary font-weight-bold">Add Supply Order</label>
@@ -56,7 +56,7 @@
                             <div class="d-flex align-items-center">
                                 <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
                             </div>
-                        @endif
+                        {{--@endif--}}
 
                     </form>
                 </div>

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

@@ -8,14 +8,14 @@
 
 <div class="mb-1">
     <span class="text-secondary">Weight (usual):</span>
-    <b><?= vsValue('usual_weight_in_pounds', $patient) ?></b>
-    <span class="text-secondary">(range <?= vsValue('usual_weight_in_pounds_min', $patient) ?> to <?= vsValue('usual_weight_in_pounds_max', $patient) ?>)</span>
+    Between <b><?= vsValue('usual_weight_in_pounds_min', $patient) ?></b>
+    and <b><?= vsValue('usual_weight_in_pounds_max', $patient) ?></b>
 </div>
 
 <div class="mb-3 ml-3">
     <span class="text-secondary">BMI (usual):</span>
-    <b><?= vsValue('usual_bmi', $patient) ?></b>
-    <span class="text-secondary"><?= vsValue('usual_bmi_category', $patient) ?></span>
+    Between <b><?= vsValue('usual_bmi_min', $patient) ?></b>
+    and <b><?= vsValue('usual_bmi_max', $patient) ?></b>
 </div>
 
 <div class="mb-1">

+ 2 - 0
resources/views/app/patient/wizard-partials/common-fields.blade.php

@@ -173,6 +173,7 @@
                 </div>
             @endif
             <div class="col-{{!@$noReview ? '6' : '12'}}">
+                @if(!@$noPlan)
                 <?php
                 $currentValue = '';
                 $previousValue = '';
@@ -215,6 +216,7 @@
                 </div>
                 <div class="d-none disallow-if-plan-same-as" compare-width="planValue"><?= str_compact($previousValue) ?></div>
                 <?php endif; ?>
+                @endif
             </div>
         </div>
     @endif

+ 14 - 10
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -223,12 +223,12 @@ parentSegment.find('#frm-add-{{$label}}')
         let payload = {};
         form.serializeArray().map(x => {payload[x.name] = x.value;});
         @if($patient->core_note_id !== $note->id)
-        if(!!reviewContent) {
+        if(!!reviewContent && $.trim($('<div/>').html(reviewContent).text())) {
             payload.childReviewData = JSON.stringify({
                 value: reviewContent
             })
         }
-        if(!!planContent) {
+        if(!!planContent && $.trim($('<div/>').html(planContent).text())) {
             payload.childPlanData = JSON.stringify({
                 value: planContent
             })
@@ -241,6 +241,7 @@ parentSegment.find('#frm-add-{{$label}}')
                 refreshDynamicStagPopup();
                 $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
                 $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                if(refreshRHSSidebar) refreshRHSSidebar();
             }
         }, 'json');
         return false;
@@ -327,12 +328,12 @@ parentSegment.find('.frm-edit-{{$label}}')
         let payload = {};
         form.serializeArray().map(x => {payload[x.name] = x.value;});
         @if($patient->core_note_id !== $note->id)
-        if(!!reviewContent) {
+        if(!!reviewContent && $.trim($('<div/>').html(reviewContent).text())) {
             payload.childReviewData = JSON.stringify({
                 value: reviewContent
             })
         }
-        if(!!planContent) {
+        if(!!planContent && $.trim($('<div/>').html(planContent).text())) {
             payload.childPlanData = JSON.stringify({
                 value: planContent
             })
@@ -353,8 +354,9 @@ parentSegment.find('.frm-edit-{{$label}}')
             if(!hasResponseError(_data)) {
                 hideMask();
                 refreshDynamicStagPopup();
-                $('.visit-segment[data-segment-template-name="intake_{{$label}}s"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_{{$label}}s"]').find('.refresh-segment').trigger('click');
+                $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                if(refreshRHSSidebar) refreshRHSSidebar();
             }
         }, 'json');
         return false;
@@ -370,8 +372,9 @@ parentSegment.find('.toggle-relevance')
             }, _data => {
                 if (!hasResponseError(_data)) {
                     refreshDynamicStagPopup();
-                    $('.visit-segment[data-segment-template-name="intake_{{$label}}s"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="plan_{{$label}}s"]').find('.refresh-segment').trigger('click');
+                    $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                    $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                    if(refreshRHSSidebar) refreshRHSSidebar();
                 }
             }, 'json');
         } else {
@@ -381,8 +384,9 @@ parentSegment.find('.toggle-relevance')
                 }, _data => {
                     if (!hasResponseError(_data)) {
                         refreshDynamicStagPopup();
-                        $('.visit-segment[data-segment-template-name="intake_{{$label}}s"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="plan_{{$label}}s"]').find('.refresh-segment').trigger('click');
+                        $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                        $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
+                        if(refreshRHSSidebar) refreshRHSSidebar();
                     }
                 }, 'json');
             } else {

+ 1 - 1
resources/views/layouts/patient.blade.php

@@ -458,7 +458,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 																	@if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
 																		<option
 																			{{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
-																			value="{{$note->uid}}">{{$note->title}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
+																			value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
 																	@endif
 																@endforeach
 																{{--<option value="-- create --">-- Create Note --</option>--}}

+ 3 - 0
routes/web.php

@@ -383,6 +383,9 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/point/plan-log/{point}', 'NoteController@planLog')->name('point-plan-log');
     Route::get('/note/pdf/{note}', 'NoteController@downloadAsPdf')->name('note-pdf');
     Route::get('/segment-summary/{segment}', 'NoteController@segmentSummary')->name('segment-summary');
+    Route::get('/note-segment-view/{patient}/{note}/{segment}/{segmentInternalName}/{view}', 'NoteController@noteSegmentView')->name('note-segment-view');
+    Route::get('/chart-segment-view/{patient}/{segmentInternalName}/{view}', 'NoteController@chartSegmentView')->name('chart-segment-view');
+    Route::get('/note-rhs-sidebar/{patient}/{note}', 'NoteController@rhsSidebar')->name('note-rhs-sidebar');
     Route::get('/medications-center/{patient}/{note}', 'NoteController@medicationsCenter')->name('medications-center');
     Route::get('/medications-reconcile/{patient}/{note}', 'NoteController@medicationsReconcile')->name('medications-reconcile');
     Route::get('/problems-center/{patient}/{note}', 'NoteController@problemsCenter')->name('problems-center');

+ 0 - 1
storage/visit-template-ui-configs/mc_default_visit.json

@@ -23,7 +23,6 @@
                             "mc_subjective_history_screenings"
                         ]
                     },
-                    "mc_subjective_lifestyle",
                     "mc_subjective_care_team"
                 ]
             }