瀏覽代碼

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

= 3 年之前
父節點
當前提交
ebb45b7f08
共有 73 個文件被更改,包括 310 次插入81 次删除
  1. 28 0
      app/Http/Controllers/McpController.php
  2. 12 7
      app/Models/Client.php
  3. 1 1
      app/Models/Point.php
  4. 20 0
      app/Models/Pro.php
  5. 1 1
      config/app.php
  6. 2 0
      js-dev/stag-popup.js
  7. 12 0
      resources/views/app/dashboard-mcp.blade.php
  8. 1 1
      resources/views/app/dashboard/measurements.blade.php
  9. 47 0
      resources/views/app/mcp/patients_awaiting_rpm_interaction.blade.php
  10. 1 1
      resources/views/app/patient/module-specific-summary-renderers/allergy/plan.blade.php
  11. 1 1
      resources/views/app/patient/module-specific-summary-renderers/allergy/subjective.blade.php
  12. 1 1
      resources/views/app/patient/module-specific-summary-renderers/behavior/plan.blade.php
  13. 1 1
      resources/views/app/patient/module-specific-summary-renderers/care_team_member/plan.blade.php
  14. 1 1
      resources/views/app/patient/module-specific-summary-renderers/care_team_member/subjective.blade.php
  15. 1 1
      resources/views/app/patient/module-specific-summary-renderers/exercise/plan.blade.php
  16. 1 1
      resources/views/app/patient/module-specific-summary-renderers/goal/plan.blade.php
  17. 1 1
      resources/views/app/patient/module-specific-summary-renderers/goal/subjective.blade.php
  18. 1 1
      resources/views/app/patient/module-specific-summary-renderers/medication/plan.blade.php
  19. 1 1
      resources/views/app/patient/module-specific-summary-renderers/medication/subjective.blade.php
  20. 1 1
      resources/views/app/patient/module-specific-summary-renderers/nutrition/plan.blade.php
  21. 1 1
      resources/views/app/patient/module-specific-summary-renderers/problem/plan.blade.php
  22. 1 1
      resources/views/app/patient/module-specific-summary-renderers/problem/subjective.blade.php
  23. 1 1
      resources/views/app/patient/segment-templates/_common_actions/remove-undo.php
  24. 1 1
      resources/views/app/patient/segment-templates/intake_allergies/summary.blade.php
  25. 1 1
      resources/views/app/patient/segment-templates/intake_care_team/summary.blade.php
  26. 1 1
      resources/views/app/patient/segment-templates/intake_goals/summary.blade.php
  27. 1 1
      resources/views/app/patient/segment-templates/intake_interventions/summary.blade.php
  28. 1 1
      resources/views/app/patient/segment-templates/intake_medications/summary.blade.php
  29. 1 1
      resources/views/app/patient/segment-templates/intake_problems/summary.blade.php
  30. 1 1
      resources/views/app/patient/segment-templates/intake_supplements/summary.blade.php
  31. 1 1
      resources/views/app/patient/segment-templates/omega_allergies/summary.blade.php
  32. 1 1
      resources/views/app/patient/segment-templates/omega_care_team/summary.blade.php
  33. 1 1
      resources/views/app/patient/segment-templates/omega_goals/summary.blade.php
  34. 1 1
      resources/views/app/patient/segment-templates/omega_medications/summary.blade.php
  35. 1 1
      resources/views/app/patient/segment-templates/omega_plan_allergies/summary.blade.php
  36. 1 1
      resources/views/app/patient/segment-templates/omega_plan_care_team/summary.blade.php
  37. 1 1
      resources/views/app/patient/segment-templates/omega_plan_goals/summary.blade.php
  38. 1 1
      resources/views/app/patient/segment-templates/omega_plan_medications/summary.blade.php
  39. 1 1
      resources/views/app/patient/segment-templates/omega_plan_problems/summary.blade.php
  40. 1 1
      resources/views/app/patient/segment-templates/omega_problems/summary.blade.php
  41. 58 3
      resources/views/app/patient/segment-templates/omega_subjective_free_text/edit.blade.php
  42. 47 2
      resources/views/app/patient/segment-templates/omega_subjective_free_text/summary.blade.php
  43. 1 1
      resources/views/app/patient/segment-templates/plan_allergies/summary.blade.php
  44. 1 1
      resources/views/app/patient/segment-templates/plan_care_team/summary.blade.php
  45. 1 1
      resources/views/app/patient/segment-templates/plan_free_text_v2/allergies.blade.php
  46. 1 1
      resources/views/app/patient/segment-templates/plan_free_text_v2/care_team.blade.php
  47. 1 1
      resources/views/app/patient/segment-templates/plan_free_text_v2/goals.blade.php
  48. 1 1
      resources/views/app/patient/segment-templates/plan_free_text_v2/medications.blade.php
  49. 1 1
      resources/views/app/patient/segment-templates/plan_free_text_v2/problems.blade.php
  50. 1 1
      resources/views/app/patient/segment-templates/plan_goals/summary.blade.php
  51. 1 1
      resources/views/app/patient/segment-templates/plan_interventions/summary.blade.php
  52. 1 1
      resources/views/app/patient/segment-templates/plan_medications/summary.blade.php
  53. 1 1
      resources/views/app/patient/segment-templates/plan_problems/summary.blade.php
  54. 1 1
      resources/views/app/patient/segment-templates/plan_supplements/summary.blade.php
  55. 1 1
      resources/views/app/patient/segment-templates/sigma_allergies/summary.blade.php
  56. 1 1
      resources/views/app/patient/segment-templates/sigma_care_team/summary.blade.php
  57. 1 1
      resources/views/app/patient/segment-templates/sigma_goals/summary.blade.php
  58. 1 1
      resources/views/app/patient/segment-templates/sigma_medications/summary.blade.php
  59. 1 1
      resources/views/app/patient/segment-templates/sigma_plan_allergies/summary.blade.php
  60. 1 1
      resources/views/app/patient/segment-templates/sigma_plan_care_team/summary.blade.php
  61. 1 1
      resources/views/app/patient/segment-templates/sigma_plan_goals/summary.blade.php
  62. 1 1
      resources/views/app/patient/segment-templates/sigma_plan_medications/summary.blade.php
  63. 1 1
      resources/views/app/patient/segment-templates/sigma_plan_problems/summary.blade.php
  64. 1 1
      resources/views/app/patient/segment-templates/sigma_problems/summary.blade.php
  65. 1 1
      resources/views/app/patient/segment-templates/subjective_general_v2/allergies.blade.php
  66. 1 1
      resources/views/app/patient/segment-templates/subjective_general_v2/care_team.blade.php
  67. 1 1
      resources/views/app/patient/segment-templates/subjective_general_v2/goals.blade.php
  68. 1 1
      resources/views/app/patient/segment-templates/subjective_general_v2/medications.blade.php
  69. 1 1
      resources/views/app/patient/segment-templates/subjective_general_v2/problems.blade.php
  70. 4 5
      resources/views/app/practice-management/remote-monitoring-row-markup-for-admin.blade.php
  71. 1 2
      resources/views/app/practice-management/rpm-matrix-for-admin-table.blade.php
  72. 17 1
      resources/views/layouts/patient.blade.php
  73. 1 0
      routes/web.php

