Răsfoiți Sursa

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

= 3 ani în urmă
părinte
comite
5913516f81

+ 5 - 1
app/Http/Controllers/StatTreeController.php

@@ -605,7 +605,9 @@ class StatTreeController extends Controller
                 "lastRefreshCount" => $line->last_refresh_count,
                 "treeOrderPositionIndex" => $line->tree_order_position_index,
                 "columns" => $columns,
-                "clause" => $clause
+                "clause" => $clause,
+                "goalPercent" => (is_null($line->goal_percent) ? -1 : $line->goal_percent),
+                "goalCondition" => (is_null($line->goal_condition) ? '' : $line->goal_condition)
             ],
             "a_attr" => [
                 "title" => $line->displayLineClause()->clause->clause_text
@@ -653,6 +655,8 @@ class StatTreeController extends Controller
         $statTreeLine->tree_order_position_index = $position;
         $statTreeLine->last_refresh_count = null;
         $statTreeLine->tsv_text_for_report_columns = null;
+        $statTreeLine->goal_condition = (!$line->goalCondition ? null : $line->goalCondition);
+        $statTreeLine->goal_percent = ($line->goalPercent === -1 ? null : $line->goalPercent);
         $statTreeLine->parent_stat_tree_line_id = $parentLine ? $parentLine->id : null;
         $statTreeLine->save();
 

+ 1 - 1
config/app.php

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

+ 12 - 0
public/css/style.css

@@ -343,6 +343,9 @@ body>nav.navbar {
     min-width: unset;
     max-width: 100%;
 }
+.mcp-theme-1 .rotateh {
+    transform: rotateY(180deg);
+}
 .mcp-theme-1 .width-200px {
     width: 200px !important;
 }
@@ -2830,6 +2833,15 @@ table.stag-compact-grid>tbody>tr>td [if-grid-view] {
 .stat-tree-view .jstree-anchor.has-drop-visualization.drop-76-100::after {
     color: red;
 }
+.stat-tree-view .jstree-anchor.has-goal-label::before {
+    content: attr(data-goal-label);
+    margin-left: auto;
+    font-size: 80%;
+    color: orangered;
+    position: absolute;
+    left: calc(100% + 0.75rem);
+    font-weight: bold;
+}
 .mv-drop-0-25 {
     color: grey;
 }

+ 1 - 1
resources/views/app/dashboard/measurements.blade.php

@@ -78,7 +78,7 @@
                                     </div>
                                     @if($measurement->mcp_pro_id !== $pro->id)
                                         <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                            <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}} during this care month.</span>
+                                            <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}}.</span>
                                             <div class="d-flex border-top mt-2">
                                                 <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
                                                     <input type="radio" class="mr-2" name="communicatedToPatient" value="true">

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

