Browse Source

Merge branch 'dev' into dev-vj

Vijayakrishnan 3 years ago
parent
commit
b2f77ca515
57 changed files with 2545 additions and 540 deletions
  1. 15 3
      app/Helpers/helpers.php
  2. 38 0
      app/Http/Controllers/AdminController.php
  3. 17 0
      app/Http/Controllers/McpController.php
  4. 3 28
      app/Http/Controllers/NoteController.php
  5. 71 0
      app/Http/Controllers/PracticeManagementController.php
  6. 90 0
      app/Models/Pro.php
  7. 51 0
      app/Models/Segment.php
  8. 13 0
      app/Models/SegmentSummaryChange.php
  9. 13 0
      app/Models/SegmentSummarySuggestion.php
  10. 2 1
      config/app.php
  11. 19 0
      config/patient-intake-data.php
  12. 38 0
      public/css/style.css
  13. 47 0
      resources/views/app/admin/notes_pending_summary_suggestion.blade.php
  14. 47 0
      resources/views/app/admin/notes_rejected_summary_suggestion.blade.php
  15. 2 0
      resources/views/app/admin/patients-table-extended.blade.php
  16. 32 1
      resources/views/app/admin/patients_filters.blade.php
  17. 2 2
      resources/views/app/confirm_sms_auth_token.blade.php
  18. 24 0
      resources/views/app/dashboard-admin.blade.php
  19. 25 0
      resources/views/app/dashboard-mcp.blade.php
  20. 1 1
      resources/views/app/dna/appointments.blade.php
  21. 1 1
      resources/views/app/login.blade.php
  22. 1 1
      resources/views/app/mcp/appointments.blade.php
  23. 47 0
      resources/views/app/mcp/notes_pending_summary_suggestion.blade.php
  24. 47 0
      resources/views/app/mcp/notes_rejected_summary_suggestion.blade.php
  25. 3 0
      resources/views/app/new-patient.blade.php
  26. 1 1
      resources/views/app/patient/appointment-calendar.blade.php
  27. 1 1
      resources/views/app/patient/appointments.blade.php
  28. 1 1
      resources/views/app/patient/care-months.blade.php
  29. 24 24
      resources/views/app/patient/create-patient/demographics-form.blade.php
  30. 2 2
      resources/views/app/patient/create-patient/insurance-coverage-form.blade.php
  31. 1 6
      resources/views/app/patient/intake-data/grid-patient-intake-data-display.blade.php
  32. 29 37
      resources/views/app/patient/intake-data/grid-patient-intake-data-form.blade.php
  33. 15 0
      resources/views/app/patient/intake-data/intake-data-display.blade.php
  34. 31 0
      resources/views/app/patient/intake-data/intake-data-form-fields.blade.php
  35. 1 10
      resources/views/app/patient/intake-data/intake-data.blade.php
  36. 1 6
      resources/views/app/patient/intake-data/patient-intake-data-display.blade.php
  37. 14 22
      resources/views/app/patient/intake-data/patient-intake-data-form.blade.php
  38. 1 1
      resources/views/app/patient/note/_create-bill.blade.php
  39. 20 0
      resources/views/app/patient/note/dashboard.blade.php
  40. 10 1
      resources/views/app/patient/note/note-segment-list-rhs.blade.php
  41. 13 2
      resources/views/app/patient/note/note-segment-list.blade.php
  42. 7 1
      resources/views/app/patient/note/segment.blade.php
  43. 119 0
      resources/views/app/patient/note/segment/suggestions_and_updates.blade.php
  44. 2 2
      resources/views/app/patient/notes.blade.php
  45. 518 12
      resources/views/app/patient/segment-templates/covid_follow-up/edit.blade.php
  46. 279 11
      resources/views/app/patient/segment-templates/covid_follow-up/summary.blade.php
  47. 25 6
      resources/views/app/patient/segment-templates/covid_intake/edit.blade.php
  48. 225 340
      resources/views/app/patient/segment-templates/covid_intake/summary.blade.php
  49. 92 0
      resources/views/app/patient/segment-templates/how_to_smbp/edit.blade.php
  50. 82 0
      resources/views/app/patient/segment-templates/how_to_smbp/summary.blade.php
  51. 205 0
      resources/views/app/practice-management/rm-action-report.blade.php
  52. 83 7
      resources/views/app/practice-management/supply-orders-ready-to-ship.blade.php
  53. BIN
      resources/views/layouts/.patient.blade.php.swp
  54. 78 0
      resources/views/layouts/deleting_dummies.sql
  55. 8 8
      resources/views/layouts/patient.blade.php
  56. 1 0
      resources/views/layouts/template.blade.php
  57. 7 1
      routes/web.php

+ 15 - 3
app/Helpers/helpers.php

@@ -124,6 +124,18 @@ if(!function_exists('get_current_session')) {
     }
     }
 }
 }
 
 
+if(!function_exists('get_current_date')) {
+    function get_current_date($timezone = null){
+        if(!$timezone){
+            $timezone = 'US\Eastern';
+        }
+        $date = new DateTime("now", new DateTimeZone('US/Eastern') );
+        return $date->format('Y-m-d');
+    }
+}
+
+
+
 if(!function_exists('friendly_date_time')) {
 if(!function_exists('friendly_date_time')) {
     function friendly_date_time($value, $includeTime = true, $default = '-', $long_year=false) {
     function friendly_date_time($value, $includeTime = true, $default = '-', $long_year=false) {
         if(!$value || empty($value)) return $default;
         if(!$value || empty($value)) return $default;
@@ -725,9 +737,9 @@ if(!function_exists('friendly_timezone')) {
     }
     }
 }
 }
 
 
-if(!function_exists('segment_template_summary_value')) {
-    function segment_template_summary_value_display($value, $default='________') {
-        if($value && strlen($value)) return '<span class="segment-template-summary-value">' . $value . '</span>';
+if(!function_exists('segment_template_summary_value_display')) {
+    function segment_template_summary_value_display($value, $default='________', $class = '') {
+        if($value && strlen($value)) return '<span class="segment-template-summary-value '.$class.'">' . $value . '</span>';
         return $default;
         return $default;
     }
     }
 }
 }

+ 38 - 0
app/Http/Controllers/AdminController.php

@@ -81,6 +81,27 @@ class AdminController extends Controller
             }
             }
         }
         }
 
 
+        if ($request->input('na')) {
+            $na = Pro::where('uid', trim($request->input('na')))->first();
+            if ($na) {
+                $patients = $patients->where('default_na_pro_id', $na->id);
+            }
+        }
+
+        if ($request->input('next_appointment_category')) {
+            if($request->input('next_appointment_category') == 'NONE'){
+                $patients = $patients->whereNull('next_mcp_appointment_id');
+            }
+        }
+
+        if ($request->input('chart_number_ends_with')) {
+            if($request->input('chart_number_ends_with') == 'ZERO'){
+                $patients = $patients->where('chart_number', 'ILIKE' , '%0');
+            }else{
+                $patients = $patients->where('chart_number', 'ILIKE' , '%'.$request->input('chart_number_ends_with'));
+            }
+        }
+
         $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
         $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
         $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
         $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');
@@ -135,6 +156,23 @@ class AdminController extends Controller
         return view('app.mcp.notes', compact('notes'));
         return view('app.mcp.notes', compact('notes'));
     }
     }
 
 
+    public function notes_pending_summary_suggestion(Request $request){
+        $pro = $this->performer->pro;
+        $data = [
+            'records' => $pro->get_notes_pending_summary_suggestion_as_admin()
+        ];
+        return view('app.admin.notes_pending_summary_suggestion', $data);
+    }
+
+    public function notes_rejected_summary_suggestion(Request $request){
+        $pro = $this->performer->pro;
+        $data = [
+            'records' => $pro->get_notes_rejected_summary_suggestion_as_admin()
+        ];
+        return view('app.admin.notes_rejected_summary_suggestion', $data);
+    }
+
+
     public function appointments(Request $request)
     public function appointments(Request $request)
     {
     {
         $appointments = Appointment::paginate(5);
         $appointments = Appointment::paginate(5);

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

@@ -286,6 +286,23 @@ class McpController extends Controller
         ];
         ];
         return view('app.mcp.notes_pending_signature', $data);
         return view('app.mcp.notes_pending_signature', $data);
     }
     }
+
+    public function notes_pending_summary_suggestion(Request $request){
+        $pro = $this->performer->pro;
+        $data = [
+            'records' => $pro->get_notes_pending_summary_suggestion_as_mcp()
+        ];
+        return view('app.mcp.notes_pending_summary_suggestion', $data);
+    }
+
+    public function notes_rejected_summary_suggestion(Request $request){
+        $pro = $this->performer->pro;
+        $data = [
+            'records' => $pro->get_notes_rejected_summary_suggestion_as_mcp()
+        ];
+        return view('app.mcp.notes_rejected_summary_suggestion', $data);
+    }
+
     public function notes_pending_billing(Request $request){
     public function notes_pending_billing(Request $request){
         $data = [
         $data = [
             'records' => Note::where('hcp_pro_id', $this->performer->pro->id)
             'records' => Note::where('hcp_pro_id', $this->performer->pro->id)

+ 3 - 28
app/Http/Controllers/NoteController.php

@@ -107,33 +107,8 @@ class NoteController extends Controller
             $pro = $performer->pro;
             $pro = $performer->pro;
 
 
             $segment = Segment::where('uid', $segmentUid)->first();
             $segment = Segment::where('uid', $segmentUid)->first();
-            $segmentTemplate = $segment->segmentTemplate;
 
 
-            $note = $segment->note;
-            $patient = $note->client;
-
-            $data = compact('performer', 'pro', 'segment', 'segmentTemplate', 'note', 'patient');
-
-
-            $summaryHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/summary', $data)->render();
-
-            $wizardPowered = [
-                'intake_medications',
-                'plan_medications',
-                'intake_problems',
-                'plan_problems',
-                'intake_goals',
-                'plan_goals',
-                'intake_allergies',
-                'plan_allergies',
-                'intake_care_team',
-                'plan_care_team',
-                'intake_supplements',
-                'plan_supplements'
-            ];
-            if(!in_array($segmentTemplate->internal_name, $wizardPowered)) {
-                $editHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/edit', $data)->render();
-            }
+            $recalculatedHtml = $segment->getRecalculatedHtml($performer);
 
 
         } catch (\Throwable $e) {
         } catch (\Throwable $e) {
             return response()->json([
             return response()->json([
@@ -144,8 +119,8 @@ class NoteController extends Controller
 
 
         return response()->json([
         return response()->json([
             'success'=>true,
             'success'=>true,
-            'summaryHtml' => $summaryHtml,
-            'editHtml' => $editHtml
+            'summaryHtml' => $recalculatedHtml['summaryHtml'],
+            'editHtml' => $recalculatedHtml['editHtml'],
         ]);
         ]);
     }
     }
 
 

+ 71 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -2447,4 +2447,75 @@ ORDER BY c.name_last, c.name_first
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
         $patients = $patients->orderBy('created_at', 'DESC')->paginate(20);
         return view('app.admin.client-ccm-rm-status', compact('patients', 'filters'));
         return view('app.admin.client-ccm-rm-status', compact('patients', 'filters'));
     }
     }
+
+    public function rmActionReport(Request $request){
+
+        $filters = $request->all();
+    
+        $careMonthStartDate = $request->get('care_month_start_date');
+        
+        if(!$careMonthStartDate){
+            $careMonthStartDate = '2022-01-01';
+        }
+
+        $lastDateOfMonth = new DateTime(date("Y-m-t", strtotime(get_current_date())));
+        $today = new DateTime(get_current_date());
+        $diff = $lastDateOfMonth->diff($today);
+        $daysBetweenNowAndEndmonth = $diff->days;
+        $minRequiredMeasurements = 16 - $daysBetweenNowAndEndmonth -1;
+
+        $numOfMeasurements = $request->get('num_of_measurements'); //16_or_more, 12_or_more
+        $hasRecentVisit = $request->get('has_recent_visit'); //yes no
+        $hasBeenSpokenToThisMonth = $request->get('has_been_spoken_to'); //yes no 
+
+        $cmQuery = CareMonth::where('start_date', $careMonthStartDate);
+
+        //remove dummies
+        $cmQuery = $cmQuery->whereHas('client', function($clientQuery) {
+            return $clientQuery->where('client_engagement_status_category','<>', 'DUMMY')
+            ->orWhere('client_engagement_status_category', '=', null);
+        });
+
+        if($numOfMeasurements){
+            if($numOfMeasurements  == '16_or_more'){
+                $cmQuery = $cmQuery->where('number_of_days_with_remote_measurements', '>=', 16);
+            }
+            if($numOfMeasurements  == 'min_or_more'){
+                $cmQuery = $cmQuery->where('number_of_days_with_remote_measurements', '>=', $minRequiredMeasurements)
+                ->where('number_of_days_with_remote_measurements', '<', 16);
+            }
+
+            if($numOfMeasurements  == 'less_than_min'){
+                $cmQuery = $cmQuery->where('number_of_days_with_remote_measurements', '<', $minRequiredMeasurements);
+            }
+        }
+
+        if($hasRecentVisit){
+            if($hasRecentVisit == 'YES'){
+                $cmQuery = $cmQuery->whereHas('client', function($clientQuery) {
+                    return $clientQuery->whereRaw("most_recent_completed_mcp_note_date::DATE >= ((NOW() - interval '90 days')::DATE)");
+                });
+            }else{
+                $cmQuery = $cmQuery->whereHas('client', function($clientQuery) {
+                    return $clientQuery->whereRaw("most_recent_completed_mcp_note_date::DATE < ((NOW() - interval '90 days')::DATE)");
+                });
+            }
+        }
+
+        if($hasBeenSpokenToThisMonth){
+            if($hasBeenSpokenToThisMonth  == 'YES'){
+                $cmQuery = $cmQuery->where('has_anyone_interacted_with_client_about_rm_outside_note', '=', true);
+            }else{
+                $cmQuery = $cmQuery->where('has_anyone_interacted_with_client_about_rm_outside_note', '=', false);
+            }
+           
+        }
+
+        $rows = $cmQuery->paginate(50);
+
+        return view('app.practice-management.rm-action-report', compact('rows', 'filters', 'minRequiredMeasurements'));
+
+    }
+
+   
 }
 }

+ 90 - 0
app/Models/Pro.php

@@ -369,6 +369,96 @@ class Pro extends Model
             ->count();
             ->count();
     }
     }
 
 
+    function get_notes_pending_summary_suggestion_as_mcp_query(){
+        $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
+            return $sugQuery->where('status', '=', 'PENDING');
+        })->get();
+        $noteIDs = [];
+        foreach($segmentsWithProposedSummarySuggestion as $seg){
+            $noteIDs[] = $seg->note_id;
+        }
+        return Note::where('hcp_pro_id', $this->id)
+            ->where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->whereIn('id', $noteIDs);
+    }
+
+    function get_notes_rejected_summary_suggestion_as_mcp_query(){
+        $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
+            return $sugQuery->where('status', '=', 'REJECTED');
+        })->get();
+        $noteIDs = [];
+        foreach($segmentsWithProposedSummarySuggestion as $seg){
+            $noteIDs[] = $seg->note_id;
+        }
+        return Note::where('hcp_pro_id', $this->id)
+            ->where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->whereIn('id', $noteIDs);
+    }
+
+    function get_notes_pending_summary_suggestion_count_as_mcp(){
+        return $this->get_notes_pending_summary_suggestion_as_mcp_query()->count();
+    }
+
+    function get_notes_pending_summary_suggestion_as_mcp(){
+        return $this->get_notes_pending_summary_suggestion_as_mcp_query()->get();
+    }
+
+    function get_notes_rejected_summary_suggestion_count_as_mcp(){
+        return $this->get_notes_rejected_summary_suggestion_as_mcp_query()->count();
+    }
+
+    function get_notes_rejected_summary_suggestion_as_mcp(){
+        return $this->get_notes_rejected_summary_suggestion_as_mcp_query()->get();
+    }
+
+    function get_notes_pending_summary_suggestion_as_admin_query(){
+        $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
+            return $sugQuery->where('status', '=', 'PENDING');
+        })->get();
+        $noteIDs = [];
+        foreach($segmentsWithProposedSummarySuggestion as $seg){
+            $noteIDs[] = $seg->note_id;
+        }
+        return Note::where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->whereIn('id', $noteIDs);
+    }
+
+    function get_notes_rejected_summary_suggestion_as_admin_query(){
+        $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
+            return $sugQuery->where('status', '=', 'REJECTED');
+        })->get();
+        $noteIDs = [];
+        foreach($segmentsWithProposedSummarySuggestion as $seg){
+            $noteIDs[] = $seg->note_id;
+        }
+        return Note::where('is_cancelled', '<>', true)
+            ->where('is_core_note', '<>', true)
+            ->where('is_signed_by_hcp', true)
+            ->whereIn('id', $noteIDs);
+    }
+
+    function get_notes_pending_summary_suggestion_count_as_admin(){
+        return $this->get_notes_pending_summary_suggestion_as_admin_query()->count();
+    }
+
+    function get_notes_pending_summary_suggestion_as_admin(){
+        return $this->get_notes_pending_summary_suggestion_as_admin_query()->get();
+    }
+
+    function get_notes_rejected_summary_suggestion_count_as_admin(){
+        return $this->get_notes_rejected_summary_suggestion_as_admin_query()->count();
+    }
+
+    function get_notes_rejected_summary_suggestion_as_admin(){
+        return $this->get_notes_rejected_summary_suggestion_as_admin_query()->get();
+    }
+
     function get_notes_pending_billing_count_as_mcp() {
     function get_notes_pending_billing_count_as_mcp() {
         return Note::where('hcp_pro_id', $this->id)
         return Note::where('hcp_pro_id', $this->id)
             ->where('is_cancelled', '<>', true)
             ->where('is_cancelled', '<>', true)

+ 51 - 0
app/Models/Segment.php

@@ -23,4 +23,55 @@ class Segment extends Model
     public function shortName(){
     public function shortName(){
         return trim(array_reverse(explode('>', $this->display_title))[0]);
         return trim(array_reverse(explode('>', $this->display_title))[0]);
     }
     }
+
+    public function summarySuggestions()
+    {
+        return $this->hasMany(SegmentSummarySuggestion::class, 'segment_id', 'id')->orderBy('created_at', 'DESC');
+    }
+
+    public function proposedSegmentSummarySuggestion() {
+        return $this->hasOne(SegmentSummarySuggestion::class, 'id', 'proposed_segment_summary_suggestion_id');
+    }
+
+    public function acceptedSegmentSummarySuggestion() {
+        return $this->hasOne(SegmentSummarySuggestion::class, 'id', 'accepted_segment_summary_suggestion_id');
+    }
+
+    public function getRecalculatedHtml($performer){
+        $pro = $performer->pro;
+        $segment = $this; 
+        $segmentTemplate = $this->segmentTemplate;
+
+        $note = $this->note;
+        $patient = $note->client;
+
+        $data = compact('performer', 'pro', 'segment', 'segmentTemplate', 'note', 'patient');
+
+
+        $summaryHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/summary', $data)->render();
+
+        $wizardPowered = [
+            'intake_medications',
+            'plan_medications',
+            'intake_problems',
+            'plan_problems',
+            'intake_goals',
+            'plan_goals',
+            'intake_allergies',
+            'plan_allergies',
+            'intake_care_team',
+            'plan_care_team',
+            'intake_supplements',
+            'plan_supplements'
+        ];
+        if(!in_array($segmentTemplate->internal_name, $wizardPowered)) {
+            $editHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/edit', $data)->render();
+        }
+
+        return [
+            'summaryHtml'=> $summaryHtml ,
+            'editHtml' => $editHtml
+        ];
+    }
+
 }
 }

+ 13 - 0
app/Models/SegmentSummaryChange.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class SegmentSummaryChange extends Model
+{
+    protected $table = 'segment_summary_change';
+
+   
+
+}

+ 13 - 0
app/Models/SegmentSummarySuggestion.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class SegmentSummarySuggestion extends Model
+{
+    protected $table = 'segment_summary_suggestion';
+
+   
+
+}

+ 2 - 1
config/app.php

@@ -277,7 +277,8 @@ return [
         'exercise',
         'exercise',
         'behavior',
         'behavior',
         'goals',
         'goals',
-        'care_team'
+        'care_team',
+        'how_to_smbp'
     ]
     ]
 
 
 ];
 ];

+ 19 - 0
config/patient-intake-data.php

@@ -0,0 +1,19 @@
+<?php 
+
+return [
+    'height' => 'Height',
+    'weight' => 'Weight',
+    'last_vitamin_d' => 'Last Vitamin D',
+    'ethnicity' => 'Ethnicity',
+    'ethnicity_checkboxes' => [
+        'is_hispanic' => 'Hispanic',
+        'is_black_or_aa' => 'Black or African American',
+        'is_native_american' => 'Native American'
+    ],
+    'hypertension' => 'Hypertension',
+    'diabetes' => 'Diabetes',
+    'copd' => 'COPD',
+    'arthritis' => 'Arthritis',
+    'emailAddress' => 'Email Address',
+    'stickyNote' => 'Sticky Note'
+];

+ 38 - 0
public/css/style.css

@@ -2898,3 +2898,41 @@ body #vakata-dnd {
 body .vakata-context .vakata-context-separator>a {
 body .vakata-context .vakata-context-separator>a {
     margin: 0;
     margin: 0;
 }
 }
+
+.phq .btn-select {
+    padding: 5px 13px;
+    border-radius: 100%;
+}
+
+.phq .btn-blank {
+    opacity: .5;
+}
+
+.phq .btn-select:focus,
+.phq .btn-blank:focus {
+    box-shadow: none;
+}
+
+.phq .btn-select.active {
+    background-color: #28b4d9;
+    color: #fff;
+}
+
+.phq .plus {
+    position: relative;
+}
+
+.phq .plus::before {
+    content: '+';
+    position: absolute;
+    left: 0
+}
+
+.phq .table td,
+.phq .table th {
+    border-top-color: #000;
+}
+
+.phq .table thead th {
+    border-bottom: 0;
+}

