Forráskód Böngészése

resolved conflict

= 3 éve
szülő
commit
c326bea103
33 módosított fájl, 695 hozzáadás és 209 törlés
  1. 19 0
      app/Helpers/helpers.php
  2. 2 2
      app/Http/Controllers/AdminController.php
  3. 34 2
      app/Http/Controllers/PracticeManagementController.php
  4. 3 3
      app/Models/Note.php
  5. 9 1
      public/css/style.css
  6. 17 10
      resources/views/app/patient/appointment-calendar.blade.php
  7. 19 17
      resources/views/app/patient/care-month/_matrix.blade.php
  8. 19 17
      resources/views/app/patient/care-month/_work_matrix.blade.php
  9. 6 4
      resources/views/app/patient/dashboard.blade.php
  10. 1 1
      resources/views/app/patient/note/_create-bill.blade.php
  11. 227 33
      resources/views/app/patient/note/dashboard.blade.php
  12. 8 2
      resources/views/app/patient/note/dashboard_script.blade.php
  13. 27 25
      resources/views/app/patient/note/follow-up-appointment.blade.php
  14. 4 1
      resources/views/app/patient/note/note-segment-list-print.blade.php
  15. 5 3
      resources/views/app/patient/note/partials/cpp-bills-claims-container.blade.php
  16. 20 3
      resources/views/app/patient/note/segment-resolve.blade.php
  17. 36 15
      resources/views/app/patient/note/segment-slim.blade.php
  18. 5 5
      resources/views/app/patient/partials/client_bp_weight_phone_number_status.blade.php
  19. 16 1
      resources/views/app/patient/point-based-partials/allergies.blade.php
  20. 16 0
      resources/views/app/patient/point-based-partials/care-team.blade.php
  21. 16 1
      resources/views/app/patient/point-based-partials/dx.blade.php
  22. 16 0
      resources/views/app/patient/point-based-partials/rx.blade.php
  23. 2 2
      resources/views/app/patient/problems-center.blade.php
  24. 5 0
      resources/views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php
  25. 5 0
      resources/views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php
  26. 13 1
      resources/views/app/patient/wizard-partials/common-script.blade.php
  27. 2 2
      resources/views/app/practice-management/_sort_header.blade.php
  28. 96 28
      resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php
  29. 25 22
      resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php
  30. 13 3
      resources/views/app/practice-management/rpm-matrix-for-admin.blade.php
  31. 1 0
      resources/views/layouts/patient-header.blade.php
  32. 5 1
      resources/views/layouts/patient.blade.php
  33. 3 4
      routes/web.php

+ 19 - 0
app/Helpers/helpers.php

@@ -168,6 +168,25 @@ if(!function_exists('friendly_date_est')) {
     }
 }
 
+if(!function_exists('friendly_date_est_compact')) {
+    function friendly_date_est_compact($value, $default = '-') {
+
+        if(!$value || empty($value)) return $default;
+        try {
+
+            $realTimezone = resolve_timezone('EASTERN');
+            $date = new DateTime($value);
+            $date->setTimezone(new DateTimeZone($realTimezone));
+
+            return $date->format('y') === date('y') ? $date->format("m/d") : $date->format("m/d/y");
+
+        }
+        catch (Exception $e) {
+            return $e->getMessage();
+        }
+    }
+}
+
 
 if(!function_exists('friendly_date_time')) {
     function friendly_date_time($value, $includeTime = true, $default = '-', $long_year=false) {

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

@@ -185,8 +185,8 @@ class AdminController extends Controller
             }
         }
 
-        $sortBy = $request->input('sort_by') ?: 'name_first';
-        $sortDir = $request->input('sort_dir') ?: 'ASC';
+        $sortBy = $request->input('sort_by') ?: 'created_at';
+        $sortDir = $request->input('sort_dir') ?: 'DESC';
 
         $patients = $patients->orderByRaw("$sortBy $sortDir NULLS LAST");
 

+ 34 - 2
app/Http/Controllers/PracticeManagementController.php

@@ -1827,11 +1827,34 @@ WHERE
         $genericBillJoinClause = "left join bill mcpBill on care_month.mcp_rm_generic_bill_id = mcpBill.id
                    left join bill rmmBill on care_month.rmm_rm_generic_bill_id = rmmBill.id";
 
+        $defaultPageSize = 25;
+
+        $page = $request->input('page') ?: 1;
+        $perPage = $request->input('per_page') ?: $defaultPageSize;
+        $offset = ($page - 1) * $perPage;
+
+        $countQuery = "
+SELECT COUNT(*)
+FROM care_month join client on care_month.client_id = client.id 
+    join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
+    left join pro mcpPro on care_month.mcp_pro_id = mcpPro.id
+    left join pro rmmPro on care_month.rmm_pro_id = rmmPro.id
+    {$genericBillJoinClause}
+WHERE
+      EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
+      AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
+      " . (count($conditions) > 0 ? 'AND ' . implode(" AND ", $conditions) : '') . "      
+";
+
+        $countResult = DB::select($countQuery);
+        $total = $countResult[0]->count;
+
         $query = "
 SELECT client.name_first, client.name_last,
        (client.name_first || ' ' || client.name_last) as client_name,
        client.uid as client_uid, 
        client.dob,
+       client.age_in_years,
        client.is_enrolled_in_rm,
        client.most_recent_completed_mcp_note_date,
        client.most_recent_completed_mcp_note_id,
@@ -1845,6 +1868,7 @@ SELECT client.name_first, client.name_last,
        care_month.rm_total_time_in_seconds_by_rmm_pro,
        care_month.number_of_days_with_remote_measurements,
        care_month.has_mcp_interacted_with_client_about_rm,
+       care_month.has_anyone_interacted_with_client_about_rm,
        care_month.rm_num_measurements_not_stamped_by_mcp,
        care_month.rm_num_measurements_not_stamped_by_non_hcp,
        care_month.rm_num_measurements_not_stamped_by_rmm,
@@ -1863,8 +1887,11 @@ SELECT client.name_first, client.name_last,
        care_month.most_recent_cellular_weight_measurement_at,
        mcpPro.mcp_rpm_payment_strategy,
        mcpPro.mcp_rpm_payment_amount,
+       (mcpPro.name_first || ' ' || mcpPro.name_last) as mcp_name,
        rmmPro.rmm_payment_strategy,
        rmmPro.rmm_payment_amount,
+       (SELECT COUNT(*) FROM claim_line where claim_line.cpt = '99454' AND claim_line.claim_id IN (SELECT claim.id FROM claim WHERE claim.care_month_id = care_month.id AND claim.status != 'CANCELLED')) as claim_454,
+       (SELECT COUNT(*) FROM claim_line where claim_line.cpt = '99457' AND claim_line.claim_id IN (SELECT claim.id FROM claim WHERE claim.care_month_id = care_month.id AND claim.status != 'CANCELLED')) as claim_457,
        {$genericBillIdColumns}
 FROM care_month join client on care_month.client_id = client.id 
     join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
@@ -1875,7 +1902,8 @@ WHERE
       EXTRACT(MONTH from care_month.start_date) = " . ($request->input('m') ?: 'EXTRACT(MONTH from now())') . "
       AND EXTRACT(YEAR from care_month.start_date) = " . ($request->input('y') ?: 'EXTRACT(YEAR from now())') . "
       " . (count($conditions) > 0 ? 'AND ' . implode(" AND ", $conditions) : '') . "
-      $orderBy
+      {$orderBy} OFFSET {$offset} LIMIT {$perPage}
+      
 ";
 
         // dd($query);
@@ -1885,7 +1913,11 @@ WHERE
         $timestamp = strtotime(date('Y-m-d'));
         $daysRemaining = (int)date('t', $timestamp) - (int)date('j', $timestamp);
 
-        return view('app.practice-management.rpm-matrix-for-admin', compact('patients', 'daysRemaining', 'careMonthStart'));
+        $paginator = new LengthAwarePaginator($patients, $total, $request->input('per_page') ?: $defaultPageSize, $request->input('page') ?: 1);
+        $perPage = $request->input('per_page') ?: $defaultPageSize;
+        $paginator->setPath(route('practice-management.rpm-matrix-admin'));
+
+        return view('app.practice-management.rpm-matrix-for-admin', compact('patients', 'daysRemaining', 'careMonthStart', 'paginator', 'perPage'));
     }
 
     public function remoteMonitoringMCP(Request $request) {

+ 3 - 3
app/Models/Note.php

@@ -84,7 +84,7 @@ class Note extends Model
     {
         return $this->hasMany(Segment::class, 'note_id', 'id')
             ->where('id', '!=', $this->core_segment_id) // dont include core-segment
-            ->where('is_active', true)
+            //->where('is_active', true)
             ->orderBy('position_index', 'asc');
     }
 
@@ -93,7 +93,7 @@ class Note extends Model
         return $this->hasMany(Segment::class, 'note_id', 'id')
             ->whereRaw("(left_or_right IS NULL OR left_or_right = 'LEFT')")
             ->where('id', '!=', $this->core_segment_id) // dont include core-segment
-            ->where('is_active', true)
+            //->where('is_active', true)
             ->orderBy('position_index', 'asc');
     }
 