@@ -107,7 +107,7 @@ foreach ($days as $k => $day) {
                                         </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> during this care month.</span>
+                                        <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">
                                                 <input type="radio" class="mr-2" name="communicatedToPatient" value="true" required>
@@ -231,7 +231,7 @@ foreach ($days as $k => $day) {
                                         </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> during this care month.</span>
+                                        <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">
                                                 <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required {{$careMonth->has_mcp_interacted_with_client_about_rm ? 'checked' : ''}}>
@@ -362,20 +362,20 @@ foreach ($days as $k => $day) {
                             </div>
                             @if($entry->pro_id === $pro->id)
                                 <div class="d-flex align-items-baseline">
-                                    @if($performerRole === 'MCP')
-                                        <div moe relative class="mr-2">
-                                            <a href="#" start show class="text-sm">Mark as {{$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted</a>
-                                            <form url="/api/careMonthEntry/setDidProInteractWithClientAboutRmTo{{$entry->did_pro_interact_with_client_about_rm ? 'False' : 'True '}}">
-                                                <input type="hidden" name="uid" value="{{$entry->uid}}">
-                                                <p class="text-nowrap">Mark as {{$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted?</p>
-                                                <div class="d-flex align-items-center flex-nowrap">
-                                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                </div>
-                                            </form>
-                                        </div>
-                                    @endif
-                                    <div moe relative>
+                                    <i class="fa fa-phone rotateh {{$entry->did_pro_interact_with_client_about_rm ? 'text-success' : 'text-danger'}} mr-1"></i>
+                                    <span class="mr-2 text-sm">{{!$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted</span>
+                                    <div moe relative class="mr-2">
+                                        <a href="#" start show class="text-sm">{{$entry->did_pro_interact_with_client_about_rm ? 'Undo' : 'Change'}}</a>
+                                        <form url="/api/careMonthEntry/setDidProInteractWithClientAboutRmTo{{$entry->did_pro_interact_with_client_about_rm ? 'False' : 'True '}}">
+                                            <input type="hidden" name="uid" value="{{$entry->uid}}">
+                                            <p class="text-nowrap">Mark as {{$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted?</p>
+                                            <div class="d-flex align-items-center flex-nowrap">
+                                                <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                    <div moe relative class="ml-3">
                                         <a href="#" start show class="text-sm text-danger">Remove</a>
                                         <form url="/api/careMonthEntry/remove">
                                             <input type="hidden" name="uid" value="{{$entry->uid}}">

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

@@ -256,7 +256,7 @@ $days = $daysWithUnstamped;
                                             </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> during this care month.</span>
+                                            <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">
                                                     <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required {{$careMonth->has_mcp_interacted_with_client_about_rm ? 'checked' : ''}}>
@@ -348,19 +348,19 @@ $days = $daysWithUnstamped;
                                 </div>
                                 @if($entry->pro_id === $pro->id)
                                     <div>
-                                        @if($performerRole === 'MCP')
-                                            <div moe relative class="mr-2">
-                                                <a href="#" start show class="text-sm">Mark as {{$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted</a>
-                                                <form url="/api/careMonthEntry/setDidProInteractWithClientAboutRmTo{{$entry->did_pro_interact_with_client_about_rm ? 'False' : 'True '}}">
-                                                    <input type="hidden" name="uid" value="{{$entry->uid}}">
-                                                    <p class="text-nowrap">Mark as {{$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted?</p>
-                                                    <div class="d-flex align-items-center flex-nowrap">
-                                                        <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
-                                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                                                    </div>
-                                                </form>
-                                            </div>
-                                        @endif
+                                        <i class="fa fa-phone rotateh {{$entry->did_pro_interact_with_client_about_rm ? 'text-success' : 'text-danger'}} mr-1"></i>
+                                        <span class="mr-2 text-sm">{{!$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted</span>
+                                        <div moe relative class="mr-2">
+                                            <a href="#" start show class="text-sm">{{$entry->did_pro_interact_with_client_about_rm ? 'Undo' : 'Change'}}</a>
+                                            <form url="/api/careMonthEntry/setDidProInteractWithClientAboutRmTo{{$entry->did_pro_interact_with_client_about_rm ? 'False' : 'True '}}">
+                                                <input type="hidden" name="uid" value="{{$entry->uid}}">
+                                                <p class="text-nowrap">Mark as {{$entry->did_pro_interact_with_client_about_rm ? 'Not ' : ''}}Interacted?</p>
+                                                <div class="d-flex align-items-center flex-nowrap">
+                                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                                </div>
+                                            </form>
+                                        </div>
                                         <div moe relative>
                                             <a href="#" start show class="text-sm">Update Content</a>
                                             <form url="/api/careMonthEntry/updateContent">

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

@@ -308,7 +308,7 @@
                                     </b>
                                 </div>
 
-                                @if(0 && $careMonth->mcp && $pro->id === $careMonth->mcp->id)
+                                @if($careMonth->mcp && $pro->id === $careMonth->mcp->id)
                                 <div class="mt-2">
                                     <?php
                                     $minsBilled = 0;
@@ -468,23 +468,19 @@
                                                     {{ friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN') }} EST
                                                 </div>
                                             </div>
-                                            @if($measurement->mcp_pro_id !== $pro->id)
-                                                <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                                    <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}} during this care month.</span>
-                                                    <div class="d-flex border-top mt-2">
-                                                        <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
-                                                            <input type="radio" class="mr-2" name="communicatedToPatient" value="true">
-                                                            <span>Yes</span>
-                                                        </label>
-                                                        <label class="mt-2 mb-0 d-inline-flex align-items-center">
-                                                            <input type="radio" class="mr-2" name="communicatedToPatient" value="false" checked>
-                                                            <span>No</span>
-                                                        </label>
-                                                    </div>
+                                            <div class="mb-2 border border-info p-2 mt-2 bg-light">
+                                                <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}}.</span>
+                                                <div class="d-flex border-top mt-2">
+                                                    <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                                                        <input type="radio" class="mr-2" name="communicatedToPatient" value="true">
+                                                        <span>Yes</span>
+                                                    </label>
+                                                    <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                                                        <input type="radio" class="mr-2" name="communicatedToPatient" value="false" checked>
+                                                        <span>No</span>
+                                                    </label>
                                                 </div>
-                                            @else
-                                                <input type="hidden" name="communicatedToPatient" value="false">
-                                            @endif
+                                            </div>
                                             <div class="mb-2">
                                                 <label class="mb-1 text-secondary text-sm">Memo</label>
                                                 <textarea class="form-control form-control-sm" name="memo"></textarea>
@@ -1942,7 +1938,7 @@
                     }
                 });
 
-                window.setTimeout(() => { measurementsCalendar.render();}, 10);
+                window.setTimeout(() => { measurementsCalendar.render(); window.dispatchEvent(new Event('resize'));}, 10);
 
             }
 

+ 1 - 1
resources/views/app/patient/send_email.blade.php

@@ -109,6 +109,6 @@
                 }
             });
         }
-        addMCInitializer('outgoingEmailTemplate', init);
+        addMCInitializer('outgoingEmailTemplate', init, '#htmlBody');
     })();
 </script>

+ 2 - 2
resources/views/app/practice-management/remote-monitoring-measurements.blade.php

@@ -26,7 +26,7 @@
                 <p class="mb-1">Stamp all measurements?</p>
                 @if($measurement->mcp_pro_id !== $pro->id)
                     <div class="mb-2 border border-info p-2 mt-2 bg-light width-300px">
-                        <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}} during this care month.</span>
+                        <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}}.</span>
                         <div class="d-flex border-top mt-2">
                             <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
                                 <input type="radio" class="mr-2" name="communicatedToPatient" value="true">
@@ -123,7 +123,7 @@
                                             </div>
                                             @if($measurement->mcp_pro_id !== $pro->id)
                                                 <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                                    <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}} during this care month.</span>