+ 47 - 0
resources/views/app/admin/notes_pending_summary_suggestion.blade.php

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card border-top-0">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-sticky-note"></i>
+                Notes With Pending Summary Suggestion
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+            <table class="table table-sm border-top table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">ICD</th>
+                    <th class="border-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
+                                {{ friendlier_date($row->effective_dateest) }}
+                            </a>
+                        </td>
+                        <td>{{$row->client->displayName()}}</td>
+                        <td>
+                            @foreach($row->reasons as $reason)
+                                <span class="pr-2">{{$reason->code}}</span>
+                            @endforeach
+                            @if(!$row->reasons || !count($row->reasons))
+                                -
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->overallStatus()}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

+ 47 - 0
resources/views/app/admin/notes_rejected_summary_suggestion.blade.php

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card border-top-0">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-sticky-note"></i>
+                Notes With Pending Summary Suggestion
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+            <table class="table table-sm border-top table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">ICD</th>
+                    <th class="border-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
+                                {{ friendlier_date($row->effective_dateest) }}
+                            </a>
+                        </td>
+                        <td>{{$row->client->displayName()}}</td>
+                        <td>
+                            @foreach($row->reasons as $reason)
+                                <span class="pr-2">{{$reason->code}}</span>
+                            @endforeach
+                            @if(!$row->reasons || !count($row->reasons))
+                                -
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->overallStatus()}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

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

@@ -36,6 +36,7 @@
 
 
             @if($pro->pro_type == 'ADMIN')
             @if($pro->pro_type == 'ADMIN')
                 <th class="border-0">MCP</th>
                 <th class="border-0">MCP</th>
+                <th class="border-0">NA</th>
                 <th class="border-0">Initiative</th>
                 <th class="border-0">Initiative</th>
             @endif
             @endif
         </tr>
         </tr>
@@ -304,6 +305,7 @@
                 <td>{{$patient->getMcpAssignedOn()}}</td>
                 <td>{{$patient->getMcpAssignedOn()}}</td>
                 @if($pro->pro_type == 'ADMIN')
                 @if($pro->pro_type == 'ADMIN')
                     <td>{{@$patient->mcp ? $patient->mcp->displayName() : '--'}}</td>
                     <td>{{@$patient->mcp ? $patient->mcp->displayName() : '--'}}</td>
+                    <td>{{@$patient->defaultNaPro ? $patient->defaultNaPro->displayName() : '--'}}</td>
                     <td>{{$patient->initiative}}</td>
                     <td>{{$patient->initiative}}</td>
                 @endif
                 @endif
             </tr>
             </tr>

+ 32 - 1
resources/views/app/admin/patients_filters.blade.php

@@ -42,6 +42,19 @@
 		</div>
 		</div>
 	</div>
 	</div>
 
 
+	<div class="sm-section">
+		<div class="">
+			<label>NA:</label>
+			<select name="na" class="form-control min-width-unset" v-model="filters.na">
+				<option value="">--select--</option>
+				<?php $naPros = \App\Models\Pro::where('is_active', true)->where('is_considered_for_dna', true)->orderBy('name_display')->get(); ?>
+				@foreach($naPros as $naPro)
+					<option value="{{$naPro->uid}}">{{$naPro->name_display}}</option>
+				@endforeach
+			</select>
+		</div>
+	</div>
+
 	<!-- AGE	 -->
 	<!-- AGE	 -->
 	<div class="sm-section">
 	<div class="sm-section">
 		<div class="">
 		<div class="">
@@ -127,13 +140,14 @@
 			<label>Next Appt.:</label>
 			<label>Next Appt.:</label>
 			<select name="next_appointment_category" class="form-control input-sm" v-model="filters.next_appointment_category">
 			<select name="next_appointment_category" class="form-control input-sm" v-model="filters.next_appointment_category">
 				<option value="">All</option>
 				<option value="">All</option>
+				<option value="NONE">None</option>
 				<option value="EXACTLY">Exactly</option>
 				<option value="EXACTLY">Exactly</option>
 				<option value="LESS_THAN">Less Than</option>
 				<option value="LESS_THAN">Less Than</option>
 				<option value="GREATER_THAN">Greater Than</option>
 				<option value="GREATER_THAN">Greater Than</option>
 				<option value="BETWEEN">Between</option>
 				<option value="BETWEEN">Between</option>
 				<option value="NOT_BETWEEN">Not Between</option>
 				<option value="NOT_BETWEEN">Not Between</option>
 			</select>
 			</select>
-			<div v-show="filters.next_appointment_category" class="mt-2">
+			<div v-show="filters.next_appointment_category && filters.next_appointment_category !== 'NONE'" class="mt-2">
 				<div>
 				<div>
 					<input  name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="number" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appt.'" />
 					<input  name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="number" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appt.'" />
 				</div>
 				</div>
@@ -176,6 +190,23 @@
 	</div>
 	</div>
 	@endif
 	@endif
 
 
+	@if($performer->pro->pro_type == 'ADMIN')
+	<div class="sm-section">
+		<div class="">
+			<label>Chart # ends with:</label>
+			<select class="form-control"  name="chart_number_ends_with" v-model="filters.chart_number_ends_with">
+				@php 
+					$chartNumbers = [1,2,3,4,5,6,7,8,9]
+				@endphp
+				<option value="ZERO">0</option>
+				@foreach($chartNumbers as $chartNum)
+					<option value="{{$chartNum}}">{{$chartNum}}</option>
+				@endforeach
+			</select>
+		</div>
+	</div>
+	@endif
+
 	@if($performer->pro->pro_type == 'ADMIN')
 	@if($performer->pro->pro_type == 'ADMIN')
 	<div class="sm-section">
 	<div class="sm-section">
 		<div class="">
 		<div class="">

+ 2 - 2
resources/views/app/confirm_sms_auth_token.blade.php

@@ -8,12 +8,12 @@
     </div>
     </div>
     <div class="card-body bg-transparent">
     <div class="card-body bg-transparent">
         @if(session()->has('message'))
         @if(session()->has('message'))
-            <div class="alert alert-danger">
+            <div class="alert alert-info">
                 {{session('message')}}
                 {{session('message')}}
             </div>
             </div>
         @endif
         @endif
         <form action="/confirm_sms_auth_token" method="POST">
         <form action="/confirm_sms_auth_token" method="POST">
-            
+
             @csrf
             @csrf
             <div class="form-group">
             <div class="form-group">
                 <label for="" class="control-label mb-1 text-secondary">Cell Number *</label>
                 <label for="" class="control-label mb-1 text-secondary">Cell Number *</label>

+ 24 - 0
resources/views/app/dashboard-admin.blade.php

@@ -36,6 +36,30 @@
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_mcp()}}</th>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_signature_count_as_mcp()}}</th>
                                     <th class="pl-2">Notes Pending Signature</th>
                                     <th class="pl-2">Notes Pending Signature</th>
                                 </tr>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_notes_pending_summary_suggestion_count_as_admin()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('admin.notes_pending_summary_suggestion') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Notes With Pending Summary Suggestion">
+                                            Notes With Pending Summary Suggestion
+                                        </a>
+                                    </th>
+                                </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_notes_rejected_summary_suggestion_count_as_admin()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('admin.notes_rejected_summary_suggestion') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Notes With Rejected Summary Suggestion">
+                                            Notes With Rejected Summary Suggestion
+                                        </a>
+                                    </th>
+                                </tr>
                                 <tr>
                                 <tr>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
                                     <th class="pl-2">Notes Pending Billing</th>
                                     <th class="pl-2">Notes Pending Billing</th>

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

@@ -1,3 +1,4 @@
+
 @extends ('layouts.template')
 @extends ('layouts.template')
 
 
 @section('content')
 @section('content')
@@ -63,6 +64,30 @@
                                         </a>
                                         </a>
                                     </th>
                                     </th>
                                 </tr>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_notes_pending_summary_suggestion_count_as_mcp()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('mcp.notes_pending_summary_suggestion') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Notes With Pending Summary Suggestion">
+                                            Notes With Pending Summary Suggestion
+                                        </a>
+                                    </th>
+                                </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_notes_rejected_summary_suggestion_count_as_mcp()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('mcp.notes_rejected_summary_suggestion') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Notes With Rejected Summary Suggestion">
+                                            Notes With Rejected Summary Suggestion
+                                        </a>
+                                    </th>
+                                </tr>
                                 <tr>
                                 <tr>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
                                     <th class="px-2 text-center">{{$pro->get_notes_pending_billing_count_as_mcp()}}</th>
                                     <th class="pl-2">
                                     <th class="pl-2">

+ 1 - 1
resources/views/app/dna/appointments.blade.php

@@ -64,7 +64,7 @@
                         <td>{{ $appointment->pro->displayName() }}</td>
                         <td>{{ $appointment->pro->displayName() }}</td>
                         <td>
                         <td>
                             <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
                             <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
-                                {{friendlier_date_time($appointment->raw_date . ' ' . $appointment->raw_start_time)}}
+                                {{friendly_date($appointment->raw_date) . ' ' . friendly_time($appointment->raw_start_time)}}
                             </a>
                             </a>
                         </td>
                         </td>
                         <td class="px-2">
                         <td class="px-2">

+ 1 - 1
resources/views/app/login.blade.php

@@ -33,7 +33,7 @@
                     <div class="w-70">
                     <div class="w-70">
                       <div class="form-group">
                       <div class="form-group">
                         <label for="cell-number" class="">Cell Number</label>
                         <label for="cell-number" class="">Cell Number</label>
-                        <input type="text" id="cell-number" name="cell-number" class="form-control"
+                        <input type="tel" id="cell-number" name="cell-number" class="form-control"
                                stag-input-phone
                                stag-input-phone
                                value="{{old('cell-number')}}" required <?= old('cell-number') ? '' : 'autofocus' ?>>
                                value="{{old('cell-number')}}" required <?= old('cell-number') ? '' : 'autofocus' ?>>
                       </div>
                       </div>

+ 1 - 1
resources/views/app/mcp/appointments.blade.php

@@ -31,7 +31,7 @@
                     <tr>
                     <tr>
                         <td>
                         <td>
                             <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}">
                             <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}">
-                                {{friendlier_date_time($appointment->raw_date . ' ' . $appointment->raw_start_time)}}
+                                {{friendly_date($appointment->raw_date) . ' ' . friendly_time($appointment->raw_start_time)}}                            
                             </a>
                             </a>
                         </td>
                         </td>
                         <td>{{ $appointment->client->displayName() }}</pre>
                         <td>{{ $appointment->client->displayName() }}</pre>

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

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card border-top-0">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-sticky-note"></i>
+                Notes With Pending Summary Suggestion
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+            <table class="table table-sm border-top table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">ICD</th>
+                    <th class="border-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
+                                {{ friendlier_date($row->effective_dateest) }}
+                            </a>
+                        </td>
+                        <td>{{$row->client->displayName()}}</td>
+                        <td>
+                            @foreach($row->reasons as $reason)
+                                <span class="pr-2">{{$reason->code}}</span>
+                            @endforeach
+                            @if(!$row->reasons || !count($row->reasons))
+                                -
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->overallStatus()}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

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

@@ -0,0 +1,47 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card border-top-0">
+
+        <div class="card-header px-2 py-1 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-sticky-note"></i>
+                Notes With Pending Summary Suggestion
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+            <table class="table table-sm border-top table-striped mb-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Date</th>
+                    <th class="border-0">Patient</th>
+                    <th class="border-0">ICD</th>
+                    <th class="border-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>
+                            <a native target="_blank" href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->uid }}?suggestion_mode=on">
+                                {{ friendlier_date($row->effective_dateest) }}
+                            </a>
+                        </td>
+                        <td>{{$row->client->displayName()}}</td>
+                        <td>
+                            @foreach($row->reasons as $reason)
+                                <span class="pr-2">{{$reason->code}}</span>
+                            @endforeach
+                            @if(!$row->reasons || !count($row->reasons))
+                                -
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->overallStatus()}}
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

+ 3 - 0
resources/views/app/new-patient.blade.php

@@ -14,6 +14,9 @@ $medicaidStates = Config::get('constants.medicaid_states');
 	.form-control:focus {
 	.form-control:focus {
 		color: rgb(0, 54, 175);
 		color: rgb(0, 54, 175);
 	}
 	}
+	#newPatientContainer label {
+		font-size: 11px;
+	}
 </style>
 </style>
 
 
 <div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>
 <div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>

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

@@ -84,7 +84,7 @@
                     <tr>
                     <tr>
                         <td>
                         <td>
                             <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
                             <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
-                                {{friendlier_date_time($appointment->raw_date . ' ' . $appointment->raw_start_time)}}
+                                {{friendly_date($appointment->raw_date) . ' ' . friendly_time($appointment->raw_start_time)}}
                             </a>
                             </a>
                         </td>
                         </td>
                         <td>{{ $appointment->pro->displayName() }}</pre></td>
                         <td>{{ $appointment->pro->displayName() }}</pre></td>

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

@@ -39,7 +39,7 @@
                     <tr>
                     <tr>
                         <td>
                         <td>
                             <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
                             <a href="/patients/view/{{$patient->uid}}/calendar/{{$appointment->uid}}" class="text-nowrap">
-                                {{friendlier_date_time($appointment->raw_date . ' ' . $appointment->raw_start_time)}} <span class="text-sm">{{friendly_timezone($appointment->timezone)}}</span>
+                                {{$appointment->raw_date . ' ' . $appointment->raw_start_time}} <span class="text-sm">{{friendly_timezone($appointment->timezone)}}</span>
                             </a>
                             </a>
                         </td>
                         </td>
                         <td>{{ $appointment->pro->displayName() }}</pre></td>
                         <td>{{ $appointment->pro->displayName() }}</pre></td>

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

@@ -120,7 +120,7 @@
                 <tr>
                 <tr>
                     <td>
                     <td>
                         <a href="/patients/view/{{ $patient->uid }}/care-months/view/{{ $careMonth->uid }}">
                         <a href="/patients/view/{{ $patient->uid }}/care-months/view/{{ $careMonth->uid }}">
-                            {{friendly_month($careMonth->start_date)}}
+                            {{friendly_date($careMonth->start_date)}}
                         </a>
                         </a>
                     </td>
                     </td>
                     <td>{{time_in_hrminsec($careMonth->rm_total_time_in_seconds)}}</td>
                     <td>{{time_in_hrminsec($careMonth->rm_total_time_in_seconds)}}</td>

+ 24 - 24
resources/views/app/patient/create-patient/demographics-form.blade.php

@@ -14,16 +14,16 @@
 	</div>
 	</div>
 	<div class="col-md-12">
 	<div class="col-md-12">
 		<div class="row form-group align-items-center">			
 		<div class="row form-group align-items-center">			
-				<label class="col-md-3 font-weight-bold m-0">Email:</label>
-			<div class="col-md-9">	
+				<label class="col col-label font-weight-bold m-0">Email:</label>
+			<div class="col-md-10">	
 				<input class='form-control' type='email' placeholder="Email Address" name='emailAddress'>
 				<input class='form-control' type='email' placeholder="Email Address" name='emailAddress'>
 			</div>
 			</div>
 		</div>
 		</div>
 	</div>
 	</div>
 	<div class="col-md-12">
 	<div class="col-md-12">
 		<div class="row form-group align-items-center">			
 		<div class="row form-group align-items-center">			
-				<label class="col-md-3 font-weight-bold m-0">Gender:</label>
-				<div class="col-md-9">
+				<label class="col-md-2 pr-0 font-weight-bold m-0">Gender:</label>
+				<div class="col-md-10">
 					<select class="form-control input-sm" name="patientSex" select2>
 					<select class="form-control input-sm" name="patientSex" select2>
 						<option value="">--</option>
 						<option value="">--</option>
 						<option value="M">Male</option>
 						<option value="M">Male</option>
@@ -36,18 +36,18 @@
 </div>
 </div>
 <div class="row">
 <div class="row">
 	<div class="col-12">
 	<div class="col-12">
-		<div class="row form-group">
-			<label class="col-md-3 font-weight-bold m-0">DOB: <span class="text-danger">*</span></label>
-			<div class="col-md-9">	
+		<div class="row align-items-center form-group">
+			<label class="col-md-2 pr-0 font-weight-bold m-0">DOB: <span class="text-danger">*</span></label>
+			<div class="col-md-10">	
 				<input type="date" required name="patientDob" value="" class="form-control input-sm">
 				<input type="date" required name="patientDob" value="" class="form-control input-sm">
 			</div>
 			</div>
 		</div>
 		</div>
 	</div>
 	</div>
 
 
 	<div class="col-12">
 	<div class="col-12">
-		<div class="row form-group">			
-			<label class="col-md-3 font-weight-bold m-0">Service:</label>
-			<div class="col-md-9">	
+		<div class="row align-items-center form-group">			
+			<label class="col-md-2 pr-0 font-weight-bold m-0">Service:</label>
+			<div class="col-md-10">	
 				<input type="date" name="dateOfService" value="{{date('Y-m-d')}}" class="form-control input-sm">
 				<input type="date" name="dateOfService" value="{{date('Y-m-d')}}" class="form-control input-sm">
 			</div>
 			</div>
 		</div>
 		</div>
@@ -59,9 +59,9 @@
 @if($pro->pro_type === 'ADMIN')
 @if($pro->pro_type === 'ADMIN')
 <div class="row">
 <div class="row">
 	<div class="col-12">
 	<div class="col-12">
-		<div class="row form-group">			
-			<label class="col-md-3 font-weight-bold m-0">HCP Pro:</label>
-			<div class="col-md-9">	
+		<div class="row align-items-center form-group">			
+			<label class="col-md-2 pr-0 font-weight-bold m-0">HCP Pro:</label>
+			<div class="col-md-10">	
 				<select name="hcpProUid" class="form-control input-sm" provider-search provider-type="hcp">
 				<select name="hcpProUid" class="form-control input-sm" provider-search provider-type="hcp">
 					<option value="">--select--</option>
 					<option value="">--select--</option>
 				</select>
 				</select>
@@ -69,9 +69,9 @@
 		</div>
 		</div>
 	</div>
 	</div>
 	<div class="col-12">
 	<div class="col-12">
-		<div class="row form-group">		
-			<label class='col-md-3 font-weight-bold m-0'>Coordinator:</label>
-			<div class="col-md-9">
+		<div class="row align-items-center form-group">		
+			<label class='col-md-2 pr-0 font-weight-bold m-0' style="font-size:10px !important;">Coordinator:</label>
+			<div class="col-md-10">
 				<select name="assistantProUid" class="form-control input-sm" provider-search provider-type="default-na">
 				<select name="assistantProUid" class="form-control input-sm" provider-search provider-type="default-na">
 					<option value="">--select--</option>
 					<option value="">--select--</option>
 				</select>
 				</select>
@@ -83,8 +83,8 @@
 <div class="row">
 <div class="row">
 	<div class="col-md-12">
 	<div class="col-md-12">
 		<div class='row form-group'>			
 		<div class='row form-group'>			
-				<label class="col-md-3 font-weight-bold m-0">HCP Pro:</label>
-			<div class="col-md-9">	
+				<label class="col-md-2 pr-0 font-weight-bold m-0">HCP Pro:</label>
+			<div class="col-md-10">	
 				<input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
 				<input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
 				<input type="hidden" name="hcpProUid" value="{{$pro->uid}}">
 				<input type="hidden" name="hcpProUid" value="{{$pro->uid}}">
 			</div>
 			</div>
@@ -94,9 +94,9 @@
 @elseif($pro->isDefaultNA())
 @elseif($pro->isDefaultNA())
 <div class="row">
 <div class="row">
 	<div class="col-12">
 	<div class="col-12">
-		<div class="row form-group">			
-				<label class="col-md-3 font-weight-bold m-0">HCP Pro:</label>
-				<div class="col-md-9">
+		<div class="row align-items-center form-group">			
+				<label class="col-md-2 pr-0 font-weight-bold m-0">HCP Pro:</label>
+				<div class="col-md-10">
 				<?php $teams = $pro->teamsWhereAssistant; ?>
 				<?php $teams = $pro->teamsWhereAssistant; ?>
 				<select name="hcpProUid" class="form-control">
 				<select name="hcpProUid" class="form-control">
 					@if(count($teams) > 1)
 					@if(count($teams) > 1)
@@ -111,9 +111,9 @@
 	</div>
 	</div>
 
 
 	<div class="col-12">
 	<div class="col-12">
-		<div class="row form-group">			
-			<label class='col-md-3 font-weight-bold m-0'>Coordinator:</label>
-			<div class="col-md-9">	
+		<div class="row align-items-center form-group">			
+			<label class='col-md-2 pr-0 font-weight-bold m-0'>Coordinator:</label>
+			<div class="col-md-10">	
 				<input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
 				<input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
 				<input type="hidden" name="assistantProUid" value="{{$pro->uid}}">
 				<input type="hidden" name="assistantProUid" value="{{$pro->uid}}">
 			</div>
 			</div>

+ 2 - 2
resources/views/app/patient/create-patient/insurance-coverage-form.blade.php

@@ -128,8 +128,8 @@
 			</div>
 			</div>
 			<div class="col-12">
 			<div class="col-12">
 				<div class="form-group col-md-6">
 				<div class="form-group col-md-6">
-					<label class="control-label">Medicare Number <span class="text-danger">*</span> </label>
-					<input type="text" name="mcrNumber" class="form-control input-sm" required oninput="this.value = this.value.toUpperCase()">
+					<label class="control-label">Medicare Number </label>
+					<input type="text" name="mcrNumber" class="form-control input-sm" oninput="this.value = this.value.toUpperCase()">
 				</div>
 				</div>
 			</div>
 			</div>
 
 

+ 1 - 6
resources/views/app/patient/intake-data/grid-patient-intake-data-display.blade.php

@@ -3,11 +3,6 @@
 		<tr>
 		<tr>
 		<th colspan="2">Patient Intake Data</th>
 		<th colspan="2">Patient Intake Data</th>
 		</tr>
 		</tr>
-		@foreach($intakeDataFields as $key=>$label)
-		<tr>
-			<td>{{ $label }}</td>
-			<td>{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}</td>
-		</tr>
-		@endforeach
+		@include('app.patient.intake-data.intake-data-display')
 	</table>
 	</table>
 </div>
 </div>