@@ -102,7 +102,7 @@ class Note extends Model
         return $this->hasMany(Segment::class, 'note_id', 'id')
             ->where('left_or_right', 'RIGHT')
             ->where('id', '!=', $this->core_segment_id) // dont include core-segment
-            ->where('is_active', true)
+            //->where('is_active', true)
             ->orderBy('position_index', 'asc');
     }
 

+ 9 - 1
public/css/style.css

@@ -1345,7 +1345,7 @@ body .node input[type="number"] {
     cursor: ns-resize;
 }
 .stag-popup.resizable .stag-popup-content {
-    overflow: auto !important;
+    /*overflow: auto !important;*/   /* trouble */
 }
 
 /* slide-in stag-popups */
@@ -3605,4 +3605,12 @@ table.v-top th {
 .no-column-wrap th:first-child,
 .no-column-wrap td:first-child {
     white-space: nowrap;
+}
+
+.inline-html-container p>br:first-child:last-child,
+.inline-html-container p:empty {
+    display: none;
+}
+.mcp-theme-1 .mb-0-pagination .pagination {
+    margin-bottom: 0 !important;
 }

+ 17 - 10
resources/views/app/patient/appointment-calendar.blade.php

@@ -4,6 +4,11 @@
 
     <?php
 
+    $oPro = false;
+    if(request()->input('opUid')) {
+        $oPro = \App\Models\Pro::where('uid', request()->input('opUid'))->first();
+    }
+
     function adjustBrightness($hex, $steps) {
         $steps = max(-255, min(255, $steps));
         $hex = str_replace('#', '', $hex);
@@ -130,7 +135,7 @@
             <div class="ml-auto d-inline-flex align-items-center">
                 <label class="mr-2 my-0 text-secondary">Show</label>
                 <select id="eventTypes"
-                        class="form-control form-control-sm w-180"
+                        class="form-control form-control-sm"
                         v-model="eventTypes"
                         v-on:change="refreshEvents()">
                     <option value="APPOINTMENTS">Active Appointments</option>
@@ -163,6 +168,9 @@
                 <select id="eventPros" name="proUid"
                         class="form-control form-control-sm flex-grow-1" multiple
                         v-model="proIds">
+                    @if($oPro)
+                        <option value="{{$oPro->id}}">{{$oPro->displayName()}}</option>
+                    @endif
                 </select>
             </form>
             <hr class="my-2">
@@ -685,10 +693,6 @@
             <?php
             $patient->nameStr = $patient->displayName();
             $clientObject = json_encode($patient);
-            $oPro = false;
-            if(request()->input('opUid')) {
-                $oPro = \App\Models\Pro::where('uid', request()->input('opUid'))->first();
-            }
             ?>
 
             function init() {
@@ -696,7 +700,7 @@
                     el: '#calendarApp-{{$patient->id}}',
                     data: {
                         client: {!! json_encode($patient) !!},
-                        eventTypes: '{{ $currentAppointment ? 'BOTH_ALL' : 'BOTH' }}',
+                        eventTypes: '{{ $currentAppointment ? 'BOTH_ALL' : 'APPOINTMENTS' }}',
                         calendar: null,
                         proIds: ['{{ $currentAppointment ? $currentAppointment->pro_id : ($oPro ? $oPro->id : $pro->id) }}'],
                         lastSelectedProUid: '',
@@ -1470,10 +1474,13 @@
                             });
                         }
                         if(localStorage.stagCalendarProIds) {
-                            this.proIds = JSON.parse(localStorage.stagCalendarProIds);
-                            Vue.nextTick(function() {
-                                $('#eventPros').trigger('change');
-                            });
+                            let lsProIds = JSON.parse(localStorage.stagCalendarProIds);
+                            if(lsProIds && lsProIds.length) {
+                                this.proIds = lsProIds;
+                                Vue.nextTick(function () {
+                                    $('#eventPros').trigger('change');
+                                });
+                            }
                         }
                         @endif
 

+ 19 - 17
resources/views/app/patient/care-month/_matrix.blade.php

@@ -206,7 +206,7 @@ foreach ($days as $k => $day) {
                                     $autoCheckEntry = false;
                                     $autoCheckEntry = ($dayTotalMinutes < 2 && $patient->is_enrolled_in_rm);
                                     ?>
-                                    <div class="p-2 border border-info bg-light mb-2">
+                                    <div class="mb-2">
                                         <div class="mb-2">
                                             <label class="mb-1 text-secondary text-sm">Memo</label>
                                             <textarea class="form-control form-control-sm" name="entryMemo">measurements within range</textarea>
@@ -218,28 +218,30 @@ foreach ($days as $k => $day) {
                                             </label>
                                         </div>
                                         <div class="if-adding-time-entry pt-2 d-none">
-                                            <div class="mb-2">
-                                                <label class="mb-1 text-secondary text-sm">Seconds</label>
-                                                <input type="number" min="75" max="300"
-                                                       class="form-control form-control-sm w-100" name="entryNumberOfSeconds"
-                                                       value="75" placeholder="Time (seconds.)">
-                                            </div>
-                                            <div class="mb-2">
-                                                <label class="mb-1 text-secondary text-sm">Date</label>
-                                                <input type="date" class="form-control form-control-sm w-100"
-                                                       name="entryDate"
-                                                       value="{{date('Y-m-d', strtotime($k))}}">
+                                            <div class="mb-2 d-flex align-items-start">
+                                                <div class="width-70px mr-2">
+                                                    <label class="mb-1 text-secondary text-sm">Seconds</label>
+                                                    <input type="number" min="75" max="300"
+                                                           class="form-control min-width-unset form-control-sm w-100" name="entryNumberOfSeconds"
+                                                           value="75" placeholder="Time (seconds.)">
+                                                </div>
+                                                <div class="flex-grow-1">
+                                                    <label class="mb-1 text-secondary text-sm">Date</label>
+                                                    <input type="date" class="form-control min-width-unset form-control-sm w-100"
+                                                           name="entryDate"
+                                                           value="{{date('Y-m-d', strtotime($k))}}">
+                                                </div>
                                             </div>
                                         </div>
                                     </div>
-                                    <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                        <span>I have had interactive communication with <b>{{$patient->displayName()}}</b>.</span>
-                                        <div class="d-flex border-top mt-2">
-                                            <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                                    <div class="my-3">
+                                        <span><i class="fa fa-phone rotateh text-dark mr-1"></i>This time entry involved interactive communication (audio, video, or in-person) with the patient and/or caretaker.</span>
+                                        <div class="d-flex pt-1">
+                                            <label class="mb-0 d-inline-flex align-items-center mr-3">
                                                 <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required {{$careMonth->has_mcp_interacted_with_client_about_rm ? 'checked' : ''}}>
                                                 <span>Yes</span>
                                             </label>
-                                            <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                                            <label class="mb-0 d-inline-flex align-items-center">
                                                 <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required {{!$careMonth->has_mcp_interacted_with_client_about_rm ? 'checked' : ''}}>
                                                 <span>No</span>
                                             </label>

+ 19 - 17
resources/views/app/patient/care-month/_work_matrix.blade.php

@@ -231,7 +231,7 @@ $days = $daysWithUnstamped;
                                         $autoCheckEntry = false;
                                         $autoCheckEntry = ($dayTotalMinutes < 2 && $patient->is_enrolled_in_rm);
                                         ?>
-                                        <div class="p-2 border border-info bg-light mb-2">
+                                        <div class="mb-2">
                                             <div class="mb-2">
                                                 <label class="mb-1 text-secondary text-sm">Memo</label>
                                                 <textarea class="form-control form-control-sm" name="entryMemo">measurements within range</textarea>
@@ -243,28 +243,30 @@ $days = $daysWithUnstamped;
                                                 </label>
                                             </div>
                                             <div class="if-adding-time-entry pt-2 d-none">
-                                                <div class="mb-2">
-                                                    <label class="mb-1 text-secondary text-sm">Seconds</label>
-                                                    <input type="number" min="75" max="300"
-                                                           class="form-control form-control-sm w-100" name="entryNumberOfSeconds"
-                                                           value="75" placeholder="Time (secs.)">
-                                                </div>
-                                                <div class="mb-2">
-                                                    <label class="mb-1 text-secondary text-sm">Date</label>
-                                                    <input type="date" class="form-control form-control-sm w-100"
-                                                           name="entryDate"
-                                                           value="{{date('Y-m-d', strtotime($k))}}">
+                                                <div class="mb-2 d-flex align-items-start">
+                                                    <div class="width-70px mr-2">
+                                                        <label class="mb-1 text-secondary text-sm">Seconds</label>
+                                                        <input type="number" min="75" max="300"
+                                                               class="form-control min-width-unset form-control-sm w-100" name="entryNumberOfSeconds"
+                                                               value="75" placeholder="Time (secs.)">
+                                                    </div>
+                                                    <div class="flex-grow-1">
+                                                        <label class="mb-1 text-secondary text-sm">Date</label>
+                                                        <input type="date" class="form-control min-width-unset form-control-sm w-100"
+                                                               name="entryDate"
+                                                               value="{{date('Y-m-d', strtotime($k))}}">
+                                                    </div>
                                                 </div>
                                             </div>
                                         </div>
-                                        <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                            <span>I have had interactive communication with <b>{{$patient->displayName()}}</b>.</span>
-                                            <div class="d-flex border-top mt-2">
-                                                <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                                        <div class="my-3">
+                                            <span><i class="fa fa-phone rotateh text-dark mr-1"></i>This time entry involved interactive communication (audio, video, or in-person) with the patient and/or caretaker.</span>
+                                            <div class="d-flex pt-1">
+                                                <label class="mb-0 d-inline-flex align-items-center mr-3">
                                                     <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required {{$careMonth->has_mcp_interacted_with_client_about_rm ? 'checked' : ''}}>
                                                     <span>Yes</span>
                                                 </label>
-                                                <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                                                <label class="mb-0 d-inline-flex align-items-center">
                                                     <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="false" required {{!$careMonth->has_mcp_interacted_with_client_about_rm ? 'checked' : ''}}>
                                                     <span>No</span>
                                                 </label>

+ 6 - 4
resources/views/app/patient/dashboard.blade.php

@@ -34,10 +34,12 @@
             <div class="col-6">
 
                 {{-- rpm summary for current caremonth --}}
-                @if($patient->currentCareMonth())
-                    @include('app/patient/partials/caremonth-summary', ['careMonth' => $patient->currentCareMonth()])
-                @else 
-                    <div class="alert alert-info">No caremonth for this month.</div>
+                @if($patient->is_enrolled_in_rm === 'YES')
+                    @if($patient->currentCareMonth())
+                        @include('app/patient/partials/caremonth-summary', ['careMonth' => $patient->currentCareMonth()])
+                    @else
+                        <div class="alert alert-info">No caremonth for this month.</div>
+                    @endif
                 @endif
 
                 {{-- appointments --}}

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

@@ -1,4 +1,4 @@
-<?php $noteRates = $note->hcpPro->noteRates(); ?>
+<?php $noteRates = $note->hcpPro ? $note->hcpPro->noteRates() : []; ?>
 @if(!$note->is_bill_closed && !$note->is_billing_marked_done)
     @if($note->hasUnacknowledgedCancelledBillsByPro($pro))
         <b class="ml-3 text-warning-dark">

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

@@ -148,31 +148,223 @@ use App\Models\Handout;
         <div class="card-header d-flex align-items-start px-3 py-2 border-bottom rounded-0" id="note-card-header">
             <div class="pr-2">
                 {{$note->title}}
+                @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
+                    <div moe class="d-block" relative id="note-edit-title">
+                        <a href="" show start></a>
+                        <form url="/api/note/putTitle">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <input type="text" name="title" value="{{$note->title}}" class="form-control form-control-sm"
+                                       placeholder="Title">
+                            </div>
+                            <div class="form-group mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             </div>
-            <div class="px-2 border-left border-right">
+            <div class="pl-2 pr-3">
                 <div class="d-flex">
                     <span>{{friendly_date_time($note->effective_dateest, false, '')}}</span>
                 </div>
+                @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
+                    <div moe relative class="d-block ml-auto" id="note-edit-date">
+                        <a href="" show start></a>
+                        <form url="/api/note/putEffectiveDateEST">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <label for="" class="text-secondary text-sm">Effective date EST</label>
+                                <input type="date" name="effectiveDateEST" value="{{$note->effective_dateest}}"
+                                       class="form-control form-control-sm">
+                            </div>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             </div>
 
-            <div class="px-2 border-right">
+            <div class="pr-3">
                 <div class="d-flex">
-                    <span><span class="text-secondary">{{$note->hcpPro->is_hcp ? 'HCP' : 'Pro'}}:</span> {{$note->hcpPro->name_first}} {{$note->hcpPro->name_last}}</span>
+                    <span><span class="text-secondary">{{$note->hcpPro && $note->hcpPro->is_hcp ? 'HCP' : 'Pro'}}:</span> @if($note->hcpPro) {{$note->hcpPro->name_first}} {{$note->hcpPro->name_last}} @endif</span>
                 </div>
+                @if($pro->pro_type === 'ADMIN')
+                    <div moe relative class="d-block ml-2" id="note-edit-hcp">
+                        <a href="" show start></a>
+                        <form url="/api/note/putHcp">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <select provider-search data-pro-uid="{{ $note->hcpPro ? @$note->hcpPro->uid : '' }}"
+                                        name="hcpProUid" class="form-control form-control-sm">
+                                    <option value="">-- Select HCP Pro --</option>
+                                </select>
+                            </div>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                    <div moe relative class="d-block ml-2" id="note-remove-hcp">
+                        <a href="" show start></a>
+                        <form url="/api/note/removeHcp">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <p class="mb-2">Remove HCP?</p>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             </div>
 
-            <div class="px-2 border-right">
+            <div class="pr-3">
+                <div class="d-flex">
+                    <span><span class="text-secondary">NA:</span> @if($note->allyPro) {{$note->allyPro->name_first}} {{$note->allyPro->name_last}} @endif</span>
+                </div>
+                @if($pro->pro_type === 'ADMIN')
+                    <div moe relative class="d-block ml-2" id="note-edit-na">
+                        <a href="" show start></a>
+                        <form url="/api/note/putNa">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <select provider-search data-pro-uid="{{ $note->allyPro ? @$note->allyPro->uid : '' }}"
+                                        name="naProUid" class="form-control form-control-sm">
+                                    <option value="">-- Select NA Pro --</option>
+                                </select>
+                            </div>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                    <div moe relative class="d-block ml-2" id="note-remove-na">
+                        <a href="" show start></a>
+                        <form url="/api/note/removeNa">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <p class="mb-2">Remove NA?</p>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
+            </div>
+
+            <div class="pr-3">
                 <div class="d-flex">
                     <span><span class="text-secondary">Type:</span> {{$note->new_or_fu_or_na ? ($note->new_or_fu_or_na === 'NEW' ? 'New Patient' : $note->new_or_fu_or_na) : '-'}}</span>
                 </div>
+                @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
+                    <div moe class="ml-auto d-block" relative id="note-edit-type">
+                        <a href="" show start></a>
+                        <form url="/api/note/updateNewOrFuOrNa">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <select name="newOrFuOrNa" class="form-control form-control-sm" required>
+                                    <option value="">-- select --</option>
+                                    <option value="NEW" {{ $note->new_or_fu_or_na === "NEW" ? "selected" : "" }}>New</option>
+                                    <option value="FU" {{ $note->new_or_fu_or_na === "FU" ? "selected" : "" }}>Follow-up</option>
+                                    <option value="NA" {{ $note->new_or_fu_or_na === "NA" ? "selected" : "" }}>N/A</option>
+                                </select>
+                            </div>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             </div>
 
-            <div class="px-2">
+            <div class="pr-3">
                 <div class="d-flex">
                     <span><span class="text-secondary">Method:</span> {{$note->method ? noteMethodDisplay($note->method) : '-'}}</span>
                 </div>
+                @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
+                    <div moe class="ml-auto d-block" relative id="note-edit-method">
+                        <a href="" show start></a>
+                        <form url="/api/note/updateMethod" hook="onNoteMethodUpdate">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <select name="method" class="form-control form-control-sm note-method-select" required>
+                                    <option value="AUDIO" {{ $note->method === "AUDIO" ? "selected" : "" }}>Audio</option>
+                                    <option value="VIDEO" {{ $note->method === "VIDEO" ? "selected" : "" }}>Video</option>
+                                    <option value="IN_CLINIC" {{ $note->method === "IN_CLINIC" ? "selected" : "" }}>In-Clinic</option>
+                                    <option value="HOUSE_CALL" {{ $note->method === "HOUSE_CALL" ? "selected" : "" }}>House Call</option>
+                                </select>
+                            </div>
+                            <div class="form-group if-in-clinic">
+                                <label for="" class="text-secondary text-sm mb-1">Location</label>
+                                <select name="hcpCompanyLocationUid" class="form-control">
+                                    <option value=""></option>
+                                    @foreach($pro->companyLocations() as $location)
+                                        <option value="{{$location->uid}}" {{$location->id === $note->hcp_company_location_id ? 'selected' : ''}}>{{$location->line1}} {{$location->city}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+                            <div class="mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                @endif
             </div>
 
+            @if($pro->pro_type === 'ADMIN')
+                <div class="d-block position-relative on-click-menu mr-2">
+                    <span class="text-sm text-primary c-pointer border px-2 p-1 rounded bg-white">
+                        <i class="fa fa-ellipsis-h"></i>
+                    </span>
+                    <div menu left class="bg-white border">
+                        <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                           onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-edit-title>a:first').trigger('click'); return false;">
+                            Edit Title
+                        </a>
+                        <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                           onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-edit-date>a:first').trigger('click'); return false;">
+                            Edit Date
+                        </a>
+                        <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                           onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-edit-hcp>a:first').trigger('click'); return false;">
+                            Edit HCP
+                        </a>
+                        @if($note->hcpPro)
+                            <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                               onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-remove-hcp>a:first').trigger('click'); return false;">
+                                Remove HCP
+                            </a>
+                        @endif
+                        <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                           onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-edit-na>a:first').trigger('click'); return false;">
+                            Edit NA
+                        </a>
+                        @if($note->allyPro)
+                            <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                               onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-remove-na>a:first').trigger('click'); return false;">
+                                Remove NA
+                            </a>
+                        @endif
+                        <a native target="_blank" href="#" class="pl-2 pr-3 pt-1 d-block text-nowrap text-sm"
+                           onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-edit-type>a:first').trigger('click'); return false;">
+                            Edit Type
+                        </a>
+                        <a native target="_blank" href="#" class="pl-2 pr-3 py-1 d-block text-nowrap text-sm"
+                           onclick="$(this).closest('.on-click-menu').find('[menu]').hide(); $('#note-edit-method>a:first').trigger('click'); return false;">
+                            Edit Method
+                        </a>
+                    </div>
+                </div>
+            @endif
+
             <div class="px-2 border-left screen-only">
                 <a href="{{route('print-note', ['patient' => $patient, 'note' => $note])}}" native target="_blank" class=""><i class="fa fa-print"></i></a>
             </div>
@@ -357,35 +549,37 @@ use App\Models\Handout;
                                 @endif
                             </div>
                         @endif
-                        @if(!$note->is_signed_by_hcp )
-                            @if($note->hcp_pro_id !== $pro->id)
-                                <span class="text-sm text-secondary screen-only">Only the note's HCP can sign</span>
-                            @else
-                                @if(!$isVisitTemplateBased)
-                                    <div moe relative
-                                         class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }} screen-only"
-                                         title="{{ $note->hcp_pro_id !== $pro->id ? 'Only the note\'s HCP can sign' : '' }}">
-                                        <a class="" href="" show start>Sign As HCP</a>
-                                        <form url="/api/note/signAsHcp" right>
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Sign this note as HCP?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-success btn-sm" submit>Sign</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </div>
+                        @if($note->hcpPro)
+                            @if(!$note->is_signed_by_hcp )
+                                @if($note->hcp_pro_id !== $pro->id)
+                                    <span class="text-sm text-secondary screen-only">Only the note's HCP can sign</span>
                                 @else
-                                    <a native target="_blank"
-                                       open-in-stag-popup
-                                       update-parent
-                                       mc-initer="note-sign-confirmation-{{$note->id}}"
-                                       popup-style="stag-popup-md"
-                                       title="Confirm and Sign"
-                                       class="screen-only"
-                                       href="{{route('patients.view.notes.view.sign-confirmation', compact('patient', 'note'))}}">
-                                        Sign Note As {{$note->hcpPro->is_hcp ? 'HCP' : 'Pro'}}
-                                    </a>
+                                    @if(!$isVisitTemplateBased)
+                                        <div moe relative
+                                             class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }} screen-only"
+                                             title="{{ $note->hcp_pro_id !== $pro->id ? 'Only the note\'s HCP can sign' : '' }}">
+                                            <a class="" href="" show start>Sign As HCP</a>
+                                            <form url="/api/note/signAsHcp" right>
+                                                <input type="hidden" name="uid" value="{{$note->uid}}">
+                                                <p>Sign this note as HCP?</p>
+                                                <div class="mb-0">
+                                                    <button class="btn btn-success btn-sm" submit>Sign</button>
+                                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    @else
+                                        <a native target="_blank"
+                                           open-in-stag-popup
+                                           update-parent
+                                           mc-initer="note-sign-confirmation-{{$note->id}}"
+                                           popup-style="stag-popup-md"
+                                           title="Confirm and Sign"
+                                           class="screen-only"
+                                           href="{{route('patients.view.notes.view.sign-confirmation', compact('patient', 'note'))}}">
+                                            Sign Note As {{$note->hcpPro->is_hcp ? 'HCP' : 'Pro'}}
+                                        </a>
+                                    @endif
                                 @endif
                             @endif
                         @endif

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