+                                                    <span>I have had interactive communication with {{$measurement->name_first}} {{$measurement->name_last}}.</span>
                                                     <div class="d-flex border-top mt-2">
                                                         <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
                                                             <input type="radio" class="mr-2" name="communicatedToPatient" value="true">

+ 61 - 30
resources/views/app/practice-management/remote-monitoring.blade.php

@@ -2,7 +2,20 @@
 
 @section('content')
 
-    <div class="p-3 mcp-theme-1" id="practice-remote-monitoring">
+    <link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">
+    <script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
+    <style>
+        #table-rm-matrix_length, #table-rm-matrix_info {
+            padding-left: 0.5rem;
+        }
+        #table-rm-matrix_filter {
+            padding-right: 0.5rem;
+        }
+        #table-rm-matrix_paginate {
+            padding: 0.5rem;
+        }
+    </style>
+    <div class="p-3 mcp-theme-1" id="practice-remote-monitoring" v-cloak>
 
         <div class="card">
 
@@ -14,7 +27,7 @@
                 </span>
                 <?php
 
-use App\Models\Note;
+                use App\Models\Note;
 
                 $mStr = request()->input('m') ? request()->input('m') : date('m');
                 $yStr = request()->input('y') ? request()->input('y') : date('Y');
@@ -63,22 +76,22 @@ use App\Models\Note;
 
             <div class="card-body p-0">
                 <div class="d-flex align-items-start m-0">
-                    <div class="flex-grow-1 p-0">
-                        <table class="table table-sm table-striped table-hover p-0 m-0">
+                    <div class="flex-grow-1 px-0 pt-2">
+                        <table class="table table-sm table-striped table-hover p-0 m-0 border-top" id="table-rm-matrix">
                             <thead class="bg-light">
                             <tr>
