Browse Source

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

root 3 years ago
parent
commit
62bd247616
32 changed files with 944 additions and 346 deletions
  1. 6 0
      app/Helpers/helpers.php
  2. 1 1
      config/app.php
  3. 12 1
      public/css/style.css
  4. 2 1
      resources/views/app/admin/patients-table-extended.blade.php
  5. 1 1
      resources/views/app/patient/allergies-center.blade.php
  6. 13 7
      resources/views/app/patient/care-month/dashboard.blade.php
  7. 1 1
      resources/views/app/patient/careteam-center.blade.php
  8. 12 12
      resources/views/app/patient/dashboard.blade.php
  9. 1 1
      resources/views/app/patient/goals-center.blade.php
  10. 1 1
      resources/views/app/patient/medications-center.blade.php
  11. 105 2
      resources/views/app/patient/note/dashboard.blade.php
  12. 1 1
      resources/views/app/patient/note/flag-care-plan.blade.php
  13. 189 195
      resources/views/app/patient/note/rm-setup.blade.php
  14. 12 0
      resources/views/app/patient/note/rpm-agreement.blade.php
  15. 8 1
      resources/views/app/patient/note/segment/suggestions_and_updates.blade.php
  16. 49 54
      resources/views/app/patient/partials/client_bp_weight_phone_number_status.blade.php
  17. 1 1
      resources/views/app/patient/partials/measurements.blade.php
  18. 6 4
      resources/views/app/patient/partials/rm-reasons-display.blade.php
  19. 2 2
      resources/views/app/patient/point-based-partials/fhx.blade.php
  20. 2 2
      resources/views/app/patient/point-based-partials/pmhx.blade.php
  21. 2 2
      resources/views/app/patient/point-based-partials/shx.blade.php
  22. 2 2
      resources/views/app/patient/point-based-partials/sochx.blade.php
  23. 1 1
      resources/views/app/patient/point-based-partials/supplements.blade.php
  24. 100 0
      resources/views/app/patient/segment-templates/omega_history_family/summary-dashboard.blade.php
  25. 159 0
      resources/views/app/patient/segment-templates/omega_history_past_medical/summary-dashboard.blade.php
  26. 97 0
      resources/views/app/patient/segment-templates/omega_history_social/summary-dashboard.blade.php
  27. 91 0
      resources/views/app/patient/segment-templates/omega_history_surgical/summary-dashboard.blade.php
  28. 1 1
      resources/views/app/patient/supplements-center.blade.php
  29. 5 0
      resources/views/app/patient/tickets.blade.php
  30. 2 2
      resources/views/app/patient/vitals-settings/bp-management-summary.blade.php
  31. 2 2
      resources/views/layouts/patient.blade.php
  32. 57 48
      resources/views/layouts/template.blade.php

+ 6 - 0
app/Helpers/helpers.php

@@ -885,3 +885,9 @@ if(!function_exists('get_doc_templates')){
         return $templates;
     }
 }
+if(!function_exists('format_phone_number')) {
+    function format_phone_number($number, $default = '-') {     
+        if(empty($number)) return $default;   
+        return preg_replace('~.*(\d{3})[^\d]{0,7}(\d{3})[^\d]{0,7}(\d{4}).*~', '($1) $2-$3', $number). "\n";
+    }
+}

+ 1 - 1
config/app.php

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

+ 12 - 1
public/css/style.css

@@ -41,6 +41,9 @@
 .w-70 {
   width: var(--w-70);
 }
+.text-warning-dark {
+    color: #856404!important;
+}
 .text-warning-mellow {
     color: #d8a714!important;
 }
@@ -669,11 +672,16 @@ input.search_field, textarea.search_field {
         padding-top: 55px;
     }
 }