@@ -47,8 +47,14 @@
                 $(document)
                     .off('click.update-fu-appt-status', '.fu-appt-container .update-fu-appt-status')
                     .on('click.update-fu-appt-status', '.fu-appt-container .update-fu-appt-status', function() {
-                        let parent = $(this).closest('.fu-appt-container');
-                        parent.find('.fu-appt-choices').removeClass('d-none').addClass('d-flex');
+                        let parent = $(this).closest('.fu-appt-container'),
+                            choices = parent.find('.fu-appt-choices');
+                        if(choices.is('.d-none')) {
+                            choices.removeClass('d-none').addClass('d-block');
+                        }
+                        else {
+                            choices.removeClass('d-block').addClass('d-none');
+                        }
                         return false;
                     });
 

+ 27 - 25
resources/views/app/patient/note/follow-up-appointment.blade.php

@@ -22,32 +22,34 @@
         </div>
     @endif
 
-    <div class="align-items-center mb-3 fu-appt-choices {{!is_null($note->is_follow_up_needed) ? 'd-none' : 'd-flex'}}">
-        <p class="font-weight-bold text-secondary my-0 mr-3">Would you like to book a follow-up appointment?</p>
-        <label class="d-inline-flex align-items-center mr-3 my-0">
-            <input type="radio" name="is_follow_up_needed" value="1">
-            <span class="ml-1">Yes</span>
-        </label>
-        <label class="d-inline-flex align-items-center mr-3 my-0">
-            <input type="radio" name="is_follow_up_needed" value="0">
-            <span class="ml-1 mr-3">No</span>
-        </label>
-    </div>
+    <div class="fu-appt-choices {{!is_null($note->is_follow_up_needed) ? 'd-none' : 'd-block'}}">
+        <div class="d-flex align-items-center mb-3">
+            <p class="font-weight-bold text-secondary my-0 mr-3">Would you like to book a follow-up appointment?</p>
+            <label class="d-inline-flex align-items-center mr-3 my-0">
+                <input type="radio" name="is_follow_up_needed" value="1">
+                <span class="ml-1">Yes</span>
+            </label>
+            <label class="d-inline-flex align-items-center mr-3 my-0">
+                <input type="radio" name="is_follow_up_needed" value="0">
+                <span class="ml-1 mr-3">No</span>
+            </label>
+        </div>
 