-                                <th class="border-0 pl-2">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Name', 'key' => 'client_name'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'DOB', 'key' => 'dob'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'RPM?', 'key' => 'is_enrolled_in_rm'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Cell. BP?', 'key' => 'is_assigned_cellular_bp_device'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Cell. Scale?', 'key' => 'is_assigned_cellular_weight_scale_device'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Last BP', 'key' => 'most_recent_cellular_bp_measurement_at'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Last Wt', 'key' => 'most_recent_cellular_weight_measurement_at'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Last Visit', 'key' => 'most_recent_completed_mcp_note_date'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => 'Interacted?', 'key' => 'has_mcp_interacted_with_client_about_rm'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), '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.remote-monitoring"), 'label' => '#Unstamped', 'key' => 'rm_num_measurements_not_stamped_by_mcp'])</th>
-                                <th class="border-0">@include('app.practice-management._sort_header', ['route' => route("practice-management.remote-monitoring"), 'label' => '#RPM Mins.', 'key' => 'rm_total_time_in_seconds_by_mcp'])</th>
+                                <th class="border-0 pl-2">Name</th>
+                                <th class="border-0">DOB</th>
+                                <th class="border-0">RPM?</th>
+                                <th class="border-0">Cell. BP?</th>
+                                <th class="border-0">Cell. Scale?</th>
+                                <th class="border-0">Last BP</th>
+                                <th class="border-0">Last Wt</th>
+                                <th class="border-0">Last Visit</th>
+                                <th class="border-0">Interacted?</th>
+                                <th class="border-0">#Meas. Days</th>
+                                <th class="border-0">#Unstamped</th>
+                                <th class="border-0">#RPM Mins.</th>
                                 <th class="border-0">Billable</th>
                             </tr>
                             </thead>
@@ -108,7 +121,14 @@ use App\Models\Note;
                                 ?>
                                 <tr>
                                     <td class="pl-2">
-                                        <a href="/patients/view/{{ $iPatient->client_uid }}" class="text-nowrap">{{ $iPatient->client_name }}</a>
+                                        <a href="/patients/view/{{ $iPatient->client_uid }}/care-months/view/{{$iPatient->care_month_uid}}" class="text-nowrap"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           update-parent
+                                           popup-style="tall overflow-visible"
+                                           mc-initer="care-month-dashboard-{{$iPatient->client_uid}}"
+                                           title="{{$iPatient->client_name}}"
+                                        >{{ $iPatient->client_name }}</a>
                                     </td>
 
                                     <td>{{friendly_date($iPatient->dob)}}</td>
@@ -118,13 +138,15 @@ use App\Models\Note;
                                     <td>
                                         {{$iPatient->most_recent_cellular_bp_sbp_mm_hg ?: '-'}}/{{$iPatient->most_recent_cellular_bp_dbp_mm_hg ?: '-'}}
                                         @if($iPatient->most_recent_cellular_bp_measurement_at)
-                                            <div class="text-sm text-secondary text-nowrap">{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}</div>
+                                            <span class="text-sm text-secondary text-nowrap ml-1"
+                                                  title="{{friendly_date_time($iPatient->most_recent_cellular_bp_measurement_at)}}">({{friendly_date($iPatient->most_recent_cellular_bp_measurement_at)}})</span>
                                         @endif
                                     </td>
                                     <td>
                                         {{$iPatient->most_recent_cellular_weight_value ? round($iPatient->most_recent_cellular_weight_value, 1) : '-'}}
                                         @if($iPatient->most_recent_cellular_weight_measurement_at)
-                                            <div class="text-sm text-secondary text-nowrap">{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}</div>
+                                            <span class="text-sm text-secondary text-nowrap ml-1"
+                                                  title="{{friendly_date_time($iPatient->most_recent_cellular_weight_measurement_at)}}">({{friendly_date($iPatient->most_recent_cellular_weight_measurement_at)}})</span>
                                         @endif
                                     </td>
                                     <td>
@@ -138,9 +160,9 @@ use App\Models\Note;
                                                 <span>-</span>
                                             @endif
                                         </div>
-                                        @if(!$lastVisitWithin90Days)
+                                        {{--@if(!$lastVisitWithin90Days)
                                             <div class="text-sm font-italic text-secondary">No visit in over 90 days</div>
-                                        @endif
+                                        @endif--}}
                                     </td>
                                     <td>
                                         <div class="d-flex align-items-baseline">
@@ -176,7 +198,7 @@ use App\Models\Note;
                                                             </div>
                                                         </div>
                                                         <div class="mb-2 border border-info p-2 mt-2 bg-light">
-                                                            <span>I have had interactive communication with <b>{{$iPatient->client_name}}</b> during this care month.</span>
+                                                            <span>I have had interactive communication with <b>{{$iPatient->client_name}}</b>.</span>
                                                             <div class="d-flex border-top mt-2">
                                                                 <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
                                                                     <input type="radio" class="mr-2" name="didProInteractWithClientAboutRm" value="true" required>
@@ -201,9 +223,9 @@ use App\Models\Note;
                                                 </div>
                                             @endif
                                         </div>