-
+.d-xlarge {
+    display: none;
+}
 @media screen and (max-width: 1400px) {
   .flex-container > div:first-child {
     margin-bottom: 20px;
   }
+  .d-xlarge {
+      display: none;
+  }
 }
 @media screen and (min-width: 1400px) {
   .flex-container{
@@ -689,6 +697,9 @@ input.search_field, textarea.search_field {
     margin-right: 20px;
     padding-right: 20px;
   }
+  .d-xlarge {
+    display: inline-block;
+}
 }
 
 .main-row > .sidebar .nav .nav-item a {

+ 2 - 1
resources/views/app/admin/patients-table-extended.blade.php

@@ -332,8 +332,9 @@
 
     </table>
 </div>
-<div class="px-3 pt-3">
+<div class="px-3 pt-3 d-flex align-items-center">
     {{$patients->withQueryString()->links()}}
+    <div class="ml-4 mb-3">Showing <b>{{$patients->firstItem()}}</b> to <b>{{$patients->lastItem()}}</b> (page {{$patients->currentPage()}}) of <b>{{$patients->total()}}</b> patients</div>
 </div>
 
 <script>

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

@@ -60,7 +60,7 @@ if(!@$summaryView) {
             <thead>
             <tr class="">
                 @if($patient->core_note_id !== $note->id)
-                    <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
+                    <th class="border-bottom-0 text-secondary text-center width-30px text-nowrap">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>

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

@@ -260,9 +260,15 @@
                                     @endif
                                 </div>
                                 @if($careMonth->showMeasurementDaysWarning())
-                                    <div class="alert alert-warning p-2 mt-1">
-                                        Need <b>{{16 - $careMonth->number_of_days_with_remote_measurements}} more days</b> with measurements before RM becomes billable.
-                                    </div>
+                                    <?php
+                                    $moreDays = 16 - $careMonth->number_of_days_with_remote_measurements;
+                                    if($moreDays < 0) $moreDays = 0;
+                                    ?>
+                                    @if($moreDays > 0)
+                                        <div class="alert alert-warning p-2 mt-1">
+                                            Need <b>{{$moreDays}} more day{{$moreDays !== 1 ? 's' : ''}}</b> with measurements before RM becomes billable.
+                                        </div>
+                                    @endif
                                 @endif
 
                                 <div class="mt-2">
@@ -336,13 +342,13 @@
                                 </div>
                                 @endif
 
-                                @if(($daysDiff !== -1 && $daysDiff <= 90) && 
+                                {{--@if(($daysDiff !== -1 && $daysDiff <= 90) &&
                                     $careMonth->number_of_days_with_remote_measurements >= 16 &&
                                     $careMonth->has_mcp_interacted_with_client_about_rm)
                                     <div class="mt-2 border border-info p-2">
                                         @include('app.rm-bills.inline', ['patient' => $patient, 'entityType' => 'CareMonth', 'entityUid' => $careMonth->uid, 'label' => 'RM'])
                                     </div>
-                                @endif
+                                @endif--}}
 
                                 <div class="mt-2">
                                     {{-- rm reasons --}}
@@ -1824,10 +1830,10 @@
 
         <hr class="m-negator my-3">
 
-        {{-- generic bills --}}
+        {{-- generic bills --}}{{--
         <div class="row">
             @include('app.generic-bills.inline', ['patient' => $patient, 'class' => 'col-12', 'entityType' => 'CareMonth', 'entityUid' => $careMonth->uid])
-        </div>
+        </div>--}}
 
     </div>
 

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

@@ -21,7 +21,7 @@ if(!@$careTeamMembers || !@$counts) {
             <thead>
             <tr class="">
                 @if($patient->core_note_id !== $note->id)
-                    <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
+                    <th class="border-bottom-0 text-secondary text-center width-30px text-nowrap">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name/Details</th>
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>

+ 12 - 12
resources/views/app/patient/dashboard.blade.php

@@ -49,7 +49,7 @@
                 @if($isOldClient && $hasAllergiesInCanvas)
                 <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">Allergies</h6>
+                        <h6 class="my-0 font-weight-bold">Allergies</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">
@@ -67,7 +67,7 @@
                 @if($isOldClient && $hasRxInCanvas)
                 <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 Medications</h6>
+                        <h6 class="my-0 font-weight-bold">Current Medications</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">
@@ -89,7 +89,7 @@
                 ?>
                 <div class="mt-2 pb-1" id="patient-dashboard-devices">
                     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
-                        <h6 class="my-0 font-weight-bold text-secondary">Devices</h6>
+                        <h6 class="my-0 font-weight-bold">Devices</h6>
                         @if($availableDevices > 0 && $pro->pro_type === 'ADMIN')
                         <span class="mx-2 text-secondary">|</span>
                         <span moe>
@@ -206,7 +206,7 @@
                 @if($isOldClient && $hasVitalsInCanvas)
                 <div class="pt-2 border-top">
                     <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Vitals</h6>
+                        <h6 class="my-0 font-weight-bold">Vitals</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">
@@ -219,7 +219,7 @@
                 <?php $latestVitals = \App\Models\Point::where('client_id', $patient->id)->where('category', 'VITALS')->orderBy('id', 'DESC')->first(); ?>
                 <div class="pt-2 mt-2">
                     <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Vitals
+                        <h6 class="my-0 font-weight-bold">Vitals
                             @if(!!$latestVitals && $latestVitals->note && $latestVitals->note->effective_dateest)
                                 <span class="text-secondary font-weight-normal pl-1">(as on
                                     <a href="{{route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $latestVitals->note])}}">{{friendlier_date($latestVitals->note->effective_dateest)}}</a>)
@@ -248,7 +248,7 @@
                 @if($isOldClient)
                     <div class="pt-2 mb-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>
+                            <h6 class="my-0 font-weight-bold">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">
@@ -266,7 +266,7 @@
                 @if($isOldClient && $hasCareTeamInCanvas)
                     <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>
+                            <h6 class="my-0 font-weight-bold">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">
@@ -284,7 +284,7 @@
                 @if($isOldClient && $hasPmhxInCanvas)
                 <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">Medical History</h6>
+                        <h6 class="my-0 font-weight-bold">Medical History</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">
@@ -302,7 +302,7 @@
                 @if($isOldClient && $hasPshxInCanvas)
                 <div class="mt-2 border-top pt-2">
                     <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Surgical History</h6>
+                        <h6 class="my-0 font-weight-bold">Surgical History</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">
@@ -320,7 +320,7 @@
                 @if($isOldClient && $hasFhxInCanvas)
                 <div class="mt-2 border-top pt-2">
                     <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Family History</h6>
+                        <h6 class="my-0 font-weight-bold">Family History</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">
@@ -338,7 +338,7 @@
                 @if($isOldClient && $hasSochxInCanvas)
                 <div class="mt-2 border-top pt-2">
                     <div class="d-flex align-items-center pb-2">
-                        <h6 class="my-0 font-weight-bold text-secondary">Social History</h6>
+                        <h6 class="my-0 font-weight-bold">Social History</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">
@@ -530,7 +530,7 @@
                 <div  class="mb-2 pt-3 pb-2 border-top">
                     <div class="">
                         <div class="d-flex align-items-start pb-2">
-                            <h6 class="my-0 font-weight-bold text-secondary">Client Memos</h6>
+                            <h6 class="my-0 font-weight-bold">Client Memos</h6>
                         </div>
                         <div moe class="w-100 p-2 border mb-3">
                             <form url="/api/clientMemo/create" show>

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

@@ -21,7 +21,7 @@ if(!@$goals || !@$counts) {
             <thead>
             <tr class="">
                 @if($patient->core_note_id !== $note->id)
-                    <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
+                    <th class="border-bottom-0 text-secondary text-center width-30px text-nowrap">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Goal</th>
                 <th class="border-bottom-0 text-secondary w-30">Subjective</th>

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

@@ -50,7 +50,7 @@ if(!@$summaryView) {
             <thead>
             <tr class="">
                 @if($patient->core_note_id !== $note->id)
-                    <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
+                    <th class="border-bottom-0 text-secondary text-center width-30px text-nowrap">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
                 <th class="border-bottom-0 text-secondary w-30">Subj. Frequency / Experience</th>

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

@@ -768,6 +768,109 @@ use App\Models\Handout;
                         ?>
                         <div class="{{ $note->is_signed_by_hcp ? 'note-signed-by-hcp' : '' }} {{$hasRightSegments ? 'w-30 border-right note-left-panel stag-scrollbar' : ''}}">
                             <div class="min-width-300px stag-scrollbar">
+                                <?php $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_create($patient->created_at))->invert === 1); ?>
+                                @if($isOldClient)
+                                    <div class="p-2 bg-light border-bottom">
+                                        <div class="d-flex align-items-baseline">
+                                            <div class="font-weight-bold font-size-14 text-warning-dark">
+                                                <i class="fa fa-clock text-secondary text-sm"></i>
+                                                Data from old notes
+                                            </div>
+                                            <a href="#" class="ml-3" onclick="$(this).parent().next().toggleClass('d-none'); return false;">Toggle</a>
+                                        </div>
+                                        <div class="mt-3 ml-3 d-none">
+                                            <?php $hasAllergiesInCanvas = $patient->hasDataInCanvas('allergies'); ?>
+                                            @if($hasAllergiesInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Allergies</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.allergies.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasRxInCanvas = $patient->hasDataInCanvas('rx'); ?>
+                                            @if($hasRxInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Current Medications</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.rx.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasDxInCanvas = $patient->hasDataInCanvas('dx'); ?>
+                                            @if($hasDxInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.dx.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasCareTeamInCanvas = $patient->hasDataInCanvas('care-team'); ?>
+                                            @if($hasCareTeamInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Care Team</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.care-team.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasPmhxInCanvas = $patient->hasDataInCanvas('pmhx'); ?>
+                                            @if($hasPmhxInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Medical History</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.pmhx.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasPshxInCanvas = $patient->hasDataInCanvas('pshx'); ?>
+                                            @if($hasPshxInCanvas)
+                                                <div class="mt-2 border-top pt-2">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Surgical History</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.pshx.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasFhxInCanvas = $patient->hasDataInCanvas('fhx'); ?>
+                                            @if($hasFhxInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Family History</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.fhx.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                            <?php $hasSochxInCanvas = $patient->hasDataInCanvas('sochx'); ?>
+                                            @if($hasSochxInCanvas)
+                                                <div class="uucol-4">
+                                                    <div class="d-flex align-items-center pb-2">
+                                                        <h6 class="my-0 font-weight-bold text-secondary">Social History</h6>
+                                                    </div>
+                                                    <div class="bg-light border p-2 mb-3">
+                                                        @include('app.patient.canvas-sections.sochx.summary')
+                                                    </div>
+                                                </div>
+                                            @endif
+                                        </div>
+                                    </div>
+                                @endif
+
                                 @if($isVisitTemplateBased && $doesVisitTemplateLayoutExist)
                                     @include($visitLayoutPath)
                                 @elseif($isVisitTemplateBased && !$doesVisitTemplateUiConfigExist)
@@ -965,7 +1068,7 @@ use App\Models\Handout;
                         <p class="font-weight-bold text-secondary m-0 font-size-14">Vitals Settings</p>
                     </div>
                     <div class="row" id="vitals-settings-{{$patient->uid}}">
-                        <div class="col-5 border-right">
+                        <div class="col-4 border-right">
                             <div class="d-flex align-items-baseline">
                                 <b>BMI/Weight Management</b>
                                 <span class="mx-2 text-secondary">|</span>
@@ -975,7 +1078,7 @@ use App\Models\Handout;
                                 @include('app.patient.vitals-settings.bmi-management-summary')
                             </div>
                         </div>
-                        <div class="col-7">
+                        <div class="col-8">
                             <div class="d-flex align-items-baseline">
                                 <b>BP Management</b>
                                 <span class="mx-2 text-secondary">|</span>

+ 1 - 1
resources/views/app/patient/note/flag-care-plan.blade.php

@@ -1,6 +1,6 @@
 
 
-	<div <?= $patient->has_care_plan_flag && !$patient->is_flag_cleared ? 'class="alert alert-danger p-1 rounded-0" style="min-width: 380px;"' : '' ?>>
+	<div <?= $patient->has_care_plan_flag && !$patient->is_flag_cleared ? 'class="alert alert-danger p-1 rounded-0" style="min-width: 380px;"' : 'class="ml-2"' ?>>
 	<?php #dump($patient); ?>
 	@if($pro->pro_type === 'ADMIN')
 		@if($patient->has_care_plan_flag && !$patient->is_flag_cleared)

+ 189 - 195
resources/views/app/patient/note/rm-setup.blade.php

@@ -1,135 +1,129 @@
 <div class="row" id="rm-setup">
-    <div class="col-6">
+    <div class="col-7">
         @if($pro->pro_type === 'ADMIN')
-            <div>
-                <table class="table table-sm table-striped table-bordered mb-1">
-                    <tr>
-                        <td>Is Eligible for RM?</td>
-                        <td>
-                            <div class="">
-                                <div class="d-inline-flex align-items-start">
-                                    <b>{{ ucwords($patient->is_eligible_for_rm ? $patient->is_eligible_for_rm : '-') }}</b>
-                                    <div moe class="ml-2">
-                                        <a start show><i class="fa fa-edit on-hover-opaque"></i></a>
-                                        <form url="/api/client/updateRmEligibility" class="mcp-theme-1">
-                                            <input type="hidden" name="uid" value="{{$patient->uid}}">
-                                            <div class="mb-2">
-                                                <label class="text-sm mb-1 text-secondary">Is Eligible?</label>
-                                                <select name="isEligibleForRm"
-                                                        class="form-control form-control-sm"
-                                                        onchange="toggleDisabledAsNeeded(this, 'NO', 'not-eligible-for-rm')">
-                                                    <option value="">-- Select Status --</option>
-                                                    <option value="YES" {{ $patient->is_eligible_for_rm === 'YES' ? 'selected' : '' }}>YES</option>
-                                                    <option value="NO" {{ $patient->is_eligible_for_rm === 'NO' ? 'selected' : '' }}>NO</option>
-                                                    <option value="UNKNOWN" {{ $patient->is_eligible_for_rm === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
-                                                </select>
-                                            </div>
-                                            <div class="mb-2">
-                                                <label class="text-sm mb-1 text-secondary">Why not eligible category</label>
-                                                <input type="text" class="not-eligible-for-rm form-control form-control-sm"
-                                                    {{$patient->is_eligible_for_rm === 'NO' ? '' : 'disabled' }}
-                                                    name="whyNotEligibleForRmCategory" value="{{$patient->why_not_eligible_for_rm_category}}">
-                                            </div>
-                                            <div class="mb-2">
-                                                <label class="text-sm mb-1 text-secondary">Why not eligible memo</label>
-                                                <input type="text" class="not-eligible-for-rm form-control form-control-sm"
-                                                    {{$patient->is_eligible_for_rm === 'NO' ? '' : 'disabled' }}
-                                                    name="whyNotEligibleForRmMemo" value="{{$patient->why_not_eligible_for_rm_memo}}">
-                                            </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 class="mb-2">
+                <div class="d-flex flex-wrap">
+                    <div class="d-flex align-items-center">
+                        <span class="mr-2 text-secondary">Eligible for RM?</span>
+                        <span class="mr-1">{{ ucwords($patient->is_eligible_for_rm ? $patient->is_eligible_for_rm : '-') }}</span>
+                        <div moe class="">
+                            <a start show><i class="fa fa-edit on-hover-opaque"></i></a>
+                            <form url="/api/client/updateRmEligibility" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Is Eligible?</label>
+                                    <select name="isEligibleForRm"
+                                            class="form-control form-control-sm"
+                                            onchange="toggleDisabledAsNeeded(this, 'NO', 'not-eligible-for-rm')">
+                                        <option value="">-- Select Status --</option>
+                                        <option value="YES" {{ $patient->is_eligible_for_rm === 'YES' ? 'selected' : '' }}>YES</option>
+                                        <option value="NO" {{ $patient->is_eligible_for_rm === 'NO' ? 'selected' : '' }}>NO</option>
+                                        <option value="UNKNOWN" {{ $patient->is_eligible_for_rm === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
+                                    </select>
+                                </div>
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Why not eligible category</label>
+                                    <input type="text" class="not-eligible-for-rm form-control form-control-sm"
+                                        {{$patient->is_eligible_for_rm === 'NO' ? '' : 'disabled' }}
+                                        name="whyNotEligibleForRmCategory" value="{{$patient->why_not_eligible_for_rm_category}}">
+                                </div>
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Why not eligible memo</label>
+                                    <input type="text" class="not-eligible-for-rm form-control form-control-sm"
+                                        {{$patient->is_eligible_for_rm === 'NO' ? '' : 'disabled' }}
+                                        name="whyNotEligibleForRmMemo" value="{{$patient->why_not_eligible_for_rm_memo}}">
+                                </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>
+                        @if($patient->is_eligible_for_rm === 'NO')
+                        <span class="ml-1 on-hover-show d-inline-block on-hover-opaque">
+                            <i class="fa fa-info-circle"></i>
+                            <div class="on-hover-content py-2 pl-3 text-nowrap text-dark" style="left:0;right:auto;">
+                                <div>
+                                    <small class="text-sm"><b>Category:</b> {{$patient->why_not_eligible_for_rm_category ?: '-'}}</small>
+                                </div>
+                                <div>
+                                    <small class="text-sm"><b>Memo:</b> {{$patient->why_not_eligible_for_rm_memo ?: '-'}}</small>
                                 </div>
-                                @if($patient->is_eligible_for_rm === 'NO')
-                                    <div class="mt-1">
-                                        <span>{{$patient->why_not_eligible_for_rm_category ?: '-'}}</span>
-                                        /
-                                        <span class="text-secondary">{{$patient->why_not_eligible_for_rm_memo ?: '-'}}</span>
-                                    </div>
-                                @endif
                             </div>
-                        </td>
-                    </tr>
+                        </span>
+                        @endif
+                    </div>
+                    <span class="text-secondary mx-2">|</span>
                     <?php $currentCareMonth = $patient->currentCareMonth(); ?>
                     @if($currentCareMonth && $pro->id === $currentCareMonth->mcp_pro_id)
                     <?php $spoken = $currentCareMonth->has_anyone_interacted_with_client_about_rm_outside_note; ?>
-                        <tr>
-                            <td>
-                            Comm. this month:
-                            </td>
-                            <td>
-                                <b class="{{$spoken ? 'text-success' : ''}}">
-                                    {{$spoken ? 'Yes' : 'No'}}
-                                    @if(!$spoken)
-                                        <i class="fa fa-exclamation-triangle"></i>
-                                    @else
-                                        <i class="fa fa-check"></i>
-                                    @endif
-                                </b>
-                                @if($currentCareMonth->mcp && $pro->id === $currentCareMonth->mcp->id)
-                                    <div moe relative class="ml-2">
-                                        <a href="#" start show class="">Toggle</a>
-                                        <form url="/api/careMonth/setHasAnyoneInteractedWithClientAboutRmOutsideNoteTo{{$spoken ? 'False' : 'True'}}" right>
-                                            <input type="hidden" name="uid" value="{{$currentCareMonth->uid}}">
-                                            <p>Set to {{$spoken ? 'No' : 'Yes'}}?</p>
-                                            <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 class="d-flex align-items-center">
+                        <span class="mr-1 text-secondary">Comm. this month:</span>
+                        <span class="{{$spoken ? 'text-success' : ''}}">
+                            {{$spoken ? 'Yes' : 'No'}}
+                            @if(!$spoken)
+                                <i class="fa fa-exclamation-triangle"></i>
+                            @else
+                                <i class="fa fa-check"></i>
+                            @endif
+                        </span>
+                        @if($currentCareMonth->mcp && $pro->id === $currentCareMonth->mcp->id)
+                            <div moe relative class="ml-1">
+                                <a href="#" start show class=""><i class="fa fa-edit on-hover-opaque"></i></a>
+                                <form url="/api/careMonth/setHasAnyoneInteractedWithClientAboutRmOutsideNoteTo{{$spoken ? 'False' : 'True'}}" right>
+                                    <input type="hidden" name="uid" value="{{$currentCareMonth->uid}}">
+                                    <p>Set to {{$spoken ? 'No' : 'Yes'}}?</p>
+                                    <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>
-                                @endif
-                            </td>
-                        </tr>
+                                </form>
+                            </div>
+                        @endif
+                    </div>
+                    <span class="text-secondary mx-2 d-xlarge">|</span>
                     @endif
-                    <tr>
-                        <td>Enrollment:</td>
-                        <td>
-                            <div class="">
-                                <div class="d-inline-flex align-items-start">
-                                    <b>{{ ucwords($patient->is_enrolled_in_rm ? $patient->is_enrolled_in_rm : '-') }}</b>
-                                    @if($patient->is_enrolled_in_rm === 'YES')
-                                        <div moe class="ml-2">
-                                            <a start show>Toggle</a>
-                                            <form url="/api/client/setIsEnrolledInRmToFalse" class="mcp-theme-1">
-                                                <input type="hidden" name="uid" value="{{$patient->uid}}">
-                                                <p>Un-enroll from RPM?</p>
-                                                <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>
-                                    @else
-                                        <a native target="_blank"
-                                        class="screen-only ml-2"
-                                        open-in-stag-popup
-                                        popup-style="medium overflow-visible"
-                                        mc-initer="rpm-agreement-{{$note->id}}"
-                                        title="Leadership Health Remote Patient Monitoring Consent Form"
-                                        href="/note/rpm-agreement/{{$note->uid}}?popupmode=1">
-                                            Mark as enrolled
-                                        </a>
-                                    @endif
-                                </div>
+
+                    <div class="d-flex align-items-center">
+                        <span class="mr-1 text-secondary">Enrollment:</span>
+                        <span>{{ ucwords($patient->is_enrolled_in_rm ? $patient->is_enrolled_in_rm : '-') }}</span>
+                        @if($patient->is_enrolled_in_rm === 'YES')
+                            <div moe class="ml-1">
+                                <a start show><i class="fa fa-edit on-hover-opaque"></i></a>
+                                <form url="/api/client/setIsEnrolledInRmToFalse" class="mcp-theme-1">
+                                    <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                    <p>Un-enroll from RPM?</p>
+                                    <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>
-                        </td>
-                    </tr>
-                </table>
+                        @else
+                            <a native target="_blank"
+                            class="screen-only ml-2"
+                            open-in-stag-popup
+                            popup-style="medium overflow-visible"
+                            mc-initer="rpm-agreement-{{$note->id}}"
+                            title="Leadership Health Remote Patient Monitoring Consent Form"
+                            href="/note/rpm-agreement/{{$note->uid}}?popupmode=1">
+                                Mark as enrolled
+                            </a>
+                        @endif
+                    </div>
+                </div>
+                
             </div> 
         @endif
         
-        <div class="d-flex align-items-baseline mb-3">
+        <div class="d-flex align-items-baseline mb-1">
             <div class="flex-grow-1">
                 <div>
                     <div class="d-flex align-items-center mb-1">
-                        <span class="mr-2">RM Reasons:</span>
+                        <span class="mr-2 text-secondary">RM Reasons:</span>
                         @include('app.patient.partials.put-rm-reasons', ['recordType' => 'CLIENT', 'record' => $patient])
                     </div>
-                    <div class="">
+                    <div class="pl-3">
                         @include('app.patient.partials.rm-reasons-display', ['recordType' => 'CLIENT', 'record' => $patient])
                     </div>
                 </div>
@@ -234,11 +228,12 @@
                 </div>--}}
             </div>
         </div>
-        <div class="mb-3">
-            <table class="table-sm table-striped table-bordered w-100 v-top">
+        <div class="my-2">
+            <table class="table-sm table-bordered v-top">
                 <tr>
-                    <td>Care Plan:</td>
+                    <td class="text-secondary">Care Plan:</td>
                     <td>
+                        <div class="{{ $patient->has_care_plan_flag && !$patient->is_flag_cleared ? '':'d-flex' }}">
                         <div class="d-inline-flex align-items-center">
                             @if($patient->has_cm_setup_been_performed)
                                 <div class="text-nowrap text-success">
@@ -330,6 +325,7 @@
                             </div>
                         @endif
                         @include('app.patient.note.flag-care-plan')
+                        </div>
                     </td>
                 </tr>
             </table>
@@ -339,10 +335,10 @@
 
         @if($pro->pro_type === 'ADMIN')
             <div>
-                <table class="table table-sm table-bordered table-striped">
+                <table class="table-sm ">
                     <tr>
-                        <td>RME Pro:</td>
-                        <td>
+                        <td class="text-secondary p-1">RME Pro:</td>
+                        <td class="p-1">
                             <div class="">
                                 <div class="d-inline-flex align-items-start">
                                     <b>{{ $patient->rme ? $patient->rme->displayName() : '-' }}</b>
@@ -380,8 +376,8 @@
                         </td>
                     </tr>
                     <tr>
-                        <td>RMM Pro:</td>
-                        <td>
+                        <td class="text-secondary p-1">RMM Pro:</td>
+                        <td class="p-1">
                             <div class="">
                                 <div class="d-inline-flex align-items-start">
                                     <b>{{ $patient->rmm ? $patient->rmm->displayName() : '-' }}</b>
@@ -421,12 +417,12 @@
                 </table>
             </div>
         @endif
-        <div class="border-top mt-2 pt-2">
+        <div class="border-top mt-1 pt-2">
             @include('app.patient.partials.client_bp_weight_phone_number_status')
         </div>
         
     </div>
-    <div class="col-6 border-left">
+    <div class="col-5 border-left">
         <?php
         $bpDevice = null;
         $weightScale = null;
@@ -475,46 +471,45 @@
         ?>
 
         @if($bpDevice)
-            <div class="mb-3">
-                <div class="d-flex align-items-baseline mb-2">
-                    <span class="width-200px font-weight-bold">Cellular BP Device</span>
-                    <b class="ml-3">Yes</b>
-                    <span class="ml-3 text-secondary">IMEI: {{$bpDevice->device->imei}}</span>
-                </div>
-                <div class="">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">Arrived:</span>
-                        <span class="ml-3">Yes</span>
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">First Measurement:</span>
+            <div class="mb-2">
+                <table class="table table-sm table-bordered mb-0">
+                    <tr class="bg-light">
+                        <td class="text-secondary" style="width: 125px;">Cellular BP Device</td>
+                        <td colspan="2">Yes <i>({{$bpDevice->device->imei}})</i></td>
+                    </tr>
+                    <tr>
+                        <td class="text-secondary">Arrived</td>
+                        <td colspan="2">Yes</td>
+                    </tr>
+                    <tr>
+                        <td class="text-secondary">First Meas.</td>
                         @if($bpMeasurements["first"])
-                            <span class="ml-3">{{ $bpMeasurements["first"]->sbp_mm_hg . '/' . $bpMeasurements["first"]->dbp_mm_hg . '' }}</span>
-                            <span class="ml-3 text-secondary">{{date("Y-m-d", $bpMeasurements["first"]->ts/1000)}}</span>
-                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $bpMeasurements["first"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                        <td class="">{{ $bpMeasurements["first"]->sbp_mm_hg . '/' . $bpMeasurements["first"]->dbp_mm_hg . '' }}</td>
+                        <td class="">{{friendly_date_short(date("Y-m-d", $bpMeasurements["first"]->ts/1000))}} <i class="text-muted">- {{date_diff(date_create(date("Y-m-d", $bpMeasurements["first"]->ts/1000)), date_create('now'))->days}} <small class="text-sm">days ago</small></i></td>
                         @else
-                            -
+                            <td colspan="3">-</td>
                         @endif
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">Last Measurement:</span>
+                    </tr>
+                    <tr>
+                        <td class="text-secondary">Last Meas.</td>
                         @if($bpMeasurements["last"])
-                            <span class="ml-3">{{ $bpMeasurements["last"]->sbp_mm_hg . '/' . $bpMeasurements["last"]->dbp_mm_hg . '' }}</span>
-                            <span class="ml-3 text-secondary">{{date("Y-m-d", $bpMeasurements["last"]->ts/1000)}}</span>
-                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $bpMeasurements["last"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                            <td>{{ $bpMeasurements["last"]->sbp_mm_hg . '/' . $bpMeasurements["last"]->dbp_mm_hg . '' }}</td>
+                            <td>{{friendly_date_short(date("Y-m-d", $bpMeasurements["last"]->ts/1000))}} <i class="text-muted">- {{date_diff(date_create(date("Y-m-d", $bpMeasurements["last"]->ts/1000)), date_create('now'))->days}} <small class="text-sm">days ago</small></i></td>
                         @else
-                            -
+                           <td colspan="3">-</td>
                         @endif
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">How often to measure:</span>
-                        <span class="ml-3"> -- </span>
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">SMS reminders:</span>
-                        <span class="ml-3"> -- </span>
-                    </div>
-                </div>
+                    </tr>
+                    {{--
+                    <tr>
+                        <td class="text-secondary">How often to measure</td>
+                        <td colspan="2">-</td>
+                    </tr>
+                    <tr>
+                        <td class="text-secondary">SMS reminders</td>
+                        <td colspan="2">-</td>
+                    </tr>
+                    --}}
+                </table>
             </div>
         @else
             <div class="d-flex align-items-baseline mb-3">
@@ -524,46 +519,45 @@
         @endif
 
         @if($weightScale)
-            <div class="mb-3">
-                <div class="d-flex align-items-baseline mb-2">
-                    <span class="width-200px font-weight-bold">Cellular Weight Scale</span>
-                    <b class="ml-3">Yes</b>
-                    <span class="ml-3 text-secondary">IMEI: {{$weightScale->device->imei}}</span>
-                </div>
-                <div class="">
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">Arrived:</span>
-                        <span class="ml-3">Yes</span>
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">First Measurement:</span>
-                        @if($weightMeasurements["first"])
-                            <span class="ml-3">{{ round($weightMeasurements["first"]->value, 2) . ' lbs' }}</span>
-                            <span class="ml-3 text-secondary">{{date("Y-m-d", $weightMeasurements["first"]->ts/1000)}}</span>
-                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $weightMeasurements["first"]->ts/1000)), date_create('now'))->days}} days ago</span>
-                        @else
-                            -
-                        @endif
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">Last Measurement:</span>
+            <div class="mb-2">
+            <table class="table table-sm table-bordered mb-0">
+                <tr class="bg-light">
+                    <td class="text-secondary">Cellular Wt. Scale</td>
+                    <td colspan="3">Yes <i>({{$weightScale->device->imei}})</i></td>
+                </tr>
+                <tr>
+                    <td class="text-secondary">Arrived</td>
+                    <td colspan="3">Yes</td>
+                </tr>
+                <tr>
+                    <td class="text-secondary">First Meas.</td>
+                    @if($weightMeasurements["first"])
+                        <td>{{ round($weightMeasurements["first"]->value, 2) . ' lbs' }}</td>
+                        <td colspan="2">{{ friendly_date_short(date("Y-m-d", $weightMeasurements["first"]->ts/1000)) }} <i class="text-muted">- {{date_diff(date_create(date("Y-m-d", $weightMeasurements["first"]->ts/1000)), date_create('now'))->days}} <small class="text-asm">days ago</small></i></td>
+                    @else
+                        <td colspan="4"></td>
+                    @endif
+                </tr>
+                <tr>
+                        <td class="text-secondary">Last Meas.</td>
                         @if($weightMeasurements["last"])
-                            <span class="ml-3">{{ round($weightMeasurements["last"]->value, 2) . ' lbs' }}</span>
-                            <span class="ml-3 text-secondary">{{date("Y-m-d", $weightMeasurements["last"]->ts/1000)}}</span>
-                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $weightMeasurements["last"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                            <td>{{ round($weightMeasurements["last"]->value, 2) . ' lbs' }}</td>
+                            <td>{{ friendly_date_short(date("Y-m-d", $weightMeasurements["last"]->ts/1000)) }} <i class="text-muted">- {{date_diff(date_create(date("Y-m-d", $weightMeasurements["last"]->ts/1000)), date_create('now'))->days}} <small class="text-sm">days ago</small></i></td>
                         @else
-                            -
+                            <td colspan="4">-</td>
                         @endif
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">How often to measure:</span>
-                        <span class="ml-3"> -- </span>
-                    </div>
-                    <div class="d-flex align-items-baseline mb-1">
-                        <span class="width-200px pl-3">SMS reminders:</span>
-                        <span class="ml-3"> -- </span>
-                    </div>
-                </div>
+                    </tr>
+                    {{--
+                    <tr>
+                        <td class="text-secondary">How often to measure</td>
+                        <td colspan="3">-</td>
+                    </tr>
+                    <tr>
+                        <td class="text-secondary">SMS reminders:</td>
+                        <td colspan="3">-</td>
+                    </tr>
+                    --}}
+            </table>
             </div>
         @else
             <div class="d-flex align-items-baseline mb-3">

+ 12 - 0
resources/views/app/patient/note/rpm-agreement.blade.php

@@ -38,6 +38,18 @@
             <span>I have the right to withdraw my consent to participate in the RPM program and stop receiving RPM Services at any time by returning the equipment.</span>
         </label>
 
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-8" required></div>
+            <span>I agree to participate in the Chronic Care Management program.</span>
+        </label>
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-9" required></div>
+            <span>I understand that CCM involves a combination of face-to-face and non-face-to-face services to ensure that my healthcare needs are met.</span>
+        </label>
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-10" required></div>
+            <span>I understand that I can revoke my participation in CCM at anytime.</span>
+        </label>
     </form>
 
     <?php $patient = $note->client; ?>

+ 8 - 1
resources/views/app/patient/note/segment/suggestions_and_updates.blade.php

@@ -44,7 +44,14 @@
 </div>
 @if($segment->proposedSegmentSummarySuggestion && ($segment->proposedSegmentSummarySuggestion->status == 'PENDING' || $segment->proposedSegmentSummarySuggestion->status == 'REJECTED') )
     <div class=" m-2 p-2">
-        {!! $segment->proposedSegmentSummarySuggestion->summary_html !!}
+        <div class="d-flex align-items-start mb-2">
+            <b class="mr-2 width-70px">Original:</b>
+            <div class="border py-2 px-2 flex-grow-1 inline-html-container">{!! $segment->summary_html !!}</div>
+        </div>
+        <div class="d-flex align-items-start mb-2">
+            <b class="mr-2 width-70px">Proposed:</b>
+            <div class="border border-info py-2 px-2 flex-grow-1 inline-html-container">{!! $segment->proposedSegmentSummarySuggestion->summary_html !!}</div>
+        </div>
         @if($segment->proposedSegmentSummarySuggestion->status == 'REJECTED')
         <div class="alert alert-info">Your suggestion has been rejected.</div>
         @endif

+ 49 - 54
resources/views/app/patient/partials/client_bp_weight_phone_number_status.blade.php

@@ -1,59 +1,54 @@
 <div class="">
     <div class="mb-1">
-        <span class="mb-0 mr-2"><b>Please ask the client to save the following numbers for receiving measurement SMS messages.</b>
-        <div moe>
-            <a start show><i class="fa fa-edit"></i></a>
-            <form url="/api/client/updateClientBpWeightPhoneNumberStatus" class="mcp-theme-1">
-                <input type="hidden" name="uid" value="{{$patient->uid}}">
-                <div class="mb-2 checkbox">
-                    <input type="checkbox" name="hasClientSavedBpPhoneNumber">
-                    <label class="mb-1 text-secondary text-sm">Has client saved bp phone number?</label>
-                </div>
-                <div class="mb-2">
-                    <label class="mb-1 text-secondary text-sm">Saved BP phone number</label>
-                    <input type="text" name="savedBpPhoneNumber" class="form-control form-control-sm" value="{{config('app.bpSmsNumber')}}">
-                </div>
-                <div class="mb-2 checkbox">
-                    <input type="checkbox" name="hasClientSavedWeightPhoneNumber">
-                    <label class="mb-1 text-secondary text-sm">Has client saved weight phone number?</label>
-                </div>
-                <div class="mb-2">
-                    <label class="mb-1 text-secondary text-sm">Saved weight phone number</label>
-                    <input type="text" name="savedWeightPhoneNumber" class="form-control form-control-sm" value="{{config('app.weightSmsNumber')}}">
-                </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>
+            <p class="mb-1 text-secondary"><b>Please ask patient to store the following phone numbers for Cardio1st notifications:</b></p>
+            <p class="mb-1"><b>BP</b> {{ format_phone_number(config('app.bpSmsNumber')) }} <b class="ml-2">WT</b> {{ format_phone_number(config('app.weightSmsNumber')) }}</p>
+        </div>
+        <div class="d-flex align-items-center">
+            <p class="mb-0 mr-2 text-secondary">Has patient stored #s?</p>
+            <span class="mr-2">
+                @if(@$patient->clientBpWeightPhoneNumberStatus->has_client_saved_bp_phone_number)
+                <i class="fas fa-check-square text-success on-hover-opaque"></i>
+                @else
+                <i class="far fa-square text-secondary on-hover-opaque"></i>
+                @endif
+                BP
+            </span>
+            <span class="mr-2">
+                @if(@$patient->clientBpWeightPhoneNumberStatus->has_client_saved_weight_phone_number)
+                <i class="fas fa-check-square text-success on-hover-opaque"></i>
+                @else
+                <i class="far fa-square text-secondary on-hover-opaque"></i>
+                @endif
+                WT
+            </span>
+            
+            <div moe>
+                <a start show><i class="fa fa-edit"></i></a>
+                <form url="/api/client/updateClientBpWeightPhoneNumberStatus" class="mcp-theme-1">
+                    <input type="hidden" name="uid" value="{{$patient->uid}}">
+                    <div class="mb-2 checkbox">
+                        <input type="checkbox" name="hasClientSavedBpPhoneNumber" <?= @$patient->clientBpWeightPhoneNumberStatus->has_client_saved_bp_phone_number ? 'checked':'' ?>>
+                        <label class="mb-1 text-secondary text-sm">Has client saved bp phone number?</label>
+                    </div>
+                    <div class="mb-2 d-none">
+                        <label class="mb-1 text-secondary text-sm">Saved BP phone number</label>
+                        <input type="text" name="savedBpPhoneNumber" class="form-control form-control-sm" value="{{ format_phone_number(config('app.bpSmsNumber')) }}">
+                    </div>
+                    <div class="mb-2 checkbox">
+                        <input type="checkbox" name="hasClientSavedWeightPhoneNumber" <?= @$patient->clientBpWeightPhoneNumberStatus->has_client_saved_weight_phone_number ? 'checked':'' ?>>
+                        <label class="mb-1 text-secondary text-sm">Has client saved weight phone number?</label>
+                    </div>
+                    <div class="mb-2 d-none">
+                        <label class="mb-1 text-secondary text-sm">Saved weight phone number</label>
+                        <input type="text" name="savedWeightPhoneNumber" class="form-control form-control-sm" value="{{ format_phone_number(config('app.weightSmsNumber')) }}">
+                    </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>
-        </span>
-        
     </div>
-    <table class="table table-sm table-striped table-bordered">
-        <tr>
-            <td>Cardio1st BP SMS number:</td>
-            <td>{{config('app.bpSmsNumber')}}</td>
-        </tr>
-        <tr>
-            <td>Cardio1st Weight SMS number:</td>
-            <td>{{config('app.weightSmsNumber')}}</td>
-        </tr>
-        <tr>
-            <td>Has client saved BP phone number:</td>
-            <td>{{ $patient->clientBpWeightPhoneNumberStatus && $patient->clientBpWeightPhoneNumberStatus->has_client_saved_bp_phone_number ? 'Yes': 'No' }}</td>
-        </tr>
-        <tr>
-            <td>Saved BP Phone number:</td>
-            <td>{{ $patient->clientBpWeightPhoneNumberStatus ?  $patient->clientBpWeightPhoneNumberStatus->saved_bp_phone_number: '-'}}</td>
-        </tr>
-        <tr>
-            <td>Has client saved Weight phone number:</td>
-            <td>{{ $patient->clientBpWeightPhoneNumberStatus && $patient->clientBpWeightPhoneNumberStatus->has_client_saved_weight_phone_number ? 'Yes': 'No' }}</td>
-        </tr>
-        <tr>
-            <td>Saved Weight Phone number:</td>
-            <td>{{ $patient->clientBpWeightPhoneNumberStatus ? $patient->clientBpWeightPhoneNumberStatus->saved_weight_phone_number : '-' }}</td>
-        </tr>
-    </table>
 </div>

+ 1 - 1
resources/views/app/patient/partials/measurements.blade.php

@@ -1,6 +1,6 @@
 <div class="mt-2 mb-3" id="patient-dashboard-measurements">
     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
-        <h6 class="my-0 font-weight-bold text-secondary">Measurements</h6>
+        <h6 class="my-0 font-weight-bold">Measurements</h6>
         <span class="mx-2 text-secondary">|</span>
         <a start show class="py-0 font-weight-normal"
            href="/patients/view/{{ $patient->uid }}/measurements">

+ 6 - 4
resources/views/app/patient/partials/rm-reasons-display.blade.php

@@ -34,15 +34,17 @@ $displayData = [
 			}
 			?>
 			@if(!$emptyICD)
-				<span class="mb-1 mr-2"><i class="fas fa-star text-warning"></i> {{$rmData['reason']}} @if(!empty($rmData['description']))({{ $rmData['description'] }})@endif</span>
+				<span class="mb-1 mr-2 d-flex align-items-center"><i class="fas fa-circle text-muted mr-1" style="font-size: 5px;"></i> {{$rmData['reason']}} @if(!empty($rmData['description']))({{ $rmData['description'] }})@endif</span>
 			@endif
 		@endforeach
 		@if($emptyICDs)
-		<small class="text-dark">-</small>
+		<small class="text-dark"></small>
 		@endif
 	</div>
+	@if($record->rm_reason_memo)
 	<div class="d-flex">
-			<span class="mr-2"><b>Memo:</b></span>
-			<small class="text-muted">{{ $record->rm_reason_memo }}</small>
+			<span class="text-secondary mr-2"><b>Memo:</b></span>
+			<small class="">{{ $record->rm_reason_memo }}</small>
 	</div>
+	@endif
 </div>

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

@@ -1,6 +1,6 @@
 <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>
+        <h6 class="my-0 font-weight-bold">Family History</h6>
         @if($isOldClient && @$hasFhxInCanvas)
             <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
         @endif
@@ -20,7 +20,7 @@
         @endif
     </div>
     <div class="bg-light border p-2 mb-3 point-content">
-        @include('app.patient.segment-templates.history_family.summary', compact('patient'))
+        @include('app.patient.segment-templates.omega_history_family.summary-dashboard', ['patient' => $patient, 'note' => $patient->coreNote])
     </div>
 </div>
 <script>

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

@@ -1,6 +1,6 @@
 <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>
+        <h6 class="my-0 font-weight-bold">Medical History</h6>
         @if($isOldClient && @$hasPmhxInCanvas)
             <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
         @endif
@@ -20,7 +20,7 @@
         @endif
     </div>
     <div class="bg-light border p-2 mb-3 point-content">
-        @include('app.patient.segment-templates.past_medical_history.summary', compact('patient'))
+        @include('app.patient.segment-templates.omega_history_past_medical.summary-dashboard', ['patient' => $patient, 'note' => $patient->coreNote])
     </div>
 </div>
 <script>

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

@@ -1,6 +1,6 @@
 <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>
+        <h6 class="my-0 font-weight-bold">Surgical History</h6>
         @if($isOldClient && @$hasPshxInCanvas)
             <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
         @endif
@@ -20,7 +20,7 @@
         @endif
     </div>
     <div class="bg-light border p-2 mb-3 point-content">
-        @include('app.patient.segment-templates.history_surgical.summary', compact('patient'))
+        @include('app.patient.segment-templates.omega_history_surgical.summary-dashboard', ['patient' => $patient, 'note' => $patient->coreNote])
     </div>
 </div>
 <script>

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

@@ -1,6 +1,6 @@
 <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>
+        <h6 class="my-0 font-weight-bold">Social History</h6>
         @if($isOldClient && @$hasSochxInCanvas)
             <div class="px-2 font-weight-bold alert alert-info text-sm my-0 ml-2 py-1">New</div>
         @endif
@@ -20,7 +20,7 @@
         @endif
     </div>
     <div class="bg-light border p-2 mb-3 point-content">
-        @include('app.patient.segment-templates.history_social.summary', compact('patient'))
+        @include('app.patient.segment-templates.omega_history_social.summary-dashboard', ['patient' => $patient, 'note' => $patient->coreNote])
     </div>
 </div>
 <script>

+ 1 - 1
resources/views/app/patient/point-based-partials/supplements.blade.php

@@ -3,7 +3,7 @@ $supplements = \App\Models\Point::getPointsOfCategory($patient, "SUPPLEMENT");
 ?>
 <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 Supplements</h6>
+        <h6 class="my-0 font-weight-bold">Current Supplements</h6>
         @if($patient->coreNote)
             @if(!@$disallowPointEdits)
             <a native target="_blank"

+ 100 - 0
resources/views/app/patient/segment-templates/omega_history_family/summary-dashboard.blade.php

@@ -0,0 +1,100 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'FAMILY_HISTORY', $sessionKey, true);
+
+$contentData = $parsed = false;
+
+$rel = !!$point->relevanceToNote($note);
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+}
+
+$labels = [
+    'general_no_health_concern' => 'No health concern',
+    'general_arthritis' => 'Arthritis',
+    'general_asthma' => 'Asthma',
+    'general_bleeding_disorder' => 'Bleeding disorder',
+    'general_cad_lt_age_55' => 'CAD &gt; age 55',
+    'general_copd' => 'COPD',
+    'general_diabetes' => 'Diabetes',
+    'general_heart_attack' => 'Heart attack',
+    'general_heart_disease' => 'Heart disease',
+    'general_high_cholesterol' => 'High cholesterol',
+    'general_hypertension' => 'Hypertension',
+    'general_mental_illness' => 'Mental illness',
+    'general_osteoporosis' => 'Osteoporosis',
+    'general_stroke' => 'Stroke',
+    'cancer_breast_ca' => 'Breast cancer',
+    'cancer_colon_ca' => 'Colon cancer',
+    'cancer_other_ca' => 'Other cancer',
+    'cancer_ovarian_ca' => 'Ovarian cancer',
+    'cancer_uterine_ca' => 'Uterine cancer',
+];
+
+if($contentData && !@$contentData['unknown'] && !!$contentData['count']) {
+    for ($i = 0; $i < $contentData['count']; $i++) {
+?>
+<div class="<?= $i > 0 ? 'mt-2' : '' ?>">
+    <div class="">
+        <b><?= isset($contentData['items'][$i]['relationship']) ? $contentData['items'][$i]['relationship'] : '--' ?></b>
+        <?php if(isset($contentData['items'][$i]['status']) && !empty($contentData['items'][$i]['status'])): ?>
+        <span class="ml-1 text-secondary">(<?= $contentData['items'][$i]['status'] ?>)</span>
+        <?php endif; ?>
+    </div>
+    <div class="ml-3">
+        <?php
+        $positives = [];
+        $negatives = [];
+        foreach ($labels as $k => $v) {
+            if(isset($contentData['items'][$i][$k])) {
+                if(strtolower($contentData['items'][$i][$k]) === 'yes') {
+                    $positives[] = $v;
+                }
+                else {
+                    $negatives[] = $v;
+                }
+            }
+        }
+        ?>
+        @if(count($positives))
+            <div class=""><b>Positive for</b>: {!!  implode(', ', $positives) !!}</div>
+        @endif
+        @if(count($negatives))
+            <div class=""><b>Negative for</b>: {!!  implode(', ', $negatives) !!}</div>
+        @endif
+    </div>
+    <?php if(isset($contentData['items'][$i]['comments']) && !empty($contentData['items'][$i]['comments'])): ?>
+    <div class="ml-3 pt-1 client-rs-contents">
+        <b>Comments: </b><?= $contentData['items'][$i]['comments'] ?>
+    </div>
+    <?php endif; ?>
+</div>
+<?php
+    }
+}
+else if(@$contentData['unknown']) {
+    ?>
+    <div class="text-secondary">Family history is unknown/unavailable</div>
+    <?php
+}
+else {
+?>
+<div class="text-secondary">-</div>
+<?php
+}
+?>

+ 159 - 0
resources/views/app/patient/segment-templates/omega_history_past_medical/summary-dashboard.blade.php

@@ -0,0 +1,159 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+
+$fields = [
+    [
+        "Head" => ["Trauma"],
+        "Eyes" => ["Blindness", "Cataracts", "Glaucoma", "Wears glasses/contacts"],
+        "Ears" => ["Hearing aids"],
+        "Nose/Sinuses" => ["Allergic Rhinitis", "Sinus infections"],
+        "Mouth/Throat/Teeth" => ["Dentures"],
+        "Cardiovascular" => ["Aneurysm", "Angina", "DVT", "Dysrhythmia", "HTN", "Murmur", "Myocardial infarction", "Other heart disease"],
+    ],
+    [
+        "Respiratory" => ["Asthma", "Bronchitis", "COPD - Bronchitis/Emphysema", "Pleuritis", "Pneumonia"],
+        "Gastrointestinal" => ["Cirrhosis", "GERD", "Gallbladder disease", "Heartburn", "Hemorrhoids", "Hepatitis", "Hiatal hernia", "Jaundice", "Ulcer"],
+        "Genitourinary" => ["Hernia", "Incontinence", "Nephrolithiasis", "Other kidney disease", "STDs", "UTI(s)"],
+    ],
+    [
+        "Musculoskeletal" => ["Arthritis", "Gout", "M/S injury"],
+        "Skin" => ["Dermatitis", "Mole(s)", "Other skin condition(s)", "Psoriasis"],
+        "Neurological" => ["Epilepsy", "Seizures", "Severe headaches, migraines", "Stroke", "TIA"],
+        "Psychiatric" => ["Bipolar disorder", "Depression", "Hallucinations, delusions", "Suicidal ideation", "Suicide attempts"],
+    ],
+    [
+        "Endocrine" => ["Goiter", "Hyperlipidemia", "Hypothyroidism", "Thyroid disease", "Thyroiditis", "Type I DM", "Type II DM"],
+        "Heme/Onc" => ["Anemia", "Cancer"],
+        "Infectious" => ["HIV", "STDs", "Tuberculosis (dz)", "Tuberculosis (exposure)"],
+    ]
+];
+
+$contentData = [
+    "bloodType" => "",
+    "bloodRH" => "",
+    "common" => [],
+    "customFields" => [],
+    "comments" => "",
+];
+$isempty = false;
+
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'PAST_MEDICAL_HISTORY', $sessionKey, true);
+
+$contentData = $parsed = false;
+
+$rel = !!$point->relevanceToNote($note);
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+}
+
+if ($contentData) {
+
+    $blood = [];
+    if(isset($contentData['bloodType'])) {
+        $blood[] = $contentData['bloodType'];
+    }
+    if(isset($contentData['bloodRH'])) {
+        $blood[] = $contentData['bloodRH'];
+    }
+    $blood = implode(" ", $blood);
+    if(!empty(trim($blood))) { ?>
+        <div class="mb-2">
+            <div><b>Blood Type &amp; RH: </b><?= $blood ?></div>
+        </div>
+    <?php }
+
+	$commonMap = [];
+
+    for ($i = 0; $i < count($fields); $i++):
+        foreach($fields[$i] as $head => $values):
+            for($k = 0; $k < count($values); $k++):
+		        $value = $values[$k];
+                $fName = $head . '_' . sanitize_field_name($values[$k]);
+                if(@$contentData['common'][$fName]) {
+                    if(!isset($commonMap[$head])) {
+                        $commonMap[$head] = [];
+                    }
+                    $commonMap[$head][] = ['value' => $value, 'fName' => $fName, 'comments' => @$contentData['common'][$fName.'__comments']];
+                ?>
+                    <div class="d-none">
+                        <?= ucwords($head) ?>
+                        <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                        <span class="font-weight-bold"><?= $values[$k] ?></span>
+                        <?php if(@$contentData['common'][$fName . '__comments']): ?>
+                            <span class="text-sm ml-1 text-secondary">(<?= $contentData['common'][$fName . '__comments'] ?>)</span>
+                        <?php endif; ?>
+                    </div>
+                <?php
+                }
+            endfor;
+        endforeach;
+    endfor;
+
+	// var_dump(json_encode($commonMap));
+	?> <div> <?php
+	foreach($commonMap as $head => $set):
+		?>
+		<div>
+			<span class="font-weight-bold"><?= ucwords($head) ?></span>
+			<i class="fa fa-arrow-right text-secondary d-none_"></i>
+			<span class="">
+			<?php $out = []; foreach($set as $item) { $out[] = '<span class="__font-weight-bold">' . $item['value'] . '</span>' . ($item['comments'] ? ('<span class="text-sm ml-1 text-secondary">(' . $item['comments'] . ')</span>') : ''); } if(!empty($out)) echo ' • '; echo implode(' • ', $out); ?>
+			</span>
+		</div>
+		<?php
+	endforeach;
+	?>
+
+	<?php
+
+    // custom fields
+
+    if(isset($contentData['customFields']) && count($contentData['customFields'])):
+        ?> <div class=""> <?php
+        for ($i = 0; $i < count($contentData['customFields']); $i++):
+            $item = $contentData['customFields'][$i];
+            if($item['value']): ?>
+                <span>
+                    <span class="font-weight-bold">Other: </span>
+		            <i class="fa fa-arrow-right d-none"></i>
+                </span>
+                <span>
+                    <span class="__font-weight-bold"><?= $item['label'] ?></span>
+                    <?php if($item['comments']): ?>
+                        <span class="text-sm ml-1 text-secondary">(<?= $item['comments'] ?>)</span>
+                    <?php endif; ?>
+                </span>
+            <?php
+            endif;
+        endfor;
+        ?> </div> <?php
+    endif;
+
+	echo '</div>';
+
+    if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) { ?>
+        <div class="mt-2 mb-1">
+            <b>Comments: </b><?= $contentData['comments'] ?>
+        </div>
+    <?php }
+
+} else {
+    echo '<div class="text-secondary">-</div>';
+}
+?>
+

+ 97 - 0
resources/views/app/patient/segment-templates/omega_history_social/summary-dashboard.blade.php

@@ -0,0 +1,97 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+$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 "],
+    ],
+    [
+        "Alcohol" => ["Do not drink", "Drink daily", "Frequently drink", "Hx of Alcoholism", "Occasional drink"],
+        "Drug Abuse" => ["IVDU", "Illicit drug use", "No illicit drug use"],
+    ],
+    [
+        "Cardiovascular" => ["Eat healthy meals", "Regular exercise", "Take daily aspirin"],
+        "Safety" => ["Household Smoke detector", "Keep Firearms in home", "Wear seatbelts"],
+    ],
+    [
+        "Sexual Activity" => ["Exposure to STI", "Homosexual encounters", "Not sexually active", "Safe sex practices", "Sexually active"],
+        "Birth Gender" => ["Male", "Female", "Undifferentiated"],
+    ]
+];
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'SOCIAL_HISTORY', $sessionKey, true);
+
+$contentData = $parsed = false;
+
+$rel = !!$point->relevanceToNote($note);
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+
+    $prevHead = ''; $items = [];
+    for ($i = 0; $i < count($fields); $i++) {
+        foreach($fields[$i] as $head => $values) {
+            $items = [];
+            for($k = 0; $k < count($values); $k++) {
+                $fName = $head . '_' . sanitize_field_name($values[$k]);
+                if(@$contentData['common'][$fName]) {
+                    $items[] = $values[$k] . (@$contentData['common'][$fName . '__comments'] ? '<span class="text-sm ml-1 text-secondary">(' . $contentData['common'][$fName . '__comments'] . ')</span>' : '');
+                }
+            }
+            if(count($items) && trim(implode('', $items)) !== '') {
+            ?>
+                <div>
+                    <b><?= $head ?></b>
+                    <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                    <?= implode(' • ', $items) ?>
+                </div>
+            <?php
+            }
+        }
+    }
+
+    // custom fields
+
+    if(isset($contentData['customFields']) && count($contentData['customFields'])):
+        ?> <div class=""> <?php
+        for ($i = 0; $i < count($contentData['customFields']); $i++):
+            $item = $contentData['customFields'][$i];
+            if($item['value']): ?>
+                <div>
+                    Custom
+                    <i class="fa fa-arrow-right text-sm text-secondary"></i>
+                    <span class="font-weight-bold"><?= $item['label'] ?></span>
+                    <?php if($item['comments']): ?>
+                        <span class="text-sm ml-1 text-secondary">(<?= $item['comments'] ?>)</span>
+                    <?php endif; ?>
+                </div>
+            <?php
+            endif;
+        endfor;
+        ?> </div> <?php
+    endif;
+
+    if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) { ?>
+        <div class="mt-2 mb-1">
+            <b>Comments: </b><?= $contentData['comments'] ?>
+        </div>
+    <?php }
+}
+else {
+    echo '<span class="text-secondary">-</span>';
+}
+?>

+ 91 - 0
resources/views/app/patient/segment-templates/omega_history_surgical/summary-dashboard.blade.php

@@ -0,0 +1,91 @@
+<?php
+
+use App\Models\Client;
+use App\Models\Point;
+use App\Models\Note;
+/** @var Client $patient */
+/** @var Note $note */
+/** @var Segment $segment */
+
+if(!@$note) {
+    $note = $patient->coreNote;
+}
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
+$fields = [
+    [
+        "" => ["Aneurysm repair", "Appendectomy", "Back surgery", "Bariatric surgery/gastric bypass", "Bilateral tubal ligation", "Breast resection/mastectomy", "CABG", "Carotid endarterectomy/stent", "Carpal tunnel release surgery",]
+    ],
+    [
+        "" => ["Cataract/lens surgery", "Cesarean section", "Cholecystectomy/bile duct surgery", "Dilation and curettage", "Hemorrhoid surgery", "Hip arthroplasty", "Hip replacement", "Hysterectomy", "Inguinal hernia repair",]
+    ],
+    [
+        "" => ["Knee arthroplasty", "LASIK", "Laminectomy", "Nasal surgery", "PTCA/PCI", "Pacemaker/defibrillator", "Prostate surgery", "Prostatectomy", "Rotator cuff surgery",]
+    ],
+    [
+        "" => ["Sinus surgery", "Skin cancer excision", "Spinal fusion", "TAH-BSO", "TURP", "Tonsillectomy/Adenoidectomy", "Vasectomy",]
+    ]
+];
+
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'SURGICAL_HISTORY', $sessionKey, true);
+
+$contentData = $parsed = false;
+
+$rel = !!$point->relevanceToNote($note);
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $parsed = $point->lastChildReview->data;
+
+    for ($i = 0; $i < count($fields); $i++):
+        foreach($fields[$i] as $head => $values):
+            for($k = 0; $k < count($values); $k++):
+                $fName = $head . '_' . sanitize_field_name($values[$k]);
+                if(@$contentData['common'][$fName]): ?>
+                    <div>
+                        <!--Common
+                        <i class="fa fa-arrow-right text-sm text-secondary"></i>-->
+                        <span class="font-weight-bold"><?= $values[$k] ?></span>
+                        <?php if(@$contentData['common'][$fName . '__comments']): ?>
+                            <span class="text-sm ml-1 text-secondary">(<?= $contentData['common'][$fName . '__comments'] ?>)</span>
+                        <?php endif; ?>
+                    </div>
+                <?php
+                endif;
+            endfor;
+        endforeach;
+    endfor;
+
+    // custom fields
+
+    if(isset($contentData['customFields']) && count($contentData['customFields'])):
+        ?> <div class=""> <?php
+        for ($i = 0; $i < count($contentData['customFields']); $i++):
+            $item = $contentData['customFields'][$i];
+            if($item['value']): ?>
+                <div>
+                    <!--Custom
+                    <i class="fa fa-arrow-right text-sm text-secondary"></i>-->
+                    <span class="font-weight-bold"><?= $item['label'] ?></span>
+                    <?php if($item['comments']): ?>
+                        <span class="text-sm ml-1 text-secondary">(<?= $item['comments'] ?>)</span>
+                    <?php endif; ?>
+                </div>
+            <?php
+            endif;
+        endfor;
+        ?> </div> <?php
+    endif;
+
+    if(isset($contentData['comments']) && !empty(trim($contentData['comments']))) { ?>
+        <div class="mt-2 mb-1">
+            <b>Comments: </b><?= $contentData['comments'] ?>
+        </div>
+    <?php }
+}
+else {
+    echo '<span class="text-secondary">-</span>';
+}
+?>

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