-    <div moe class="no-fu-memo-form mb-3 d-none">
-        <form show url="/api/note/updateFollowUpStatus">
-            <input type="hidden" name="uid" value="{{$note->uid}}">
-            <input type="hidden" name="isFollowUpNeeded" value="0">
-            <div class="d-flex align-items-start mb-3">
-                <span class="text-nowrap mr-2">Please indicate why follow-up<br>appointment is not needed:</span>
-                <textarea class="form-control form-control-sm width-300px no-fu-memo"
-                         rows="2" name="followUpNotNeededMemo" required>{{$note->follow_up_not_needed_memo}}</textarea>
-            </div>
-            <div class="mb-0">
-                <button class="btn btn-primary btn-sm mr-1" submit>Submit</button>
-                <button class="btn btn-default bg-white border btn-sm mr-1 cancel-fu-appt-form">Cancel</button>
-            </div>
-        </form>
+        <div moe class="no-fu-memo-form mb-3 d-none">
+            <form show url="/api/note/updateFollowUpStatus">
+                <input type="hidden" name="uid" value="{{$note->uid}}">
+                <input type="hidden" name="isFollowUpNeeded" value="0">
+                <div class="d-flex align-items-start mb-3">
+                    <span class="text-nowrap mr-2">Please indicate why follow-up<br>appointment is not needed:</span>
+                    <textarea class="form-control form-control-sm width-300px no-fu-memo"
+                             rows="2" name="followUpNotNeededMemo" required>{{$note->follow_up_not_needed_memo}}</textarea>
+                </div>
+                <div class="mb-0">
+                    <button class="btn btn-primary btn-sm mr-1" submit>Submit</button>
+                    <button class="btn btn-default bg-white border btn-sm mr-1 cancel-fu-appt-form">Cancel</button>
+                </div>
+            </form>
+        </div>
     </div>
 
 </div>