-                                        @if(!$iPatient->has_mcp_interacted_with_client_about_rm)
+                                        {{--@if(!$iPatient->has_mcp_interacted_with_client_about_rm)
                                             <div class="text-sm font-italic text-secondary">{{$performerRole === 'MCP' ? 'Not' : "MCP hasn't"}} interacted this month!</div>
-                                        @endif
+                                        @endif--}}
                                     </td>
                                     <td>
                                         <div class="d-flex align-items-baseline">
@@ -230,9 +252,9 @@ use App\Models\Note;
                                                 </div>
                                             @endif
                                         </div>
-                                        @if($iPatient->number_of_days_with_remote_measurements < 16)
+                                        {{--@if($iPatient->number_of_days_with_remote_measurements < 16)
                                             <div class="text-sm font-italic text-secondary">Meas. days < 16</div>
-                                        @endif
+                                        @endif--}}
                                     </td>
                                     <td>
                                         <div class="d-flex align-items-baseline">
@@ -273,17 +295,17 @@ use App\Models\Note;
                                                 <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'}}"></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>
                                             </div>
-                                            @if($iPatient->rm_total_time_in_seconds_by_mcp < 1200)
+                                            {{--@if($iPatient->rm_total_time_in_seconds_by_mcp < 1200)
                                                 <div class="text-sm font-italic text-secondary">Entry mins. < 20</div>
-                                            @endif
+                                            @endif--}}
                                         @elseif($performerRole === 'RMM')
                                             <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'}}"></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>
                                             </div>
-                                            @if($iPatient->rm_total_time_in_seconds_by_rmm_pro < 1200)
+                                            {{--@if($iPatient->rm_total_time_in_seconds_by_rmm_pro < 1200)
                                                 <div class="text-sm font-italic text-secondary">Entry mins. < 20</div>
-                                            @endif
+                                            @endif--}}
                                         @endif
                                     </td>
                                     <td>
@@ -320,4 +342,13 @@ use App\Models\Note;
             </div>
         </div>
     </div>
+    <script>
+        (function() {
+            function init() {
+                $('#table-rm-matrix').DataTable();
+                $('#practice-remote-monitoring').removeAttr('v-cloak');
+            }
+            addMCInitializer('practice-remote-monitoring', init, '#practice-remote-monitoring');
+        }).call(window);
+    </script>
 @endsection

+ 74 - 3
resources/views/app/stat-tree/stat-trees/sub/edit.blade.php

@@ -362,6 +362,11 @@
                                             <div class="flex-grow-1 overflow-overlay-on-hover">
                                                 <div class="mb-3 d-flex align-items-baseline p-2 border-bottom font-weight-bold">
                                                     <span line-label></span>
+                                                    <div class="ml-3 pl-3 border-left d-inline-flex align-items-baseline">
+                                                        <span class="mr-1 font-weight-normal">Goal:</span>
+                                                        <span line-goal class="mr-2"></span>
+                                                        <a href="#" class="btn-edit-goal"><i class="fa fa-edit"></i></a>
+                                                    </div>
                                                 </div>
                                                 <div class="d-flex align-items-baseline mb-2 px-2">
                                                     <h6 class="font-weight-bold m-0 text-secondary">Argument Values</h6>