@@ -19,7 +19,7 @@ list($supplements, $counts) = Point::getPointsOfCategoryExtended($patient, 'SUPP
             <thead>
             <tr class="">
                 @if($patient->core_note_id !== $note->id)
-                <th class="border-bottom-0 text-secondary text-center width-30px">Rel.</th>
+                <th class="border-bottom-0 text-secondary text-center width-30px text-nowrap">Rel.</th>
                 @endif
                 <th class="border-bottom-0 text-secondary">Name</th>
                 <th class="border-bottom-0 text-secondary width-50px">Edit</th>

+ 5 - 0
resources/views/app/patient/tickets.blade.php

@@ -949,6 +949,11 @@
                             $(document).on('focus', '#ticketsApp input.form-control', function() {
                                 $(this).select();
                             });
+
+                            $(document).off('stag-popup-closed.add-edit-popup-closure')
+                            $(document).on('stag-popup-closed.add-edit-popup-closure', function() {
+                                $('input.date-input').datepicker('hide');
+                            });
                         },
                         inWords: function (num) {
                             try {

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

@@ -1,8 +1,8 @@
 <div class="w-100" moe center id="bp-management-settings-summary">
     <form start show url="">
       <fieldset disabled>
-        <div id="bpManagementComponentSummary" class="flex-container mx-0" v-cloak>
-            <div>
+        <div id="bpManagementComponentSummary" class="d-flex mx-0" v-cloak>
+            <div class="mr-3">
                 <div class="mb-2 d-flex align-items-center">
                     <span class="text-secondary min-width-140px w-50">BP Status</span>
                     <div class="w-50">

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

@@ -23,7 +23,7 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 					<li class="nav-item">
 						<a class="nav-link {{ strpos($routeName, 'patients.view.dashboard') === 0 ? 'active' : '' }}" href="{{ route('patients.view.dashboard', ['patient' => $patient]) }}">Dashboard</a>
 					</li>
-					@if($performer->pro->pro_type == 'ADMIN')
+					@if($performer->pro->pro_type == 'ADMIN' && $isOldClient)
 					<li class="nav-item">
 						<a class="nav-link {{ strpos($routeName, 'patients.view.migrate-canvas') === 0 ? 'active' : '' }}" href="{{ route('patients.view.migrate-canvas', ['patient' => $patient]) }}">Canvas Migrate</a>
 					</li>
@@ -135,7 +135,7 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 					<li class="nav-item">
 						<a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === '' ? 'active' : '' }}" href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => '']) }}">Tickets</a>
 					</li>