+ 29 - 37
resources/views/app/patient/intake-data/grid-patient-intake-data-form.blade.php

@@ -1,19 +1,10 @@
 <?php
 <?php
-	$intakeDataFields = [
-		'height' => 'Height',
-		'weight' => 'Weight',
-		'last_vitamin_d' => 'Last Vitamin D',
-		'ethnicity' => 'Ethnicity',
-		'hypertension' => 'Hypertension',
-		'diabetes' => 'Diabetes',
-		'copd' => 'COPD',
-		'arthritis' => 'Arthritis',
-	];
-	$patientCanvasData = json_decode($patient->canvas_data ?? null);
-	$patientIntakeData = null;
-	if($patientCanvasData && @$patientCanvasData->INTAKE_DATA){
-		$patientIntakeData = @$patientCanvasData->INTAKE_DATA;
-	}
+$intakeDataFields = config('patient-intake-data');
+$patientCanvasData = json_decode($patient->canvas_data ?? null);
+$patientIntakeData = null;
+if ($patientCanvasData && @$patientCanvasData->INTAKE_DATA) {
+	$patientIntakeData = @$patientCanvasData->INTAKE_DATA;
+}
 ?>
 ?>
 
 
 <div id="grid-patient-intake-data-form" visit-moe moe relative wide class="ml-2 hide-inside-popup">
 <div id="grid-patient-intake-data-form" visit-moe moe relative wide class="ml-2 hide-inside-popup">
@@ -26,15 +17,7 @@
 			<input type="hidden" name="uid" value="{{$patient->uid}}">
 			<input type="hidden" name="uid" value="{{$patient->uid}}">
 			<input type="hidden" name="key" value="INTAKE_DATA">
 			<input type="hidden" name="key" value="INTAKE_DATA">
 			<input type="hidden" name="data">
 			<input type="hidden" name="data">
-			<div class="row">
-				@foreach($intakeDataFields as $key=>$label)
-				<div class="col-md-6 mb-2">
-					<label class="text-secondary text-sm font-weight-bold">{{ $label }}</label>
-					<input name="{{$key}}" class="form-control" value="{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}" />
-				</div>
-				@endforeach
-			</div>
-
+			@include('app.patient.intake-data.intake-data-form-fields')
 			<div class="mb-2">
 			<div class="mb-2">
 				<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
 				<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
 				<button cancel class="btn btn-sm btn-default border">
 				<button cancel class="btn btn-sm btn-default border">