@@ -925,10 +930,10 @@
                                         if(!realNode.data) return;
                                         if(parent && parent.data.lastRefreshCount !== null && parent.data.lastRefreshCount !== -1) {
                                             if(node.data.lastRefreshCount !== null && node.data.lastRefreshCount !== -1) {
-                                                realNode.data.dropPercent = 100 - ((node.data.lastRefreshCount / parent.data.lastRefreshCount) * 100);
+                                                realNode.data.dropPercent = ((node.data.lastRefreshCount / parent.data.lastRefreshCount) * 100);
                                                 if(realNode.data.dropPercent) {
                                                     let element = StatTree.el.jstree(true).get_node(node.id, true), cssClass = '';
-                                                    if(realNode.data.dropPercent > 75) {
+                                                    /*if(realNode.data.dropPercent > 75) {
                                                         cssClass = 'drop-76-100';
                                                     }
                                                     else if(realNode.data.dropPercent > 50 && realNode.data.dropPercent <= 75) {
@@ -939,11 +944,48 @@
                                                     }
                                                     else if(realNode.data.dropPercent > 0 && realNode.data.dropPercent <= 25) {
                                                         cssClass = 'drop-0-25';
-                                                    }
+                                                    }*/
+                                                    cssClass = 'drop-0-25';
                                                     element.find('>a.jstree-anchor')
                                                         .addClass('has-drop-visualization')
                                                         .addClass(cssClass)
                                                         .attr('data-drop-percent', (realNode.data.dropPercent.toFixed(3)) + '% ⤵');
+
+                                                    if(!!realNode.data.goalCondition && realNode.data.goalPercent !== -1) {
+                                                        let goalLabel = '';
+                                                        switch(realNode.data.goalCondition) {
+                                                            case '=':
+                                                                if(realNode.data.dropPercent !== realNode.data.goalPercent) {
+                                                                    goalLabel = 'Should be = ' + realNode.data.goalPercent + '%';
+                                                                }
+                                                                break;
+                                                            case '>':
+                                                                if(realNode.data.dropPercent <= realNode.data.goalPercent) {
+                                                                    goalLabel = 'Should be > ' + realNode.data.goalPercent + '%';
+                                                                }
+                                                                break;
+                                                            case '<':
+                                                                if(realNode.data.dropPercent >= realNode.data.goalPercent) {
+                                                                    goalLabel = 'Should be < ' + realNode.data.goalPercent + '%';
+                                                                }
+                                                                break;
+                                                            case '>=':
+                                                                if(realNode.data.dropPercent < realNode.data.goalPercent) {
+                                                                    goalLabel = 'Should be >= ' + realNode.data.goalPercent + '%';
+                                                                }
+                                                                break;
+                                                            case '<=':
+                                                                if(realNode.data.dropPercent > realNode.data.goalPercent) {
+                                                                    goalLabel = 'Should be <= ' + realNode.data.goalPercent + '%';
+                                                                }
+                                                                break;
+                                                        }
+                                                        if(!!goalLabel) {
+                                                            element.find('>a.jstree-anchor')
+                                                                .addClass('has-goal-label')
+                                                                .attr('data-goal-label', '⚠ ' + goalLabel);
+                                                        }
+                                                    }
                                                 }
                                             }
                                         }
@@ -1082,6 +1124,8 @@
                                             displayLabel: node.data.displayLabel,
                                             clause: node.data.clause,
                                             columns: node.data.columns,
+                                            goalPercent: node.data.goalPercent,
+                                            goalCondition: node.data.goalCondition,
                                         };
                                         let children = [];
                                         for (let i = 0; i < node.children.length; i++) {
@@ -1145,6 +1189,10 @@
 
                                     linePropsColumn.removeClass('d-none');
                                     linePropsColumn.find('[line-label]').text(selected.data.displayLabel);
+                                    linePropsColumn.find('[line-goal]').text(
+                                        selected.data.goalCondition + ' ' +
+                                        (selected.data.goalPercent === -1 ? '-' : selected.data.goalPercent + '%')
+                                    );
 
                                     // fill args
                                     let tbody = linePropsColumn.find('[line-args]');
@@ -1323,6 +1371,29 @@
                                     return false;
                                 });
 
+                            $(document)
+                                .off('click', '.btn-edit-goal')
+                                .on('click', '.btn-edit-goal', function() {
+                                    let selected = StatTree.selectedNode();
+                                    let condition = window.prompt('Condition (=, <, >, <=, ):', selected.data.goalCondition);
+                                    if(condition !== null) {
+                                        let value = window.prompt('New goal (%):', (selected.data.goalPercent !== -1 ? selected.data.goalPercent : ''));
+                                        if(value !== null) {
+                                            if($.trim(value) === '') {
+                                                value = -1;
+                                            }
+                                            else {
+                                                value = +value;
+                                            }
+                                            selected.data.goalCondition = condition;
+                                            selected.data.goalPercent = value;
+                                            StatTree.onSelected();
+                                            StatTree.setDirty();
+                                        }
+                                    }
+                                    return false;
+                                });
+
                             $(document)
                                 .off('click', '.clause-expand-all')
                                 .on('click', '.clause-expand-all', function() {

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

@@ -14,7 +14,7 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 	}
 </style>
 @section('content')
-	<div class="container-fluid h-100">
+	<div class="container-fluid h-100 popup-content-container">
 		<div class="main-row h-100 {{ !request()->input('popupmode') ? '' : 'px-0' }} {{$isVisitNote ? 'autohide-leftnav' : ''}}">
 			@if(!request()->input('popupmode'))
 			<nav id="sidebarMenu" class="d-block bg-light sidebar collapse px-0">