-					@if($isOldClient)
+					@if($isOldClient && 0)
 					<li class="nav-item">
 						<a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 ? 'active' : '' }}" href="{{ route('patients.view.patient-tickets', ['patient' => $patient]) }}" title="Deprecated">ERx / Orders
 							<span class="text-secondary text-sm pl-2">(dep)</span>

+ 57 - 48
resources/views/layouts/template.blade.php

@@ -128,22 +128,61 @@
                         <i class="mr-1 fas fa-tasks"></i> Practice
                     </a>
                     <div class="dropdown-menu mcp-theme-1 no-overflow-menu p-0" aria-labelledby="practice-management">
-                        @if($pro->pro_type !== 'ADMIN')
-                            @if($pro->is_enrolled_as_mcp)
-                            <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-mcp') }}">RPM (MCP)</a>
-                            @endif
-                            @if($pro->is_considered_for_rmm)
-                            <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-rmm') }}">RPM (RMM)</a>
-                            @endif
-                            @if($pro->is_considered_for_rme)
-                            <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-rme') }}">RPM (RME)</a>
-                            @endif
-                            <a class="dropdown-item" href="{{ route('practice-management.client-ccm-rm-status') }}">Client RM Status</a>
-                        @else
+                        @if($pro->is_enrolled_as_mcp)
+                        <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-mcp') }}">RPM (MCP)</a>
+                        @endif
+                        @if($pro->is_considered_for_rmm)
+                        <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-rmm') }}">RPM (RMM)</a>
+                        @endif
+                        @if($pro->is_considered_for_rme)
+                        <a class="dropdown-item" href="{{ route('practice-management.rpm-matrix-rme') }}">RPM (RME)</a>
+                        @endif
+                        <a class="dropdown-item" href="{{ route('practice-management.client-ccm-rm-status') }}">Client RM Status</a>
+
+                        @if($pro->is_enrolled_as_mcp && $pro->is_considered_for_mcp_assignment)
+
+                            <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">Text Shortcuts</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.myFavorites') }}">Favorites</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.proAvailability') }}">Availability</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Calendar</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.remoteMonitoringReport') }}">Remote Monitoring Report</a>
+
+                            <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
+
+                            <a class="dropdown-item" href="{{ route('mcp.notes') }}">Notes</a>
+                            <a class="dropdown-item" href="{{ route('mcp.memos') }}">Memos</a>
+                            <a class="dropdown-item" href="{{ route('mcp.appointments') }}">Appointments</a>
+                            <a class="dropdown-item" href="{{ route('mcp.bills') }}">Bills</a>
+                            <a class="dropdown-item" href="{{ route('mcp.erx_and_orders') }}">ERx & Orders</a>
+                            <a class="dropdown-item" href="{{ route('mcp.reports') }}">Reports</a>
+                            <a class="dropdown-item" href="{{ route('mcp.supply_orders') }}">Supply Orders</a>
+                            <a class="dropdown-item" href="{{ route('mcp.client_messages') }}">Messages</a>
+                            <a class="dropdown-item" href="{{ route('mcp.patients_accounts_invites') }}">Patients Accounts Invites</a>
+                            <a class="dropdown-item" href="{{ route('mcp.clients_bdt_devices') }}">Clients BDT Devices</a>
+                        @elseif($pro->isDefaultNA())
+
+                            <a class="dropdown-item" href="/practice-management/my-teams">My Teams</a>
+                            <a class="dropdown-item" href="{{ route('dna.encounters') }}">Encounters</a>
+                            <a class="dropdown-item" href="{{ route('dna.appointments') }}">Appointments</a>
+                            <a class="dropdown-item" href="{{ route('dna.careMonths') }}">Care Months</a>
+                            <a class="dropdown-item" href="{{ route('dna.financialTransactions') }}">Financial Transactions</a>
+                            <a class="dropdown-item" href="{{ route('dna.myBills') }}">My Bills</a>
+                            <a class="dropdown-item" href="{{ route('dna.myClinicalTeams') }}">My Clinical Teams</a>
+                        @endif
+                        <a class="dropdown-item" href="{{ route('practice-management.my-flyers') }}">My Flyers</a>
+                    </div>
+                </li>
+
+                @if($pro->pro_type === 'ADMIN')
+                    <li class="nav-item dropdown">
+                        <a class="nav-link dropdown-toggle" href="#" id="practice-management" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                            <i class="mr-1 fas fa-tasks"></i> Admin
+                        </a>
+                        <div class="dropdown-menu mcp-theme-1 no-overflow-menu p-0" aria-labelledby="practice-management">
                             <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring-admin') }}">Remote Monitoring (admin)</a>
                             <a class="dropdown-item" href="{{ route('practice-management.daily-treatment-services') }}">Daily Treatment Services</a>