+ 4 - 1
resources/views/app/patient/note/note-segment-list-print.blade.php

@@ -2,8 +2,11 @@
     <?php
     $previousHeading = null;
     $previousSubHeading = null;
+	$segments = $note->segments->filter(function($_x) {
+		return !!$_x->is_active;
+	});
     ?>
-    @foreach($note->segments as $segment)
+    @foreach($segments as $segment)
 		@if($segment->segmentTemplate->internal_name !== 'medrisk_vigilence' && $segment->left_or_right !== 'RIGHT')
 		<?php
         if ($segment->heading !== $previousHeading) {

+ 5 - 3
resources/views/app/patient/note/partials/cpp-bills-claims-container.blade.php

@@ -28,9 +28,11 @@
                             <div class="mb-2">
                                 <select name="hcpCompanyProUid" class="form-control form-control-sm">
                                     <option value="">-- select --</option>
-                                    @foreach($note->hcpPro->companyPros as $companyPro)
-                                        <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
-                                    @endforeach
+                                    @if($note->hcpPro)
+                                        @foreach($note->hcpPro->companyPros as $companyPro)
+                                            <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
+                                        @endforeach
+                                    @endif
                                 </select>
                             </div>
                             <div class="mb-0">

+ 20 - 3
resources/views/app/patient/note/segment-resolve.blade.php

@@ -10,10 +10,27 @@
 
     <!-- title -->
 
-        <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'xxxmb-2'}}" style="">
-            <span style="color: black; text-decoration: underline; font-size: 13px;">
+        <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'xxxmb-2'}}">
+            <span style="color: black; text-decoration: underline; font-size: 13px;" class="{{!$segment->is_active ? 'opacity-35' : ''}}">
                 {{$segment->display_title}}
             </span>
+            @if($note->is_signed_by_hcp && $pro->pro_type === 'ADMIN')
+                @if($segment->is_active)
+                    <div moe class="ml-3">
+                        <form url="/api/segment/deactivate" show>
+                            <input type="hidden" name="uid" value="{{$segment->uid}}">
+                            <button submit class="p-0 border-0 bg-transparent text-primary text-sm outline-0">Deactivate</button>
+                        </form>
+                    </div>
+                @else
+                    <div moe class="ml-3">
+                        <form url="/api/segment/reactivate" show>
+                            <input type="hidden" name="uid" value="{{$segment->uid}}">
+                            <button submit class="p-0 border-0 bg-transparent text-primary text-sm outline-0">Reactivate</button>
+                        </form>
+                    </div>
+                @endif
+            @endif
         </span>
 
         @if($isLSSegment)
@@ -57,7 +74,7 @@
         ]) === TRUE);
     ?>
 
-    @if(!$isLSSegment)
+    @if(!$isLSSegment && $segment->is_active)
         <?php
             $html = '';
             if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html) {

+ 36 - 15
resources/views/app/patient/note/segment-slim.blade.php

@@ -20,26 +20,29 @@ $isOmegaHistorySegment = strpos($iName, 'omega_history_') === 0;
             ?>
 
             @if(!!$segment->display_title)
-            <div class="text-dark font-weight-bold font-size-13 mr-2 {{$extraClass}}">
+            <div class="text-dark font-weight-bold font-size-13 mr-2 {{$extraClass}} {{!$segment->is_active ? 'opacity-35' : ''}}">
                 {{$segment->display_title}}:
             </div>
             @endif
 
             <div class="flex-grow-1">
-                <div class="d-none if-not-edit inset-comment summary-container">
-                    @if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html)
-                        {!! $segment->accepted_suggestion_summary_html !!}
-                    @else
-                        {!! $segment->summary_html !!}
-                    @endif
-                </div>
-
-                <?php if($iName !== 'ros' && $iName !== 'omega_ros' && !$isOmegaHistorySegment) { ?>
-                <div class="d-none if-edit edit-container">
-                    {!! $segment->edit_html !!}
-                </div>
-                <?php } ?>
-
+                @if($segment->is_active)
+                    <div class="d-none if-not-edit inset-comment summary-container">
+                        @if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html)
+                            {!! $segment->accepted_suggestion_summary_html !!}
+                        @else
+                            {!! $segment->summary_html !!}
+                        @endif
+                    </div>
+
+                    <?php if($iName !== 'ros' && $iName !== 'omega_ros' && !$isOmegaHistorySegment) { ?>
+                    <div class="d-none if-edit edit-container">
+                        {!! $segment->edit_html !!}
+                    </div>
+                    <?php } ?>
+                @else
+                    <span class="text-warning-dark">Deactivated</span>
+                @endif
             </div>
 
 
@@ -71,6 +74,24 @@ $isOmegaHistorySegment = strpos($iName, 'omega_history_') === 0;
             </a>
         @endif
 
+        @if($note->is_signed_by_hcp && $pro->pro_type === 'ADMIN')
+            @if($segment->is_active)
+                <div moe class="ml-2">
+                    <form url="/api/segment/deactivate" show>
+                        <input type="hidden" name="uid" value="{{$segment->uid}}">
+                        <button submit class="p-0 border-0 bg-transparent text-primary text-sm outline-0">Deactivate</button>
+                    </form>
+                </div>
+            @else
+                <div moe class="ml-2">
+                    <form url="/api/segment/reactivate" show>
+                        <input type="hidden" name="uid" value="{{$segment->uid}}">
+                        <button submit class="p-0 border-0 bg-transparent text-primary text-sm outline-0">Reactivate</button>
+                    </form>
+                </div>
+            @endif
+        @endif
+
     </div>
 
 

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

@@ -1,7 +1,7 @@
 <div class="">
     <div class="mb-1">
         <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 text-secondary"><b>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">
@@ -27,17 +27,17 @@
                 <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">
+                    <div class="mb-2 checkbox d-flex">
                         <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>
+                        <label class="ml-1 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">
+                    <div class="mb-2 checkbox d-flex">
                         <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>
+                        <label class="ml-1 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>

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

@@ -29,7 +29,22 @@ $allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
         @foreach($allergies as $allergy)
             <div class="mb-1">
                 <b><?= !!@($allergy->data->name) ? @($allergy->data->name) : '-' ?></b>
-                <?= !!@($allergy->data->description) ? '/&nbsp;' . @($allergy->data->description) : '' ?>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $allergy;
+                    $note = $point->note;
+                    $childHeading = 'Subjective';
+                    include resource_path('views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php');
+                    ?>
+                </div>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $allergy;
+                    $note = $point->note;
+                    $childHeading = 'Plan';
+                    include resource_path('views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php');
+                    ?>
+                </div>
             </div>
         @endforeach
         @if(!count($allergies))

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