@@ -48,47 +31,56 @@
 <script>
 <script>
 	(function() {
 	(function() {
 		function init() {
 		function init() {
-			(function($){
+			(function($) {
 				var patientDataIntake = {
 				var patientDataIntake = {
 					form: null,
 					form: null,
-					data:{},
+					data: {},
 					showForm: false,
 					showForm: false,
 					patientIntakeData: <?= json_encode($patientIntakeData) ?>,
 					patientIntakeData: <?= json_encode($patientIntakeData) ?>,
-					initOnInputChange: function(){
+					initOnInputChange: function() {
 						var self = this;
 						var self = this;
-						self.form.find('input').change(function(evt){
+						self.form.find('input, textarea').change(function(evt) {
 							var input = evt.target;
 							var input = evt.target;
 							var name = input.name;
 							var name = input.name;
 							var value = input.value;
 							var value = input.value;
-							self.data[name] = value;
+							if($(input).is(':checkbox')){
+								var isChecked =input.checked ? true:false;
+								if(isChecked){
+									self.data[name] = value;
+								}else{
+									delete self.data[name];
+								}
+							}else{
+								self.data[name] = value;	
+							}
 							self.updateJsonStringValue();
 							self.updateJsonStringValue();
 						});
 						});
 					},
 					},
-					updateJsonStringValue: function(){
+					updateJsonStringValue: function() {
 						var self = this;
 						var self = this;
 						self.form.find('input[name=data]').val(JSON.stringify(self.data));
 						self.form.find('input[name=data]').val(JSON.stringify(self.data));
 					},
 					},
-					toggleForm: function(){
+					toggleForm: function() {
 						var target = $('#gridPatientIntakeFormSection');
 						var target = $('#gridPatientIntakeFormSection');
 						var table = $('#gridPatientIntakeDataDisplay');
 						var table = $('#gridPatientIntakeDataDisplay');
-						if(this.showForm){
+						if (this.showForm) {
 							target.removeClass('d-none');
 							target.removeClass('d-none');
 							table.addClass('d-none');
 							table.addClass('d-none');
-						}else{
+						} else {
 							target.addClass('d-none');
 							target.addClass('d-none');
 							table.removeClass('d-none');
 							table.removeClass('d-none');
 						}
 						}
 					},
 					},
-					setDefaultData: function(){
+					setDefaultData: function() {
 						var self = this;
 						var self = this;
-						if(!this.patientIntakeData) return;
-						for(var f in this.patientIntakeData){
+						if (!this.patientIntakeData) return;
+						for (var f in this.patientIntakeData) {
 							var value = this.patientIntakeData[f];
 							var value = this.patientIntakeData[f];
 							self.data[f] = value;
 							self.data[f] = value;
 						}
 						}
 						self.updateJsonStringValue();
 						self.updateJsonStringValue();
 					},
 					},
-					init: function(){
+					init: function() {
 						this.form = $('#gridPatientIntakeDataForm');
 						this.form = $('#gridPatientIntakeDataForm');
 						this.initOnInputChange();
 						this.initOnInputChange();
 						this.setDefaultData();
 						this.setDefaultData();

+ 15 - 0
resources/views/app/patient/intake-data/intake-data-display.blade.php

@@ -0,0 +1,15 @@
+@foreach($intakeDataFields as $key=>$label)
+	@if($key == 'ethnicity_checkboxes')
+		@foreach($label as $eKey => $eLabel)
+		<tr>
+			<td>{{ $eLabel }}</td>
+			<td>{{ $patientIntakeData ? @$patientIntakeData->{$eKey}:'' }}</td>
+		</tr>
+		@endforeach
+	@else
+	<tr>
+		<td>{{ $label }}</td>
+		<td>{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}</td>
+	</tr>
+	@endif
+@endforeach

+ 31 - 0
resources/views/app/patient/intake-data/intake-data-form-fields.blade.php

@@ -0,0 +1,31 @@
+<div class="row">
+	@foreach($intakeDataFields as $key=>$label)
+	@if($key == 'stickyNote')
+	<div class="col-md-12 mb-2">
+		<label class="text-secondary text-sm font-weight-bold">{{ $label }}</label>
+		<textarea name="{{$key}}" class="form-control">{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}</textarea>
+	</div>
+	@elseif($key == 'emailAddress')
+	<div class="col-md-12 mb-2">
+		<label class="text-secondary text-sm font-weight-bold">{{ $label }}</label>
+		<input name="{{$key}}" class="form-control" value="{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}" />
+	</div>
+	@elseif($key == 'ethnicity_checkboxes')
+	<div class="col-md-12 mt-2 mb-2">
+		@foreach($label as $eKey => $eLabel)
+		<div class="form-check form-check-inline">
+			<label class="form-check-label">
+				<input name="{{$eKey}}" class="form-check-input" type="checkbox" value="YES" <?= $patientIntakeData && @$patientIntakeData->{$eKey} === 'YES' ? 'checked':'' ?> />
+				{{$eLabel}}
+			</label>
+		</div>
+		@endforeach
+	</div>
+	@else
+	<div class="col-md-6 mb-2">
+		<label class="text-secondary text-sm font-weight-bold">{{ $label }}</label>
+		<input name="{{$key}}" class="form-control" value="{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}" />
+	</div>
+	@endif
+	@endforeach
+</div>

+ 1 - 10
resources/views/app/patient/intake-data/intake-data.blade.php

@@ -1,14 +1,5 @@
 <?php
 <?php
-	$intakeDataFields = [
-		'height' => 'Height',
-		'weight' => 'Weight',
-		'last_vitamin_d' => 'Last Vitamin D',
-		'ethnicity' => 'Ethnicity',
-		'hypertension' => 'Hypertension',
-		'diabetes' => 'Diabetes',
-		'copd' => 'COPD',
-		'arthritis' => 'Arthritis',
-	];
+	$intakeDataFields = config('patient-intake-data');
 	$patientCanvasData = json_decode($patient->canvas_data ?? null);
 	$patientCanvasData = json_decode($patient->canvas_data ?? null);
 	$patientIntakeData = null;
 	$patientIntakeData = null;
 	if($patientCanvasData && @$patientCanvasData->INTAKE_DATA){
 	if($patientCanvasData && @$patientCanvasData->INTAKE_DATA){

+ 1 - 6
resources/views/app/patient/intake-data/patient-intake-data-display.blade.php

@@ -3,11 +3,6 @@
 		<tr>
 		<tr>
 		<th colspan="2">Patient Intake Data</th>
 		<th colspan="2">Patient Intake Data</th>
 		</tr>
 		</tr>
-		@foreach($intakeDataFields as $key=>$label)
-		<tr>
-			<td>{{ $label }}</td>
-			<td>{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}</td>
-		</tr>
-		@endforeach
+		@include('app.patient.intake-data.intake-data-display')
 	</table>
 	</table>
 </div>
 </div>

+ 14 - 22
resources/views/app/patient/intake-data/patient-intake-data-form.blade.php

@@ -1,14 +1,5 @@
 <?php
 <?php
-	$intakeDataFields = [
-		'height' => 'Height',
-		'weight' => 'Weight',
-		'last_vitamin_d' => 'Last Vitamin D',
-		'ethnicity' => 'Ethnicity',
-		'hypertension' => 'Hypertension',
-		'diabetes' => 'Diabetes',
-		'copd' => 'COPD',
-		'arthritis' => 'Arthritis',
-	];
+	$intakeDataFields = config('patient-intake-data');
 	$patientCanvasData = json_decode($patient->canvas_data ?? null);
 	$patientCanvasData = json_decode($patient->canvas_data ?? null);
 	$patientIntakeData = null;
 	$patientIntakeData = null;
 	if($patientCanvasData && @$patientCanvasData->INTAKE_DATA){
 	if($patientCanvasData && @$patientCanvasData->INTAKE_DATA){
@@ -36,15 +27,7 @@
 			<input type="hidden" name="uid" value="{{$patient->uid}}">
 			<input type="hidden" name="uid" value="{{$patient->uid}}">
 			<input type="hidden" name="key" value="INTAKE_DATA">
 			<input type="hidden" name="key" value="INTAKE_DATA">
 			<input type="hidden" name="data">
 			<input type="hidden" name="data">
-			<div class="row">
-				@foreach($intakeDataFields as $key=>$label)
-				<div class="col-md-6 mb-2">
-					<label class="text-secondary text-sm font-weight-bold">{{ $label }}</label>
-					<input name="{{$key}}" class="form-control" value="{{ $patientIntakeData ? @$patientIntakeData->{$key}:'' }}" />
-				</div>
-				@endforeach
-			</div>
-
+				@include('app.patient.intake-data.intake-data-form-fields')
 			<div class="mb-2">
 			<div class="mb-2">
 				<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
 				<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
 				<button cancel class="btn btn-sm btn-default border">
 				<button cancel class="btn btn-sm btn-default border">
@@ -66,11 +49,21 @@
 					patientIntakeData: <?= json_encode($patientIntakeData) ?>,
 					patientIntakeData: <?= json_encode($patientIntakeData) ?>,
 					initOnInputChange: function(){
 					initOnInputChange: function(){
 						var self = this;
 						var self = this;
-						self.form.find('input').change(function(evt){
+						self.form.find('input, textarea').change(function(evt){
 							var input = evt.target;
 							var input = evt.target;
 							var name = input.name;
 							var name = input.name;
 							var value = input.value;
 							var value = input.value;
-							self.data[name] = value;
+							if($(input).is(':checkbox')){
+								var isChecked =input.checked ? true:false;
+								if(isChecked){
+									self.data[name] = value;
+								}else{
+									delete self.data[name];
+								}
+							}else{
+								self.data[name] = value;	
+							}
+							
 							self.updateJsonStringValue();
 							self.updateJsonStringValue();
 						});
 						});
 					},
 					},
@@ -110,7 +103,6 @@
 						for(var f in this.patientIntakeData){
 						for(var f in this.patientIntakeData){
 							var value = this.patientIntakeData[f];
 							var value = this.patientIntakeData[f];
 							self.data[f] = value;
 							self.data[f] = value;
-							console.log({f});
 						}
 						}
 						self.updateJsonStringValue();
 						self.updateJsonStringValue();
 					},
 					},

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

@@ -9,7 +9,7 @@
                 <input type="hidden" name="noteUid" value="{{$note->uid}}">
                 <input type="hidden" name="noteUid" value="{{$note->uid}}">
                 <div class="mb-2">
                 <div class="mb-2">
                     <label for="" class="text-secondary text-sm">Effective Date</label>
                     <label for="" class="text-secondary text-sm">Effective Date</label>
-                    <input type="date" name="effectiveDate" class="form-control form-control-sm" value="{{$note->effective_dateest ? $note->effective_dateest : date('Y-m-d')}}" required>
+                    <input type="date" name="effectiveDate" class="form-control form-control-sm" value="{{$note->effective_dateest ? $note->effective_dateest : get_current_date($pro->display_timezone)}}" required>
                 </div>
                 </div>
                 <div class="mb-2">
                 <div class="mb-2">
                     @if($noteRates && count($noteRates))
                     @if($noteRates && count($noteRates))

+ 20 - 0
resources/views/app/patient/note/dashboard.blade.php

@@ -355,6 +355,26 @@
             </div>
             </div>
             @endif
             @endif
 
 
+
+            @if($note->is_signed_by_hcp)
+                @php 
+                    $suggestionMode = request()->get('suggestion_mode');
+                @endphp 
+                @if($suggestionMode == 'on')
+                    <a class="ml-3 native font-weight-normal refresh-segment c-pointer screen-only"
+                        href="/patients/view/{{$note->client->uid}}/notes/view/{{$note->uid}}?suggestion_mode=off"
+                        title="Update with latest patient data">
+                        Toggle Suggestion Mode Off
+                    </a>
+                @else 
+                    <a class="ml-3 native font-weight-normal refresh-segment c-pointer screen-only"
+                        href="/patients/view/{{$note->client->uid}}/notes/view/{{$note->uid}}?suggestion_mode=on"
+                        title="Update with latest patient data">
+                        Turn Suggestion Mode On
+                    </a>
+                @endif
+            @endif
+
             <div class="ml-auto d-flex align-items-start">
             <div class="ml-auto d-flex align-items-start">
                 <div class="">
                 <div class="">
                     <div>
                     <div>

+ 10 - 1
resources/views/app/patient/note/note-segment-list-rhs.blade.php

@@ -3,6 +3,9 @@
     $previousHeading = null;
     $previousHeading = null;
     $previousSubHeading = null;
     $previousSubHeading = null;
 	$rhsSegments = config('app.note_rhs_segments');
 	$rhsSegments = config('app.note_rhs_segments');
+
+    $suggestionModeOn = request()->get('suggestion_mode') == 'on' && $note->is_signed_by_hcp 
+
     ?>
     ?>
     @foreach($rhsSegments as $segmentIName)
     @foreach($rhsSegments as $segmentIName)
 		<?php $segment = $note->getSegmentByInternalName($segmentIName); ?>
 		<?php $segment = $note->getSegmentByInternalName($segmentIName); ?>
@@ -25,7 +28,13 @@
 			$previousHeading = $segment->heading;
 			$previousHeading = $segment->heading;
 		}
 		}
 		?>
 		?>
-        <div>@include('app.patient.note.segment')</div>
+        <div>
+			@if($suggestionModeOn)
+				@include('app.patient.note.segment.suggestions_and_updates')
+			@else 
+				@include('app.patient.note.segment')
+			@endif
+		</div>
         @endif
         @endif
     @endforeach
     @endforeach
     <?php
     <?php

+ 13 - 2
resources/views/app/patient/note/note-segment-list.blade.php

@@ -1,3 +1,6 @@
+<?php  
+    $suggestionModeOn = request()->get('suggestion_mode') == 'on' && $note->is_signed_by_hcp 
+?> 
 <div class="segments-list" id="note-segments-list">
 <div class="segments-list" id="note-segments-list">
     <?php
     <?php
     $previousHeading = null;
     $previousHeading = null;
@@ -25,12 +28,20 @@
         ?>
         ?>
 		@if($note->visitTemplate->internal_name !== 'soap_visit')
 		@if($note->visitTemplate->internal_name !== 'soap_visit')
 			<div class="{{$segment->segmentTemplate->internal_name === 'medrisk_vigilence' ? 'd-none' : ''}}">
 			<div class="{{$segment->segmentTemplate->internal_name === 'medrisk_vigilence' ? 'd-none' : ''}}">
-				@include('app.patient.note.segment')
+                @if($suggestionModeOn)
+                    @include('app.patient.note.segment.suggestions_and_updates')
+                @else 
+                    @include('app.patient.note.segment')
+                @endif
 			</div>
 			</div>
 		@else
 		@else
 			@if(in_array($segment->segmentTemplate->internal_name, config('app.note_lhs_segments')))
 			@if(in_array($segment->segmentTemplate->internal_name, config('app.note_lhs_segments')))
 				<div>
 				<div>
-					@include('app.patient.note.segment')
+                    @if($suggestionModeOn)
+                        @include('app.patient.note.segment.suggestions_and_updates')
+                    @else 
+                        @include('app.patient.note.segment')
+                    @endif
 				</div>
 				</div>
 			@endif
 			@endif
 		@endif
 		@endif

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

@@ -62,6 +62,7 @@
                 <i class="fa fa-sync"></i>
                 <i class="fa fa-sync"></i>
             </a>
             </a>
 
 
+           
             <!-- if intake - link to plan segment-->
             <!-- if intake - link to plan segment-->
             <?php
             <?php
             $isIntake = strpos($iName, 'intake_') === 0;
             $isIntake = strpos($iName, 'intake_') === 0;
@@ -101,9 +102,14 @@
     <?php if(!$isLSSegment): ?>
     <?php if(!$isLSSegment): ?>
 
 
     <div class="d-none if-not-edit inset-comment summary-container {{$iName === 'medrisk_vigilence' ? 'px-0' : 'p-2 pl-4'}}">
     <div class="d-none if-not-edit inset-comment summary-container {{$iName === 'medrisk_vigilence' ? 'px-0' : 'p-2 pl-4'}}">
-        {!! $segment->summary_html !!}
+        @if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html)
+            {!! $segment->accepted_suggestion_summary_html !!}
+        @else 
+            {!! $segment->summary_html !!}
+        @endif 
     </div>
     </div>
 
 
+
     <?php
     <?php
     $wizardPowered = [
     $wizardPowered = [
         'intake_medications',
         'intake_medications',

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

@@ -0,0 +1,119 @@
+
+<?php $iName = $segment->segmentTemplate->internal_name; ?>
+<?php $isLSSegment = strpos($iName, 'lifestyle_') === 0; ?>
+<div class="ml-2">
+    @if($iName === 'medrisk_vigilence')
+        <div class="font-weight-bold text-center flex-grow-1">
+            <div class="on-hover-hide font-weight-normal text-info font-weight-bold text-center pt-2 font-size-11">MRV</div>
+            <span class="on-hover-only text-left">MedRisk Vigilence</span>
+        </div>
+    @else
+        <span class="font-weight-bold d-flex align-items-center {{$isLSSegment || $iName === 'medrisk_vigilence' ? '' : 'xxxmb-2'}}" style="">
+            <span style="color: black; text-decoration: underline; font-size: 13px;">
+    @if($isLSSegment && $iName === 'lifestyle_general')
+                Lifestyle
+            @else
+                {{$segment->display_title}}
+            @endif
+    </span>
+            @if($segment->heading && $iName !== 'medrisk_vigilence')
+                <span class="text-secondary ml-2 text-sm font-weight-normal">({{$segment->heading}})</span>
+            @endif
+        </span>
+    @endif
+
+    @if($isLSSegment)
+        @if($iName === 'lifestyle_general')
+            <a href="#" class="ls-segment-trigger ml-2" data-target="lifestyle_general">General</a>
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a href="#" class="ls-segment-trigger" data-target="lifestyle_nutrition">Nutrition</a>
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a href="#" class="ls-segment-trigger" data-target="lifestyle_physical_activity">Physical Act.</a>
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a href="#" class="ls-segment-trigger" data-target="lifestyle_sleep">Sleep</a>
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a href="#" class="ls-segment-trigger" data-target="lifestyle_social">Social Relns.</a>
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a href="#" class="ls-segment-trigger" data-target="lifestyle_substances">Subst. Use</a>
+            <span class="mx-2 text-secondary text-sm">|</span>
+            <a href="#" class="ls-segment-trigger" data-target="lifestyle_stress">Stress</a>
+        @else
+            <span class="text-info ml-auto font-weight-normal">(click to view)</span>
+        @endif
+    @endif
+</div>
+@if($segment->proposedSegmentSummarySuggestion && ($segment->proposedSegmentSummarySuggestion->status == 'PENDING' || $segment->proposedSegmentSummarySuggestion->status == 'REJECTED') )
+    <div class=" m-2 p-2">
+        {!! $segment->proposedSegmentSummarySuggestion->summary_html !!}
+        @if($segment->proposedSegmentSummarySuggestion->status == 'REJECTED')
+        <div class="alert alert-info">Your suggestion has been rejected.</div>
+        @endif
+        <div class="d-flex">
+            @if(($note->hcp_pro_id == $performer->pro_id ) && $segment->proposedSegmentSummarySuggestion->status == 'PENDING')
+            <div class="d-block mt-1 mr-2" moe>
+                <form url="/api/segment/acceptProposedSegmentSummarySuggestion" show>
+                    <input type="hidden" name="uid" value="{{$segment->uid}}">
+                    <div class="mb-0">
+                        <button class="btn btn-primary btn-sm" submit>Accept</button>
+                    </div>
+                </form>
+            </div>
+            <div class="d-block mt-1  mr-2" moe>
+                <form url="/api/segment/rejectProposedSegmentSummarySuggestion" show>
+                    <input type="hidden" name="uid" value="{{$segment->uid}}">
+                    <div class="mb-0">
+                        <button class="btn btn-primary btn-sm" submit>Reject</button>
+                    </div>
+                </form>
+            </div>
+            @endif
+
+            <div class="d-block mt-1 mr-2" moe>
+                <a class="btn btn-outline-primary btn-sm " start>Override proposed suggestion</a>
+                <form url="/api/segment/overrideProposedSegmentSummarySuggestion">
+                    <input type="hidden" name="uid" value="{{$segment->uid}}">
+                    <textarea name="proposedSuggestedSummaryHtml" class="form-control" rte>{!! $segment->proposedSegmentSummarySuggestion->summary_html !!}</textarea>
+                    <div class="mb-0">
+                        <button class="btn btn-primary btn-sm" submit>Submit</button>
+                        <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                    </div>
+                </form>
+            </div>
+            <div class="d-block mt-1  mr-2" moe>
+                <form url="/api/segmentSummarySuggestion/update-status" show>
+                    <input type="hidden" name="uid" value="{{$segment->proposedSegmentSummarySuggestion->uid}}">
+                    <input type="hidden" name="status" value="DISCARDED">
+                    <div class="mb-0">
+                        <button class="btn btn-primary btn-sm" submit>Discard suggestion</button>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+@else
+    <div class=" ml-2 border m-2 p-2">
+        @if($segment->accepted_suggestion_summary_html)
+            {!! $segment->accepted_suggestion_summary_html !!}
+        @else 
+            {!! $segment->summary_html !!}
+        @endif 
+        <hr>
+        <div class="d-block mt-1" moe>
+            <a href="" start>Propose suggestion</a>
+            <form url="/api/segment/proposeSegmentSummarySuggestion">
+                <input type="hidden" name="uid" value="{{$segment->uid}}">
+                <textarea name="proposedSuggestedSummaryHtml" rte>
+                    @if($segment->accepted_suggestion_summary_html)
+                        {!! $segment->accepted_suggestion_summary_html !!}
+                    @else 
+                        {!! $segment->getRecalculatedHtml($performer)['summaryHtml'] !!}
+                    @endif 
+                </textarea>
+                <div class="mb-0 mt-2">
+                    <button class="btn btn-primary btn-sm" submit>Submit</button>
+                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                </div>
+            </form>
+        </div>
+    </div>
+@endif

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

@@ -80,7 +80,7 @@
                     
                     
                     <div class="form-group mb-2">
                     <div class="form-group mb-2">
                         <label for="" class="text-secondary text-sm mb-1">Effective Date *</label>
                         <label for="" class="text-secondary text-sm mb-1">Effective Date *</label>
-                        <input type="date" name="effectiveDate" class="form-control" value="{{date("Y-m-d")}}">
+                        <input type="date" name="effectiveDate" class="form-control" value="{{get_current_date($pro->display_timezone)}}">
                     </div>
                     </div>
                     <div class="form-group">
                     <div class="form-group">
                         <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
                         <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
@@ -252,7 +252,7 @@
                                         <input type="hidden" name="visitToCloneUid" value="{{$note->uid}}">
                                         <input type="hidden" name="visitToCloneUid" value="{{$note->uid}}">
                                         <div class="mb-2">
                                         <div class="mb-2">
                                             <label for="" class="text-sm text-secondary mb-1">Effective Date</label>
                                             <label for="" class="text-sm text-secondary mb-1">Effective Date</label>
-                                            <input type="date" name="effectiveDate" class="form-control input-sm" value="{{date('Y-m-d')}}">
+                                            <input type="date" name="effectiveDate" class="form-control input-sm" value="{{get_current_date($pro->display_timezone)}}">
                                         </div>
                                         </div>
                                         <div class="mb-2">
                                         <div class="mb-2">
                                             <label for="" class="text-secondary text-sm mb-1">New/Follow-up</label>
                                             <label for="" class="text-secondary text-sm mb-1">New/Follow-up</label>

+ 518 - 12
resources/views/app/patient/segment-templates/covid_follow-up/edit.blade.php

@@ -1,13 +1,519 @@
-<div class="p-3 mb-0">
-        <ul class="mb-0">
-                <li><strong>Note to HCP:</strong> Every patient is so unique. Please complete a standard SOAP note. Key points to consider:</strong></li>
-                <li>How are you?</li>
-                <li>Did you receive the meters? Any issues?</li>
-                <li>Reiterate education about asymptomatic hypoxia and guidelines to check regularly.</li>
-                <li>If SpO2 drops slightly, call us or your PCP.</li>
-                <li>If SpO2 drops to 94, go straight to the ER, even if you feel fine.</li>
-                <li>How are you doing with your other conditions?</li>
-                <li>How are you doing with stress? Stress really affects your blood pressure and even your blood sugar. COVID-19 has created so much stress in our lives, 7 in 10 adults now report anxiety or feelings of depression and isolation.</li>
-                <li><a href="https://press.aarp.org/AARP-Survey-7-in-10-Older-Adults-Report-Increased-Feelings-of-Anxiety-Sadness-and-Depression-Due-to-Coronavirus">AARP Link</a></li>
-        </ul>
+<?php
+
+use App\Models\Point;
+
+$category = 'COVID_FOLLOW-UP';
+$endPoint = 'upsertNoteSingleton';
+
+$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$contentData = [
+        "ans_has_received_printed_cdc_covid_matrials" => null, // yes/no
+        "ans_has_signed_up_for_gvt_covid_kit" => null, // yes/no/not_sure
+        "ans_apply_gvt_covid_kit_for_patient" => null, // yes/no/not_sure
+        "ans_has_reviewed_printed_cdc_covid_matrials" => null, // yes/no,
+        "cdc_self_protection_emphasis_vaccination" => null,
+        "cdc_self_protection_emphasis_mask_wearing" => null,
+        "cdc_self_protection_emphasis_mask_wearing" => null,
+        "cdc_self_protection_emphasis_social_distancing" => null,
+        "cdc_self_protection_emphasis_avoid_crowds" => null,
+        "cdc_self_protection_emphasis_test_appropriately" => null,
+        "cdc_self_protection_emphasis_wash_hands_often" => null,
+        "cdc_self_protection_emphasis_cover_coughs" => null,
+        "cdc_self_protection_emphasis_disinfect" => null,
+        "cdc_self_protection_emphasis_monitor_health_daily" => null,
+        "cdc_self_protection_emphasis_quarantine" => null,
+        "cdc_self_protection_emphasis_isolation" => null,
+        "cdc_self_protection_emphasis_travel_precaution" => null,
+        "ans_has_answered_all_covid_19_questions" => null,
+        "ans_has_received_printed_cdc_mental_health_matrials" => null, // yes/no
+        "ans_educated_patient_on_mental_health_screening" => null,
+        "ans_how_patient_is_doing_regarding_stress" => null,
+        "total_phq2" => null,
+        "phq_action_taken" => null,
+        "cdc_stress_emphasis_covid_19_effects" => null,
+        "cdc_stress_emphasis_stressful_challenges" => null,
+        "cdc_stress_emphasis_public_health_actions" => null,
+        "cdc_stress_emphasis_physical_reactions" => null,
+        "cdc_stress_emphasis_coping_with_stress" => null,
+        "ans_hypertension_rpm_education" => null,
+	"top_wish_1" => null,
+	"top_wish_2" => null,
+	"top_wish_3" => null,
+	"follow_up_for" => null
+];
+
+if (!!@$point->data) {
+        $contentData = $point->data;
+}
+
+?>
+<div visit-moe close-on-save close-on-cancel class="d-block p-3">
+        <form id="visitNoteForm" show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
+                <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+                <input type="hidden" name="category" value="<?= $category ?>">
+                <input id="mainData" type="hidden" name="data" value="{{json_encode($contentData)}}">
+
+		<h2>Note to provider: please begin visit asking vital signs using supplied equipment, and resolve any technical questions.</h2>
+
+                <div class="mb-2">
+                        <label class="mb-1">Have you received printed materials from CDC, “<b>How to Protect Yourself & Others</b>”?</label>
+                        <div class="d-inline-flex ml-2 align-items-baseline pt-1">
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_received_printed_cdc_covid_matrials" name="ans_has_received_printed_cdc_covid_matrials" {{@$contentData['ans_has_received_printed_cdc_covid_matrials'] && @$contentData['ans_has_received_printed_cdc_covid_matrials'] === 'yes' ? 'checked' : ''}} value="yes">
+                                        <span class="ml-1">Yes</span>
+                                </label>
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_received_printed_cdc_covid_matrials" name="ans_has_received_printed_cdc_covid_matrials" {{@$contentData['ans_has_received_printed_cdc_covid_matrials'] && @$contentData['ans_has_received_printed_cdc_covid_matrials'] === 'no' ? 'checked' : ''}} value="no">
+                                        <span class="ml-1">No</span>
+                                </label>
+                        </div>
+                </div>
+
+                <hr class="my-3">
+
+                <div class="mb-2">
+                        <label class="mb-1">Have you already signed up for government supplied COVID-19 home diagnostic kits?</label>
+                        <div class="d-inline-flex ml-2 align-items-baseline pt-1">
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_signed_up_for_gvt_covid_kit" name="ans_has_signed_up_for_gvt_covid_kit" {{@$contentData['ans_has_signed_up_for_gvt_covid_kit'] && @$contentData['ans_has_signed_up_for_gvt_covid_kit'] === 'yes' ? 'checked' : ''}} value="yes">
+                                        <span class="ml-1">Yes</span>
+                                </label>
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_signed_up_for_gvt_covid_kit" name="ans_has_signed_up_for_gvt_covid_kit" {{@$contentData['ans_has_signed_up_for_gvt_covid_kit'] && @$contentData['ans_has_signed_up_for_gvt_covid_kit'] === 'no' ? 'checked' : ''}} value="no">
+                                        <span class="ml-1">No</span>
+                                </label>
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_signed_up_for_gvt_covid_kit" name="ans_has_signed_up_for_gvt_covid_kit" {{@$contentData['ans_has_signed_up_for_gvt_covid_kit'] && @$contentData['ans_has_signed_up_for_gvt_covid_kit'] === 'no' ? 'checked' : ''}} value="not_sure">
+                                        <span class="ml-1">Not Sure</span>
+                                </label>
+                        </div>
+                </div>
+
+                <hr class="my-3">
+
+                <div class="mb-2">
+                        <label class="mb-1">Can we apply on CovidTests.gov for you?</label>
+                        <div class="d-inline-flex ml-2 align-items-baseline pt-1">
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_apply_gvt_covid_kit_for_patient" name="ans_apply_gvt_covid_kit_for_patient" {{@$contentData['ans_apply_gvt_covid_kit_for_patient'] && @$contentData['ans_apply_gvt_covid_kit_for_patient'] === 'yes' ? 'checked' : ''}} value="yes">
+                                        <span class="ml-1">Yes</span>
+                                </label>
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_apply_gvt_covid_kit_for_patient" name="ans_apply_gvt_covid_kit_for_patient" {{@$contentData['ans_apply_gvt_covid_kit_for_patient'] && @$contentData['ans_apply_gvt_covid_kit_for_patient'] === 'no' ? 'checked' : ''}} value="no">
+                                        <span class="ml-1">No</span>
+                                </label>
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_apply_gvt_covid_kit_for_patient" name="ans_apply_gvt_covid_kit_for_patient" {{@$contentData['ans_apply_gvt_covid_kit_for_patient'] && @$contentData['ans_apply_gvt_covid_kit_for_patient'] === 'no' ? 'checked' : ''}} value="not_sure">
+                                        <span class="ml-1">Not Sure</span>
+                                </label>
+                        </div>
+                </div>
+
+                <hr class="my-3">
+
+                <div class="mb-2">
+                        <div class="d-flex align-items-start">
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="ans_has_reviewed_printed_cdc_covid_matrials" {{@($contentData['ans_has_reviewed_printed_cdc_covid_matrials'] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span></span>
+                                </label>
+                                <label class="mr-3">Reviewed CDC "<b>How to Protect Yourself & Others</b>" with the patient
+                                        <br />
+                                        <a href="https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/prevention.html" target="_blank">https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/prevention.html</a>
+                                </label>
+                        </div>
+                </div>
+
+                <hr class="my-3">
+                <div class="mb-2">
+                        <div>
+                                <label> Emphasis placed on:</label>
+                        </div>
+
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_vaccination" {{@($contentData["cdc_self_protection_emphasis_vaccination"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Vaccination.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_mask_wearing" {{@($contentData["cdc_self_protection_emphasis_mask_wearing"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Mask wearing.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_social_distancing" {{@($contentData["cdc_self_protection_emphasis_social_distancing"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Social distancing.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_avoid_crowds" {{@($contentData["cdc_self_protection_emphasis_avoid_crowds"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Avoid poorly ventilated spaces and crowds.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_test_appropriately" {{@($contentData["cdc_self_protection_emphasis_test_appropriately"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Test appropriately</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_wash_hands_often" {{@($contentData["cdc_self_protection_emphasis_wash_hands_often"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Wash your hands often</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_cover_coughs" {{@($contentData["cdc_self_protection_emphasis_cover_coughs"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Cover coughs</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_disinfect" {{@($contentData["cdc_self_protection_emphasis_disinfect"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Clean and disinfect surfaces</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_monitor_health_daily" {{@($contentData["cdc_self_protection_emphasis_monitor_health_daily"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Monitor your health daily; Monitoring symptoms is especially important if you are running errands, going into the office or workplace, and in settings where it may be difficult to keep a physical distance of 6 feet.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_quarantine" {{@($contentData["cdc_self_protection_emphasis_quarantine"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Follow recommendations for quarantine; If you come into close contact with someone with COVID-19: follow CDC’s recommendations for quarantine.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_isolation" {{@($contentData["cdc_self_protection_emphasis_isolation"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Follow recommendations for isolation; If you test positive for COVID-19 or have symptoms: follow CDC’s recommendations for isolation.</span>
+                        </label>
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="cdc_self_protection_emphasis_travel_precaution" {{@($contentData["cdc_self_protection_emphasis_travel_precaution"] ? 'checked' : '')}} cdc-covid-emphasis>
+                                </div>
+                                <span>Take precautions when you travel; Follow CDC’s recommendations for domestic and international travel.</span>
+                        </label>
+                </div>
+
+                <hr class="my-3">
+                <div class="mb-2">
+                        <label class="mb-1">Answered all questions relating to COVID-19; patient verbalizes understanding.</label>
+                        <div class="d-inline-flex ml-2 align-items-baseline pt-1">
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_answered_all_covid_19_questions" name="ans_has_answered_all_covid_19_questions" {{@$contentData['ans_has_answered_all_covid_19_questions'] && @$contentData['ans_has_answered_all_covid_19_questions'] === 'yes' ? 'checked' : ''}} value="yes">
+                                        <span class="ml-1">Yes</span>
+                                </label>
+                                <label class="my-0 mr-3 d-flex align-items-center">
+                                        <input type="radio" data-name="ans_has_answered_all_covid_19_questions" name="ans_has_answered_all_covid_19_questions" {{@$contentData['ans_has_answered_all_covid_19_questions'] && @$contentData['ans_has_answered_all_covid_19_questions'] === 'no' ? 'checked' : ''}} value="no">
+                                        <span class="ml-1">No</span>
+                                </label>
+                        </div>
+                </div>
+
+                <hr class="my-3">
+                <div class="mb-2">
+                        <h6><b>CDC: Coping with Stress - Mental Health Screening</b></h6>
+                        <div class="mb-3">
+                                <label>Have you received printed materials from the CDC “<b>Coping with Stress</b>”.</label>
+                                <div class="d-inline-flex ml-2 align-items-baseline pt-1">
+                                        <label class="my-0 mr-3 d-flex align-items-center">
+                                                <input type="radio" data-name="ans_has_received_printed_cdc_mental_health_matrials" name="ans_has_received_printed_cdc_mental_health_matrials" {{@$contentData['ans_has_received_printed_cdc_mental_health_matrials'] && @$contentData['ans_has_received_printed_cdc_mental_health_matrials'] === 'yes' ? 'checked' : ''}} value="yes">
+                                                <span class="ml-1">Yes</span>
+                                        </label>
+                                        <label class="my-0 mr-3 d-flex align-items-center">
+                                                <input type="radio" data-name="ans_has_received_printed_cdc_mental_health_matrials" name="ans_has_received_printed_cdc_mental_health_matrials" {{@$contentData['ans_has_received_printed_cdc_mental_health_matrials'] && @$contentData['ans_has_received_printed_cdc_mental_health_matrials'] === 'no' ? 'checked' : ''}} value="no">
+                                                <span class="ml-1">No</span>
+                                        </label>
+                                </div>
+                                <div>
+                                        <a href="https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html" target="_blank">https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html</a>
+                                </div>
+                        </div>
+                        <div class="mb-2">
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="ans_educated_patient_on_mental_health_screening" {{@($contentData["ans_educated_patient_on_mental_health_screening"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span>Educated patient that stress and mental health screening is important because 7 in 10 adults are reporting feelings of anxiety, sadness, and depression due to COVID-19</span>
+                                </label>
+                        </div>
+
+                        <div class="mb-2">
+                                <label class="mb-1">How are you doing regarding stress?</label>
+                                <input id="stressChangeInput" type="text" data-name="ans_how_patient_is_doing_regarding_stress" value="{{@$contentData['ans_how_patient_is_doing_regarding_stress']}}" class="form-control form-control-sm d-inline-block w-auto ml-2">
+                        </div>
+                        <hr class="my-3">
+                        <div class="mb-2 phq">
+                                <div class="table-responsive">
+                                        <h6><b>Patient Health Questionnaire-2 (PHQ-2)</b></h6>
+                                        <table class="table">
+                                                <thead>
+                                                        <tr>
+                                                                <th>Over the last 2 weeks, how often have you been bothered by any of the following problems?</th>
+                                                                <th class="text-center">Not at all</th>
+                                                                <th class="text-center">Several days</th>
+                                                                <th class="text-center">More than half the days</th>
+                                                                <th class="text-center">Nearly every day</th>
+                                                        </tr>
+                                                </thead>
+                                                <tbody>
+                                                        <tr>
+                                                                <td>1. Little interest or pleasure in doing things</td>
+                                                                <td class="text-center"><button type="button" class="btn btn-blank">0</button></td>
+                                                                <td class="text-center"><button type="button" onclick="onValueChange(this, 'no_interest', 'phq2')" class="no_interest_phq2 btn btn-select one_phq2 {{ @$contentData['no_interest_phq2'] == 1 ? 'active':'' }}" data-id="1">1</button></td>
+                                                                <td class="text-center"><button type="button" onclick="onValueChange(this, 'no_interest', 'phq2')" class="no_interest_phq2 btn btn-select two_phq2 {{ @$contentData['no_interest_phq2'] == 2 ? 'active':'' }}" data-id="2">2</button></td>
+                                                                <td class="text-center"><button type="button" onclick="onValueChange(this, 'no_interest', 'phq2')" class="no_interest_phq2 btn btn-select three_phq2 {{ @$contentData['no_interest_phq2'] == 3 ? 'active':'' }}" data-id="3">3</button></td>
+                                                        </tr>
+                                                        <tr>
+                                                                <td>2. Feeling down, depressed, or hopeless</td>
+                                                                <td class="text-center"><button type="button" class="btn btn-blank">0</button></td>
+                                                                <td class="text-center"><button type="button" onclick="onValueChange(this, 'depressed', 'phq2')" class="depressed_phq2 btn btn-select one_phq2 {{ @$contentData['depressed_phq2'] == 1 ? 'active':'' }}" data-id="1">1</button></td>
+                                                                <td class="text-center"><button type="button" onclick="onValueChange(this, 'depressed', 'phq2')" class="depressed_phq2 btn btn-select two_phq2 {{ @$contentData['depressed_phq2'] == 2 ? 'active':'' }}" data-id="2">2</button></td>
+                                                                <td class="text-center"><button type="button" onclick="onValueChange(this, 'depressed', 'phq2')" class="depressed_phq2 btn btn-select three_phq2 {{ @$contentData['depressed_phq2'] == 3 ? 'active':'' }}" data-id="3">3</button></td>
+                                                        </tr>
+                                                        <tr>
+                                                                <td class="text-right"><em>For office coding:</em></td>
+                                                                <td class="text-center">0</td>
+                                                                <td class="text-center plus"><span id="first_phq2"><b><u><?= @$contentData['first_phq2'] ?? '____' ?></u></b></span></td>
+                                                                <td class="text-center plus"><span id="second_phq2"><b><u><?= @$contentData['second_phq2'] ?? '____' ?></u></b></span></td>
+                                                                <td class="text-center plus"><span id="third_phq2"><b><u><?= @$contentData['third_phq2'] ?? '____' ?></u></b></span></td>
+                                                        </tr>
+                                                        <tr>
+                                                                <td class="text-right" colspan="5">
+                                                                        <input type="hidden" name="total_phq2" data-name="total_phq2" value="{{ @$contentData['total_phq2'] }}">
+                                                                        <em>= Total Score</em> <span id="total_phq2"><b><u><?= @$contentData['total_phq2'] ?? '___' ?></u></b></span>
+                                                                </td>
+                                                        </tr>
+                                                </tbody>
+                                        </table>
+                                </div>
+                        </div>
+
+                        <div class="mb-2">
+                                <label class="mb-1">If(PHQ-2 > 3?) then optionally:</label>
+                                <div class="d-flex flex-column ml-2 align-items-baseline pt-1">
+                                        <label class="my-0 mr-3 d-flex align-items-center">
+                                                <input type="radio" data-name="phq_action_taken" name="phq_action_taken" {{@$contentData['phq_action_taken'] && @$contentData['phq_action_taken'] === 'phq_administer_phq_9_now' ? 'checked' : ''}} value="phq_administer_phq_9_now">
+                                                <span class="ml-1">Administer PHQ-9 now.</span>
+                                        </label>
+                                        <label class="my-0 mr-3 d-flex align-items-center">
+                                                <input type="radio" data-name="phq_action_taken" name="phq_action_taken" {{@$contentData['phq_action_taken'] && @$contentData['phq_action_taken'] === 'phq_schedule_phq_9_now' ? 'checked' : ''}} value="phq_schedule_phq_9_now">
+                                                <span class="ml-1">Schedule PHQ-9 now.</span>
+                                        </label>
+                                        <label class="my-0 mr-3 d-flex align-items-center">
+                                                <input type="radio" data-name="phq_action_taken" name="phq_action_taken" {{@$contentData['phq_action_taken'] && @$contentData['phq_action_taken'] === 'phq_schedule_phq_9_later' ? 'checked' : ''}} value="phq_schedule_phq_9_later">
+                                                <span class="ml-1">Schedule PHQ-9 later.</span>
+                                        </label>
+                                        <label class="my-0 mr-3 d-flex align-items-center">
+                                                <input type="radio" data-name="phq_action_taken" name="phq_action_taken" {{@$contentData['phq_action_taken'] && @$contentData['phq_action_taken'] === 'phq_refer_to_psych_np' ? 'checked' : ''}} value="phq_refer_to_psych_np">
+                                                <span class="ml-1">Referral to Psych NP - “Stress Specialist”.</span>
+                                        </label>
+                                </div>
+                        </div>
+                        <div class="mb-2">
+                                <label class="mb-1">Reviewed “<b>CDC: Coping with Stress</b>” with patient. Went over the following points.</label>
+
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="cdc_stress_emphasis_covid_19_effects" {{@($contentData["cdc_stress_emphasis_covid_19_effects"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span>The COVID-19 pandemic has had a major effect on our lives.</span>
+                                </label>
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="cdc_stress_emphasis_stressful_challenges" {{@($contentData["cdc_stress_emphasis_stressful_challenges"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span>Many of us are facing challenges that can be stressful.</span>
+                                </label>
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="cdc_stress_emphasis_public_health_actions" {{@($contentData["cdc_stress_emphasis_public_health_actions"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span>Public health actions like social distancing can increase stress and anxiety / isolation.</span>
+                                </label>
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="cdc_stress_emphasis_physical_reactions" {{@($contentData["cdc_stress_emphasis_physical_reactions"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span>Stress can cause adverse feelings and physical reactions, especially relating to HTN and DM.</span>
+                                </label>
+                                <label class="d-flex align-items-baseline mb-2">
+                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                <input type="checkbox" data-name="cdc_stress_emphasis_coping_with_stress" {{@($contentData["cdc_stress_emphasis_coping_with_stress"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                        </div>
+                                        <span>Educated patient on healthy ways to cope with stress (as per CDC: Coping with Stress):</span>
+                                </label>
+                                <div class="pl-4">
+                                        <?php
+                                        $healthyWaysOptions = [
+                                                'take_break_from_social_media' => 'Take breaks from news and social media.',
+                                                'take_care_of_your_body' => 'Take care of your body',
+                                                'take_deep_breaths' => 'Take deep breaths, stretch, or meditate',
+                                                'try_to_eat_healthy' => 'Try to eat healthy, well-balanced meals',
+                                                'exercise_regularly' => 'Exercise regularly',
+                                                'get_plenty_of_sleep' => 'Get plenty of sleep',
+                                                'avoid_excessive_alcohol' => 'Avoid excessive alcohol, tobacco, and substance use',
+                                                'continue_with_routine_preventive_measures' => 'Continue with routine preventive measures (such as vaccinations, cancer screenings, etc.) as recommended by your healthcare provider',
+                                                'get_vaccinated_with_covid' => 'Get vaccinated with a COVID-19 vaccine',
+                                                'make_time_unwind' => 'Make time to unwind — Try to do some other activities you enjoy',
+                                                'connect_with_others' => 'Connect with others — Talk with people you trust about your concerns and how you are feeling',
+                                                'connect_with_your_community' => 'Connect with your community- or faith-based organizations — While social distancing measures are in place, try connecting online, through social media, or by phone or mail'
+                                        ];
+                                        ?>
+                                        <div class="">
+                                                @foreach($healthyWaysOptions as $hOptionKey => $hOptionLabel)
+                                                <label class="d-flex align-items-baseline mb-2">
+                                                        <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                                                <input type="checkbox" data-name="{{ $hOptionKey }}" {{@($contentData[$hOptionKey] ? 'checked' : '')}} cdc-stress-emphasis>
+                                                        </div>
+                                                        <span>{{ $hOptionLabel }}</span>
+                                                </label>
+                                                @endforeach
+                                        </div>
+                                </div>
+
+                        </div>
+                </div>
+
+                <div class="mb-2">
+                        <label class="d-flex align-items-baseline mb-2">
+                                <div class="mr-2 align-self-stretch" style="padding-top: 2px;">
+                                        <input type="checkbox" data-name="ans_hypertension_rpm_education" {{@($contentData["ans_hypertension_rpm_education"] ? 'checked' : '')}} cdc-stress-emphasis>
+                                </div>
+                                <span>Educated patient about hypertension RPM and election to enroll into it.</span>
+                        </label>
+                </div>
+
+                <hr class="my-3">
+
+		<div class="mb-2">
+                   <label class="mb-1">What are your top three wishes for your health? <i class="fa fa-info-circle"></i> (Note to provider: sometimes patients need help to identify goals; <strong>"if you could wave a magic wand and have any three health wishes granted, what would they be?"</strong> common issues are fatigue, weight, joint pain, blood sugar, BP, etc.)</label>
+                                     <div class="mt-1">1. <input type="text" data-name="top_wish_1" value="{{@$contentData        ['top_wish_1']}}" class="form-control form-control-sm d-inline-block w-auto ml-2"></div>
+                                     <div class="mt-1">2. <input type="text" data-name="top_wish_2" value="{{@$contentData        ['top_wish_2']}}" class="form-control form-control-sm d-inline-block w-auto ml-2"></div>
+                                     <div class="mt-1">3. <input type="text" data-name="top_wish_3" value="{{@$contentData        ['top_wish_3']}}" class="form-control form-control-sm d-inline-block w-auto ml-2"></div>
+                         </div>
+	<hr class="my-3">
+
+		<div class="mb-2">
+                   <label class="mb-1">Next follow-up for:</label>
+                                     <input type="text" data-name="follow_up_for" value="{{@$contentData        ['follow_up_for']}}" class="form-control form-control-sm d-inline-block w-auto ml-2">
+                         </div>
+
+	<hr class="my-3">
+
+                <div class="pt-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>
 </div>
+
+<script>
+        // PHQ
+        function phqSubmitChanges() {
+                var form = $('#visitNoteForm');
+                $.post('/api/visitPoint/upsertNoteSingleton', form.serializeArray(), function(response) {}, 'json');
+        }
+
+        function phqUpdateData(object) {
+                var mainDataInput = $('#mainData');
+                var mainData = mainDataInput.val();
+                try {
+                        mainData = JSON.parse(mainData);
+                } catch (e) {
+                        mainData = {};
+                }
+                var data = $.extend(mainData, object);
+                mainDataInput.val(JSON.stringify(data));
+                phqSubmitChanges(data);
+        }
+
+        function onValueChange(elem, category, phq_type) {
+                var btn = elem;
+                var name = category + '_' + phq_type;
+                var value = $(btn).data('id');
+                $('[name=' + name + ']').remove();
+                if ($(btn).hasClass('active')) {
+                        $(btn).removeClass('active');
+                        calculateChange(phq_type);
+                        return;
+                }
+                $('.' + name).removeClass('active');
+                $(btn).addClass('active');
+                $('.phq').append('<input type="hidden" data-name=' + name + ' name=' + name + ' value=' + value + ' />');
+                calculateChange(phq_type);
+                phqUpdateData({
+                        [name]: value
+                });
+        };
+
+        function calculateChange(phq_type) {
+                var first = $('.one_' + phq_type + '.active').length * 1;
+                var second = $('.two_' + phq_type + '.active').length * 2;
+                var third = $('.three_' + phq_type + '.active').length * 3;
+                var total = first + second + third;
+
+                var values = [first, second, third, total];
+                var labels = ['first', 'second', 'third', 'total'];
+                var object = {};
+                for (var i = 0; i < labels.length; i++) {
+                        var name = labels[i] + '_' + phq_type;
+                        var value = values[i];
+                        $('#' + name).html(value);
+                        $('[name=' + name + ']').remove();
+                        $('.phq').append('<input type="hidden" data-name=' + name + ' name=' + name + ' value=' + value + ' />');
+                        object[name] = value;
+                        phqUpdateData({
+                                [name]: value
+                        });
+                }
+        };
+        // PHQ
+
+        (function() {
+                window.segmentInitializers.covidFollowUp = function() {
+                        var covidFollowUp = {
+                                parentSegment: $('[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] '),
+                                initAutoCheckAll: function() {
+                                        var self = this;
+                                        var checkSegments = $('[check-all]');
+                                        $.each(checkSegments, function(i, segment) {
+                                                var target = $(segment).data('target');
+                                                var allChildrenCheckboxes = self.parentSegment.find('input[type=checkbox][' + target + ']');
+                                                $(segment).click(function() {
+                                                        var checkAllInput = this;
+                                                        var isChecked = checkAllInput.checked ? true : false;
+                                                        allChildrenCheckboxes.attr('checked', isChecked);
+                                                });
+                                                var allCheckedChildrenCheckboxes = self.parentSegment.find('input[type=checkbox][' + target + ']:checked');
+                                                if (allChildrenCheckboxes.length === allCheckedChildrenCheckboxes.length) {
+                                                        $(segment).attr('checked', true);
+                                                }
+                                        });
+
+                                },
+                                init: function() {
+                                        this.initAutoCheckAll();
+                                }
+                        };
+                        covidFollowUp.init();
+                };
+        }).call(window);
+</script>

+ 279 - 11
resources/views/app/patient/segment-templates/covid_follow-up/summary.blade.php

@@ -1,13 +1,281 @@
-<div class="p-3 mb-0">
-        <ul class="mb-0">
-                <li><strong>Note to HCP:</strong> Every patient is so unique. Please complete a standard SOAP note. Key points to consider:</strong></li>
-                <li>How are you?</li>
-                <li>Did you receive the meters? Any issues?</li>
-                <li>Reiterate education about asymptomatic hypoxia and guidelines to check regularly.</li>
-                <li>If SpO2 drops slightly, call us or your PCP.</li>
-                <li>If SpO2 drops to 94, go straight to the ER, even if you feel fine.</li>
-                <li>How are you doing with your other conditions?</li>
-                <li>How are you doing with stress? Stress really affects your blood pressure and even your blood sugar. COVID-19 has created so much stress in our lives, 7 in 10 adults now report anxiety or feelings of depression and isolation.</li>
-                <li><a href="https://press.aarp.org/AARP-Survey-7-in-10-Older-Adults-Report-Increased-Feelings-of-Anxiety-Sadness-and-Depression-Due-to-Coronavirus">AARP Link</a></li>
+<?php
+
+use App\Models\Point;
+
+$category = 'COVID_FOLLOW-UP';
+$endPoint = 'upsertNoteSingleton';
+
+$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+
+$contentData = [
+    "ans_has_received_printed_cdc_covid_matrials" => null, // yes/no
+    "ans_has_signed_up_for_gvt_covid_kit" => null, // yes/no/not_sure
+    "ans_apply_gvt_covid_kit_for_patient" => null, // yes/no/not_sure
+    "ans_has_reviewed_printed_cdc_covid_matrials" => null,
+    "cdc_self_protection_emphasis_vaccination" => null,
+    "cdc_self_protection_emphasis_mask_wearing" => null,
+    "cdc_self_protection_emphasis_mask_wearing" => null,
+    "cdc_self_protection_emphasis_social_distancing" => null,
+    "cdc_self_protection_emphasis_avoid_crowds" => null,
+    "cdc_self_protection_emphasis_test_appropriately" => null,
+    "cdc_self_protection_emphasis_wash_hands_often" => null,
+    "cdc_self_protection_emphasis_cover_coughs" => null,
+    "cdc_self_protection_emphasis_disinfect" => null,
+    "cdc_self_protection_emphasis_monitor_health_daily" => null,
+    "cdc_self_protection_emphasis_quarantine" => null,
+    "cdc_self_protection_emphasis_isolation" => null,
+    "cdc_self_protection_emphasis_travel_precaution" => null,
+    "ans_has_answered_all_covid_19_questions" => null,
+    "ans_has_received_printed_cdc_mental_health_matrials" => null, // yes/no
+    "ans_educated_patient_on_mental_health_screening" => null,
+    "ans_how_patient_is_doing_regarding_stress" => null,
+    "total_phq2" => null,
+    "phq_action_taken" => null,
+    "cdc_stress_emphasis_covid_19_effects" => null,
+    "cdc_stress_emphasis_stressful_challenges" => null,
+    "cdc_stress_emphasis_public_health_actions" => null,
+    "cdc_stress_emphasis_physical_reactions" => null,
+    "cdc_stress_emphasis_coping_with_stress" => null,
+    "ans_hypertension_rpm_education" => null,
+
+];
+if (!!@$point->data) {
+    $contentData = $point->data;
+}
+
+?>
+
+<div class="events-none form-read-mode">
+    <div class="mb-2">
+        <label><b>{{ $patient->displayName() }}</b> is a <b>{{$patient->age_in_years }} y.o.</b>
+            @if($patient->sex == 'M')
+            <b>M</b>
+            @elseif($patient->sex == 'F')
+            <b>F</b>
+            @endif
+            presenting for follow-up regarding CDC COVID-19 guidelines & ongoing medical care.</label>
+    </div>
+
+    <div class="mb-2">
+        <h6><b><u>CDC: How to Protect Yourself & Others: Education</u></b></h6>
+        @if(@$contentData['ans_has_received_printed_cdc_covid_matrials'] == 'yes')
+        Patient has received printed materials from CDC, “How to Protect Yourself & Others”.
+        @elseif(@$contentData['ans_has_received_printed_cdc_covid_matrials'] == 'no')
+        Patient has not received printed materials from CDC, “How to Protect Yourself & Others”.
+        @else
+
+        @endif
+    </div>
+
+    <div class="mb-2">
+        <label>Asked patient if they have already signed up for government supplied COVID-19 home diagnostic kits? Patient replied:</label>
+        @if(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] == 'yes')
+        {{segment_template_summary_value_display('Yes') }}
+        @elseif(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] == 'no')
+        {{segment_template_summary_value_display('No') }}
+        @elseif(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] == 'not_sure')
+        {{segment_template_summary_value_display('Not Sure') }}
+        @else
+        {{segment_template_summary_value_display('') }}
+        @endif
+    </div>
+
+    @if(@$contentData['ans_has_signed_up_for_gvt_covid_kit'] && @$contentData['ans_has_signed_up_for_gvt_covid_kit'] != 'yes')
+    <div class="mb-2">
+        <label>Asked patient if we can apply on CovidTests.gov for them? Patient replied:</label>
+        @if(@$contentData['ans_apply_gvt_covid_kit_for_patient'] == 'yes')
+        {{segment_template_summary_value_display('Yes') }}
+        @elseif(@$contentData['ans_apply_gvt_covid_kit_for_patient'] == 'no')
+        {{segment_template_summary_value_display('No') }}
+        @elseif(@$contentData['ans_apply_gvt_covid_kit_for_patient'] == 'not_sure')
+        {{segment_template_summary_value_display('Not Sure') }}
+        @else
+        {{segment_template_summary_value_display('') }}
+        @endif
+    </div>
+    @endif
+
+    @if(@$contentData['ans_has_reviewed_printed_cdc_covid_matrials'])
+    <div class="mb-2">
+        <label>Reviewed “<b>CDC: How to Protect Yourself & Others</b>” with patient.</label>
+        <div>
+            <a href="https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/prevention.html" target="_blank">https://www.cdc.gov/coronavirus/2019-ncov/prevent-getting-sick/prevention.html</a>
+        </div>
+    </div>
+    @endif
+
+    <div class="mb-2">
+        <label> Emphasis placed on:</label>
+        <ul>
+            @if(@$contentData['cdc_self_protection_emphasis_vaccination'])
+            <li>Vaccination</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_mask_wearing'])
+            <li>Mask wearing.</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_social_distancing'])
+            <li>Social distancing.</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_avoid_crowds'])
+            <li>Avoid poorly ventilated spaces and crowds.</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_test_appropriately'])
+            <li>Test appropriately</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_vaccination'])
+            <li>Wash your hands often</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_cover_coughs'])
+            <li>Cover coughs</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_disinfect'])
+            <li>Clean and disinfect surfaces</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_monitor_health_daily'])
+            <li>Monitor your health daily; Monitoring symptoms is especially important if you are running errands, going into the office or workplace, and in settings where it may be difficult to keep a physical distance of 6 feet.</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_quarantine'])
+            <li>Follow recommendations for quarantine; If you come into close contact with someone with COVID-19: follow CDC’s recommendations for quarantine.</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_isolation'])
+            <li>Follow recommendations for isolation; If you test positive for COVID-19 or have symptoms: follow CDC’s recommendations for isolation.</li>
+            @endif
+            @if(@$contentData['cdc_self_protection_emphasis_travel_precaution'])
+            <li>Take precautions when you travel; Follow CDC’s recommendations for domestic and international travel.</li>
+            @endif
         </ul>
         </ul>
+    </div>
+
+    <div class="mb-2">
+        @if(@$contentData['ans_has_answered_all_covid_19_questions'] == 'yes')
+            <label>Answered all questions relating to COVID-19.</label>
+            {{segment_template_summary_value_display('Patient verbalizes understanding.')}}
+        @elseif(@$contentData['ans_has_answered_all_covid_19_questions'] == 'no')
+
+        @endif
+    </div>
+
+    <div class="mb-2">
+        <h6><b><u>CDC: Coping with Stress - Mental Health Screening</b></u></h6>
+    </div>
+    @if(@$contentData['ans_has_received_printed_cdc_mental_health_matrials'] == 'yes')
+    <div class="mb-2">
+        <label>Patient has received printed materials from the CDC “<b>Coping with Stress</b>”.</label>
+        <div>
+            <a href="https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html" target="_blank">https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html</a>
+        </div>
+    </div>
+    @elseif(@$contentData['ans_has_received_printed_cdc_mental_health_matrials'] == 'no')
+    <div class="mb-2">
+        <label>Patient has not received printed materials from the CDC “<b>Coping with Stress</b>”.</label>
+        <div>
+            <a href="https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html" target="_blank">https://www.cdc.gov/mentalhealth/stress-coping/cope-with-stress/index.html</a>
+        </div>
+    </div>
+    @endif
+
+    @if(@$contentData['ans_educated_patient_on_mental_health_screening'])
+    <div class="mb-2">
+        <label>Educated patient that stress and mental health screening is important because 7 in 10 adults are reporting feelings of anxiety, sadness, and depression due to COVID-19.</label>
+    </div>
+    @endif
+
+    <div class="mb-2">
+        <label>Asked patient, how are you doing regarding stress? Patient replied:</label>
+        {{segment_template_summary_value_display(@$contentData['ans_how_patient_is_doing_regarding_stress'])}}
+    </div>
+
+    <div class="mb-2">
+        <label>Conducted PHQ-2 with patient. Patient score is:</label>
+        {{segment_template_summary_value_display(@$contentData['total_phq2'])}}
+    </div>
+
+    @if((int) @$contentData['total_phq2'] > 3)
+    <ul>
+        @if(@$contentData['phq_action_taken'])
+        <li>
+            @if(@$contentData['phq_action_taken'] == 'phq_administer_phq_9_now')
+            Administer PHQ-9 now.
+            @elseif(@$contentData['phq_action_taken'] == 'phq_schedule_phq_9_now')
+            Schedule PHQ-9 now.
+            @elseif(@$contentData['phq_action_taken'] == 'phq_schedule_phq_9_later')
+            Schedule PHQ-9 later.
+            @elseif(@$contentData['phq_action_taken'] == 'phq_refer_to_psych_np')
+            Referral to Psych NP - “Stress Specialist”.
+            @endif
+        </li>
+        @endif
+    </ul>
+    @endif
+
+    <div class="mb-2 d-none">
+        <h6><b><u>OPTIONAL: Election to participate in PHQ-9:</u></b></h6>
+    </div>
+    <div class="mb-2">
+        <label>Reviewed “<b>CDC: Coping with Stress</b>” with patient. Went over the following points.</label>
+    </div>
+    <div class="mb-2">
+        <ul>
+            @if(@$contentData['cdc_stress_emphasis_covid_19_effects'])
+            <li>The COVID-19 pandemic has had a major effect on our lives.</li>
+            @endif
+            @if(@$contentData['cdc_stress_emphasis_stressful_challenges'])
+            <li>Many of us are facing challenges that can be stressful.</li>
+            @endif
+            @if(@$contentData['cdc_stress_emphasis_public_health_actions'])
+            <li>Public health actions like social distancing can increase stress and anxiety / isolation.</li>
+            @endif
+            @if(@$contentData['cdc_stress_emphasis_physical_reactions'])
+            <li>Stress can cause adverse feelings and physical reactions, especially relating to HTN and DM.</li>
+            @endif
+            @if(@$contentData['cdc_stress_emphasis_coping_with_stress'])
+            <li>Educated patient on healthy ways to cope with stress (as per CDC: Coping with Stress):
+                <?php
+                $healthyWaysOptions = [
+                    'take_break_from_social_media' => 'Take breaks from news and social media.',
+                    'take_care_of_your_body' => 'Take care of your body',
+                    'take_deep_breaths' => 'Take deep breaths, stretch, or meditate',
+                    'try_to_eat_healthy' => 'Try to eat healthy, well-balanced meals',
+                    'exercise_regularly' => 'Exercise regularly',
+                    'get_plenty_of_sleep' => 'Get plenty of sleep',
+                    'avoid_excessive_alcohol' => 'Avoid excessive alcohol, tobacco, and substance use',
+                    'continue_with_routine_preventive_measures' => 'Continue with routine preventive measures (such as vaccinations, cancer screenings, etc.) as recommended by your healthcare provider',
+                    'get_vaccinated_with_covid' => 'Get vaccinated with a COVID-19 vaccine',
+                    'make_time_unwind' => 'Make time to unwind — Try to do some other activities you enjoy',
+                    'connect_with_others' => 'Connect with others — Talk with people you trust about your concerns and how you are feeling',
+                    'connect_with_your_community' => 'Connect with your community- or faith-based organizations — While social distancing measures are in place, try connecting online, through social media, or by phone or mail'
+                ];
+                ?>
+                <ul>
+                @foreach($healthyWaysOptions as $hOptionKey => $hOptionLabel)
+                    @if(@$contentData[$hOptionKey])
+                        <li>{{ $hOptionLabel }}</li>
+                    @endif
+                @endforeach
+                </ul>
+            </li>
+            @endif
+        </ul>
+    </div>
+
+	<hr class="my-3">
+
+    <div class="mb-2">
+        <label class="mb-1">Asked patient top three wishes for health. They replied:</label>
+        <div class="mt-1">1. {{@$contentData ['top_wish_1']}}</div>
+        <div class="mt-1">2. {{@$contentData ['top_wish_2']}}</div>
+        <div class="mt-1">3. {{@$contentData ['top_wish_3']}}</div>
+    </div>
+    <hr class="my-3">
+
+    <div class="mb-2">
+        <label class="mb-1">Next follow-up for:</label>
+        {{@$contentData ['follow_up_for']}}
+    </div>
+
+    @if(@$contentData['ans_hypertension_rpm_education'])
+    <h6 class="d-none"><b><u>OPTIONAL: Election to enroll into hypertension RPM: (Requires H&P)</u></b></h6>
+    <p>Educated patient regarding AHA position statement on HTN & RPM, educated about availability of CCM, informed patient about importance as per AHA position statement. Patient consents to RPM.</p>
+    <p>Remote patient monitoring (RPM) can empower patients to better manage their health and participate in their health care. When used by clinicians, RPM can provide a more holistic view of a patient’s health over time, increase visibility into a patient’s adherence to a treatment, and enable timely intervention before a costly care episode. Clinicians can strengthen their relationships with, and improve the experience of, their patients by using the data sent to them via RPM to develop a personalized care plan and to engage in joint decision-making to foster better outcomes. The American Heart Association supports initiatives that increase access to and incentivize the appropriate design and use of evidence-based remote patient monitoring technologies.</p>
+    @endif
 </div>
 </div>

+ 25 - 6
resources/views/app/patient/segment-templates/covid_intake/edit.blade.php

@@ -7,6 +7,10 @@ $endPoint = 'upsertGlobalSingleton';
 
 
 $point = Point::getGlobalSingletonOfCategory($patient, 'COVID_INTAKE', true);
 $point = Point::getGlobalSingletonOfCategory($patient, 'COVID_INTAKE', true);
 $contentData = [
 $contentData = [
+
+	"ans_cdc_guidelines_aarp_mental_health" => '',
+	"ans_follow_up_scheduled" => '',
+
     "ans_how_are_you" => '',
     "ans_how_are_you" => '',
     "ans_is_address_correct" => null, // yes/no
     "ans_is_address_correct" => null, // yes/no
     "ans_corrected_address" => '',
     "ans_corrected_address" => '',
@@ -121,6 +125,7 @@ $contentData = [
     "ans_booster_status" => '',
     "ans_booster_status" => '',
 
 
     "ans_current_behaviors_to_stay_safe" => '',
     "ans_current_behaviors_to_stay_safe" => '',
+    "ans_total_mins_spent" => '',
 
 
     "ans_edu_provided_use_of_smd" => null, // checkbox
     "ans_edu_provided_use_of_smd" => null, // checkbox
     "ans_edu_provided_asymptomatic_hypoxia" => null, // checkbox
     "ans_edu_provided_asymptomatic_hypoxia" => null, // checkbox
@@ -176,10 +181,6 @@ if (!!@$point->data) {
             So it'll be my responsibility to ensure that you know exactly how to use the kit once you get it.
             So it'll be my responsibility to ensure that you know exactly how to use the kit once you get it.
         </div>
         </div>
 
 
-	<div class="mb-2>
-	    DialMD
-	</div>
-
         <div class="mb-2">
         <div class="mb-2">
             <label class="mb-1">Have you ever worked with a nurse practitioner before?</label>
             <label class="mb-1">Have you ever worked with a nurse practitioner before?</label>
             <div class="d-inline-flex ml-2 align-items-baseline pt-1">
             <div class="d-inline-flex ml-2 align-items-baseline pt-1">
@@ -731,14 +732,14 @@ if (!!@$point->data) {
 
 
         <hr class="my-3">
         <hr class="my-3">
 
 
-	<div class="ml-3 mb-3">
+	    <div class="ml-3 mb-3">
             <label class="mb-2 d-flex align-items-center">
             <label class="mb-2 d-flex align-items-center">
                 <input type="checkbox" data-name="ans_cdc_push" {{@$contentData['ans_vaccine_push'] ? 'checked' : ''}} class="mr-2">
                 <input type="checkbox" data-name="ans_cdc_push" {{@$contentData['ans_vaccine_push'] ? 'checked' : ''}} class="mr-2">
                 <span class="ml-2">Educated patient that self-monitoring is not a replacement for following CDC guidelines re: vaccines, mask-wearing, and social distancing; <strong>CDC guidelines re: vaccines, masks, and social distancing are the most effective strategy to reduce COVID-19 risk.</strong>.</span>
                 <span class="ml-2">Educated patient that self-monitoring is not a replacement for following CDC guidelines re: vaccines, mask-wearing, and social distancing; <strong>CDC guidelines re: vaccines, masks, and social distancing are the most effective strategy to reduce COVID-19 risk.</strong>.</span>
             </label>
             </label>
         </div>
         </div>
         
         
-	<p><b>Vaccine Status:</b></p>
+	    <p><b>Vaccine Status:</b></p>
 
 
         <div class="ml-3 mb-3">
         <div class="ml-3 mb-3">
             <label class="mb-2 d-flex align-items-center">
             <label class="mb-2 d-flex align-items-center">
@@ -793,6 +794,24 @@ if (!!@$point->data) {
             </label>
             </label>
         </div>
         </div>
 
 
+	    <p><b>Printed material to be sent:</b></p>
+        <div class="ml-3 mb-3">
+            <label class="mb-2 d-flex align-items-center">
+                    <input type="checkbox" data-name="ans_cdc_guidelines_aarp_mental_health" {{@$contentData['ans_cdc_guidelines_aarp_mental_health'] ? 'checked' : ''}} class="mr-2">
+                    <span class="ml-2">CDC "How to Protect Yourself & Others" & AARP mental health / COVID alert</span>
+                </label>
+            <label class="mb-2 d-flex align-items-center">
+                    <input type="checkbox" data-name="ans_follow_up_scheduled" {{@$contentData['ans_follow_up_scheduled'] ? 'checked' : ''}} class="mr-2">
+                    <span class="ml-2">Follow-up scheduled</span>
+                </label>
+        </div>
+
+        <div class="mb-3">
+            <label class="mb-1"><b>Total minutes  spent on this visit counseling or educating a patient or caregiver, documentation, and care coordination.</b></label>
+            <input type="text" data-name="ans_total_mins_spent" value="{{@$contentData['ans_total_mins_spent']}}" class="form-control form-control-sm">
+            <small class="d-none">Over 50% of this time was directed towards counseling and education.</small>
+        </div>
+
         <div class="pt-2">
         <div class="pt-2">
             <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></button>
             <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">
             <div class="d-inline-flex align-self-stretch align-items-center">

+ 225 - 340
resources/views/app/patient/segment-templates/covid_intake/summary.blade.php

@@ -111,7 +111,8 @@ $contentData = [
     "ans_plan_ls_patient_confirms_understanding_ls_mods" => null, // checkbox
     "ans_plan_ls_patient_confirms_understanding_ls_mods" => null, // checkbox
     "ans_plan_ls_patient_elects_supervised_ls_mods" => null, // checkbox
     "ans_plan_ls_patient_elects_supervised_ls_mods" => null, // checkbox
     "ans_plan_ls_explained_exercise_risks" => null, // checkbox
     "ans_plan_ls_explained_exercise_risks" => null, // checkbox
-    "ans_plan_ls_instructed_bp_random_times_daily" => null, // checkbox
+    "ans_plan_ls_instructed_bp_random_times_daily" => null, // checkbox,
+    "ans_total_mins_spent" => ''
 
 
 ];
 ];
 if (!!@$point->data) {
 if (!!@$point->data) {
@@ -119,437 +120,321 @@ if (!!@$point->data) {
 }
 }
 
 
 ?>
 ?>
-
-<div class="p-3 mb-0">
-	<ul class="mb-0">
-		<li><strong>For the second visit</strong>, every patient is so unique. Please complete a standard SOAP note. Here are key points:</strong></li>
-		<li>How are you?</li>
-		<li>Did you receive the meters? Any issues?</li>
-		<li>Reiterate education about asymptomatic hypoxia and guidelines to check regularly.</li>
-		<li>If SpO2 drops slightly, call us or your PCP.</li>
-		<li>If SpO2 drops to 94, go straight to the ER, even if you feel fine.</li>
-		<li>How are you doing with your other conditions?</li>
-		<li>How are you doing with stress? Stress really affects your blood pressure and even your blood sugar. COVID-19 has created so much stress in our lives, 7 in 10 adults now report anxiety or feelings of depression and isolation.</li>
-		<li><a href="https://press.aarp.org/AARP-Survey-7-in-10-Older-Adults-Report-Increased-Feelings-of-Anxiety-Sadness-and-Depression-Due-to-Coronavirus">AARP Link</a></li>
-	</ul>
-</div>
-
-<hr class="m-1">
-
 <div class="events-none form-read-mode">
 <div class="events-none form-read-mode">
-
-    <div class="mb-2">
-        <label>How are you?</label> 
-        <?= segment_template_summary_value_display(@$contentData['ans_how_are_you']) ?>
-    </div>
-
-    <hr class="my-3 d-none">
-
-    <div class="mb-2 d-none">
-        <?php
-        $mailingAddress = implode(' ', [$patient->mailing_address_line1, $patient->mailing_address_line2, $patient->mailing_address_city, $patient->mailing_address_state, $patient->mailing_address_zip]);
-        ?>
-        <label>Let me confirm your mailing address: {{$mailingAddress}}</label>
-        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_is_address_correct'])) ?>
-    </div>
-    
-    @if(strlen(@$contentData['ans_corrected_address']))
     <div class="mb-2">
     <div class="mb-2">
-        <label>If different from above:</label>
-        <?= segment_template_summary_value_display(@$contentData['ans_corrected_address']) ?>
-    </div>
-    @endif
-
-    <hr class="my-3">
-
-    <div class="mb-2">
-        Our goal right now is to help you stay healthy and monitor your most important vital signs at home during this pandemic.
+        <label><b>{{ $patient->displayName() }}</b> is a <b>{{$patient->age_in_years }} year(s) </b> 
+            @if($patient->sex == 'M')
+                <b>Male</b>
+            @elseif($patient->sex == 'F')
+                <b>Female</b>
+            @else
+                <b>(Unspecified Gender)</b>
+            @endif
+         presenting via telehealth for consultation regarding COVID-19 prevention and early detection.</label>
     </div>
     </div>
     <div class="mb-2 ml-3">
     <div class="mb-2 ml-3">
+        <div class="mb-2">
+        Points discussed:
+        </div>
         <ul>
         <ul>
-            <li>So as you might know, last week Governor Hogan declared a state of emergency.</li>
-            <li>Right now, there are more individuals hospitalized in Maryland due to COVID-19 than at any previous point in the entire pandemic.</li>
-            <li>
-                So self-monitoring your vitals is more important than ever these days because even though vaccines are really effective, there’s an ongoing risk of getting COVID even after vaccination.
-                <ul>
-                    <li>It’s likely that COVID is going to become ‘endemic’ like the flu, where the virus is here to stay and change season to season.</li>
-                    <li>So you do need a long-term strategy to protect yourself in addition to vaccines.</li>
-                    <li>Small changes in your temperature or oxygen levels are extremely helpful in detecting COVID early, and early treatment is extremely effective at preventing hospitalization.</li>
-                    <li>
-                        <label><b>Does that make sense?</b></label>
-                        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_goal_expl_feedback'])) ?>
-                    </li>
-                </ul>
-            </li>
+            <li>Recent surge in cases and hospitalizations.</li>
+            <li>Importance of self-monitoring and vigilance of vital signs.</li>
+            <li>Importance of vaccination.</li>
+            <li>Ongoing risk of breakthrough COVID as COVID becomes endemic like flu.</li>
+            <li>Early warning signs of COVID relating to temperature and hypoxia.</li>
         </ul>
         </ul>
     </div>
     </div>
-
+    @if(@$contentData['ans_goal_expl_feedback'] == 'yes')
     <div class="mb-2">
     <div class="mb-2">
-        <label>So today we’re going to conduct a quick intake, I’m going to give you some important information, and then we’ll get you all set up. <b>Ok?</b></label>
-        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_quick_intake_expl_feedback'])) ?>
-    </div>
-
-    <hr class="my-3">
-
-    <div class="mb-1">
-        So first we’re going to talk a little bit about the <b>baseline</b> numbers of your vital signs.
+        <?= segment_template_summary_value_display('Patient verbalized understanding.') ?>
     </div>
     </div>
-
-    <div class="mb-1">
-        Baseline means what is normal for <b>you</b>.
+    @elseif(@$contentData['ans_goal_expl_feedback'] == 'no')
+    <div class="mb-2">
+        <?= segment_template_summary_value_display('Patient verbalized lack of understanding.') ?>
     </div>
     </div>
-
+    @else
     <div class="mb-2">
     <div class="mb-2">
-        <label class="mb-1">For example, have you heard that normal body temperature is 98.6 F?.</label>
-        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_normal_temp_is_986'])) ?>
+        <?= segment_template_summary_value_display('') ?>
     </div>
     </div>
+    @endif
 
 
-    <div class="mb-2 ml-3">
-        <ul>
-            <li>So, that’s the <b>average</b> for all humans.</li>
-            <li>But everyone is unique. Some people run hotter and some run colder.</li>
-            <li>Also, normal body temperature number goes <b>down</b> with age</li>
-            <li>As we get older our bodies run on a colder temperature.</li>
-            <li>So when you were 18, your baseline body temperature might have been 98.6, but today it might in fact be 97!</li>
-            <li>So, what’s normal for one person could be signs of a fever in another person!</li>
-            <li>So if someone with a baseline temperature of 97.7 measures in at 98.6, it could mean that <b>they’re not actually normal</b> - in fact they are starting to run a fever!</li>
-            <li>
-                <label><b>Does that make sense?</b></label>
-                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_baseline_expl_feedback_1'])) ?>
-            </li>
-        </ul>
-    </div>
+    <hr class="my-3">
 
 
     <div class="mb-2">
     <div class="mb-2">
-        <label><b>So the numbers you read on self-monitoring equipment mean different things to different people.</b> So we’re going to go through your vital signs and each meter one by one, and I’m going to ask you some questions about each of them. <b>OK?</b></label>
-        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_baseline_expl_feedback_2'])) ?>
+        <label class="d-inline">Explained that baseline vital signs are individualized, and vary due to age esp. Such as temperature, which runs cooler as we age.</label>
+        @if(@$contentData['ans_baseline_expl_feedback_1'] == 'yes')
+        <?= segment_template_summary_value_display('Patient verbalized understanding.') ?>
+        @elseif(@$contentData['ans_baseline_expl_feedback_1'] == 'no')
+        <?= segment_template_summary_value_display('Patient verbalized lack of understanding.') ?>
+        @else
+        <?= segment_template_summary_value_display('') ?>
+        @endif
     </div>
     </div>
 
 
     <hr class="my-3">
     <hr class="my-3">
-
-    <p><b>Temperature</b></p>
+    <div class="mb-2">
+        Asked patient the following:
+    </div>
 
 
     <div class="ml-3">
     <div class="ml-3">
 
 
         <div class="mb-2">
         <div class="mb-2">
-            <label>Do you know what your baseline temperature usually reads in at?</label>
+            <label>-Baseline temperature, to which they replied: </label>
             <?= segment_template_summary_value_display(@$contentData['ans_baseline_temperature']) ?>
             <?= segment_template_summary_value_display(@$contentData['ans_baseline_temperature']) ?>
         </div>
         </div>
 
 
-        <div class="mb-2 ml-3">
-            If you don't, don’t worry, we can measure that once you get the thermometer.
-        </div>
-
         <div class="mb-2">
         <div class="mb-2">
-            <label class="mb-1">Do you currently feel like you may be running high?</label>
+            <label class="mb-1">-If they currently feel like they're running a fever, to which they replied:</label>
             <?= segment_template_summary_value_display(@$contentData['ans_currently_running_high']) ?>
             <?= segment_template_summary_value_display(@$contentData['ans_currently_running_high']) ?>
         </div>
         </div>
 
 
-    </div>
-
-    <hr class="my-3">
-
-    <p class="mb-3"><b>Blood Oxygen / Pulmonary</b></p>
-
-    <div class="ml-3">
-
         <div class="mb-2">
         <div class="mb-2">
-            <label>And what about your baseline blood oxygen, do you know what that usually reads in at?</label>
+            <label>-Baseline SpO2, to which they replied:</label>
             <?= segment_template_summary_value_display(@$contentData['ans_baseline_blood_ox']) ?>
             <?= segment_template_summary_value_display(@$contentData['ans_baseline_blood_ox']) ?>
         </div>
         </div>
 
 
-        <div class="mb-2 ml-3">
-            <ul>
-                <li>
-                    <label>Have you ever operated a fingertip pulse oxygen meter by yourself?</label>
-                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_blood_ox_by_self'])) ?>
-                </li>
-                <li>
-                    Blood oxygen is particularly important to know about these days.
-                    <ul>
-                        <li>There are many causes of fever.</li>
-                        <li>Most of them, like the normal flu, don’t affect your oxygen level.</li>
-                        <li>COVID, however, almost always causes a drop in your oxygen level!</li>
-                        <li>So, if you ever have a fever, and notice a drop in your blood oxygen level as well, it’s more likely to be COVID and you can help you seek appropriate medical attention sooner.</li>
-                        <li>
-                            <label>Does that make sense?</label>
-                            <?= segment_template_summary_value_display(ucwords(@$contentData['ans_blood_ox_expl_feedback'])) ?>
-                        </li>
-                        <li>
-                            Have you ever been diagnosed with any condition that affects the lungs and may possibly affect your blood oxygen readings, such as COVID, asthma, or COPD?
-                            <ul>
-                                <li>
-                                    <div>
-                                        <label>COVID</label>
-                                        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_blood_ox_condition_covid'])) ?>
-                                    </div>
-                                    <ul>
-                                        <li class="mb-2">
-                                            <label>How are you feeling now?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_covid_how_now']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Have you recovered completely?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_covid_recovered']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Do you have any lingering symptoms like Shortness of breath, weakness, or brain fog?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_covid_lingering_symptoms']) ?>
-                                        </li>
-                                    </ul>
-                                </li>
-                                <li>
-                                    <div>
-                                        <label>Asthma</label>
-                                        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_blood_ox_condition_asthma'] )) ?>
-                                    </div>
-                                    <ul>
-                                        <li class="mb-2">
-                                            <label>How are you feeling now?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_asthma_how_now']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label class="mb-1">Have you recovered completely?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_asthma_recovered']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Do you have any lingering symptoms like Shortness of breath, weakness, or brain fog?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_asthma_lingering_symptoms']) ?>
-                                        </li>
-                                    </ul>
-                                </li>
-                                <li>
-                                    <div>
-                                        <label>COPD</label>
-                                        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_blood_ox_condition_copd'])) ?>
-                                    </div>
-                                    <ul>
-                                        <li class="mb-2">
-                                            <label>How are you feeling now?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_copd_how_now']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Have you recovered completely?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_copd_recovered']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Do you have any lingering symptoms like Shortness of breath, weakness, or brain fog?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_copd_lingering_symptoms']) ?>
-                                        </li>
-                                    </ul>
-                                </li>
-                                <li>
-                                    <div>
-                                        <label>Other</label>
-                                        <?= segment_template_summary_value_display(@$contentData['ans_blood_ox_condition_other']) ?>
-                                    </div>
-                                    <ul>
-                                        <li class="mb-2">
-                                            <label>How are you feeling now?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_other_how_now']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Have you recovered completely?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_other_recovered']) ?>
-                                        </li>
-                                        <li class="mb-2">
-                                            <label>Do you have any lingering symptoms like Shortness of breath, weakness, or brain fog?</label>
-                                            <?= segment_template_summary_value_display(@$contentData['ans_condition_other_lingering_symptoms']) ?>
-                                        </li>
-                                    </ul>
-                                </li>
-                            </ul>
-                        </li>
-
-                    </ul>
-                </li>
-            </ul>
+        <div class="mb-2">
+            <label>-If they have ever used fingertip oximeter, to which they replied:</label>
+            <?= segment_template_summary_value_display(ucwords(@$contentData['ans_blood_ox_by_self'])) ?>
         </div>
         </div>
 
 
     </div>
     </div>
 
 
     <hr class="my-3">
     <hr class="my-3">
 
 
-    <p><b>Blood Oxygen / Pulmonary</b></p>
+    <div class="mb-2">
+        <label>Discussed risk of asymptomatic hypoxia during COVID.</label>
+        @if(@$contentData['ans_blood_ox_expl_feedback'] == 'yes')
+        <?= segment_template_summary_value_display('Patient verbalized understanding.') ?>
+        @elseif(@$contentData['ans_blood_ox_expl_feedback'] == 'no')
+        <?= segment_template_summary_value_display('Patient verbalized lack of understanding.') ?>
+        @else
+        <?= segment_template_summary_value_display('') ?>
+        @endif
+    </div>
 
 
-    <div class="ml-3">
+    <hr class="my-3">
 
 
+    <div class="mb-2">
+        <div>
+            <label>Asked patient if they have ever had COVID, to which:</label>
+            @if(@$contentData['ans_blood_ox_condition_covid'] == 'yes')
+                <?= segment_template_summary_value_display('Patient reports having COVID.') ?>
+            @elseif(@$contentData['ans_blood_ox_condition_covid'] == 'no')
+                <?= segment_template_summary_value_display('Patient denies having COVID.') ?>
+            @else
+                <?= segment_template_summary_value_display('') ?>
+            @endif
+            
+        </div>
+        <div>
+            <label>Asked patient how they are feeling now, to which they replied</label>
+            <?= segment_template_summary_value_display(@$contentData['ans_condition_covid_how_now']) ?>
+        </div>
         <div class="mb-2">
         <div class="mb-2">
-            <label>Do you know what your baseline heart rate and blood pressure usually read in at?</label>
-            <div class="pl-3">
-                <div>Heart Rate: <?= segment_template_summary_value_display(@$contentData['ans_baseline_heart_rate']) ?></div>
-                <div>BP: <?= segment_template_summary_value_display(@$contentData['ans_baseline_bp']) ?></div>
-            </div>
+            <label> Asked patient if they've recovered completely, to which they replied</label>
+            <?= segment_template_summary_value_display(@$contentData['ans_condition_covid_recovered']) ?>
         </div>
         </div>
-
         <div class="mb-2">
         <div class="mb-2">
-            <label>Have you ever operated a digital blood pressure and pulse meter by yourself?</label>
-            <?= segment_template_summary_value_display(ucwords(@$contentData['ans_bp_by_self'])) ?>
+            <label>Asked patient if they have any lingering symptoms like shortness of breath, weakness, or brain fog, to which they replied <?= segment_template_summary_value_display(@$contentData['ans_condition_covid_lingering_symptoms']) ?></label>
+            
         </div>
         </div>
+    </div>
 
 
-        <div class="mb-2">
-            <label>Have you ever been diagnosed with high blood pressure?</label>
-            <?= segment_template_summary_value_display(ucwords(@$contentData['ans_high_bp_ever'])) ?>
+    <hr class="my-3">
+    <div class="mb-2">
+        <div>
+            <label>Asked patient if they have ever had asthma, to which:</label>
+            @if(@$contentData['ans_blood_ox_condition_asthma'] == 'yes')
+                <?= segment_template_summary_value_display('Patient reports having Asthma.') ?>
+            @elseif(@$contentData['ans_blood_ox_condition_asthma'] == 'no')
+                <?= segment_template_summary_value_display('Patient denies having Asthma.') ?>
+            @else
+                <?= segment_template_summary_value_display('') ?>
+            @endif
         </div>
         </div>
 
 
-        <div class="mb-2">
-            <label>Do you take BP medicine?</label>
-            <?= segment_template_summary_value_display(ucwords(@$contentData['ans_bp_medicine'])) ?>
+        <div>
+            <label>Asked patient if they have ever had COPD, to which:</label>
+            @if(@$contentData['ans_blood_ox_condition_copd'] == 'yes')
+                <?= segment_template_summary_value_display('Patient reports having COPD.') ?>
+            @elseif(@$contentData['ans_blood_ox_condition_copd'] == 'no')
+                <?= segment_template_summary_value_display('Patient denies having COPD.') ?>
+            @else
+                <?= segment_template_summary_value_display('') ?>
+            @endif
+        </div>
+        <div>
+            <label>Asked patient if they have ever had any other lung condition that affects oxygen, to which they replied</label>
+            <?= segment_template_summary_value_display(@$contentData['ans_blood_ox_condition_other']) ?>
         </div>
         </div>
 
 
-        <div class="mb-3 ml-3">
-            <label class="mb-2">If taking BP medication:</label>
-            <div class="pl-3">
-                @if(@$contentData['ans_bp_medicine_1_type'])
-                <div class="mb-2">
-                    ▸ <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_1_type']) ?>: 
-                    <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_1_dose']) ?>                
-                </div>
-                @endif
+    </div>
 
 
-                @if(@$contentData['ans_bp_medicine_2_type'])
-                <div class="mb-2">
-                    ▸ <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_2_type']) ?>: 
-                    <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_2_dose']) ?>                
-                </div>
-                @endif
+    <hr class="my-3">
+    <div class="mb-2">
+        <div class="mb-2">
+                <label>Asked patient their baseline heart rate and BP:</label>
+                <div class="mr-3 d-inline">Heart Rate: <?= segment_template_summary_value_display(@$contentData['ans_baseline_heart_rate']) ?></div>
+                        <div class="d-inline">BP: <?= segment_template_summary_value_display(@$contentData['ans_baseline_bp']) ?></div>
+            </div>
 
 
-                @if(@$contentData['ans_bp_medicine_3_type'])
-                <div class="mb-2">
-                    ▸ <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_3_type']) ?>: 
-                    <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_3_dose']) ?>                
-                </div>
+            <div class="mb-2">
+                <label>Asked patient if they have ever operated a digital BP / pulse meter. Patient response:</label>
+                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_bp_by_self'])) ?>
+            </div>
+
+            <div class="mb-2">
+                <label>Asked patient if ever Dx of HTN, patient response:</label>
+                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_high_bp_ever'])) ?>
+            </div>
+
+            <div class="mb-2">
+                <label>Asked patient if they have ever taken BP medicine, patient response:</label>
+                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_bp_medicine'])) ?>
+            </div>
+
+            @if(@$contentData['ans_bp_medicine'] == 'yes')
+                <div class="mb-3 ml-3">
+                <label class="mb-2">BP medicine reported:</label>
+                @if(!strlen(@$contentData['ans_bp_medicine_1_type']) && !strlen(@$contentData['ans_bp_medicine_2_type']) && !strlen(@$contentData['ans_bp_medicine_3_type']))
+                    <?= segment_template_summary_value_display('None') ?>
                 @endif
                 @endif
+                <div class="pl-3">
+                    @if(@$contentData['ans_bp_medicine_1_type'])
+                    <div class="mb-2">
+                        ▸ <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_1_type']) ?>:
+                        <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_1_dose']) ?>
+                    </div>
+                    @endif
+
+                    @if(@$contentData['ans_bp_medicine_2_type'])
+                    <div class="mb-2">
+                        ▸ <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_2_type']) ?>:
+                        <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_2_dose']) ?>
+                    </div>
+                    @endif
+
+                    @if(@$contentData['ans_bp_medicine_3_type'])
+                    <div class="mb-2">
+                        ▸ <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_3_type']) ?>:
+                        <?= segment_template_summary_value_display(@$contentData['ans_bp_medicine_3_dose']) ?>
+                    </div>
+                    @endif
+                </div>
             </div>
             </div>
-            
-        </div>
+            @endif
 
 
-        <div class="mb-2">
-            <label class="mb-1">Have you ever been diagnosed with any cardiac or heart condition that may affect your heart rate or blood pressure, such as....?</label>
-            <ul>
-                <li>
-                    <label>CAD or other atherosclerosis</label>
-                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_cardiac_heart_ever_cad'])) ?>
-                </li>
-                <li>
-                    <label>Irregular heart rhythm</label>
-                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_cardiac_heart_ever_irr'])) ?>
-                </li>
-                <li>
-                    <label>CHF</label>
-                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_cardiac_heart_ever_chf'])) ?>
-                </li>
-                <li>
-                    <label>Other</label>
-                    <?= segment_template_summary_value_display(@$contentData['ans_cardiac_heart_ever_other']) ?>
-                </li>
-            </ul>
-        </div>
+            <div class="mb-2">
+                <label>CAD or other atherosclerosis:</label>
+                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_cardiac_heart_ever_cad'])) ?>
+            </div>
+            <div class="mb-2">
+                <label>Irregular heart rhythm</label>
+                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_cardiac_heart_ever_irr'])) ?>
+            </div>
+            <div class="mb-2">
+                <label>CHF</label>
+                <?= segment_template_summary_value_display(ucwords(@$contentData['ans_cardiac_heart_ever_chf'])) ?>
+            </div>
+            <div class="mb-2">
+                <label>Other</label>
+                <?= segment_template_summary_value_display(@$contentData['ans_cardiac_heart_ever_other']) ?>
+            </div>
+    </div>
+    <hr class="my-3">
 
 
-        <div class="mb-2">
-            <label class="mb-1">Do you have any:</label>
+    <div class="mb-2">
+    <label>Asked patient following:</label>
+        <div class="ml-3">            
             <ul>
             <ul>
                 <li>
                 <li>
-                    <label>Chest pain</label>
+                    <label> Chest pain, patient response:</label>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_chest_pain'])) ?>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_chest_pain'])) ?>
                 </li>
                 </li>
                 <li>
                 <li>
-                    <label>Shortness of breath?</label>
+                    <label>Shortness of breath,patient response:</label>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_shortness_of_breath'])) ?>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_shortness_of_breath'])) ?>
                 </li>
                 </li>
                 <li>
                 <li>
-                    <label>Fatigue or light-headedness?</label>
+                    <label>Fatigue or light-headedness, patient response:</label>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_fatigue'])) ?>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_fatigue'])) ?>
                 </li>
                 </li>
                 <li>
                 <li>
-                    <label>Headache?</label>
+                    <label>Headache, patient response:</label>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_headache'])) ?>
                     <?= segment_template_summary_value_display(ucwords(@$contentData['ans_headache'])) ?>
                 </li>
                 </li>
-            </ul>
-        </div>
-
-        <div class="mb-2">
-            <label>Do you ever notice an increase in your heart rate?</label>
-            <?= segment_template_summary_value_display(ucwords(@$contentData['ans_increase_in_heart_rate'])) ?>
-            <ul>
-                <li>
-                    <label>How ofter?</label>
-                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_increase_in_heart_rate_frequency'])) ?>
-                </li>
                 <li>
                 <li>
-                    <label>Do you monitor your BP before / after workouts?</label>
-                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_monitor_bp_before_after_workouts'])) ?>
+                    <label>Ever feels increase in heart rate, patient response:</label>
+                    <?= segment_template_summary_value_display(ucwords(@$contentData['ans_increase_in_heart_rate'])) ?>
+                    @if(@$contentData['ans_increase_in_heart_rate'] == 'yes')
+                    ; How often: <?= segment_template_summary_value_display(ucwords(@$contentData['ans_increase_in_heart_rate_frequency'])) ?>
+                    @endif
                 </li>
                 </li>
             </ul>
             </ul>
         </div>
         </div>
-
+    </div>
+    <hr class="my-3">
+    <div class="mb-2">
+        <label>Do you monitor your BP before / after workouts? Response:</label>
+        <?= segment_template_summary_value_display(ucwords(@$contentData['ans_monitor_bp_before_after_workouts'])) ?>
     </div>
     </div>
 
 
     <hr class="my-3">
     <hr class="my-3">
 
 
-    <p><b>Vaccine Status:</b></p>
-    <div class="pl-3 mb-3">
-        <div>
-        ▸ Not enough rapport right now to ask: <?= @$contentData['ans_monitor_bp_before_after_workouts'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
-        </div>
-        <div>
-        ▸ Declined to answer: <?= @$contentData['ans_vaccine_status_declined_to_answer'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
+    <p>Regarding vaccine status:
+        @if(@$contentData['ans_vaccine_status_declined_to_answer'] == 'yes')
+            <?= segment_template_summary_value_display('Patient declined to provide vaccine status.') ?>
+        @else
             @if(@$contentData['ans_vaccine_status'])
             @if(@$contentData['ans_vaccine_status'])
-            <small class="ml-3"><i><?= segment_template_summary_value_display(@$contentData['ans_vaccine_status']) ?></i></small>
+                <?= segment_template_summary_value_display(@$contentData['ans_vaccine_status']) ?>
+            @else
+                <?= segment_template_summary_value_display('') ?>
             @endif
             @endif
-        </div>
-    </div>
+        @endif
+    </p>
 
 
-
-    <p><b>Booster Status:</b></p>
-    <div class="pl-3 mb-3">
-        <div>
-        ▸ Not enough rapport right now to ask: <?= @$contentData['ans_booster_status_not_enough_rapport'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
-        </div>
-        <div>
-        ▸ Declined to answer: <?= @$contentData['ans_booster_status_declined_to_answer'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
+    <p>Regarding booster status:
+        @if(@$contentData['ans_booster_status_declined_to_answer'] == 'yes')
+            <?= segment_template_summary_value_display('Patient declined to provide booster status.') ?>
+        @else
             @if(@$contentData['ans_booster_status'])
             @if(@$contentData['ans_booster_status'])
-            <small class="ml-3"><i><?= segment_template_summary_value_display(@$contentData['ans_booster_status']) ?></i></small>
+                <?= segment_template_summary_value_display(@$contentData['ans_booster_status']) ?>
+            @else
+                <?= segment_template_summary_value_display('') ?>
             @endif
             @endif
-        </div>
-    </div>
+        @endif
+    </p>
 
 
     <div class="mb-3">
     <div class="mb-3">
-        <label>Current Behaviors to Stay Safe:</label>
+        <label>Asked patient about current behaviors they are partaking to stay safe, to which they replied:</label>
         <?= segment_template_summary_value_display(@$contentData['ans_current_behaviors_to_stay_safe']) ?>
         <?= segment_template_summary_value_display(@$contentData['ans_current_behaviors_to_stay_safe']) ?>
     </div>
     </div>
 
 
-    <p><b>Education Provided:</b></p>
+    <p>Education Provided:
+    @if(!strlen(@$contentData['ans_edu_provided_use_of_smd']) && !strlen(@$contentData['ans_edu_provided_asymptomatic_hypoxia']) && !strlen(@$contentData['ans_edu_provided_cdc_guidelines']))
+        <?= segment_template_summary_value_display('') ?>
+    @endif
+    </p>
     <div class="pl-3 mb-3">
     <div class="pl-3 mb-3">
+        @if(@$contentData['ans_edu_provided_use_of_smd'] == 'yes')
         <div>
         <div>
-        ▸ Appropriate use of self-monitoring devices: <?= @$contentData['ans_edu_provided_use_of_smd'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
+            ▸ Appropriate use of self-monitoring devices
         </div>
         </div>
+        @endif
+        @if(@$contentData['ans_edu_provided_asymptomatic_hypoxia'] == 'yes')
         <div>
         <div>
-        ▸ Asymptomatic hypoxia: <?= @$contentData['ans_edu_provided_asymptomatic_hypoxia'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
+            ▸ Asymptomatic hypoxia
         </div>
         </div>
+        @endif
+        @if(@$contentData['ans_edu_provided_cdc_guidelines'] == 'yes')
         <div>
         <div>
-        ▸ CDC guidelines: <?= @$contentData['ans_edu_provided_cdc_guidelines'] ? 
-            segment_template_summary_value_display('Yes')
-            :
-            segment_template_summary_value_display('No') ?>
-        </div>        
+            ▸ CDC guidelines
+        </div>
+        @endif
+    </div>
+    <div class="mb-3">
+        <label>A total of <?= segment_template_summary_value_display(@$contentData['ans_total_mins_spent'], '', 'ml-0') ?> minutes was spent on this visit counseling or educating a patient or caregiver, documentation, and care coordination. Over 50% of this time was directed towards counseling and education.</label>
+        
     </div>
     </div>
 </div>
 </div>

+ 92 - 0
resources/views/app/patient/segment-templates/how_to_smbp/edit.blade.php

@@ -0,0 +1,92 @@
+<?php
+
+use App\Models\Point;
+
+$category = 'HOW_TO_SMBP';
+$endPoint = 'upsertNoteSingleton';
+
+//$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
+
+$bp_checkboxes = [
+    [
+        'section' => 'Prepare',
+        'items' => [
+            'Avoid caffeine, cigarettes and other stimulants 30 minutes before you measure your blood pressure.',
+            'Wait at least 30 minutes after a meal.',
+            'If you’re on blood pressure medication, measure your BP before you take your medication.',
+            'Empty your bladder beforehand.',
+            'Find a quiet space where you can sit comfortably without distraction.'
+        ],
+    ],
+    [
+        'section' => 'Position',
+        'items' => [
+            'Put cuff on bare arm, above elbow at mid-arm.',
+            'Position arm so cuff is at heart level.',
+            'Keep arm supported, palm up, with muscles relaxed.',
+            'Sit with legs uncrossed.',
+            'Keep feet flat on the floor.',
+            'Keep your back supported.'
+
+        ]
+    ],
+    [
+        'section' => 'Measure',
+        'items' => [
+            'Rest for five minutes while in position before starting.',
+            'Take two or three measurements, one minute apart.',
+            'Keep your body relaxed and in position during measurements.',
+            'Sit quietly with no distractions during measurements—avoid conversations, TV, phones and other devices.',
+            'Record your measurements when finished.'
+        ]
+    ]
+];
+	
+$contentData = [];
+
+foreach($bp_checkboxes as $x){
+    foreach($x['items'] as $item){
+        $contentData[$item] = null;
+    }
+}
+
+if (!!@$point->data) {
+    $contentData = json_decode($point->data, true);
+}
+
+?>
+
+<div visit-moe close-on-save close-on-cancel class="d-block p-3">
+    <form show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="category" value="<?= $category ?>">
+        <input type="hidden" name="data" value="{{json_encode($contentData)}}">
+
+        @foreach($bp_checkboxes as $cb)
+            <h2>{{$cb['section']}}</h2>
+            @foreach($cb['items'] as $item)
+            <div class="ml-3 mb-1">
+                <label class="mb-1 d-flex align-items-center">
+                    <input type="checkbox" data-name="{{$item}}" {{@($contentData[$item] ? 'checked' : '')}} class="mr-2">
+                    <span class="ml-2">{{$item}}</strong></span>
+                </label>
+            </div>
+            @endforeach
+            @if($cb['section'] != 'Measure')
+            <hr class="my-3">
+            @endif
+        @endforeach
+
+        <div class="pt-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>

+ 82 - 0
resources/views/app/patient/segment-templates/how_to_smbp/summary.blade.php

@@ -0,0 +1,82 @@
+<?php
+
+use App\Models\Point;
+
+$category = 'HOW_TO_SMBP';
+$endPoint = 'upsertNoteSingleton';
+
+//$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$point = Point::where('added_in_segment_id', $segment->id)->where('category', $category)->orderBy('id', 'DESC')->first();
+
+
+$bp_checkboxes = [
+    [
+        'section' => 'Prepare',
+        'items' => [
+            'Avoid caffeine, cigarettes and other stimulants 30 minutes before you measure your blood pressure.',
+            'Wait at least 30 minutes after a meal.',
+            'If you’re on blood pressure medication, measure your BP before you take your medication.',
+            'Empty your bladder beforehand.',
+            'Find a quiet space where you can sit comfortably without distraction.'
+        ],
+    ],
+    [
+        'section' => 'Position',
+        'items' => [
+            'Put cuff on bare arm, above elbow at mid-arm.',
+            'Position arm so cuff is at heart level.',
+            'Keep arm supported, palm up, with muscles relaxed.',
+            'Sit with legs uncrossed.',
+            'Keep feet flat on the floor.',
+            'Keep your back supported.'
+
+        ]
+    ],
+    [
+        'section' => 'Measure',
+        'items' => [
+            'Rest for five minutes while in position before starting.',
+            'Take two or three measurements, one minute apart.',
+            'Keep your body relaxed and in position during measurements.',
+            'Sit quietly with no distractions during measurements—avoid conversations, TV, phones and other devices.',
+            'Record your measurements when finished.'
+        ]
+    ]
+];
+	
+$contentData = [];
+
+foreach($bp_checkboxes as $x){
+    foreach($x['items'] as $item){
+        $contentData[$item] = null;
+    }
+}
+
+if (!!@$point->data) {
+    $contentData = json_decode($point->data, true);
+}
+
+?>
+
+<div visit-moe close-on-save close-on-cancel class="d-block">
+    <form show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="category" value="<?= $category ?>">
+        <input type="hidden" name="data" value="{{json_encode($contentData)}}">
+
+        @foreach($bp_checkboxes as $cb)
+            <h2>{{$cb['section']}}</h2>
+            @foreach($cb['items'] as $item)
+            <div class="ml-1 mb-1">
+                <label class="mb-1 d-flex align-items-center">
+                    <input readonly type="checkbox" data-name="{{$item}}" {{@($contentData[$item] ? 'checked' : '')}} class="mr-2">
+                    <span class="ml-2">{{$item}}</strong></span>
+                </label>
+            </div>
+            @endforeach
+            @if($cb['section'] != 'Measure')
+            <hr class="my-3">
+            @endif
+        @endforeach
+    </form>
+</div>

+ 205 - 0
resources/views/app/practice-management/rm-action-report.blade.php

@@ -0,0 +1,205 @@
+@extends ('layouts/template')
+
+@section('content')
+<style>
+	#rm-action-report-filters label {
+		font-weight: bold;
+	}
+
+	#rm-action-report-filters .mw-100px {
+		min-width: 100px;
+	}
+	.filter-container{
+		display: flex;
+		align-items: flex-start;
+		flex-wrap: wrap;
+	}
+	.filter-container >div {
+		width: 165px;
+	}
+	.filter-container >div:not(:last-child) {
+		margin-right: 15px;
+	}
+	.sm-section {
+		width: 200px !important;
+	}
+</style>
+<div id="rm-action-report" class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-2 py-1 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-user"></i>
+                RM Action Report
+            </strong>
+        </div>
+        <div class="card-body p-0 border-0 table-responsive">
+            <div class="m-2">
+                <form id="rm-action-report-filters" method="GET" action="{{ route('practice-management.rmActionReport') }}" class="filter-container" v-cloak>
+                    <div class="sm-section">
+                        <div class="form-group">
+                            <label>Care Month Start Date:</label>
+                            <input name="care_month_start_date" type="date" class="form-control input-sm" v-model="filters.care_month_start_date">
+                        </div>
+                    </div>
+                    <div class="sm-section">
+                        <div class="form-group">
+                            <label>Number Of Measurement Days:</label>
+                            <select name="num_of_measurements" class="form-control input-sm" v-model="filters.num_of_measurements">
+                                <option value="">All</option>
+                                <option value="16_or_more">16 or more</option>
+                                <option value="min_or_more">{{$minRequiredMeasurements}} or more</option>
+                                <option value="less_than_min">Less than {{$minRequiredMeasurements}}</option>
+                            </select>
+                        </div>
+                    </div>
+
+                    <div class="sm-section">
+                        <div class="form-group">
+                            <label>Has had visit in the last 90 days:</label>
+                            <select name="has_recent_visit" class="form-control input-sm" v-model="filters.has_recent_visit">
+                                <option value="">All</option>
+                                <option value="YES">Yes</option>
+                                <option value="NO">No</option>
+                            </select>
+                        </div>
+                    </div>
+
+                    <div class="sm-section">
+                        <div class="form-group">
+                            <label>Has been spoken to this month:</label>
+                            <select name="has_been_spoken_to" class="form-control input-sm" v-model="filters.has_been_spoken_to">
+                                <option value="">All</option>
+                                <option value="YES">Yes</option>
+                                <option value="NO">No</option>
+                            </select>
+                        </div>
+                    </div>
+
+                    <div>
+                        <div class="form-group">
+                            <label>&nbsp;</label>
+                            <div class=" d-flex">
+                                <button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
+                                <a href="#" v-on:click.prevent="fastLoad('{{route('mcp.patients')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div> 
+            <table class="table table-sm table-striped border-0 p-0 m-0 text-nowrap">
+                <thead class="bg-light">
+                    <tr>
+                        <th>Patient</th>
+                        <th>Care Month</th>
+                        <th>MCP</th>
+                        <th>Number of Measurement Days</th>
+                        <th>Has Been Spoken To This Month</th>
+                        <th>Days Since Last Visit</th>
+                        <th>Last Visit Date</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach ($rows as $row)
+                    <tr class="{{false ? 'bg-light' : ''}}">
+                        <td class="text-nowrap border-left-0">
+                            <a href="/patients/view/{{$row->client->uid}}">
+                                {{$row->client->name_first}} {{$row->client->name_last}}
+                            </a>
+                        </td>
+                        <td class="text-nowrap border-left-0">
+                            <a href="/patients/view/{{$row->client->uid}}/care-months/view/{{$row->uid}}">
+                                {{friendly_date($row->start_date)}}
+                            </a>
+                        </td>
+                        <td>
+                            @if($row->client->mcp)
+                                {{$row->client->mcp->name_first}} {{$row->client->mcp->name_last}}
+                            @else 
+                                --
+                            @endif
+                        </td>
+                        <td>
+                            {{$row->number_of_days_with_remote_measurements}}
+                        </td>
+                        <td>
+                            {{$row->has_anyone_interacted_with_client_about_rm_outside_note? 'YES': 'NO'}}
+                        </td>
+                        <td>
+                            @if($row->client->most_recent_completed_mcp_note_date)
+                                @php 
+                                    $date1 = new DateTime(friendly_date($row->client->most_recent_completed_mcp_note_date));
+                                    $date2 = new DateTime(get_current_date());
+                                    $diff = $date1->diff($date2);
+                                @endphp 
+                                {{ $diff->days}}
+                            @else 
+                            --
+                            @endif
+                        </td>
+                        <td>
+                            @if($row->client->mostRecentCompletedMcpNote)
+                            <a href="/patients/view/{{$row->client->uid}}/notes/view/{{$row->client->mostRecentCompletedMcpNote->uid}}">
+                                {{friendly_date($row->client->most_recent_completed_mcp_note_date)}}
+                            </a>
+                            @else 
+                            --
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+                </tbody>
+            </table>
+
+        </div>
+    </div>
+    <div class="mt-3">
+        {{$rows->appends(request()->input())->links()}}
+    </div>
+
+</div>
+<?php
+$loadedFilters = $filters;
+$allFilterKeys = [
+	'care_month_start_date',
+    'num_of_measurements',
+    'has_recent_visit',
+    'has_been_spoken_to',
+];
+for ($i=0; $i < count($allFilterKeys); $i++) {
+	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
+		$loadedFilters[$allFilterKeys[$i]] = '';
+	}
+}
+?>
+
+<script>
+	(function() {
+		function init() {
+			new Vue({
+				el: '#rm-action-report-filters',
+				delimiters: ['@{{', '}}'],
+				data: {
+					filters: <?= json_encode($loadedFilters) ?>
+				},
+				methods: {
+					init: function() {
+
+					},
+					doSubmit: function() {
+						fastLoad('{{  route('practice-management.rmActionReport') }}?' + $('#rm-action-report-filters').serialize());
+						return false;
+					}
+				},
+				mounted: function() {
+					console.log(this.filters);
+					this.init();
+				},
+			});
+
+
+		}
+		addMCInitializer('rm-action-report-filters', init, '#rm-action-report-filters');
+	})();
+</script>
+@endsection

+ 83 - 7
resources/views/app/practice-management/supply-orders-ready-to-ship.blade.php

@@ -1,7 +1,11 @@
 @extends ('layouts/template')
 @extends ('layouts/template')
 
 
 @section('content')
 @section('content')
-
+    <style>
+        #practice-supply-orders-ready-to-ship .bulk-actions {
+            width: 188px;
+        }
+    </style>
     <div id="practice-supply-orders-ready-to-ship" class="p-3 mcp-theme-1">
     <div id="practice-supply-orders-ready-to-ship" class="p-3 mcp-theme-1">
         <div class="card">
         <div class="card">
 
 
@@ -20,9 +24,25 @@
 <!--                <a href="{{route('practice-management.supply-orders-ready-to-ship')}}" class="ml-auto">Clear Filters</a>-->
 <!--                <a href="{{route('practice-management.supply-orders-ready-to-ship')}}" class="ml-auto">Clear Filters</a>-->
             </div>
             </div>
             <div class="card-body p-0">
             <div class="card-body p-0">
-                <table class="table table-sm table-condensed p-0 m-0" style="table-layout: fixed">
+                <table id="ordersSupplyReadyToShipTable" class="table table-sm table-condensed p-0 m-0" style="table-layout: fixed">
                     <thead class="bg-light">
                     <thead class="bg-light">
                     <tr>
                     <tr>
+                    <th class="border-0 bulk-actions">
+                        <div class="d-flex align-items-center">
+                            <input type="checkbox" multi-select />
+                            <div class="ml-2">
+                                <div class="dropdown">
+                                    <button class="btn btn btn-outline-primary dropdown-toggle p-1" type="button" id="dropdownMenuButtonOrdersReadyToShip" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                                        Bulk Action
+                                    </button>
+                                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButtonOrdersReadyToShip">
+                                        <a class="dropdown-item" href="#" data-applybulkaction="generate_shipment">Generate Shipment</a>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        
+                    </th>
 <!--                        <th class="border-0">Date</th>-->
 <!--                        <th class="border-0">Date</th>-->
                         <th class="border-0">Patient</th>
                         <th class="border-0">Patient</th>
                         <th class="border-0">Address</th>
                         <th class="border-0">Address</th>
@@ -31,7 +51,7 @@
                         <th class="border-0">Actions</th>
                         <th class="border-0">Actions</th>
                     </tr>
                     </tr>
                     </thead>
                     </thead>
-                    <div>
+                    <tbody>
                     <?php
                     <?php
                     $prevClientAndAddress = null;
                     $prevClientAndAddress = null;
                     $shipmentIndex = 0;
                     $shipmentIndex = 0;
@@ -43,7 +63,7 @@
                             $sameClientAndAddress = false;
                             $sameClientAndAddress = false;
                         ?>
                         ?>
                         @if($currentClientAndAddress !== $prevClientAndAddress)
                         @if($currentClientAndAddress !== $prevClientAndAddress)
-                            <tr class="sep"><td colspan="4"></td></tr>
+                            <tr class="sep"><td colspan="6"></td></tr>
                             <?php
                             <?php
                             $shipmentIndex++;
                             $shipmentIndex++;
                             $prevClientAndAddress = $currentClientAndAddress;
                             $prevClientAndAddress = $currentClientAndAddress;
@@ -60,6 +80,11 @@
                             data-address-zip="{{$supplyOrder->mailing_address_zip}}"
                             data-address-zip="{{$supplyOrder->mailing_address_zip}}"
                             data-shipment-index="{{$shipmentIndex}}"
                             data-shipment-index="{{$shipmentIndex}}"
                             data-supply-order-uid="{{$supplyOrder->uid}}">
                             data-supply-order-uid="{{$supplyOrder->uid}}">
+                            <td class="border-top-0">
+                                @if(!$sameClientAndAddress)
+                                    <input type="checkbox" data-supply="{{$supplyOrder->uid}}" />
+                                @endif
+                            </td>
 <!--                            <td class="align-top border-top-0">{{friendlier_date_time($supplyOrder->created_at)}}</td>-->
 <!--                            <td class="align-top border-top-0">{{friendlier_date_time($supplyOrder->created_at)}}</td>-->
                             <td class="align-top border-top-0">
                             <td class="align-top border-top-0">
                                 @if(!$sameClientAndAddress)
                                 @if(!$sameClientAndAddress)
@@ -90,7 +115,7 @@
                                     </form>
                                     </form>
                                 </div>
                                 </div>
                             </td>
                             </td>
-                            <td>
+                            <td class="border-top-0">
                                 @if(!$sameClientAndAddress)
                                 @if(!$sameClientAndAddress)
                                     @foreach($patient->devices as $device)
                                     @foreach($patient->devices as $device)
                                         <div>
                                         <div>
@@ -103,10 +128,10 @@
                             </td>
                             </td>
                             <td class="align-top border-top-0">
                             <td class="align-top border-top-0">
                                 @if(!$sameClientAndAddress)
                                 @if(!$sameClientAndAddress)
-                                    <a href="#" id="generate-shipment">Generate Shipment</a>
+                                    <a href="#" id="generate-shipment" data-generateshipment="{{ $supplyOrder->uid }}">Generate Shipment</a>
                                 @endif
                                 @endif
                             </td>
                             </td>
-                        </div>
+                        </tr>                        
                     @endforeach
                     @endforeach
                     </tbody>
                     </tbody>
                 </table>
                 </table>
@@ -118,6 +143,56 @@
     </div>
     </div>
 
 
     <script>
     <script>
+        var multiSelectActions = null;
+        
+        (function($){
+            multiSelectActions = {
+                table: null,
+
+                initOnMultiSelect: function(){
+                    var self = this;
+                    $('[multi-select]').change(function(evt){
+                        var input = evt.target;
+                        var isChecked = input.checked ? true:false;
+                        self.toggleAll(isChecked);
+                    });
+                },
+                toggleAll: function(isChecked){
+                    var self = this;
+                    self.table.find('tr input[data-supply]').prop('checked', isChecked);
+                },
+                initBulkAction: function(){
+                    var self = this;
+                    $('[data-applybulkaction]').click(function(evt){
+                        evt.preventDefault();
+                        var action = $(evt.target).data('applybulkaction');
+                        var text = $(evt.target).text();
+                        $('#dropdownMenuButtonOrdersReadyToShip').text(text);
+                        if(action === 'generate_shipment') self.bulkGenerateShipment();
+                    });
+                },
+                bulkGenerateShipment: function(){
+                    var self = this;
+                    var rows = self.table.find('tr');
+                    var count = 0;
+                    $.each(rows, function(i, row){
+                        var rowCheckbox = $(row).find('input[type=checkbox]');
+                        var rowCheckboxIsChecked = rowCheckbox.prop('checked');
+                        var rowCheckedOrderUid = rowCheckbox.data('supply');
+                        if(rowCheckboxIsChecked){
+                            count++;
+                            $('[data-generateshipment='+rowCheckedOrderUid+']').text('Processing...').click();
+                        }
+                    });
+                    if(!count) toastr.error('Nothing selected!');
+                },
+                init: function(){
+                    this.table = $('#ordersSupplyReadyToShipTable');
+                    this.initBulkAction();
+                    this.initOnMultiSelect();
+                }
+            };
+        })(jQuery);
         (function() {
         (function() {
 
 
             function hasError (_data) {
             function hasError (_data) {
@@ -162,6 +237,7 @@
                             }
                             }
                         }, 'json');
                         }, 'json');
                     });
                     });
+                    multiSelectActions.init();
             }
             }
 
 
             addMCInitializer('practice-supply-orders-ready-to-ship', init, '#practice-supply-orders-ready-to-ship')
             addMCInitializer('practice-supply-orders-ready-to-ship', init, '#practice-supply-orders-ready-to-ship')

BIN
resources/views/layouts/.patient.blade.php.swp


+ 78 - 0
resources/views/layouts/deleting_dummies.sql

@@ -0,0 +1,78 @@
+
+SELECT id FROM client WHERE uid = '718eb53f-4267-4d5c-9c9a-2d2bb45941ed';
+
+
+DELETE FROM account_client                                 WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM account_invite                                 WHERE  for_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM action_item                                    WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM bill                                           WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client                                         WHERE  duplicate_of_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client                                         WHERE  source_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM note                                           WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM pro                                            WHERE  shadow_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM amendment                                      WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM app_session                                    WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM app_session                                    WHERE  in_meeting_for_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM appointment                                    WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM bill_care_month_entry                          WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM claim                                          WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM care_month                                     WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM care_month_entry                               WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_ally_update                             WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_bdt_day                                 WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_bdt_device                              WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_bdt_measurement                         WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_bdt_month                               WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_cm_rm_reason                            WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_document                                WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_eligible_refresh                        WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_info_line                               WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_info_line_update                        WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_mb_payer_validation_result              WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_mcp_update                              WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM measurement                                    WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_memo                                    WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_memo_update                             WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_name_change                             WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_onboarding_data_json_update             WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_point_update                            WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_primary_coverage                        WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_pro_access                              WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_pro_change                              WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_program                                 WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_sms                                     WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_sms_number                              WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM client_tag                                     WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM doc                                            WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM dx                                             WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM erx                                            WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM handout_client                                 WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM imail                                          WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM incoming_report                                WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM internal_message                               WHERE  regarding_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM invitation                                     WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM isms                                           WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM lead                                           WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM mb_claim                                       WHERE  mb_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM mc_code_check                                  WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM mcp_request                                    WHERE  for_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM measurement_confirmation_number                WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM page                                           WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM point                                          WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM pro_client_view                                WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM pro_client_work                                WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM pro_transaction                                WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM recurring_appointment                          WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM relationship                                   WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM relationship                                   WHERE  contact_client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM section                                        WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM shipment                                       WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM simple_sms_reminder                            WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM stamp                                          WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM status                                         WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM supply_order                                   WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM task                                           WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM ticket                                         WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+DELETE FROM user_event_log                                 WHERE  client_id IN  (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY') ;
+
+DELETE FROM client WHERE id IN (SELECT id FROM client WHERE client_engagement_status_category = 'DUMMY');

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

@@ -531,16 +531,16 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 											</div>
 											</div>
 
 
 										<div>
 										<div>
-											<label>Physician:</label> {{$patient->pcp ? $patient->pcp->displayName() : '-' }}
+											<label>CC:</label> {{$patient->defaultNaPro ? $patient->defaultNaPro->displayName() : '-' }}
 											@if($pro->pro_type == 'ADMIN')
 											@if($pro->pro_type == 'ADMIN')
 												<div moe class="ml-2 hide-inside-popup">
 												<div moe class="ml-2 hide-inside-popup">
 													<a start show><i class="fa fa-edit"></i></a>
 													<a start show><i class="fa fa-edit"></i></a>
-													<form url="/api/client/putPhysicianPro" class="mcp-theme-1">
+													<form url="/api/client/putDefaultNaPro" class="mcp-theme-1">
 														<input type="hidden" name="uid" value="{{$patient->uid}}">
 														<input type="hidden" name="uid" value="{{$patient->uid}}">
 														<div class="mb-2">
 														<div class="mb-2">
-															<label class="text-secondary text-sm">Physician Pro</label>
-															<select provider-search data-pro-uid="{{ @$patient->pcp->uid }}"
-																	name="physicianProUid"
+															<label class="text-secondary text-sm">Care Coordinator</label>
+															<select provider-search data-pro-uid="{{ @$patient->defaultNaPro->uid }}"
+																	name="defaultNaProUid"
 																	class="form-control form-control-sm">
 																	class="form-control form-control-sm">
 																<option value=""> --select--</option>
 																<option value=""> --select--</option>
 																@foreach($pros as $iPro)
 																@foreach($pros as $iPro)
@@ -561,10 +561,10 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 												@if($patient->pcp)
 												@if($patient->pcp)
 												<div moe class="ml-2 hide-inside-popup">
 												<div moe class="ml-2 hide-inside-popup">
 													<a start show><i class="fa fa-times"></i></a>
 													<a start show><i class="fa fa-times"></i></a>
-													<form url="/api/client/removePhysicianPro" class="mcp-theme-1">
+													<form url="/api/client/removeDefaultNaPro" class="mcp-theme-1">
 														<input type="hidden" name="uid" value="{{$patient->uid}}">
 														<input type="hidden" name="uid" value="{{$patient->uid}}">
 														<div class="mb-2">
 														<div class="mb-2">
-															<label class="text-secondary text-sm">Remove Physician Pro</label>
+															<label class="text-secondary text-sm">Remove Care Coordinator</label>
 
 
                                           </div>
                                           </div>
                                           <div>
                                           <div>
@@ -642,7 +642,7 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 										</div>
 										</div>
 										@endif
 										@endif
 										<div>
 										<div>
-											<a href="#" start show class="d-flex align-items-baseline" onclick="return openInRHS('/pro/meed/{{ $patient->uid }}')"><i class="fa fa-video text-sm mr-1"></i><span>Join</span></a>
+											<a href="#" start show class="d-flex align-items-baseline" onclick="return openInRHS('/pro/meet/{{ $patient->uid }}')"><i class="fa fa-video text-sm mr-1"></i><span>Join</span></a>
 										</div>
 										</div>
                                     </section>
                                     </section>
 									@if(!$patient->getPrimaryCoverage() || $patient->getPrimaryCoverageStatus() !== 'YES')
 									@if(!$patient->getPrimaryCoverage() || $patient->getPrimaryCoverageStatus() !== 'YES')

+ 1 - 0
resources/views/layouts/template.blade.php

@@ -160,6 +160,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.process-notes') }}">Process Notes</a>
                             <a class="dropdown-item" href="{{ route('practice-management.process-notes') }}">Process Notes</a>
                             <a class="dropdown-item" href="{{ route('practice-management.notes-processing-center') }}">Notes Processing Center</a>
                             <a class="dropdown-item" href="{{ route('practice-management.notes-processing-center') }}">Notes Processing Center</a>
                             <a class="dropdown-item" href="{{ route('practice-management.client-ccm-rm-status') }}">Client CCM/RM Status</a>
                             <a class="dropdown-item" href="{{ route('practice-management.client-ccm-rm-status') }}">Client CCM/RM Status</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.rmActionReport') }}">RM Action Report</a>
                             <a class="dropdown-item" href="{{ route('practice-management.hcp-note-activity') }}">HCP Note Activity</a>
                             <a class="dropdown-item" href="{{ route('practice-management.hcp-note-activity') }}">HCP Note Activity</a>
                             
                             
                             @if($pro->id == '1' || $pro->id == '16')
                             @if($pro->id == '1' || $pro->id == '16')

+ 7 - 1
routes/web.php

@@ -91,6 +91,8 @@ Route::middleware('pro.auth')->group(function () {
 
 
         Route::get('new-patients-awaiting-visit', 'McpController@new_patients_awaiting_visit')->name('new_patients_awaiting_visit');
         Route::get('new-patients-awaiting-visit', 'McpController@new_patients_awaiting_visit')->name('new_patients_awaiting_visit');
         Route::get('notes-pending-signature', 'McpController@notes_pending_signature')->name('notes_pending_signature');
         Route::get('notes-pending-signature', 'McpController@notes_pending_signature')->name('notes_pending_signature');
+        Route::get('notes-pending-summary-suggestion', 'McpController@notes_pending_summary_suggestion')->name('notes_pending_summary_suggestion');
+        Route::get('notes-rejected-summary-suggestion', 'McpController@notes_rejected_summary_suggestion')->name('notes_rejected_summary_suggestion');
         Route::get('notes-pending-billing', 'McpController@notes_pending_billing')->name('notes_pending_billing');
         Route::get('notes-pending-billing', 'McpController@notes_pending_billing')->name('notes_pending_billing');
         Route::get('bills-pending-signature', 'McpController@bills_pending_signature')->name('bills_pending_signature');
         Route::get('bills-pending-signature', 'McpController@bills_pending_signature')->name('bills_pending_signature');
         Route::get('reports-pending-signature', 'McpController@reports_pending_signature')->name('reports_pending_signature');
         Route::get('reports-pending-signature', 'McpController@reports_pending_signature')->name('reports_pending_signature');
@@ -194,6 +196,8 @@ Route::middleware('pro.auth')->group(function () {
 
 
         Route::get('patients', 'AdminController@patients')->name('patients');
         Route::get('patients', 'AdminController@patients')->name('patients');
         Route::get('notes', 'AdminController@notes')->name('notes');
         Route::get('notes', 'AdminController@notes')->name('notes');
+        Route::get('notes-pending-summary-suggestion', 'AdminController@notes_pending_summary_suggestion')->name('notes_pending_summary_suggestion');
+        Route::get('notes-rejected-summary-suggestion', 'AdminController@notes_rejected_summary_suggestion')->name('notes_rejected_summary_suggestion');
         Route::get('appointments', 'AdminController@appointments')->name('appointments');
         Route::get('appointments', 'AdminController@appointments')->name('appointments');
         Route::get('bills', 'AdminController@bills')->name('bills');
         Route::get('bills', 'AdminController@bills')->name('bills');
         Route::get('erx-and-orders', 'AdminController@erx_and_orders')->name('erx_and_orders');
         Route::get('erx-and-orders', 'AdminController@erx_and_orders')->name('erx_and_orders');
@@ -251,8 +255,10 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('hcp-note-activity', 'PracticeManagementController@hcpNoteActivity')->name('hcp-note-activity');
         Route::get('hcp-note-activity', 'PracticeManagementController@hcpNoteActivity')->name('hcp-note-activity');
 
 
         Route::middleware('pro.auth.admin')->group(function () {
         Route::middleware('pro.auth.admin')->group(function () {
+
+            Route::get('rm-action-report', 'PracticeManagementController@rmActionReport')->name('rmActionReport');
         	
         	
-		Route::get('remote-monitoring-report', 'PracticeManagementController@remoteMonitoringReport')->name('remoteMonitoringReport');
+		    Route::get('remote-monitoring-report', 'PracticeManagementController@remoteMonitoringReport')->name('remoteMonitoringReport');
 
 
             // BILLING REPORT
             // BILLING REPORT
             Route::get('billing-report', 'PracticeManagementController@billingReport')->name('billing-report');
             Route::get('billing-report', 'PracticeManagementController@billingReport')->name('billing-report');