-                        @endif
-                        @if($pro->pro_type == 'ADMIN')
+
                             <a class="dropdown-item" href="{{ route('practice-management.client-pro-changes') }}">Client Pro Changes</a>
                             <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
                             {{--<a class="dropdown-item" href="{{ route('practice-management.previousBills') }}">Previous Bills</a>--}}
@@ -178,7 +217,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.rmActionReport') }}">RM Action Report</a>
                             <a class="dropdown-item" href="{{ route('practice-management.hcp-note-activity') }}">HCP Note Activity</a>
                             <a class="dropdown-item" href="{{ route('practice-management.allNotes') }}">All Notes</a>
-                            
+
                             @if($pro->id == '1' || $pro->id == '16')
                                 <a class="dropdown-item" href="{{ route('practice-management.treatmentServiceUtil') }}">Treatment Service Util.</a>
                             @endif
@@ -202,40 +241,10 @@
                             <a class="dropdown-item" href="{{ route('admin.part_b_patients') }}">Part B Patients</a>
                             <a class="dropdown-item" href="{{ route('admin.bdt_devices') }}">BDT Devices</a>
                             <a class="dropdown-item" href="{{ route('admin.patientsMissingDefasultSettings') }}">Patients Missing Default Settings</a>
-                        @elseif($pro->is_enrolled_as_mcp && $pro->is_considered_for_mcp_assignment)
-
-                            <a class="dropdown-item" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">Text Shortcuts</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.myFavorites') }}">Favorites</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.proAvailability') }}">Availability</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Calendar</a>
-                            <a class="dropdown-item" href="{{ route('practice-management.remoteMonitoringReport') }}">Remote Monitoring Report</a>
-
-                            <a class="dropdown-item" href="{{ route('practice-management.rpmMatrix') }}">RPM Matrix</a>
 