@@ -31,6 +31,22 @@ $careTeamMembers = \App\Models\Point::getPointsOfCategory($patient, "CARE_TEAM_M
                 <b><?= !!@($careTeamMember->data->name) ? @($careTeamMember->data->name) : '-' ?></b>
                 <?= !!@($careTeamMember->data->specialty) ? '/&nbsp;' . @($careTeamMember->data->specialty) . '<br>' : '' ?>
                 <?= !!@($careTeamMember->data->organization) ? '/&nbsp;' . @($careTeamMember->data->organization) . '<br>' : '' ?>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $careTeamMember;
+                    $note = $point->note;
+                    $childHeading = 'Subjective';
+                    include resource_path('views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php');
+                    ?>
+                </div>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $careTeamMember;
+                    $note = $point->note;
+                    $childHeading = 'Plan';
+                    include resource_path('views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php');
+                    ?>
+                </div>
             </div>
         @endforeach
         @if(!count($careTeamMembers))

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

@@ -30,7 +30,22 @@ $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
             <div class="mb-1">
                 <b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
                 <?= !!@($problem->data->icd) ? '/&nbsp;' . @($problem->data->icd) : '' ?>
-                <?= !!@($problem->data->description) ? '/&nbsp;' . @($problem->data->description) : '' ?>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $problem;
+                    $note = $point->note;
+                    $childHeading = 'Subjective';
+                    include resource_path('views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php');
+                    ?>
+                </div>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $problem;
+                    $note = $point->note;
+                    $childHeading = 'Plan';
+                    include resource_path('views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php');
+                    ?>
+                </div>
             </div>
         @endforeach
         @if(!count($problems))

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

@@ -29,6 +29,22 @@ $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
         @foreach($medications as $medication)
             <div class="mb-1">
                 <b><?= !!@($medication->data->name) ? @($medication->data->name) : '-' ?></b>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $medication;
+                    $note = $point->note;
+                    $childHeading = 'Subjective';
+                    include resource_path('views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php');
+                    ?>
+                </div>
+                <div class="ml-3 mt-1">
+                    <?php
+                    $point = $medication;
+                    $note = $point->note;
+                    $childHeading = 'Plan';
+                    include resource_path('views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php');
+                    ?>
+                </div>
             </div>
         @endforeach
         @if(!count($medications))

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

@@ -135,6 +135,7 @@ if(!@$summaryView) {
                                                     <div class="mb-2 bg-light p-2 border">
                                                         <p class="mb-1 font-weight-bold">
                                                             {{ @$problem->data->name }}
+                                                            {{!!@($problem->data->icd) ? ' / ' . @($problem->data->icd) : ''}}
                                                         </p>
                                                         @if($patient->core_note_id !== $note->id)
                                                             <div class="text-secondary">This problem was added outside of this visit.
@@ -168,8 +169,7 @@ if(!@$summaryView) {
                                                             <input type="text"
                                                                    data-name="icd"
                                                                    class="form-control form-control-sm"
-                                                                   value="{{@$problem->data->icd}}"
-                                                                   readonly>
+                                                                   value="{{@$problem->data->icd}}">
                                                         </div>
                                                     </div>
 

+ 5 - 0
resources/views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php

@@ -1,6 +1,9 @@
 <?php if ($point->last_child_plan_point_id && $point->last_child_plan_data): ?>
     <?php $parsedPlan = json_decode($point->last_child_plan_data); ?>
     <span class="screen-only">
+    <?php if(@$childHeading): ?>
+        <span class="on-hover-opaque font-weight-bold mr-2 c-pointer upsert-rp-trigger font-underline"><?= $childHeading ?></span>
+    <?php endif; ?>
     <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>
         <span class="text-sm text-secondary">(updated on the patient's chart)</span>
     <?php else: ?>
@@ -13,6 +16,8 @@
                         <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
                         <?php if($point->last_child_plan_creator): ?>
                             by <?= $point->last_child_plan_creator ?>
+                        <?php elseif($point->last_child_plan_creator_pro_first_name || $point->last_child_plan_creator_pro_last_name): ?>
+                            by <?= implode(' ', [$point->last_child_plan_creator_pro_first_name, $point->last_child_plan_creator_pro_last_name]); ?>
                         <?php endif; ?>
                     </span>
                     <div menu right class="bg-white border">

+ 5 - 0
resources/views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php

@@ -1,6 +1,9 @@
 <?php if ($point->last_child_review_point_id && $point->last_child_review_data): ?>
     <?php $parsedReview = json_decode($point->last_child_review_data); ?>
     <span class="screen-only">
+        <?php if(@$childHeading): ?>
+            <span class="on-hover-opaque font-weight-bold mr-2 c-pointer upsert-rp-trigger font-underline"><?= $childHeading ?></span>
+        <?php endif; ?>
         <?php if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id): ?>
             <span class="text-sm text-secondary">(updated on the patient's chart)</span>
         <?php else: ?>
@@ -13,6 +16,8 @@
                             <?= relative_friendly_date($point->last_child_review_effective_date) ?>
                             <?php if($point->last_child_review_creator): ?>
                                 by <?= $point->last_child_review_creator ?>
+                            <?php elseif($point->last_child_review_creator_pro_first_name || $point->last_child_review_creator_pro_last_name): ?>
+                                by <?= implode(' ', [$point->last_child_review_creator_pro_first_name, $point->last_child_review_creator_pro_last_name]); ?>
                             <?php endif; ?>
                         </span>
                         <div menu right class="bg-white border">

+ 13 - 1
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -835,12 +835,15 @@ function getOrCreateRowAfter(_tr) {
     let tr = getRowAfter(_tr);
     if(!tr.length) {
         tr = newRow(_tr).insertAfter(_tr);
+        __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
     }
     return tr;
 }
 
 function createRowAfter(_tr) {
-    return newRow(_tr).insertAfter(_tr);
+    let tr = newRow(_tr).insertAfter(_tr);
+    __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
+    return tr;
 }
 
 function newRow(_tr) {
@@ -849,6 +852,13 @@ function newRow(_tr) {
     newTr.find('textarea').attr('rows', 1).css({minHeight: '', height: ''});
     newTr.find('[stag-suggest-initialized]').removeAttr('stag-suggest-initialized');
     newTr.find('.stag-suggestions-container').remove();
+    newTr.find('div[note-rte][key][bucket]').each(function() {
+        let newRTE = $('<div note-rte class="rte-holder" ' +
+            'key="' + $(this).attr('key') + '" ' +
+            'bucket="' + $(this).attr('bucket') + '" ' +
+            '/>');
+        $(this).closest('td').empty().append(newRTE);
+    });
     return newTr;
 }
 
@@ -957,6 +967,7 @@ parentSegment
         let isFirst = (tr.index() === 0);
         if(isFirst) {
             newRow(tr).insertAfter(tr);
+            __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
         }
         tr.remove();
         return false;
@@ -967,6 +978,7 @@ parentSegment
     .on('click.add-line', '.stag-sheet .add-line', function() {
         let tr = $(this).closest('tr');
         newRow(tr).insertAfter(tr);
+        __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
         initStagSuggest();
         return false;
     });

+ 2 - 2
resources/views/app/practice-management/_sort_header.blade.php

@@ -1,6 +1,6 @@
-<div class="d-flex align-items-baseline flex-wrap">
+<div class="d-flex align-items-end flex-wrap">
     <a href="{{ $route }}?{{queryLineExcept(['sort_by', 'sort_dir'])}}&sort_by={{$key}}&sort_dir={{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? 'DESC' : 'ASC'}}" class="text-decoration-none">
-        <b class="{{request()->input('sort_by') === $key ? 'text-primary' : 'text-secondary'}}">{{$label}}</b>
+        <b class="{{request()->input('sort_by') === $key ? 'text-primary' : 'text-secondary'}}">{!! $label !!}</b>
         <span class="ml-1 d-inline-flex align-items-baseline">
             <i class="text-sm fa fa-chevron-up {{request()->input('sort_by') === $key && request()->input('sort_dir') === 'DESC' ? '' : 'on-hover-opaque text-secondary'}}"></i>
             <i class="ml-1 text-sm fa fa-chevron-down {{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? '' : 'on-hover-opaque text-secondary'}}"></i>

+ 96 - 28
resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php

@@ -10,38 +10,45 @@
            class="text-nowrap d-block max-width-170px overflow-hidden text-ellipsis"
         ><span class="sort-data">{{ $iPatient->client_name }}</span></a>
     </td>
-
-    <td>{{friendly_date($iPatient->dob)}}</td>
+    <td>{{$iPatient->mcp_name}}</td>
+    <td>{{$iPatient->age_in_years}}</td>
     {{--<td>{!! $iPatient->is_enrolled_in_rm === 'YES' ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>--}}
-    <td>{!! $iPatient->is_assigned_cellular_bp_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
-    <td>{!! $iPatient->is_assigned_cellular_weight_scale_device ? '<i class="fa fa-check text-success"></i>' : 'No' !!}</td>
     <td>
-        @if($iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
-            <div class="text-nowrap">
-                <span class="sort-data">{{$iPatient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}</span>/{{$iPatient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}
-                @if($iPatient->most_recent_cellular_bp_measurement_at)
-                    <span class="text-sm text-secondary text-nowrap ml-1"
-                          title="{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}">({{friendly_date_est($iPatient->most_recent_cellular_bp_measurement_at)}})</span>
-                @endif
+        @if($iPatient->is_assigned_cellular_bp_device)
+            <div class="d-flex align-items-baseline">
+            <i class="fa fa-check text-success"></i>
+            @if($iPatient->most_recent_cellular_bp_sbp_mm_hg && $iPatient->most_recent_cellular_bp_dbp_mm_hg)
+                <div class="text-nowrap ml-1">
+                    <span class="sort-data">{{$iPatient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}</span>/{{$iPatient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}
+                    @if($iPatient->most_recent_cellular_bp_measurement_at)
+                        <span class="text-sm text-secondary text-nowrap"
+                              title="{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}">{{friendly_date_est_compact($iPatient->most_recent_cellular_bp_measurement_at)}}</span>
+                    @endif
+                </div>
+            @endif
             </div>
         @else
-            -
+            <span class="text-secondary">No</span>
         @endif
     </td>
     <td>
-        @if($iPatient->most_recent_cellular_weight_value)
-            <div class="text-nowrap">
-                <span class="sort-data">{{$iPatient->most_recent_cellular_weight_value ? round($iPatient->most_recent_cellular_weight_value, 1) : '-'}}</span>
-                @if($iPatient->most_recent_cellular_weight_measurement_at)
-                    <span class="text-sm text-secondary text-nowrap ml-1"
-                          title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">({{friendly_date_est($iPatient->most_recent_cellular_weight_measurement_at)}})</span>
+        @if($iPatient->is_assigned_cellular_weight_scale_device)
+            <div class="d-flex align-items-baseline">
+                <i class="fa fa-check text-success"></i>
+                @if($iPatient->most_recent_cellular_weight_value)
+                    <div class="text-nowrap ml-1">
+                        <span class="sort-data">{{$iPatient->most_recent_cellular_weight_value ? round($iPatient->most_recent_cellular_weight_value, 1) : '-'}}</span>
+                        @if($iPatient->most_recent_cellular_weight_measurement_at)
+                            <span class="text-sm text-secondary text-nowrap"
+                                  title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">{{friendly_date_est_compact($iPatient->most_recent_cellular_weight_measurement_at)}}</span>
+                        @endif
+                    </div>
                 @endif
             </div>
         @else
-            -
+            <span class="text-secondary">No</span>
         @endif
     </td>
-    
     <td>
         <div class="d-flex align-items-baseline">
             <i class="mr-1 text-sm fa {{$lastVisitWithin90Days ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
@@ -56,6 +63,13 @@
         </div>
     </td>
 
+    <td>
+        <div class="d-flex align-items-baseline">
+            <i class="mr-1 text-sm fa {{$iPatient->has_anyone_interacted_with_client_about_rm ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
+            <span class="sort-data">{{$iPatient->has_anyone_interacted_with_client_about_rm ? 'Yes' : 'No'}}</span>
+        </div>
+    </td>
+
     <td>
         <div class="d-flex align-items-baseline">
             <i class="mr-1 text-sm fa {{$iPatient->number_of_days_with_remote_measurements >= 16 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
@@ -74,7 +88,7 @@
     <td>
         <div class="d-flex align-items-baseline">
             <i class="mr-1 text-sm fa {{$iPatient->rm_total_time_in_seconds_by_mcp >= 1200 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
-            <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_mcp / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_mcp % 60)}}s</span>
+            <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_mcp / 60)}}:{{round($iPatient->rm_total_time_in_seconds_by_mcp % 60)}}</span>
             <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_mcp}}</span>
         </div>
     </td>
@@ -82,16 +96,16 @@
     <td>
         <div class="d-flex align-items-baseline">
             <i class="mr-1 text-sm fa {{$iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200 ? 'fa-check text-success' : 'fa-exclamation-triangle text-danger on-hover-opaque'}}"></i>
-            <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro / 60)}}m {{round($iPatient->rm_total_time_in_seconds_by_rmm_pro % 60)}}s</span>
+            <span class="text-nowrap">{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro / 60)}}:{{round($iPatient->rm_total_time_in_seconds_by_rmm_pro % 60)}}</span>
             <span class="sort-data d-none">{{$iPatient->rm_total_time_in_seconds_by_rmm_pro}}</span>
         </div>
     </td>
 
     <td>
         @if($lastVisitWithin90Days && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_mcp >= 1200)