+ 28 - 0
app/Http/Controllers/McpController.php

@@ -438,6 +438,34 @@ class McpController extends Controller
         ];
         return view('app.mcp.unsigned_incoming_reports', $data);
     }
+    public function patients_awaiting_rpm_interaction(Request $request) {
+        $cmStartDate = date('Y-m-01');
+        $query = "
+SELECT
+    client.uid as client_uid,
+    care_month.uid as care_month_uid,
+    (client.name_first || ' ' || client.name_last) as client_name,
+    client.age_in_years,
+    client.sex,
+    care_month.start_date,
+    care_month.number_of_days_with_remote_measurements
+FROM
+    client join care_month on client.id = care_month.client_id
+WHERE
+    care_month.start_date = '{$cmStartDate}'
+    AND client.is_enrolled_in_rm = 'YES'
+    AND care_month.has_mcp_interacted_with_client_about_rm IS NOT TRUE
+    AND care_month.mcp_pro_id = {$this->performer->pro->id}
+    AND (client.client_engagement_status_category IS NULL OR client.client_engagement_status_category != 'DUMMY')
+    AND client.name_first NOT ILIKE '%test%'
+    AND client.name_last NOT ILIKE '%test%'
+ORDER BY care_month.number_of_days_with_remote_measurements DESC NULLS LAST
+        ";
+        $data = [
+            'records' => DB::select($query)
+        ];
+        return view('app.mcp.patients_awaiting_rpm_interaction', $data);
+    }
     public function measurements_pending_stamping(Request $request){
         $data = [
             'records' => CareMonth::where('mcp_pro_id', $this->performer->pro->id)

+ 12 - 7
app/Models/Client.php

@@ -298,16 +298,21 @@ class Client extends Model
 
     public function currentCareMonth()
     {
-        $cmStartDate = strtotime(date('Y-m-d'));
-        $month = date("n", $cmStartDate);
-        $year = date("Y", $cmStartDate);
-        return CareMonth
-            ::where('client_id', $this->id)
-            ->whereRaw('EXTRACT(MONTH FROM start_date) = ?', [$month])
-            ->whereRaw('EXTRACT(YEAR FROM start_date) = ?', [$year])
+        $cmStartDate = date('Y-m-01');
+        return CareMonth::where('client_id', $this->id)
+            ->whereRaw('start_date = ?', [$cmStartDate])
             ->first();
     }
 
+    // returns the current care-month, if in fact patient is awaiting mcp rm interaction
+    public function isAwaitingRMCommunicationFromMCP() {
+        // if patient is enrolled in rm AND has current care month AND $careMonth->has_mcp_interacted_with_client_about_rm IS FALSE
+        if($this->is_enrolled_in_rm !== 'YES') return false;
+        $careMonth = $this->currentCareMonth();
+        if(!$careMonth) return false;
+        return $careMonth->has_mcp_interacted_with_client_about_rm ? false : $careMonth;
+    }
+
     public function previousCareMonth()
     {
         $cmStartDate = date('Y-m-d', strtotime('first day of last month'));

+ 1 - 1
app/Models/Point.php

@@ -525,7 +525,7 @@ class Point extends Model
             if ($point->removed_in_note_id === $note->id && $point->removal_reason_category === 'DURING_VISIT') {
                 $point->badge = 'Removed During Visit';
             } elseif ($point->removed_in_note_id === $note->id && $point->removal_reason_category === 'ON_INTAKE') {
-                $point->badge = 'Marked Removed on Intake';
+                $point->badge = 'Marked Historic';
             } elseif ($point->removed_in_note_id !== $note->id) {
                 $point->badge = 'Historic Record Removed in a Previous Visit';
             }

+ 20 - 0
app/Models/Pro.php

@@ -736,6 +736,26 @@ WHERE
         return $count[0]->count;
     }
 
+    function get_patients_awaiting_rpm_interaction_count_as_mcp() {
+        $cmStartDate = date('Y-m-01');
+        $query = "
+SELECT
+    count(client.id)
+FROM
+    client join care_month on client.id = care_month.client_id
+WHERE
+    care_month.start_date = '{$cmStartDate}'
+    AND client.is_enrolled_in_rm = 'YES'
+    AND care_month.has_mcp_interacted_with_client_about_rm IS NOT TRUE
+    AND care_month.mcp_pro_id = {$this->id}
+    AND (client.client_engagement_status_category IS NULL OR client.client_engagement_status_category != 'DUMMY')
+    AND client.name_first NOT ILIKE '%test%'
+    AND client.name_last NOT ILIKE '%test%'
+        ";
+        $count = DB::select($query);
+        return $count[0]->count;
+    }
+
     function get_birthdays_today_as_mcp(){
         return;
         $queryClients = $this->performer()->pro->getAccessibleClientsQuery();

+ 1 - 1
config/app.php

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

+ 2 - 0
js-dev/stag-popup.js

@@ -302,6 +302,7 @@ function hasResponseError(_data) {
         $(document)
             .off('mousedown.start-drag', '.stag-popup.dynamic-popup.draggable .stag-popup-title')
             .on('mousedown.start-drag', '.stag-popup.dynamic-popup.draggable .stag-popup-title', function(_e) {
+                if(_e.which !== 1) return;
                 if(dragging && dragging.length) {
                     dragging = false;
                 }
@@ -356,6 +357,7 @@ function hasResponseError(_data) {
         $(document)
             .off('mousedown.start-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content')
             .on('mousedown.start-resize', '.stag-popup.dynamic-popup.resizable .stag-popup-content', function(_e) {
+                if(_e.which !== 1) return;
                 if(resizeHighlighting && resizeHighlighting.length) {
                     if(resizing && resizing.length) {
                         resizing.removeClass('resizing-x resizing-y');

+ 12 - 0
resources/views/app/dashboard-mcp.blade.php

@@ -244,6 +244,18 @@
                                         </a>
                                     </th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_patients_awaiting_rpm_interaction_count_as_mcp()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('mcp.patients_awaiting_rpm_interaction') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="stag-popup-md"
+                                           title="Patients Awaiting RPM Interaction">
+                                            Patients Awaiting RPM Interaction
+                                        </a>
+                                    </th>
+                                </tr>
                                 @endif
                                 @if($pro->is_considered_for_rmm)
                                     <tr>

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

@@ -17,7 +17,7 @@
             <?php foreach($measurements as $measurement): ?>
                 <tr>
                     <td class="px-2">
-                        <a href="/patients/view/{{$measurement->client_uid}}" class="font-weight-bold">
+                        <a href="/patients/view/{{$measurement->client_uid}}" class="font-weight-normal">
                             {{ $measurement->name_first }} {{ $measurement->name_last }}
                         </a>
                     </td>

+ 47 - 0
resources/views/app/mcp/patients_awaiting_rpm_interaction.blade.php

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-box"></i>
+                Patients Awaiting RPM Interaction
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+
+            <table class="table table-sm table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0 text-secondary">Patient</th>
+                    <th class="border-0 text-secondary">Gender, Age</th>
+                    <th class="border-0 text-secondary">Care Month</th>
+                    <th class="border-0 text-secondary">Days with measurements</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $record)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/mc/patients/view/{{$record->client_uid}}">{{$record->client_name}}</a>
+                        </td>
+                        <td>{{$record->sex}} {{$record->age_in_years}} years</td>
+                        <td>
+                            <a native target="_blank" href="/mc/patients/view/{{$record->client_uid}}/care-months/view/{{$record->care_month_uid}}">{{$record->start_date}}</a>
+                        </td>
+                        <td>
+                            {{$record->number_of_days_with_remote_measurements ?: 0}}
+                        </td>
+                    </tr>
+                @endforeach
+                @if(!count($records))
+                    <tr>
+                        <td colspan="6">No records found.</td>
+                    </tr>
+                @endif
+                </tbody>
+            </table>
+
+        </div>
+    </div>
+</div>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/allergy/plan.blade.php

@@ -39,7 +39,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/allergy/subjective.blade.php

@@ -36,7 +36,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/behavior/plan.blade.php

@@ -43,7 +43,7 @@
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                             <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/care_team_member/plan.blade.php

@@ -39,7 +39,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/care_team_member/subjective.blade.php

@@ -36,7 +36,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/exercise/plan.blade.php

@@ -43,7 +43,7 @@
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                             <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/goal/plan.blade.php

@@ -39,7 +39,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/goal/subjective.blade.php

@@ -36,7 +36,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/medication/plan.blade.php

@@ -49,7 +49,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/medication/subjective.blade.php

@@ -36,7 +36,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/nutrition/plan.blade.php

@@ -43,7 +43,7 @@
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                             <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/problem/plan.blade.php

@@ -40,7 +40,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/problem/subjective.blade.php

@@ -36,7 +36,7 @@
                                 @if($point->removal_reason_category === 'DURING_VISIT')
                                     <span class="text-sm text-secondary">Removed during visit</span>
                                 @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                    <span class="text-sm text-secondary">Removed on intake</span>
+                                    <span class="text-sm text-secondary">Historic</span>
                                 @endif
                                 <?php elseif ($point->added_in_note_id === $note->id): ?>
                                 <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 1 - 1
resources/views/app/patient/segment-templates/_common_actions/remove-undo.php

@@ -14,7 +14,7 @@ $epNotPart = ($intakeOrVisit === 'INTAKE') ? 'DuringVisit' : 'OnIntake';
         <?php if($point->removal_reason_category === 'DURING_VISIT'): ?>
         <span class="ont-weight-bold text-secondary mr-2 text-nowrap">Removed during visit</span>
         <?php elseif($point->removal_reason_category === 'ON_INTAKE'): ?>
-        <span class="ont-weight-bold text-secondary mr-2 text-nowrap">Removed on intake</span>
+        <span class="ont-weight-bold text-secondary mr-2 text-nowrap">Historic</span>
         <?php endif; ?>
     <?php endif; ?>
     <div visit-moe>

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

@@ -51,7 +51,7 @@ $plural = 'Allergies';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="text-sm text-secondary">Removed on intake</span>
+                            <span class="text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -46,7 +46,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -41,7 +41,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -46,7 +46,7 @@ foreach($interventions as $intervention) {
                                 @if($intervention->removal_reason_category === 'DURING_VISIT')
                                     <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                                 @elseif($intervention->removal_reason_category === 'ON_INTAKE')
-                                    <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                                    <span class="ml-2 text-sm text-secondary">Historic</span>
                                 @endif
                             <?php elseif ($intervention->added_in_note_id === $note->id): ?>
                             <span class="ml-2 text-sm text-success">* Added on intake</span>

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

@@ -46,7 +46,7 @@ $plural = 'Medications';
 					@if($point->removal_reason_category === 'DURING_VISIT')
 						<span class="text-sm text-secondary">Removed during visit</span>
 					@elseif($point->removal_reason_category === 'ON_INTAKE')
-						<span class="text-sm text-secondary">Removed on intake</span>
+						<span class="text-sm text-secondary">Historic</span>
 					@endif
 				<?php elseif ($point->added_in_note_id === $note->id): ?>
 					<?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -41,7 +41,7 @@ $plural = 'Problems';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -31,7 +31,7 @@ $numRelevant = 0;
                     @if($supplement->removal_reason_category === 'DURING_VISIT')
                         <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                     @elseif($supplement->removal_reason_category === 'ON_INTAKE')
-                        <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                        <span class="ml-2 text-sm text-secondary">Historic</span>
                     @endif
                 <?php elseif ($supplement->added_in_note_id === $note->id): ?>
                 <span class="ml-2 text-sm text-success">* Added on intake</span>

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

@@ -48,7 +48,7 @@ $plural = 'Allergies';
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                         <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -45,7 +45,7 @@ $plural = 'Care team members';
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                             <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -38,7 +38,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="text-sm text-secondary">Removed on intake</span>
+                            <span class="text-sm text-secondary">Historic</span>
                         @endif
                         <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -64,7 +64,7 @@ $plural = 'Medications';
 				@if($point->removal_reason_category === 'DURING_VISIT')
 					<span class="text-sm text-secondary">Removed during visit</span>
 				@elseif($point->removal_reason_category === 'ON_INTAKE')
-					<span class="text-sm text-secondary">Removed on intake</span>
+					<span class="text-sm text-secondary">Historic</span>
 				@endif
 				<?php elseif ($point->added_in_note_id === $note->id): ?>
 				<?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -56,7 +56,7 @@ $plural = 'Allergies';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -52,7 +52,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="mt-1 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="mt-1 text-sm text-secondary">Removed on intake</span>
+                            <span class="mt-1 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -52,7 +52,7 @@ $plural = 'Medications';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Problems';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -25,7 +25,7 @@ $plural = 'Problems';
                    @if($point->removal_reason_category === 'DURING_VISIT')
                        <span class="text-sm text-secondary">Removed during visit</span>
                    @elseif($point->removal_reason_category === 'ON_INTAKE')
-                       <span class="text-sm text-secondary">Removed on intake</span>
+                       <span class="text-sm text-secondary">Historic</span>
                    @endif
                    <?php elseif ($point->added_in_note_id === $note->id): ?>
                    <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

+ 58 - 3
resources/views/app/patient/segment-templates/omega_subjective_free_text/edit.blade.php

@@ -1,4 +1,59 @@
 <?php
-$category = 'SUBJECTIVE_GENERAL';
-$endPoint = 'upsertNoteSingleton';
-include resource_path('views/app/patient/segment-templates/_simple_text_segment/edit.php');
+
+use App\Models\Point;
+
+$point = Point::where('added_in_note_id', $note->id)->where('category', 'SUBJECTIVE_GENERAL')->orderBy('id', 'DESC')->first();
+$parsed = null;
+if (!!@$point->data) {
+    $parsed = json_decode($point->data);
+}
+$content = '';
+if (!!$parsed && @$parsed->free_text) {
+    $content = $parsed->free_text;
+}
+else {
+    if($note->visit_number === 1) {
+        $intakeDataFields = config('patient-intake-data');
+        $patientCanvasData = json_decode($patient->canvas_data ?? null);
+        $patientIntakeData = null;
+        if ($patientCanvasData && @$patientCanvasData->INTAKE_DATA) {
+            $patientIntakeData = @$patientCanvasData->INTAKE_DATA;
+            foreach($intakeDataFields as $key=>$label) {
+                if($key == 'ethnicity_checkboxes') {
+                    foreach($label as $eKey => $eLabel) {
+                        if(@$patientIntakeData->{$eKey}) {
+                            $content .= $eLabel . ': ' . @$patientIntakeData->{$eKey} . '&nbsp;&nbsp;&nbsp;';
+                        }
+                    }
+                }
+                else {
+                    if(@$patientIntakeData->{$key}) {
+                        $content .= ($key !== 'stickyNote' ? $label . ': ' : '<br>') . @$patientIntakeData->{$key} . '&nbsp;&nbsp;&nbsp;';
+                    }
+                }
+            }
+        }
+    }
+}
+?>
+<div visit-moe close-on-save close-on-cancel class="d-block">
+    <form show url="/api/visitPoint/upsertNoteSingleton" class="mcp-theme-1">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="category" value="SUBJECTIVE_GENERAL">
+        <input type="hidden" name="data">
+        <div note-rte
+             class="form-group mb-2 border-left border-right rte-holder"
+             data-field-name="free_text"
+        ><?= $content ?></div>
+        <div class="m-2">
+            <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></button>
+            <div class="d-inline-flex align-self-stretch align-items-center">
+                <span class="autosave-indicator saving text-sm text-secondary">Saving changes &hellip;</span>
+                <span class="autosave-indicator saved text-sm text-secondary">
+                    <i class="fa fa-check"></i>
+                    Saved
+                </span>
+            </div>
+        </div>
+    </form>
+</div>

+ 47 - 2
resources/views/app/patient/segment-templates/omega_subjective_free_text/summary.blade.php

@@ -1,3 +1,48 @@
 <?php
-$category = 'SUBJECTIVE_GENERAL';
-include resource_path('views/app/patient/segment-templates/_simple_text_segment/summary.php');
+
+use App\Models\Point;
+
+$point = Point::where('added_in_note_id', $note->id)->where('category', 'SUBJECTIVE_GENERAL')->orderBy('id', 'DESC')->first();
+$parsed = null;
+if (!!@$point->data) {
+    $parsed = json_decode($point->data);
+}
+?>
+<div class="wrapping-pre-container">
+    <?php
+    if (!!$parsed && @$parsed->free_text) {
+        echo $parsed->free_text;
+    }
+    else {
+        if($note->visit_number === 1) {
+            $intakeDataFields = config('patient-intake-data');
+            $patientCanvasData = json_decode($patient->canvas_data ?? null);
+            $patientIntakeData = null;
+            if ($patientCanvasData && @$patientCanvasData->INTAKE_DATA) {
+                $patientIntakeData = @$patientCanvasData->INTAKE_DATA;
+                foreach($intakeDataFields as $key=>$label) {
+                    if($key == 'ethnicity_checkboxes') {
+                        foreach($label as $eKey => $eLabel) {
+                            if(@$patientIntakeData->{$eKey}) {
+                                echo $eLabel . ': ' . @$patientIntakeData->{$eKey} . '&nbsp;&nbsp;&nbsp;';
+                            }
+                        }
+                    }
+                    else {
+                        if(@$patientIntakeData->{$key}) {
+                            echo ($key !== 'stickyNote' ? $label . ': ' : '<br>') . @$patientIntakeData->{$key} . '&nbsp;&nbsp;&nbsp;';
+                        }
+                    }
+                }
+            }
+            else {
+                echo "-";
+            }
+        }
+        else {
+            echo "-";
+        }
+    }
+    ?>
+</div>
+

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

@@ -56,7 +56,7 @@ $plural = 'Allergies';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -52,7 +52,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="mt-1 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="mt-1 text-sm text-secondary">Removed on intake</span>
+                            <span class="mt-1 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -48,7 +48,7 @@ $plural = 'Allergies';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -51,7 +51,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="mt-1 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="mt-1 text-sm text-secondary">Removed on intake</span>
+                            <span class="mt-1 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -46,7 +46,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -48,7 +48,7 @@ $plural = 'Medications';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -46,7 +46,7 @@ $plural = 'Problems';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -42,7 +42,7 @@ $numRelevant = 0;
                         @if($intervention->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($intervention->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($intervention->added_in_note_id === $note->id): ?>
                         <?php if ($intervention->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -52,7 +52,7 @@ $plural = 'Medications';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Problems';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -42,7 +42,7 @@ $numVisible = 0;
                     @if($supplement->removal_reason_category === 'DURING_VISIT')
                         <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                     @elseif($supplement->removal_reason_category === 'ON_INTAKE')
-                        <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                        <span class="ml-2 text-sm text-secondary">Historic</span>
                     @endif
                 <?php elseif ($supplement->added_in_note_id === $note->id): ?>
                     <?php if ($supplement->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -50,7 +50,7 @@ $plural = 'Allergies';
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                         <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -45,7 +45,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="text-sm text-secondary">Removed on intake</span>
+                            <span class="text-sm text-secondary">Historic</span>
                         @endif
                         <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -40,7 +40,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="text-sm text-secondary">Removed on intake</span>
+                            <span class="text-sm text-secondary">Historic</span>
                         @endif
                         <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -45,7 +45,7 @@ $plural = 'Medications';
 				@if($point->removal_reason_category === 'DURING_VISIT')
 					<span class="text-sm text-secondary">Removed during visit</span>
 				@elseif($point->removal_reason_category === 'ON_INTAKE')
-					<span class="text-sm text-secondary">Removed on intake</span>
+					<span class="text-sm text-secondary">Historic</span>
 				@endif
 				<?php elseif ($point->added_in_note_id === $note->id): ?>
 				<?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -56,7 +56,7 @@ $plural = 'Allergies';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -52,7 +52,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="mt-1 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="mt-1 text-sm text-secondary">Removed on intake</span>
+                            <span class="mt-1 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -52,7 +52,7 @@ $plural = 'Medications';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Problems';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -40,7 +40,7 @@ $plural = 'Problems';
                        @if($point->removal_reason_category === 'DURING_VISIT')
                            <span class="text-sm text-secondary">Removed during visit</span>
                        @elseif($point->removal_reason_category === 'ON_INTAKE')
-                           <span class="text-sm text-secondary">Removed on intake</span>
+                           <span class="text-sm text-secondary">Historic</span>
                        @endif
                        <?php elseif ($point->added_in_note_id === $note->id): ?>
                        <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -50,7 +50,7 @@ $plural = 'Allergies';
                             @if($point->removal_reason_category === 'DURING_VISIT')
                                 <span class="text-sm text-secondary">Removed during visit</span>
                             @elseif($point->removal_reason_category === 'ON_INTAKE')
-                                <span class="text-sm text-secondary">Removed on intake</span>
+                                <span class="text-sm text-secondary">Historic</span>
                             @endif
                         <?php elseif ($point->added_in_note_id === $note->id): ?>
                             <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -47,7 +47,7 @@ $plural = 'Care team members';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -42,7 +42,7 @@ $plural = 'Goals';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -43,7 +43,7 @@ $plural = 'Medications';
 					@if($point->removal_reason_category === 'DURING_VISIT')
 						<span class="text-sm text-secondary">Removed during visit</span>
 					@elseif($point->removal_reason_category === 'ON_INTAKE')
-						<span class="text-sm text-secondary">Removed on intake</span>
+						<span class="text-sm text-secondary">Historic</span>
 					@endif
 				<?php elseif ($point->added_in_note_id === $note->id): ?>
 					<?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -42,7 +42,7 @@ $plural = 'Problems';
                         @if($point->removal_reason_category === 'DURING_VISIT')
                             <span class="ml-2 text-sm text-secondary">Removed during visit</span>
                         @elseif($point->removal_reason_category === 'ON_INTAKE')
-                            <span class="ml-2 text-sm text-secondary">Removed on intake</span>
+                            <span class="ml-2 text-sm text-secondary">Historic</span>
                         @endif
                     <?php elseif ($point->added_in_note_id === $note->id): ?>
                         <?php if ($point->addition_reason_category === 'DURING_VISIT'): ?>

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

@@ -1,6 +1,5 @@
 <tr data-client-uid="{{$iPatient->client_uid}}" data-care-month-uid="{{$iPatient->care_month_uid}}">
     <td>{{ $trIndex + 1 }}</td>
-    <td>{{ @$iPatient->mcp_name }}</td>
     <td class="pl-2">
         <a href="/patients/view/{{ $iPatient->client_uid }}/care-months/view/{{$iPatient->care_month_uid}}"
            native target="_blank"
@@ -133,7 +132,7 @@
         if($iPatient->number_of_days_with_remote_measurements >= 16 && $lastVisitWithin90Days) {
             $codeStatus = 'Ready';
             if($iPatient->claim_454) {
-                $codeStatus = 'Billed';
+                $codeStatus = 'Claimed';
             }
         }
         ?>
@@ -146,7 +145,7 @@
                 <i class="fa fa-thumbs-up text-sm"></i>
                 {{$codeStatus}}
             </span>
-        @elseif($codeStatus === 'Billed')
+        @elseif($codeStatus === 'Claimed')
             <span class="text-nowrap text-success">
                 <i class="fa fa-check text-sm"></i>
                 {{$codeStatus}}
@@ -161,7 +160,7 @@
             ($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';
+                $codeStatus = 'Claimed';
             }
         }
         ?>
@@ -174,7 +173,7 @@
                 <i class="fa fa-thumbs-up text-sm"></i>
                 {{$codeStatus}}
             </span>
-        @elseif($codeStatus === 'Billed')
+        @elseif($codeStatus === 'Claimed')
             <span class="text-nowrap text-success">
                 <i class="fa fa-check text-sm"></i>
                 {{$codeStatus}}

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

@@ -24,8 +24,7 @@
         <table class="table table-sm table-striped table-hover p-0 m-0 min-width-1100px" id="table-rm-matrix">
             <thead class="bg-light">
             <tr>
-		<th></th>
-		<th>CM MCP</th>
+		        <th></th>
                 <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' => '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>

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

@@ -305,8 +305,24 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 						@include('layouts.patient-header')
 					</div>
 				</div>
+				<?php $iCM = $patient->isAwaitingRMCommunicationFromMCP(); ?>
+				@if($iCM !== FALSE)
+					<div class="d-block my-0 mx-2 p-2 alert alert-warning mcp-theme-1 border border-warning text-dark">
+						<span class="font-size-13">
+							<i class="fa fa-exclamation-triangle mr-1"></i>
+							This patient has not had RPM-related interactive communication this month. Please document interactive time
+							@if(request()->route()->getName() === 'patients.view.care-months.view.dashboard' && @$careMonth && @$careMonth->id === $iCM->id)
+								here.
+							@else
+								<a href="{{route('patients.view.care-months.view.dashboard', ['patient' => $patient, 'careMonth' => $iCM])}}"
+								   class="font-weight-bold d-inline">here</a>.
+							@endif
+							This time may not be billed towards a note.
+						</span>
+					</div>
+				@endif
 				@if($pro->pro_type === 'ADMIN')
-				<div class="screen-only card-header py-2 d-flex align-items-start justify-content-between mcp-theme-1 bg-aliceblue hide-inside-popup">
+				<div class="screen-only {{$iCM !== FALSE ? 'mt-2' : ''}} card-header py-2 d-flex align-items-start justify-content-between mcp-theme-1 bg-aliceblue hide-inside-popup">
 					<div class="d-flex align-items-center">
 						<b class="">Tags ({{count($patient->clientTags)}}):</b>
 					@foreach($patient->clientTags as $tag)

+ 1 - 0
routes/web.php

@@ -105,6 +105,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('supply-orders-pending-signature', 'McpController@supply_orders_pending_signature')->name('supply_orders_pending_signature');
         Route::get('supply-orders-awaiting-shipment', 'McpController@supply_orders_awaiting_shipment')->name('supply_orders_awaiting_shipment');
         Route::get('unsigned-incoming-reports', 'McpController@unsigned_incoming_reports')->name('unsigned_incoming_reports');
+        Route::get('patients-awaiting-rpm-interaction', 'McpController@patients_awaiting_rpm_interaction')->name('patients_awaiting_rpm_interaction');
 
         Route::get('measurements-pending-stamping', 'McpController@measurements_pending_stamping')->name('measurements_pending_stamping');
         Route::get('measurements-pending-stamping-in-care-month', 'McpController@measurements_pending_stamping_in_care_month')->name('measurements_pending_stamping_in_care_month');