-                            <a class="dropdown-item" href="{{ route('mcp.notes') }}">Notes</a>
-                            <a class="dropdown-item" href="{{ route('mcp.memos') }}">Memos</a>
-                            <a class="dropdown-item" href="{{ route('mcp.appointments') }}">Appointments</a>
-                            <a class="dropdown-item" href="{{ route('mcp.bills') }}">Bills</a>
-                            <a class="dropdown-item" href="{{ route('mcp.erx_and_orders') }}">ERx & Orders</a>
-                            <a class="dropdown-item" href="{{ route('mcp.reports') }}">Reports</a>
-                            <a class="dropdown-item" href="{{ route('mcp.supply_orders') }}">Supply Orders</a>
-                            <a class="dropdown-item" href="{{ route('mcp.client_messages') }}">Messages</a>
-                            <a class="dropdown-item" href="{{ route('mcp.patients_accounts_invites') }}">Patients Accounts Invites</a>
-                            <a class="dropdown-item" href="{{ route('mcp.clients_bdt_devices') }}">Clients BDT Devices</a>
-                        @elseif($pro && $pro->isDefaultNA())
-
-                            <a class="dropdown-item" href="/practice-management/my-teams">My Teams</a>
-                            <a class="dropdown-item" href="{{ route('dna.encounters') }}">Encounters</a>
-                            <a class="dropdown-item" href="{{ route('dna.appointments') }}">Appointments</a>
-                            <a class="dropdown-item" href="{{ route('dna.careMonths') }}">Care Months</a>
-                            <a class="dropdown-item" href="{{ route('dna.financialTransactions') }}">Financial Transactions</a>
-                            <a class="dropdown-item" href="{{ route('dna.myBills') }}">My Bills</a>
-                            <a class="dropdown-item" href="{{ route('dna.myClinicalTeams') }}">My Clinical Teams</a>
-                        @endif
-                        <a class="dropdown-item" href="{{ route('practice-management.my-flyers') }}">My Flyers</a>
-                    </div>
-                </li>
+                        </div>
+                    </li>
+                @endif
             </ul>
             {{-- if pro is working on a client and is not in tht client
             <div class="current-work mr-2">