-            <span class="text-success font-weight-bold">
-                <i class="fa fa-check"></i>
-                ${{friendly_money($pro->mcp_rpm_payment_amount, 0)}}
+            <span class="text-success">
+                <i class="fa fa-check text-sm"></i>{{--
+                ${{friendly_money($pro->mcp_rpm_payment_amount, 0)}}--}}
             </span>
         @else
             <span class="text-danger font-weight-normal">
@@ -101,9 +115,9 @@
     </td>
     <td>
         @if($lastVisitWithin90Days && $iPatient->has_mcp_interacted_with_client_about_rm && $iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->rm_total_time_in_seconds_by_rmm_pro >= 1200)
-            <span class="text-success font-weight-bold">
-                <i class="fa fa-check"></i>
-                ${{friendly_money($pro->rmm_payment_amount, 0)}}
+            <span class="text-success">
+                <i class="fa fa-check text-sm"></i>{{--
+                ${{friendly_money($pro->rmm_payment_amount, 0)}}--}}
             </span>
         @else
             <span class="text-danger font-weight-normal">
@@ -111,4 +125,58 @@
             </span>
         @endif
     </td>
+    <td>
+        <?php
+        $codeStatus = 'No';
+        if($iPatient->number_of_days_with_remote_measurements >= 16 && $lastVisitWithin90Days) {
+            $codeStatus = 'Ready';
+            if($iPatient->claim_454) {
+                $codeStatus = 'Billed';
+            }
+        }
+        ?>
+        @if($codeStatus === 'No')
+            <span class="text-nowrap text-danger font-weight-normal">
+                {{$codeStatus}}
+            </span>
+        @elseif($codeStatus === 'Ready')
+            <span class="text-nowrap text-dark">
+                <i class="fa fa-thumbs-up text-sm"></i>
+                {{$codeStatus}}
+            </span>
+        @elseif($codeStatus === 'Billed')
+            <span class="text-nowrap text-success">
+                <i class="fa fa-check text-sm"></i>
+                {{$codeStatus}}
+            </span>
+        @endif
+    </td>
+    <td>
+        <?php
+        $codeStatus = 'No';
+        if($iPatient->number_of_days_with_remote_measurements >= 16 && $iPatient->has_anyone_interacted_with_client_about_rm &&
+            $lastVisitWithin90Days &&
+            ($iPatient->rm_total_time_in_seconds_by_mcp + $iPatient->rm_total_time_in_seconds_by_rmm_pro) >= 1200) {
+            $codeStatus = 'Ready';
+            if($iPatient->claim_457) {
+                $codeStatus = 'Billed';
+            }
+        }
+        ?>
+        @if($codeStatus === 'No')
+            <span class="text-nowrap text-danger font-weight-normal">
+                {{$codeStatus}}
+            </span>
+        @elseif($codeStatus === 'Ready')
+            <span class="text-nowrap text-dark">
+                <i class="fa fa-thumbs-up text-sm"></i>
+                {{$codeStatus}}
+            </span>
+        @elseif($codeStatus === 'Billed')
+            <span class="text-nowrap text-success">
+                <i class="fa fa-check text-sm"></i>
+                {{$codeStatus}}
+            </span>
+        @endif
+    </td>
 </tr>

+ 25 - 22
resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php

@@ -1,4 +1,13 @@
 <div class="d-flex align-items-stretch m-0 h-100">
+    @if(!request()->input('not-enrolled'))
+        <div class="overflow-auto border-right h-100 rpm-matrix-left-column">
+            @if(request()->input('f_mcp'))
+                @include('app.stat-tree.summary', ['slug' => 'rm-tree-mcp', 'showForPro' => $pro, 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
+            @else
+                @include('app.stat-tree.summary', ['slug' => 'rm-tree-admin', 'noDropVisualize' => true, 'stParams' => ['start_date' => $rcmStartDate]])
+            @endif
+        </div>
+    @endif
     <div class="flex-grow-1 px-0 overflow-auto h-100 rpm-matrix-right-column">
         <?php $trIndex = 0; ?>
         @foreach ($patients as $iPatient)
@@ -17,29 +26,23 @@
             <tr>
 
                 <th class="border-0 pl-2">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Name', 'key' => 'client_name'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'DOB', 'key' => 'dob'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'CM MCP', 'key' => 'mcp_name'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Age', 'key' => 'age_in_years'])</th>
                 {{--<th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>--}}
-                <th class="border-0 text-secondary">BP?</th>
-                <th class="border-0 text-secondary">Scale?</th>
-                <th class="border-0 text-secondary">Latest BP</th>
-                <th class="border-0 text-secondary">Latest Wt</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Days Since Last Visit', 'key' => 'most_recent_completed_mcp_note_date'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'Comm?', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#Meas. Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#MCP Unst.', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM Unst.', 'key' => 'rm_num_measurements_not_stamped_by_rmm'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#MCP Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
-                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM Mins.', 'key' => 'rm_total_time_in_seconds_by_rmm_pro'])</th>
-                @if(!request()->input('f_mcp_billable') || request()->input('f_mcp_billable') === 'all')
-                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'MCP Bill', 'key' => 'mcp_rm_generic_bill_id'])</th>
-                @else
-                    <th class="border-0 text-secondary">MCP Bill</th>
-                @endif
-                @if(!request()->input('f_rmm_billable') || request()->input('f_rmm_billable') === 'all')
-                    <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'RMM Bill', 'key' => 'rmm_rm_generic_bill_id'])</th>
-                @else
-                    <th class="border-0 text-secondary">RMM Bill</th>
-                @endif
+                <th class="border-0 text-secondary">BP</th>
+                <th class="border-0 text-secondary">Scale</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => 'DSLV', 'key' => 'most_recent_completed_mcp_note_date'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '<i class="text-sm fa fa-phone rotateh"></i> MCP', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '<i class="text-sm fa fa-phone rotateh"></i> Any', 'key' => 'has_anyone_interacted_with_client_about_rm'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#Meas.<br>Days', 'key' => 'number_of_days_with_remote_measurements'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#MCP<br>Unst.', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM<br>Unst.', 'key' => 'rm_num_measurements_not_stamped_by_rmm'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#MCP<br>Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
+                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.rpm-matrix-admin"), 'label' => '#RMM<br>Mins.', 'key' => 'rm_total_time_in_seconds_by_rmm_pro'])</th>
+                <th class="border-0 text-secondary">MCP</th>
+                <th class="border-0 text-secondary">RMM</th>
+                <th class="border-0 text-secondary">454</th>
+                <th class="border-0 text-secondary">457</th>
             </tr>
             </thead>
             <tbody>

+ 13 - 3
resources/views/app/practice-management/rpm-matrix-for-admin.blade.php

@@ -149,7 +149,7 @@
                         </div>
 
                         <div>
-                            <label class="mb-0 text-sm {{request()->input('f_lmb') && request()->input('f_lmb') !== 'ACTIVE' ? 'font-weight-bold text-info' : 'text-secondary'}}">LMB</label>
+                            <label class="mb-0 text-sm {{request()->input('f_lmb') && request()->input('f_lmb') !== 'any' ? 'font-weight-bold text-info' : 'text-secondary'}}">LMB</label>
                             <select name="f_lmb" class="mr-2 form-control form-control-sm min-width-unset width-70px pl-0">
                                 <option {{request()->input('f_lmb') === 'any' ? 'selected' : ''}} value="any">Any</option>
                                 <option {{request()->input('f_lmb') === '1' ? 'selected' : ''}} value="1">1 day</option>
@@ -276,8 +276,8 @@
             <?php $rc = request()->input('rc') ? request()->input('rc') : 1; ?>
 
             <div class="card-body p-0">
-                <div>
-                    <div class="d-flex align-items-baseline p-2 border-bottom" tab-links="">
+                <div class="d-flex align-items-baseline p-2 border-bottom">
+                    <div class="d-inline-flex align-items-baseline" tab-links="">
                         <a class="{{ !request()->input('not-enrolled') ? 'tab-link-active' : '' }} text-dark c-pointer"
                            onclick="$('[name=not-enrolled]').val(''); return fastLoad('{{route('practice-management.rpm-matrix-admin')}}?' + $('#rpm-matrix-filter').serialize());"
                            tab-link="rpm">Enrolled in RPM</a>
@@ -285,6 +285,16 @@
                            onclick="$('[name=not-enrolled]').val('1'); return fastLoad('{{route('practice-management.rpm-matrix-admin')}}?' + $('#rpm-matrix-filter').serialize());"
                            tab-link="no-rpm">Not Enrolled in RPM</a>
                     </div>
+                    <div class="d-inline-flex align-items-baseline ml-auto mb-0-pagination">
+                        <div class="mr-2"><b>{{$paginator->firstItem()}}</b> to <b>{{$paginator->lastItem()}}</b> (page {{$paginator->currentPage()}}) of <b>{{$paginator->total()}}</b> care months</div>
+                        {!! $paginator->onEachSide(2)->withQueryString()->links() !!}
+                        <select class="form-control form-control-sm min-width-unset width-100px px-2 ml-2" onchange="fastLoad('{{ route('practice-management.rpm-matrix-admin') }}?{{queryLineExcept(['per_page', 'page'])}}&per_page=' + this.value)">
+                            <option {{$perPage == 25 ? 'selected' : ''}} value="25">25/page</option>
+                            <option {{$perPage == 50 ? 'selected' : ''}} value="50">50/page</option>
+                            <option {{$perPage == 75 ? 'selected' : ''}} value="75">75/page</option>
+                            <option {{$perPage == 100 ? 'selected' : ''}} value="100">100/page</option>
+                        </select>
+                    </div>
                 </div>
                 <div class="cm-tab {{!request()->input('not-enrolled') ? '' : 'd-none'}}" tab-key="rpm">
                     @include('app.practice-management.rpm-matrix-for-admin-table')

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

@@ -75,6 +75,7 @@ $addressParts .= implode(", ", $addressPart2);
         </span>
       </h6>
       <div class="d-flex border-left pl-2 ml-2">
+        <div class="mr-2">RPM: <b>{{ucwords(strtolower($patient->is_enrolled_in_rm))}}</b></div>
         <div class="mr-1">Cell. BP: <b>{{$patient->hasBPDevice()?'Yes':'No'}}</b>
           @if($patient->most_recent_cellular_bp_sbp_mm_hg && $patient->most_recent_cellular_bp_dbp_mm_hg)
           (<b>{{$patient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}/{{$patient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}</b>@if($patient->most_recent_cellular_bp_measurement_at), {{friendly_date_short($patient->most_recent_cellular_bp_measurement_at)}}@endif)@endif

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

@@ -32,7 +32,11 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 					</li>
 					@endif
 					<li class="nav-item">
-						<a class="nav-link {{ strpos($routeName, 'patients.view.calendar') === 0 ? 'active' : '' }}" href="{{ route('patients.view.calendar', ['patient' => $patient]) }}">Calendar</a>
+						@if($pro->pro_type === 'ADMIN' && $patient->mcp)
+							<a class="nav-link {{ strpos($routeName, 'patients.view.calendar') === 0 ? 'active' : '' }}" href="{{ route('patients.view.calendar', ['patient' => $patient]) }}?opUid={{$patient->mcp->uid}}">Calendar</a>
+						@else
+							<a class="nav-link {{ strpos($routeName, 'patients.view.calendar') === 0 ? 'active' : '' }}" href="{{ route('patients.view.calendar', ['patient' => $patient]) }}">Calendar</a>
+						@endif
 					</li>
 					<li class="nav-item">
 						<a class="nav-link {{ strpos($routeName, 'patients.view.appointments') === 0 ? 'active' : '' }}" href="{{ route('patients.view.appointments', ['patient' => $patient, 'forPro' => 'all', 'status' => 'all']) }}">Appointments</a>

+ 3 - 4
routes/web.php

@@ -340,7 +340,10 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('generic-bills', 'PracticeManagementController@genericBills')->name('generic-bills');
             Route::get('mc-code-checks', 'PracticeManagementController@mcCodeChecks')->name('mc-code-checks');
 
+            Route::get('remote-monitoring-admin', 'PracticeManagementController@remoteMonitoringAdmin')->name('remote-monitoring-admin');
+            Route::get('remote-monitoring-admin-count', 'PracticeManagementController@remoteMonitoringAdminCount')->name('remote-monitoring-admin-count');
 
+            Route::get('rpm-admin', 'PracticeManagementController@rpmMatrixForAdmin')->name('rpm-matrix-admin');
         });
 
         Route::get('supply-orders/cancelled-but-unacknowledged', 'PracticeManagementController@supplyOrdersCancelledButUnacknowledged')->name('supply-orders-cancelled-but-unacknowledged');
@@ -349,13 +352,9 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('remote-monitoring', 'PracticeManagementController@remoteMonitoring')->name('remote-monitoring');
         Route::get('remote-monitoring-count', 'PracticeManagementController@remoteMonitoringCount')->name('remote-monitoring-count');
 
-        Route::get('remote-monitoring-admin', 'PracticeManagementController@remoteMonitoringAdmin')->name('remote-monitoring-admin');
-        Route::get('remote-monitoring-admin-count', 'PracticeManagementController@remoteMonitoringAdminCount')->name('remote-monitoring-admin-count');
-
         Route::get('rpm-mcp', 'PracticeManagementController@remoteMonitoringMCP')->name('rpm-matrix-mcp');
         Route::get('rpm-rmm', 'PracticeManagementController@remoteMonitoringRMM')->name('rpm-matrix-rmm');
         Route::get('rpm-rme', 'PracticeManagementController@remoteMonitoringRME')->name('rpm-matrix-rme');
-        Route::get('rpm-admin', 'PracticeManagementController@rpmMatrixForAdmin')->name('rpm-matrix-admin');
 
 
         //stat tree stuff