소스 검색

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

root 3 년 전
부모
커밋
4a130f0ec7
81개의 변경된 파일1994개의 추가작업 그리고 1082개의 파일을 삭제
  1. 9 0
      app/Helpers/helpers.php
  2. 3 0
      app/Http/Controllers/AppointmentController.php
  3. 41 0
      app/Http/Controllers/Controller.php
  4. 8 0
      app/Http/Controllers/HomeController.php
  5. 27 41
      app/Http/Controllers/McpController.php
  6. 18 2
      app/Http/Controllers/NoteController.php
  7. 2 20
      app/Http/Controllers/PatientController.php
  8. 37 4
      app/Http/Controllers/PracticeManagementController.php
  9. 4 0
      app/Models/AccountInvite.php
  10. 5 0
      app/Models/ClientMemo.php
  11. 4 0
      app/Models/IncomingReport.php
  12. 1 1
      app/Models/Note.php
  13. 1 1
      app/Models/Point.php
  14. 8 0
      app/Models/Pro.php
  15. 11 0
      app/Models/Stamp.php
  16. 1 1
      config/app.php
  17. 84 2
      public/css/style.css
  18. 18 0
      public/js/mc.js
  19. 3 0
      public/js/stag-popup.js
  20. 1 1
      public/js/stag-suggest.js
  21. 61 0
      public/js/stag-table-filter.js
  22. 4 4
      resources/views/app/dashboard-admin.blade.php
  23. 4 4
      resources/views/app/dashboard-dna.blade.php
  24. 24 5
      resources/views/app/dashboard-mcp.blade.php
  25. 1 0
      resources/views/app/generic-bills/modal.blade.php
  26. 17 0
      resources/views/app/mcp/dashboard/appointment-change-status.blade.php
  27. 27 26
      resources/views/app/mcp/dashboard/appointments.blade.php
  28. 1 1
      resources/views/app/mcp/dashboard/calls_memos.blade.php
  29. 42 0
      resources/views/app/mcp/dashboard/measurements-pending-stamping.blade.php
  30. 4 4
      resources/views/app/mcp/measurements_pending_stamping.blade.php
  31. 109 0
      resources/views/app/mcp/patients-accounts-invites-filters.blade.php
  32. 90 0
      resources/views/app/mcp/patients-accounts-invites.blade.php
  33. 1 1
      resources/views/app/mcp/patients-table.blade.php
  34. 42 0
      resources/views/app/mcp/supply_orders_awaiting_shipment.blade.php
  35. 355 377
      resources/views/app/new-patient.blade.php
  36. 1 1
      resources/views/app/patient/accounts.blade.php
  37. 0 10
      resources/views/app/patient/care-month/_matrix.blade.php
  38. 41 25
      resources/views/app/patient/dashboard.blade.php
  39. 1 1
      resources/views/app/patient/devices.blade.php
  40. 3 33
      resources/views/app/patient/documents.blade.php
  41. 3 0
      resources/views/app/patient/handouts.blade.php
  42. 14 33
      resources/views/app/patient/incoming-reports.blade.php
  43. 30 3
      resources/views/app/patient/measurements.blade.php
  44. 1 1
      resources/views/app/patient/note/dashboard-univ.blade.php
  45. 61 31
      resources/views/app/patient/note/dashboard.blade.php
  46. 5 3
      resources/views/app/patient/note/dashboard_script.blade.php
  47. 1 1
      resources/views/app/patient/note/hpi-log.blade.php
  48. 2 2
      resources/views/app/patient/note/last-hpi.blade.php
  49. 37 0
      resources/views/app/patient/note/note-segment-list.blade.php
  50. 2 2
      resources/views/app/patient/note/review-log.blade.php
  51. 15 0
      resources/views/app/patient/note/segment.blade.php
  52. 1 1
      resources/views/app/patient/note/sign-confirmation.blade.php
  53. 1 1
      resources/views/app/patient/notes.blade.php
  54. 1 1
      resources/views/app/patient/partials/appointments.blade.php
  55. 3 1
      resources/views/app/patient/partials/latest-vitals.blade.php
  56. 28 3
      resources/views/app/patient/partials/measurements.blade.php
  57. 1 1
      resources/views/app/patient/point-based-partials/dx.blade.php
  58. 1 1
      resources/views/app/patient/prescriptions/list.blade.php
  59. 22 6
      resources/views/app/patient/prescriptions/pdf/IMAGING.blade.php
  60. 22 6
      resources/views/app/patient/prescriptions/pdf/LAB.blade.php
  61. 20 14
      resources/views/app/patient/problems-center.blade.php
  62. 9 2
      resources/views/app/patient/pros.blade.php
  63. 0 142
      resources/views/app/patient/sections.blade.php
  64. 2 2
      resources/views/app/patient/segment-templates/_child_plan/last-plan.php
  65. 2 2
      resources/views/app/patient/segment-templates/_child_review/last-review.php
  66. 1 1
      resources/views/app/patient/segment-templates/history_family/edit.blade.php
  67. 1 1
      resources/views/app/patient/segment-templates/history_social/edit.blade.php
  68. 1 1
      resources/views/app/patient/segment-templates/history_surgical/edit.blade.php
  69. 1 6
      resources/views/app/patient/segment-templates/intake_problems/summary.blade.php
  70. 1 1
      resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php
  71. 1 6
      resources/views/app/patient/segment-templates/plan_problems/summary.blade.php
  72. 5 3
      resources/views/app/patient/wizard-partials/common-fields.blade.php
  73. 1 1
      resources/views/app/patient/wizard-partials/state-badge.blade.php
  74. 4 4
      resources/views/app/practice-management/calendar.blade.php
  75. 216 91
      resources/views/app/practice-management/my-text-shortcuts.blade.php
  76. 1 1
      resources/views/app/practice-management/notes-processing-center.blade.php
  77. 109 0
      resources/views/app/practice-management/patients-accounts-invites-filters.blade.php
  78. 90 0
      resources/views/app/practice-management/patients-accounts-invites.blade.php
  79. 147 141
      resources/views/layouts/patient.blade.php
  80. 13 0
      resources/views/layouts/template.blade.php
  81. 4 1
      routes/web.php

+ 9 - 0
app/Helpers/helpers.php

@@ -656,4 +656,13 @@ if(!function_exists('str_compact')) {
     {
         return preg_replace("/[^a-zA-Z0-9]/", "", strip_tags($_str));
     }
+}
+
+if(!function_exists('noteMethodDisplay')) {
+    function noteMethodDisplay($method)
+    {
+        if($method === 'IN_CLINIC') return 'In-Clinic';
+        $method = str_replace('_', ' ', $method);
+        return ucwords(strtolower($method));
+    }
 }

+ 3 - 0
app/Http/Controllers/AppointmentController.php

@@ -30,6 +30,9 @@ class AppointmentController extends Controller
 
         if(empty($request->get('proIds'))) {
             $proIds = [];
+            if($performerPro && $performerPro->pro_type !== 'ADMIN') {
+                $proIds = [$performerPro->id];
+            }
         }
         else {
             $proIds = explode(',', $request->get('proIds'));

+ 41 - 0
app/Http/Controllers/Controller.php

@@ -91,4 +91,45 @@ class Controller extends BaseController
             'message' => $message
         ];
     }
+
+    public function filterMultiQuery(Request $request, $query, $columnName, $keyName, $valueName1, $valueName2) {
+        switch($request->input($keyName)) {
+            case 'EXACTLY':
+                if($request->input($valueName1)) {
+                    $query->where($columnName, $request->input($valueName1));
+                }
+                break;
+            case 'LESS_THAN':
+                if($request->input($valueName1)) {
+                    $query->where($columnName, '<', $request->input($valueName1));
+                }
+                break;
+            case 'GREATER_THAN':
+                if($request->input($valueName1)) {
+                    $query->where($columnName, '>', $request->input($valueName1));
+                }
+                break;
+            case 'BETWEEN':
+                if($request->input($valueName1) && $request->input($valueName2)) {
+                    $query
+                        ->where($columnName, '>=', $request->input($valueName1))
+                        ->where($columnName, '<=', $request->input($valueName2));
+                }
+                break;
+            case 'NOT_BETWEEN':
+                if($request->input($valueName1) && $request->input($valueName2)) {
+                    $query
+                        ->where(function ($q) use ($request, $columnName, $valueName1, $valueName2) {
+                            $q->where($columnName, '<', $request->input($valueName1))
+                                ->orWhere($columnName, '>', $request->input($valueName2));
+                        });
+                }
+                break;
+        }
+    }
+    public function filterSimpleQuery(Request $request, $query, $columnName, $valueName) {
+        if($request->input($valueName)) {
+            $query->where($columnName, $request->input($valueName));
+        }
+    }
 }

+ 8 - 0
app/Http/Controllers/HomeController.php

@@ -6,6 +6,7 @@ use App\Lib\Backend;
 use App\Models\Appointment;
 use App\Models\AppointmentConfirmationDecision;
 use App\Models\AppSession;
+use App\Models\CareMonth;
 use App\Models\ClientMemo;
 use App\Models\ClientProChange;
 use App\Models\ClientSMS;
@@ -540,11 +541,18 @@ WHERE cl.shadow_pro_id IS NULL
             ORDER BY created_at DESC
         ", ['mcp_pro_id' => $performer->pro->id]);
 
+        $measurementsPendingStamping = CareMonth::where('mcp_pro_id', $this->performer->pro->id)
+            ->where('rm_num_measurements_not_stamped_by_mcp', '>', 0)
+            ->whereNotNull('rm_num_measurements_not_stamped_by_mcp')
+            ->orderBy('created_at', 'DESC')
+            ->paginate(15);
+
         return view('app/dashboard-mcp', compact('keyNumbers', 'reimbursement', 'milliseconds',
             'businessNumbers',
             'incomingReports', 'tickets', 'supplyOrders',
             'numERx', 'numLabs', 'numImaging', 'numSupplyOrders',
             'newMCPAssociations', 'newNAAssociations',
+            'measurementsPendingStamping',
             'mcpClientMemos', 'mcpClientMemosCount', 'naClientMemos', 'incomingSmsMessagesPendingReply'));
     }
 

+ 27 - 41
app/Http/Controllers/McpController.php

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\File;
 use App\Models\Bill;
 use App\Models\ClientSMS;
+use App\Models\AccountInvite;
 
 use Illuminate\Support\Facades\Http;
 use PDF;
@@ -96,47 +97,6 @@ class McpController extends Controller
         return view('app.mcp.patients', compact('patients', 'filters'));
     }
 
-    private function filterSimpleQuery(Request $request, $query, $columnName, $valueName) {
-        if($request->input($valueName)) {
-            $query->where($columnName, $request->input($valueName));
-        }
-    }
-    private function filterMultiQuery(Request $request, $query, $columnName, $keyName, $valueName1, $valueName2) {
-        switch($request->input($keyName)) {
-            case 'EXACTLY':
-                if($request->input($valueName1)) {
-                    $query->where($columnName, $request->input($valueName1));
-                }
-                break;
-            case 'LESS_THAN':
-                if($request->input($valueName1)) {
-                    $query->where($columnName, '<', $request->input($valueName1));
-                }
-                break;
-            case 'GREATER_THAN':
-                if($request->input($valueName1)) {
-                    $query->where($columnName, '>', $request->input($valueName1));
-                }
-                break;
-            case 'BETWEEN':
-                if($request->input($valueName1) && $request->input($valueName2)) {
-                    $query
-                        ->where($columnName, '>=', $request->input($valueName1))
-                        ->where($columnName, '<=', $request->input($valueName2));
-                }
-                break;
-            case 'NOT_BETWEEN':
-                if($request->input($valueName1) && $request->input($valueName2)) {
-                    $query
-                        ->where(function ($q) use ($request, $columnName, $valueName1, $valueName2) {
-                            $q->where($columnName, '<', $request->input($valueName1))
-                                ->orWhere($columnName, '>', $request->input($valueName2));
-                        });
-                }
-                break;
-        }
-    }
-
     public function notes(Request $request)
     {
         $filters = $request->all();
@@ -239,6 +199,21 @@ class McpController extends Controller
         return view('app.mcp.client_messages', compact('clientMessages', 'filters'));
     }
 
+    public function patients_accounts_invites(Request $request){
+        $filters = $request->all();
+
+        $accountInvites = AccountInvite::select('account_invite.*')
+                            ->join('client', 'client.id', '=', 'account_invite.for_client_id');
+        $accountInvites = $accountInvites->where('client.mcp_pro_id', $this->performer->pro->id);
+
+        $this->filterMultiQuery($request, $accountInvites, 'account_invite.created_at', 'date_category', 'date_value_1', 'date_value_2');
+        $this->filterSimpleQuery($request, $accountInvites, 'account_invite.status', 'status');
+
+        $accountInvites = $accountInvites->orderBy('created_at', 'DESC')->paginate(20);
+
+        return view('app.mcp.patients-accounts-invites', compact('accountInvites', 'filters'));
+    }
+
     public function new_patients_awaiting_visit(Request $request){
         $data = [
             'records' => Client::where('mcp_pro_id', $this->performer->pro->id)
@@ -333,6 +308,17 @@ class McpController extends Controller
         ];
         return view('app.mcp.supply_orders_pending_signature', $data);
     }
+    public function supply_orders_awaiting_shipment(Request $request){
+        $data = [
+            'records' => SupplyOrder::where('created_by_pro_id', $this->performer->pro->id)
+                ->where('is_signed_by_pro', true)
+                ->where('is_cleared_for_shipment', true)
+                ->whereNull('shipment_id')
+                ->orderBy('created_at')
+                ->get()
+        ];
+        return view('app.mcp.supply_orders_awaiting_shipment', $data);
+    }
     public function measurements_pending_stamping(Request $request){
         $data = [
             'records' => CareMonth::where('mcp_pro_id', $this->performer->pro->id)

+ 18 - 2
app/Http/Controllers/NoteController.php

@@ -116,7 +116,22 @@ class NoteController extends Controller
 
 
             $summaryHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/summary', $data)->render();
-            $editHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/edit', $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'
+            ];
+            if(!in_array($segmentTemplate->internal_name, $wizardPowered)) {
+                $editHtml = view('app.patient.segment-templates.' . $segmentTemplate->internal_name . '/edit', $data)->render();
+            }
 
         } catch (\Throwable $e) {
             return response()->json([
@@ -327,7 +342,8 @@ class NoteController extends Controller
         return view("app.patient.segment-templates.{$segmentInternalName}.{$view}", [
             'patient' => $patient,
             'note' => $patient->coreNote,
-            'segmentInternalName' => $segmentInternalName
+            'segmentInternalName' => $segmentInternalName,
+            'closeOnSave' => true
         ]);
     }
 

+ 2 - 20
app/Http/Controllers/PatientController.php

@@ -307,25 +307,6 @@ class PatientController extends Controller
         return view('app.patient.rm-setup', compact('patient'));
     }
 
-    public function sections(Request $request, Client $patient )
-    {
-        $pros = $this->pros;
-        $sections = $patient->sections;
-
-        $allSections = SectionTemplate::where('is_active', true)->get();
-        foreach ($allSections as $section) {
-            $section->used = false;
-            foreach ($sections as $section) {
-                if ($section->sectionTemplate->id === $section->id) {
-                    $section->used = true;
-                    $section->section_uid = $section->uid;
-                    break;
-                }
-            }
-        }
-        return view('app.patient.sections', compact('patient', 'pros', 'allSections'));
-    }
-
     public function handouts(Request $request, Client $patient )
     {
         $handouts = Handout::where('is_active', true)->get();
@@ -471,7 +452,8 @@ class PatientController extends Controller
         if(!!$currentErx) {
             $currentErx = Erx::where('uid', $currentErx)->first();
         }
-        return view('app.patient.prescriptions.index', compact('patient', 'type', 'currentErx'));
+        $note = $patient->coreNote;
+        return view('app.patient.prescriptions.index', compact('patient', 'type', 'currentErx', 'note'));
     }
 
     public function prescriptionsPopup(Request $request, Client $patient, String $type = '', String $currentErx = '') {

+ 37 - 4
app/Http/Controllers/PracticeManagementController.php

@@ -32,6 +32,7 @@ use App\Models\Shipment;
 use App\Models\SupplyOrder;
 use App\Models\Team;
 use App\Models\Ticket;
+use App\Models\AccountInvite;
 use App\Models\ClientMeasurementDaysPerMonth;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Http;
@@ -338,7 +339,7 @@ class PracticeManagementController extends Controller
     public function myTextShortcuts(Request $request)
     {
 
-        $myTextShortcuts = DB::table('pro_text_shortcut')
+        $personalShortcuts = DB::table('pro_text_shortcut')
             ->leftJoin('pro', 'pro_text_shortcut.pro_id', '=', 'pro.id')
             ->select(
                 'pro_text_shortcut.uid',
@@ -350,15 +351,27 @@ class PracticeManagementController extends Controller
             ->where('pro_text_shortcut.is_removed', false);
 
         if($this->performer()->pro->pro_type !== 'ADMIN') {
-            $myTextShortcuts = $myTextShortcuts->where('pro_id', $this->performer()->pro_id);
+            $personalShortcuts = $personalShortcuts->where('pro_id', $this->performer()->pro_id);
         }
 
-        $myTextShortcuts = $myTextShortcuts
+        $personalShortcuts = $personalShortcuts
             ->orderBy('pro.name_last')
             ->orderBy('pro.name_first')
+            ->orderBy('pro_text_shortcut.shortcut')
             ->get();
 
-        return view('app.practice-management.my-text-shortcuts', compact('myTextShortcuts'));
+        $globalTextShortcuts = DB::table('pro_text_shortcut')
+            ->select(
+                'pro_text_shortcut.uid',
+                'pro_text_shortcut.shortcut',
+                'pro_text_shortcut.text'
+            )
+            ->whereNull('pro_id')
+            ->where('pro_text_shortcut.is_removed', false)
+            ->orderBy('pro_text_shortcut.shortcut')
+            ->get();
+
+        return view('app.practice-management.my-text-shortcuts', compact('personalShortcuts', 'globalTextShortcuts'));
     }
 
     public function myFavorites(Request $request, $filter = 'all')
@@ -1991,4 +2004,24 @@ ORDER BY c.name_last, c.name_first
         return view('app.practice-management.my-teams', compact('teams'));
     }
 
+    public function patientsAccountsInvites(Request $request){
+        $filters = $request->all();
+
+        $accountInvites = AccountInvite::select('account_invite.*')
+                            ->join('client', 'client.id', '=', 'account_invite.for_client_id');
+        if($this->performer->pro->pro_type !== 'ADMIN'){
+            $accountInvites = $accountInvites->where('client.mcp_pro_id', $this->performer->pro->id);
+        }
+
+        $this->filterMultiQuery($request, $accountInvites, 'account_invite.created_at', 'date_category', 'date_value_1', 'date_value_2');
+        $this->filterSimpleQuery($request, $accountInvites, 'account_invite.status', 'status');
+
+        $accountInvites = $accountInvites->orderBy('created_at', 'DESC')->paginate(20);
+
+        return view('app.practice-management.patients-accounts-invites', compact('accountInvites','filters'));
+    }
+
+
+    
+
 }

+ 4 - 0
app/Models/AccountInvite.php

@@ -14,4 +14,8 @@ class AccountInvite extends Model
     {
         return 'access_token';
     }
+
+    public function client() {
+        return $this->hasOne(Client::class, 'id', 'for_client_id');
+    }
 }

+ 5 - 0
app/Models/ClientMemo.php

@@ -18,4 +18,9 @@ class ClientMemo extends Model
         return $this->hasMany(ClientMemoUpdate::class, 'client_memo_id', 'id')->orderBy('created_at', 'DESC');
     }
 
+    public function stamp(): HasOne
+    {
+        return $this->hasOne(Stamp::class, 'client_memo_id', 'id');
+    }
+
 }

+ 4 - 0
app/Models/IncomingReport.php

@@ -19,4 +19,8 @@ class IncomingReport extends Model
     public function client(){
         return $this->hasOne(Client::class, 'id', 'client_id');
     }
+
+    public function note() {
+        return $this->hasOne(Note::class, 'id', 'note_id');
+    }
 }

+ 1 - 1
app/Models/Note.php

@@ -53,7 +53,7 @@ class Note extends Model
             if ($this->is_billing_marked_done) $status = 'Billed';
             else if ($this->is_signed_by_hcp) $status = 'Signed';
         }
-        return $status . ' **';
+        return $status;
     }
 
     public function bills()

+ 1 - 1
app/Models/Point.php

@@ -249,7 +249,7 @@ class Point extends Model
             } elseif ($point->removed_in_note_id === $note->id && $point->removal_reason_category === 'ON_INTAKE') {
                 $point->badge = 'Marked Removed on Intake';
             } elseif ($point->removed_in_note_id !== $note->id) {
-                $point->badge = 'Historic Record Removed In A Previous Visit';
+                $point->badge = 'Historic Record Removed In Previous Visit';
             }
         } elseif ($point->state === 'ENTRY_ERROR') {
             if ($point->removed_in_note_id === $note->id) {

+ 8 - 0
app/Models/Pro.php

@@ -483,6 +483,14 @@ WHERE mcp_pro_id = :pro_id
             ->count();
     }
 
+    function get_supply_orders_awaiting_shipment_count_as_mcp() {
+        return SupplyOrder::where('created_by_pro_id', $this->id)
+            ->where('is_signed_by_pro', true)
+            ->where('is_cleared_for_shipment', true)
+            ->whereNull('shipment_id')
+            ->count();
+    }
+
     function get_birthdays_today_as_mcp(){
         return;
         $queryClients = $this->performer()->pro->getAccessibleClientsQuery();

+ 11 - 0
app/Models/Stamp.php

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

+ 1 - 1
config/app.php

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

+ 84 - 2
public/css/style.css

@@ -96,6 +96,9 @@
 .dropdown-item:not(:last-child) {
   border-bottom:1px solid #ddd;
 }
+body>.navbar .dropdown-menu {
+    margin-top: -3px;
+}
 
 main {
   padding:0 1rem;
@@ -131,6 +134,27 @@ body.stag_rhs_collapsed .app-right-panel {
     height: 24px;
     line-height: 24px;
 }
+.mcp-theme-1 input[type="file"] {
+    position: relative;
+    cursor: pointer;
+    box-shadow: none;
+}
+.mcp-theme-1 input[type="file"]::after {
+    content: attr(selected-file);
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    background: #fff;
+    display: flex;
+    align-items: center;
+    padding: 0 0.5rem;
+    color: #0d59af;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+}
 .mcp-theme-1 *:not(i) {
     font-family: Verdana, sans-serif;
     font-size: 12px;
@@ -1495,9 +1519,16 @@ table.table-edit-sheet .ql-editor[contenteditable] {
     cursor: pointer;
     padding: 0.2rem 0.5rem;
     border-bottom: 1px solid #ddd;
-    color: #666;
+    color: #222;
     font-size: 90%;
 }
+.data-option-list>div[desc]::after {
+    content: attr(desc);
+    opacity: 0.75;
+    padding-left: 0.5rem;
+    font-size: 90%;
+    font-family: Verdana, sans-serif;
+}
 .data-option-list>div:last-child {
     border-bottom: 0;
 }
@@ -1958,7 +1989,7 @@ form.non-interactive .form-content * {
 }*/
 .no-overflow-menu {
     overflow-y: auto;
-    max-height: calc(100vh - 60px);
+    max-height: calc(100vh - 44px);
 }
 .zero-height-field {
     height: 1px !important;
@@ -1969,6 +2000,9 @@ form.non-interactive .form-content * {
 table.dashboard-stats-table th {
     padding: 0.5rem 0.75rem
 }
+.max-height-200px {
+    max-height: 200px;
+}
 .min-height-300px {
     min-height: 300px;
 }
@@ -2104,6 +2138,40 @@ body.in-iframe .main-row > .sidebar {
 .note-container .note-rhs-content {
     flex-grow: 1;
 }
+
+.note-container .segments-list .note-content-node>a {
+    display: block;
+    padding: 0.15rem 0;
+    padding-left: 0.75rem;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    text-decoration: none;
+    color: #333;
+}
+.note-container .segments-list>.note-content-node>a:not([data-non-segment-target]) {
+    font-weight: bold;
+    color: #333;
+}
+.note-container .segments-list .note-content-node>a:hover {
+    background-color: aliceblue;
+    color: #0d59af !important;
+}
+.note-container .segments-list .note-content-node:hover>a,
+.note-container .segments-list .note-content-node.hovered>a {
+    background-color: aliceblue;
+}
+.note-container .segments-list .note-content-node.active>a {
+    font-weight: bold !important;
+    color: #0d59af !important;
+}
+.note-container .segments-list .note-content-children>.note-content-node>a {
+    padding-left: 2rem;
+}
+.note-container .segments-list .note-content-children .note-content-children>.note-tree-node>a {
+    padding-left: 4rem;
+}
+
 .note-container .note-rhs-sidebar {
     min-width: 180px;
     max-width: 180px;
@@ -2253,4 +2321,18 @@ tr.relevant-to-visit td:nth-child(2) {
 }
 .autosave-indicator.show {
     display: block;
+}
+table .stag-filter-hide {
+    display: none !important;
+}
+table .stag-filter-highlight {
+    background: rgb(255 215 215);
+}
+
+.event-bg-green {
+    background-color: #f6ffeb;
+}
+
+.event-bg-gray {
+    background-color: #ececec;
 }

+ 18 - 0
public/js/mc.js

@@ -50,6 +50,7 @@ $(document).ready(function () {
     initPrimaryForm();
     initPatientPresenceIndicator();
     runMCInitializers();
+    initFileInputs();
 
     // if(typeof initializeCalendar !== 'undefined') {
     //     initializeCalendar();
@@ -172,6 +173,7 @@ function onFastLoaded(_data, _href, _history) {
                 initPrimaryForm();
                 initPatientPresenceIndicator();
                 runMCInitializers();
+                initFileInputs();
                 if (window.top.currentMcUrl.split('?')[0] !== window.top.location.href.split('?')[0]) {
                     $(window).scrollTop(0);
                 }
@@ -265,6 +267,8 @@ function fastLoad(_href, _history = true, _useCache = true, _replaceState = fals
             cleanedHREF = cleanedHREF.replace('/?', '?');
         }
 
+        if(cleanedHREF.length > 0 && cleanedHREF[0] === '?') cleanedHREF = '/' + cleanedHREF;
+
         $.get(cleanedHREF, function (_data) {
             onFastLoaded(_data, _href, _history);
         }).fail(function (_jqXhr) {
@@ -382,6 +386,20 @@ function initQuillEdit(_selector = '.note-content[auto-edit]') {
 }
 
 var patientPresenceTimer = false;
+function initFileInputs() {
+    $(document)
+        .off('change', 'input[type="file"]')
+        .on('change', 'input[type="file"]', function(_e) {
+            if(_e.target.files && _e.target.files.length) {
+                $(this).attr('selected-file', _e.target.files[0].name);
+            }
+            else {
+                $(this).attr('selected-file', 'No file chosen');
+            }
+            return false;
+        });
+    $('input[type="file"]').attr('selected-file', 'No file chosen');
+}
 function initPatientPresenceIndicator() {
     return false;
     if (patientPresenceTimer !== false) {

+ 3 - 0
public/js/stag-popup.js

@@ -12,6 +12,7 @@ function showStagPopup(_key, _noAutoFocus) {
     stagPopup.addClass('show');
     stagPopup.find('[moe][initialized]').removeAttr('initialized');
     initMoes();
+    initFileInputs();
     if(!_noAutoFocus) {
         window.setTimeout(function() {
             stagPopup.find('input[type="text"]:not([readonly]):visible,select:visible').first().focus();
@@ -139,6 +140,7 @@ function openDynamicStagPopup(_url, initer, title, updateParent, style = '', rep
         runMCInitializer('pro-suggest'); // not the place for this! Move to better place.
         initMoes();
         hideMask();
+        initFileInputs();
     }).fail(() => {
         toastr.error('Unable to open ' + _url);
         hideMask();
@@ -168,6 +170,7 @@ function refreshDynamicStagPopup(_url = false) {
             runMCInitializer('pro-suggest');
             initMoes();
             hideMask();
+            initFileInputs();
         });
     }
     return false;

+ 1 - 1
public/js/stag-suggest.js

@@ -56,7 +56,7 @@
                             if(_data.data[i].sub_text) {
                                 item.append($('<span/>')
                                     .addClass('ml-1 text-sm text-secondary')
-                                    .append('(')
+                                    .append(' (')
                                     .append(_data.data[i].sub_text)
                                     .append(')')
                                 );

+ 61 - 0
public/js/stag-table-filter.js

@@ -0,0 +1,61 @@
+(function () {
+    window.initStagTableFilters = function () {
+
+        const debounce = (func, wait) => {
+            let timeout;
+            return function executedFunction(...args) {
+                const later = () => {
+                    clearTimeout(timeout);
+                    func(...args);
+                };
+                clearTimeout(timeout);
+                timeout = setTimeout(later, wait);
+            };
+        };
+
+        var returnedFunction = debounce(function (_elem) {
+            let term = $.trim(_elem.val()).toLowerCase(),
+                columnIndex = _elem.closest('td, th').index(),
+                trs = _elem.closest('table').find('tbody').find('tr');
+            trs.removeClass('stag-filter-hide');
+            trs.find('.stag-filter-highlight').replaceWith(function() {
+                return $(this).text();
+            });
+            _elem.closest('td, th').siblings().find('input[stag-table-filter]').val('');
+            if(!!term) {
+                trs.each(function () {
+                    let td = $(this).find('td:eq(' + columnIndex + ')'),
+                        text = td.text();
+                    if (text.toLowerCase().indexOf(term) === -1) {
+                        $(this).addClass('stag-filter-hide');
+                    }
+                    /*else {
+                        let re = new RegExp('(' + term + ')', 'ig');
+                        text = text.replace(re, '<span class="stag-filter-highlight">$&</span>');
+                        td.html(text);
+                    }*/
+                });
+            }
+        }, 100);
+
+        function applyFilter(_elem) {
+            returnedFunction(_elem);
+        }
+
+        $(document)
+            .off('input.stag-table-filter').on('input.stag-table-filter', 'input[stag-table-filter]', function() { applyFilter($(this)); })
+            .off('change.stag-table-filter').on('change.stag-table-filter', 'input[stag-table-filter]', function() { applyFilter($(this)); })
+            .off('paste.stag-table-filter').on('paste.stag-table-filter', 'input[stag-table-filter]', function() { applyFilter($(this)); })
+
+        $(document)
+            .off('keyup.stag-table-filter')
+            .on('keyup.stag-table-filter', 'input[stag-table-filter]', function(_e) {
+                if(_e.which === 27) {
+                    $(this).val('');
+                    applyFilter($(this));
+                    return false;
+                }
+            })
+    }
+    addMCInitializer('stag-table-filter', window.initStagTableFilters);
+})();

+ 4 - 4
resources/views/app/dashboard-admin.blade.php

@@ -230,7 +230,7 @@
                                                     @endif
                                                 @endif
                                             </div>
-                                            <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Stamp</a>
+                                            <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Ack.</a>
                                         </div>
                                     @endforeach
                                 </div>
@@ -275,7 +275,7 @@
                                                 @endif
                                             </div>
                                             <a href="#" class="ack-client-pro-change"
-                                               data-uid="{{$assoc->uid}}">Stamp</a>
+                                               data-uid="{{$assoc->uid}}">Ack.</a>
                                         </div>
                                     @endforeach
                                 </div>
@@ -303,7 +303,7 @@
                                                 <td>{!! $memo->content !!}</td>
                                                 <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
                                                 <td><a href="#" class="ack-client-memo"
-                                                       data-uid="{{$memo->uid}}">Stamp</a></td>
+                                                       data-uid="{{$memo->uid}}">Ack.</a></td>
                                             </tr>
                                         @endforeach
                                         </tbody>
@@ -331,7 +331,7 @@
                                                 <td>{!! $memo->content !!}</td>
                                                 <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
                                                 <td><a href="#" class="ack-client-memo"
-                                                       data-uid="{{$memo->uid}}">Stamp</a></td>
+                                                       data-uid="{{$memo->uid}}">Ack.</a></td>
                                             </tr>
                                         @endforeach
                                         </tbody>

+ 4 - 4
resources/views/app/dashboard-dna.blade.php

@@ -227,7 +227,7 @@
                                                     @endif
                                                 @endif
                                             </div>
-                                            <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Stamp</a>
+                                            <a href="#" class="ack-client-pro-change ml-3" data-uid="{{$assoc->uid}}">Ack.</a>
                                         </div>
                                     @endforeach
                                 </div>
@@ -272,7 +272,7 @@
                                                 @endif
                                             </div>
                                             <a href="#" class="ack-client-pro-change"
-                                               data-uid="{{$assoc->uid}}">Stamp</a>
+                                               data-uid="{{$assoc->uid}}">Ack.</a>
                                         </div>
                                     @endforeach
                                 </div>
@@ -300,7 +300,7 @@
                                                 <td>{!! $memo->content !!}</td>
                                                 <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
                                                 <td><a href="#" class="ack-client-memo"
-                                                       data-uid="{{$memo->uid}}">Stamp</a></td>
+                                                       data-uid="{{$memo->uid}}">Ack.</a></td>
                                             </tr>
                                         @endforeach
                                         </tbody>
@@ -328,7 +328,7 @@
                                                 <td>{!! $memo->content !!}</td>
                                                 <td class="text-nowrap">{{friendlier_date_time($memo->created_at)}}</td>
                                                 <td><a href="#" class="ack-client-memo"
-                                                       data-uid="{{$memo->uid}}">Stamp</a></td>
+                                                       data-uid="{{$memo->uid}}">Ack.</a></td>
                                             </tr>
                                         @endforeach
                                         </tbody>

+ 24 - 5
resources/views/app/dashboard-mcp.blade.php

@@ -173,6 +173,18 @@
                                         </a>
                                     </th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_supply_orders_awaiting_shipment_count_as_mcp()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('mcp.supply_orders_awaiting_shipment') }}"
+                                           native target="_blank"
+                                           open-in-stag-popup
+                                           popup-style="tall"
+                                           title="Supply Orders Awaiting Shipment">
+                                            Supply Orders Awaiting Shipment
+                                        </a>
+                                    </th>
+                                </tr>
                                 </tbody>
                             </table>
                         </div>
@@ -280,18 +292,18 @@
                                         Appointments @{{ formatSelectedDate(selectedDate) }}
                                     </strong>
                                 </div>
-                                <div class="card-body p-0">
+                                <div class="card-body p-0 max-height-200px overflow-auto">
                                     @include('app.mcp.dashboard.appointments')
                                 </div>
                             </div>
                             <div class="card mb-4">
                                 <div class="card-header pl-2">
                                     <strong>
-                                        Measurements
+                                        Measurements Pending Stamping
                                     </strong>
                                 </div>
-                                <div class="card-body">
-                                    @include('app.mcp.dashboard.measurements')
+                                <div class="card-body p-0">
+                                    @include('app.mcp.dashboard.measurements-pending-stamping')
                                 </div>
                             </div>
                         </div>
@@ -385,6 +397,8 @@
                                         // self.highlightDatesWithEvents(self.datesWithEvents);
                                         initFastLoad($('.appointments-tab'));
                                         initFastLoad($('#pro-dashboard-container'));
+                                        $('#pro-dashboard-container').find('[moe][initialized]').removeAttr('initialized');
+                                        initMoes();
                                     });
                                 });
                             }, 25);
@@ -592,7 +606,12 @@
                                 default:
                                     return 'N/A';
                             }
-                        }
+                        },
+                        getEventBgColor: function(status){
+                            if(status === 'COMPLETED') return 'event-bg-green';
+                            if(status === 'CANCELLED') return 'event-bg-gray';
+                            return '';
+                        },
                     },
                     mounted: function () {
                         let self = this;

+ 1 - 0
resources/views/app/generic-bills/modal.blade.php

@@ -1,5 +1,6 @@
 <a native target="_blank"
    open-in-stag-popup
+   class="text-nowrap"
    popup-style="tall"
    title="{{@$label ? $label : 'Generic'}} bills"
    href="{{route('generic-bill-view', ['entityType' => @$entityType, 'entityUid' => @$entityUid])}}">

+ 17 - 0
resources/views/app/mcp/dashboard/appointment-change-status.blade.php

@@ -0,0 +1,17 @@
+<div class="ml-2" moe relative>
+    <a href="#" start show><i class="fa fa-edit"></i></a>
+    <form url="/api/appointment/updateStatus">
+        <input type="hidden" name="uid" :value="event.uid">
+        <p class="text-nowrap mb-2 font-weight-bold text-secondary">Change appointment status</p>
+        <select name="status" class="form-control form-control-sm input-sm bg-light mb-2">
+            <option value="PENDING" :selected="event.status === 'PENDING'">PENDING</option>
+            <option value="CONFIRMED" :selected="event.status === 'CONFIRMED'">CONFIRMED</option>
+            <option value="CANCELLED" :selected="event.status === 'CANCELLED'">CANCELLED</option>
+            <option value="COMPLETED" :selected="event.status === 'COMPLETED'">COMPLETED</option>
+        </select>
+        <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>

+ 27 - 26
resources/views/app/mcp/dashboard/appointments.blade.php

@@ -1,6 +1,6 @@
 <table v-if="events.length > 0"
        class="mb-0 table table-sm table-bordered appointments">
-    <tr v-for="event in events" class="">
+    <tr v-for="event in events" :class="getEventBgColor(event.status)">
         <td>
             <a :href="'/patients/view/' + event.clientUid" class="font-weight-bold">@{{
                 event.clientName }}</a><br/>
@@ -17,32 +17,33 @@
                                                   </span>
         </td>
         <td>
-            <div class="d-flexi align-items-baseline">
-                <!-- <div v-if="event.status === 'CREATED'"
-                     class="text-warning-mellow font-weight-bold">
-                    <i class="fa fa-exclamation-triangle"></i>
-                    Confirmation pending
-                </div>
-                <div v-else-if="event.status === 'CONFIRMED'"
-                     class="text-success font-weight-bold">
-                    <i class="fa fa-check"></i>
-                    Confirmed by the patient
-                </div>
-                <div v-else-if="event.status === 'REJECTED'"
-                     class="text-danger font-weight-bold">
-                    <i class="fa fa-stop"></i>
-                    Rejected by the patient
-                </div> -->
-                <select v-model="event.newStatus"
-                        class="form-control input-sm bg-light"
-                        v-on:change="updateStatus(event)">
-                    <option value="PENDING">PENDING</option>
-                    <option value="CONFIRMED">CONFIRMED</option>
-                    <option value="CANCELLED">CANCELLED</option>
-                    <option value="COMPLETED">COMPLETED</option>
-                </select>
+            <div class="d-flex flex-column">
+                <div class="d-flex align-items-center">
+                    <div v-if="event.status === 'PENDING'"
+                        class="text-warning-mellow font-weight-bold">
+                        <i class="fa fa-exclamation-triangle"></i>
+                        Pending
+                    </div>
+                    <div v-else-if="event.status === 'CONFIRMED'"
+                        class="text-success font-weight-bold">
+                        <i class="fa fa-check"></i>
+                        Confirmed
+                    </div>
+                    <div v-else-if="event.status === 'CANCELLED'"
+                        class="text-danger font-weight-bold">
+                        <i class="fa fa-stop"></i>
+                        Cancelled
+                    </div>
+                    <div v-else-if="event.status === 'COMPLETED'"
+                        class="text-success font-weight-bold">
+                        <i class="far fa-calendar-check"></i>
+                        Completed
+                    </div>
+                    @include('app.mcp.dashboard.appointment-change-status')
+                </div>              
+                
                 <div v-if="selectedDate === '{{ date('Y-m-d') }}'"
-                     class="pt-1 text-right"
+                     class=""
                      :class="event.started ? 'text-danger': 'text-secondary'">
                     @{{ event.inHowManyHours }}
                 </div>

+ 1 - 1
resources/views/app/mcp/dashboard/calls_memos.blade.php

@@ -20,7 +20,7 @@
 				<div moe relative class="ml-auto">
 					<form show url="/api/clientMemo/stamp">
 						<input type="hidden" name="uid" value="{{$memo->uid}}">
-						<button submit class="bg-transparent border-0 p-0 text-primary font-underline">Stamp</button>
+						<button submit class="bg-transparent border-0 p-0 text-primary font-underline">Ack.</button>
 					</form>
 				</div>
 			</td>

+ 42 - 0
resources/views/app/mcp/dashboard/measurements-pending-stamping.blade.php

@@ -0,0 +1,42 @@
+@if($measurementsPendingStamping && count($measurementsPendingStamping))
+    <table class="table table-sm table-striped mb-0">
+            <thead>
+            <tr>
+                <th class="border-bottom-0 border-top-0 text-secondary">Patient</th>
+                <th class="border-bottom-0 border-top-0 text-secondary">Care Month</th>
+                <th class="border-bottom-0 border-top-0 text-secondary">Meas.</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($measurementsPendingStamping as $row)
+                <tr>
+                    <td class="pl-2">
+                        <a href="{{ route('patients.view.dashboard', $row->patient) }}">
+                            {{$row->patient->displayName()}}
+                        </a>
+                    </td>
+                    <td>
+                        <a native target="_blank"
+                           open-in-stag-popup
+                           update-parent
+                           mc-initer="cm-matrix-{{$row->patient->id}}"
+                           title="Care Month Matrix: {{date('M Y', strtotime($row->start_date))}}"
+                           href="/patient-care-month-matrix/{{$row->uid}}">
+                            {{ friendly_month($row->start_date) }}
+                        </a>
+                    </td>
+                    <td>
+                        {{ $row->rm_num_measurements_not_stamped_by_mcp }}
+                    </td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    <div class="m-2">
+        {{ $measurementsPendingStamping->onEachSide(0)->withQueryString()->links() }}
+    </div>
+@else
+    <div class="p-3">
+        No measurement pending stamping
+    </div>
+@endif

+ 4 - 4
resources/views/app/mcp/measurements_pending_stamping.blade.php

@@ -24,10 +24,10 @@
                     <tr>
                         <td>
                             <b>
-				<a href="{{ route('patients.view.dashboard', $row->patient) }}">
-					{{$row->patient->displayName()}}
-				</a>
-			    </b>
+                                <a href="{{ route('patients.view.dashboard', $row->patient) }}">
+                                    {{$row->patient->displayName()}}
+                                </a>
+                            </b>
                         </td>
                         <td>
                             <a native target="_blank"

+ 109 - 0
resources/views/app/mcp/patients-accounts-invites-filters.blade.php

@@ -0,0 +1,109 @@
+<style>
+	#patients-accounts-invites-filters label {
+		font-weight: bold;
+	}
+
+	#patients-accounts-invites-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;
+	}
+</style>
+<form id="patients-accounts-invites-filters" method="GET" action="{{ route('practice-management.patientsAccountsInvites') }}" class="filter-container" v-cloak>
+	<!-- DATE	 -->
+	<div>
+		<div class="form-group">
+			<label>Date:</label>
+			<select name="date_category" class="form-control input-sm" v-model="filters.date_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+			<div v-show="filters.date_category" class="mt-2">
+				<div>
+					<input name="date_value_1" v-model="filters.date_value_1" type="date" class="form-control input-sm"/>
+				</div>
+				<div v-show="filters.date_category === 'BETWEEN' || filters.date_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="date_value_2" v-model="filters.date_value_2" type="date" class="form-control input-sm"/>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!-- STATUS -->
+	<div>
+		<div class="form-group">
+			<label>Status:</label>
+			<select name="status" class="form-control input-sm" v-model="filters.status">
+				<option value="">All</option>
+				<option value="ACCEPTED">Accepted</option>
+				<option value="PENDING">Pending</option>
+				<option value="REJECTED">Rejected</option>
+				<option value="CANCELLED">Cancelled</option>
+			</select>
+		</div>
+	</div>
+
+	<div>
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<div class="d-flex">
+				<button type="submit" 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('practice-management.patientsAccountsInvites') }}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+			</div>
+		</div>
+	</div>
+</form>
+<?php
+$loadedFilters = $filters;
+$allFilterKeys = [
+	'date_category',
+	'date_value_1',
+	'date_value_2',
+	'status'
+];
+for ($i = 0; $i < count($allFilterKeys); $i++) {
+	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
+		$loadedFilters[$allFilterKeys[$i]] = '';
+	}
+}
+?>
+<script>
+	(function() {
+		function init() {
+			window.apapp = new Vue({
+				el: '#patients-accounts-invites-filters',
+				delimiters: ['@{{', '}}'],
+				data: {
+					filters: <?= json_encode($loadedFilters) ?>
+				},
+				methods: {
+					doSubmit: function() {
+						fastLoad('{{ route("practice-management.patientsAccountsInvites") }}?' + $('#patients-accounts-invites-filters').serialize());
+						return false;
+					},
+					init: function() {
+
+					}
+				},
+				mounted: function() {
+					this.init();
+				},
+			});
+
+
+		}
+		addMCInitializer('patients-accounts-invites-filters', init, '#patients-accounts-invites-filters');
+	})();
+</script>

+ 90 - 0
resources/views/app/mcp/patients-accounts-invites.blade.php

@@ -0,0 +1,90 @@
+@extends ('layouts/template')
+
+@section('content')
+
+<div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-user"></i>
+                Accounts Invites ({{ $accountInvites->total() }})
+            </strong>
+        </div>
+        <div class="card-body p-0">
+        <div class="p-3">
+                @include('app.practice-management.patients-accounts-invites-filters')
+            </div>
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="px-2 text-secondary border-bottom-0">Created At</th>
+                        <th class="px-2 text-secondary border-bottom-0">Client</th>
+                        <th class="px-2 text-secondary border-bottom-0">Name</th>
+                        <th class="px-2 text-secondary border-bottom-0">Email</th>
+                        <th class="px-2 text-secondary border-bottom-0">Cell Number</th>
+                        <th class="px-2 text-secondary border-bottom-0">Status</th>
+                        <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($accountInvites as $accountInvite)
+                    <tr>
+                        <td class="px-2">
+                            {{ friendlier_date_time($accountInvite->created_at) }}
+                            @if($accountInvite->status === 'CANCELLED')
+                            <span class="text-sm text-secondary">(CANCELLED)</span>
+                            @endif
+                        </td>
+                        <td class="px-2">{{ $accountInvite->client->displayName() }}</td>
+                        <td class="px-2">{{ $accountInvite->first_name }} {{ $accountInvite->last_name }}</pre>
+                        </td>
+                        <td class="px-2">{{ $accountInvite->to_email_address }}</td>
+                        <td class="px-2">{{ $accountInvite->cell_number }}</td>
+                        <td class="px-2">{{ $accountInvite->status }} <span class="text-sm text-secondary">(Updated: {{friendlier_date_time($accountInvite->status_updated_at)}})</span>
+                            @if($accountInvite->status_memo)
+                            <div class="py-1 font-italic text-secondary text-sm">{{$accountInvite->status_memo}}</div>
+                            @endif
+                        </td>
+                        <td class="px-2">
+                            <div class="d-flex">
+                                @if($accountInvite->status === 'PENDING')
+                                <span moe class="ml-1" relative>
+                                    <a class="" href="" show start>Cancel</a>
+                                    <form url="/api/accountInvite/markAsCancelled" right>
+                                        <input type="hidden" name="uid" value="{{$accountInvite->uid}}">
+                                        <p>Cancel this invite?</p>
+                                        <div class="mb-0">
+                                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                @endif
+                                @if($accountInvite->status == 'CANCELLED')
+                                <span moe class="ml-1" relative>
+                                    <a class="" href="" show start>Undo Cancel</a>
+                                    <form url="/api/accountInvite/undoMarkAsCancelled" right>
+                                        <input type="hidden" name="uid" value="{{$accountInvite->uid}}">
+                                        <p>Un-cancel this invite?</p>
+                                        <div class="mb-0">
+                                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                @endif
+                            </div>
+                        </td>
+                    </tr>
+                    @endforeach
+                </tbody>
+            </table>
+            <div class="ml-2 mt-2">
+                {{ $accountInvites->appends(request()->input())->links() }}
+            </div>
+        </div>
+    </div>
+</div>
+
+@endsection

+ 1 - 1
resources/views/app/mcp/patients-table.blade.php

@@ -22,7 +22,7 @@
 		@foreach($patients as $patient)
 		<tr>
 			<td class="px-3">
-				<a href="{{route('patients.view.dashboard', $patient)}}">
+				<a native target="_blank" href="{{route('patients.view.dashboard', $patient)}}">
 					{{$patient->chart_number}}
 				</a>
 			</td>

+ 42 - 0
resources/views/app/mcp/supply_orders_awaiting_shipment.blade.php

@@ -0,0 +1,42 @@
+<div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 hide-inside-popup border-bottom-0">
+            <strong class="mr-4">
+                <i class="fas fa-box"></i>
+                Supply Orders Awaiting Shipment
+            </strong>
+        </div>
+
+        <div class="card-body p-0 border-top-0 pb-0">
+
+
+            <table class="table table-sm table-striped mb-0">
+                <thead>
+                <tr>
+                    <th class="border-bottom-0">Date</th>
+                    <th class="border-bottom-0">Patient</th>
+                    <th class="border-bottom-0">Product</th>
+                    <th class="border-bottom-0">Reason</th>
+                    <th class="border-bottom-0">Status</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($records as $row)
+                    <tr>
+                        <td>{{ friendly_date_time($row->created_at, false) }}</td>
+                        <td>
+                            <a target="_blank" native href="{{route('patients.view.dashboard', $row->client)}}">
+                                {{$row->client->displayName()}}
+                            </a>
+                        </td>
+                        <td>{{ $row->product->title }}</td>
+                        <td>{{ $row->reason ?: '-' }}</td>
+                        <td>Cleared for shipment</td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+</div>

+ 355 - 377
resources/views/app/new-patient.blade.php

@@ -2,392 +2,370 @@
 
 @section('content')
 
-    <?php
-    $patients = [1,2,3,4];
-    $medicaidStates = Config::get('constants.medicaid_states');
-    ?>
+<?php
+$patients = [1, 2, 3, 4];
+$medicaidStates = Config::get('constants.medicaid_states');
+?>
 
-    <div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>
-        <div class="col-12 col-lg-6 px-0">
-            <div class="card d-block mb-3" moe="">
+<div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>
+	<div class="col-12">
+		<div class="card d-block mb-3" moe="">
 
-                <div class="card-header">
-                    <strong>
-                        <i class="fas fa-user-plus"></i>
-                        New Patient
-                    </strong>
-                </div>
-                <div class="card-body">
-                    <form show url="/api/client/create" class="px-2 pb-1 primary-form" redir="patients/view/[data]">
-                        @if (session('message'))
-                            <div class="alert alert-danger">{{ session('message') }}</div>
-                        @endif
-                        <div class="row">
-                					<div class="col-md-12 bg-light p-3 mb-2">
-                						<h5 class="m-0 font-weight-bold">Patient Name / Demographics:</h5>
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">First Name <span class="text-danger">*</span> </label>
-                						<input type="text" required name="patientNameFirst" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Middle Name / MI</label>
-                						<input type="text" name="patientNameMiddle" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Last Name <span class="text-danger">*</span></label>
-                						<input type="text" required name="patientNameLast" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Prefix</label>
-                						<input type="text" name="patientNamePrefix" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Suffix</label>
-                						<input type="text" name="patientNameSuffix" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Sex</label>
-                						<select class="form-control input-sm" name="patientSex" select2>
-                							<option value="">--</option>
-                							<option value="M">Male</option>
-                							<option value="F">Female</option>
-                							<option value="UNKNOWN">Unknown</option>
-                						</select>
-                					</div>
-                					<div class="form-group col-md-6">
-                						<label class="control-label">Date of Birth <span class="text-danger">*</span></label>
-                						<input type="date" required name="patientDob" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-6">
-                						<label class="control-label">Date Of Service</label>
-                						<input type="date" name="dateOfService" value="{{date('Y-m-d')}}" class="form-control input-sm">
-                					</div>
-                				</div>
-                        @if($pro->pro_type === 'ADMIN')
-                            <div class='form-group mb-3'>
-                                <label class='control-label'>HCP Pro</label>
-                                <select name="hcpProUid" class="form-control" provider-search provider-type="hcp">
-                                    <option value="">--select--</option>
-                                </select>
-                            </div>
-                            <div class='form-group mb-3'>
-                                <label class='control-label'>Care Coordinator</label>
-                                <select name="assistantProUid" class="form-control" provider-search provider-type="default-na">
-                                    <option value="">--select--</option>
-                                </select>
-                            </div>
-                        @elseif($pro->is_hcp === true)
-                            <div class='form-group mb-3'>
-                                <label class='control-label'>HCP Pro</label>
-                                <input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
-                                <input type="hidden" name="hcpProUid" value="{{$pro->uid}}">
-                            </div>
-                        @elseif($pro->isDefaultNA())
-                            <div class='form-group mb-3'>
-                                <label class='control-label'>HCP Pro</label>
-                                <?php $teams = $pro->teamsWhereAssistant; ?>
-                                <select name="hcpProUid" class="form-control">
-                                    <option value="">--select--</option>
-                                    @foreach($teams as $team)
-                                        <option value="{{$team->mcp->uid}}">{{$team->mcp->displayName()}}</option>
-                                    @endforeach
-                                </select>
-                            </div>
-                            <div class='form-group mb-3'>
-                                <label class='control-label'>Care Coordinator</label>
-                                <input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
-                                <input type="hidden" name="assistantProUid" value="{{$pro->uid}}">
-                            </div>
-                        @endif
+			<div class="card-header">
+				<strong>
+					<i class="fas fa-user-plus"></i>
+					New Patient
+				</strong>
+			</div>
+			<div class="card-body">
+				<form show url="/api/client/create" class="px-2 pb-1 primary-form" redir="patients/view/[data]">
+					@if (session('message'))
+					<div class="alert alert-danger">{{ session('message') }}</div>
+					@endif
+					<div class="row">
+						<div class="col-md-6">
+							<div class="row">
+								<div class="col-md-12 bg-light p-3 mb-2">
+									<h5 class="m-0 font-weight-bold">Patient Name / Demographics:</h5>
+								</div>
+								<div class="form-group col-md-4">
+									<label class="control-label">First Name <span class="text-danger">*</span> </label>
+									<input type="text" required name="patientNameFirst" value="" class="form-control input-sm">
+								</div>
+								<div class="form-group col-md-4">
+									<label class="control-label">Middle Name / MI</label>
+									<input type="text" name="patientNameMiddle" value="" class="form-control input-sm">
+								</div>
+								<div class="form-group col-md-4">
+									<label class="control-label">Last Name <span class="text-danger">*</span></label>
+									<input type="text" required name="patientNameLast" value="" class="form-control input-sm">
+								</div>
+								<div class="form-group col-md-4">
+									<label class="control-label">Prefix</label>
+									<input type="text" name="patientNamePrefix" value="" class="form-control input-sm">
+								</div>
+								<div class="form-group col-md-4">
+									<label class="control-label">Suffix</label>
+									<input type="text" name="patientNameSuffix" value="" class="form-control input-sm">
+								</div>
+								<div class="form-group col-md-4">
+									<label class="control-label">Sex</label>
+									<select class="form-control input-sm" name="patientSex" select2>
+										<option value="">--</option>
+										<option value="M">Male</option>
+										<option value="F">Female</option>
+										<option value="UNKNOWN">Unknown</option>
+									</select>
+								</div>
+								<div class="form-group col-md-6">
+									<label class="control-label">Date of Birth <span class="text-danger">*</span></label>
+									<input type="date" required name="patientDob" value="" class="form-control input-sm">
+								</div>
+								<div class="form-group col-md-6">
+									<label class="control-label">Date Of Service</label>
+									<input type="date" name="dateOfService" value="{{date('Y-m-d')}}" class="form-control input-sm">
+								</div>
+							</div>
+							@if($pro->pro_type === 'ADMIN')
+							<div class="row">
+								<div class="col-md-6">
+									<div class='form-group mb-3'>
+										<label class='control-label'>HCP Pro</label>
+										<select name="hcpProUid" class="form-control" provider-search provider-type="hcp">
+											<option value="">--select--</option>
+										</select>
+									</div>
+								</div>
+								<div class="col-md-6">
+									<div class='form-group mb-3'>
+										<label class='control-label'>Care Coordinator</label>
+										<select name="assistantProUid" class="form-control" provider-search provider-type="default-na">
+											<option value="">--select--</option>
+										</select>
+									</div>
+								</div>
+							</div>
+							@elseif($pro->is_hcp === true)
+							<div class="row">
+								<div class="col-md-12">
+									<div class='form-group mb-3'>
+										<label class='control-label'>HCP Pro</label>
+										<input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
+										<input type="hidden" name="hcpProUid" value="{{$pro->uid}}">
+									</div>
+								</div>
+							</div>
+							@elseif($pro->isDefaultNA())
+							<div class="row">
+								<div class="col-md-6">
+									<div class='form-group mb-3'>
+										<label class='control-label'>HCP Pro</label>
+										<?php $teams = $pro->teamsWhereAssistant; ?>
+										<select name="hcpProUid" class="form-control">
+											<option value="">--select--</option>
+											@foreach($teams as $team)
+											<option value="{{$team->mcp->uid}}">{{$team->mcp->displayName()}}</option>
+											@endforeach
+										</select>
+									</div>
 
-                        <div class='form-group mb-3'>
-                            <label class='control-label d-flex align-items-center'>
-                                <span>Home Phone Number</span>
-                                <a href="#"
-                                   class="ml-2 px-1 on-hover-opaque hpn-to-cpn">
-                                    <i class="fa fa-arrow-down"></i>
-                                </a>
-                                <a href="#"
-                                   class="ml-2 px-1 on-hover-opaque swap-pns">
-                                    <i class="fa fa-retweet"></i>
-                                </a>
-                            </label>
-                            <input class='form-control' stag-input-phone type='tel' name='homeNumber'>
-                        </div>
-                        <div class='form-group mb-3'>
-                            <label class='control-label d-flex align-items-center'>
-                                <span>Cell Phone Number</span>
-                                <a href="#"
-                                   class="ml-2 px-1 on-hover-opaque cpn-to-hpn">
-                                    <i class="fa fa-arrow-up"></i>
-                                </a>
-                            </label>
-                            <input class='form-control' stag-input-phone type='tel' name='cellNumber'>
-                        </div>
-                        <div class='form-group mb-3'>
-                            <label class='control-label'>Email Address </label>
-                            <input class='form-control' type='email' name='emailAddress'>
-                        </div>
-                        <hr class="m-neg-4">
-                        <div class="row">
-                					<div class="form-group col-md-12">
-                						<p class="mb-1 font-weight-bold">Type of insurance card:</p>
-                						<div class="form-check form-check-inline">
-                							<label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="MEDICARE">Medicare Part B (Primary)</label>
-                						</div>
-                						<div class="form-check form-check-inline">
-                							<label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="MEDICAID">Medicaid (Primary)</label>
-                						</div>
-                						<div class="form-check form-check-inline">
-                							<label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="COMMERCIAL">Commercial / Third Party (Primary)</label>
-                						</div>
-                					</div>
-                				</div>
-                        <div class="row" v-show="planType == 'COMMERCIAL'">
-                					<div class="form-group col-md-12">
-                						<label for="" class="control-label">Commercial Payer</label>
-                						<input name="commercialPayerUidSuggest" class="form-control input-sm" value="" stag-suggest stag-suggest-ep="/search-payer/json" />
-                						<input type="hidden" name="commercialPayerUid" />
-                					</div>
-                					<div class="form-group col-md-6">
-                						<label class="control-label">Patient Member Identifier</label>
-                						<input type="text" name="commercialMemberIdentifier"  class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-6">
-                						<label class="control-label">Patient Group Number</label>
-                						<input type="text" name="commercialGroupNumber"  class="form-control input-sm">
-                					</div>
-                				</div>
+								</div>
+								<div class="col-md-6">
+									<div class='form-group mb-3'>
+										<label class='control-label'>Care Coordinator</label>
+										<input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
+										<input type="hidden" name="assistantProUid" value="{{$pro->uid}}">
+									</div>
+								</div>
+							</div>
+							@endif
 
-                        <div class="row">
-                					<div class="form-group col-md-12" v-if="planType == 'MEDICAID' || planType == 'COMMERCIAL'">
-                						<div class="form-check form-check-inline">
-                							<label class="form-check-label"><input class="form-check-input" type="checkbox" name="isPatientSubscriber" v-model="isPatientSubscriber">Is Patient The Subscriber?</label>
-                						</div>
-                					</div>
-                				</div>
+							<div class="row">
+								<div class="col-md-4">
+									<div class='form-group mb-3'>
+										<label class='control-label d-flex align-items-center'>
+											<span>Home Phone Number</span>
+											<a v-if="form.homeNumber" @click="hpnToCpn" class="ml-1 px-1 on-hover-opaque hpn-to-cpn c-pointer">
+												<i class="fa fa-arrow-right"></i>
+											</a>
+											<a v-if="form.cellNumber && form.homeNumber" @click="swapHpnCpn" class="ml-1 px-1 on-hover-opaque swap-pns c-pointer">
+												<i class="fa fa-retweet"></i>
+											</a>
+										</label>
+										<input class='form-control' stag-input-phone type='tel' name='homeNumber' v-model="form.homeNumber">
+									</div>
+								</div>
+								<div class="col-md-4">
+									<div class='form-group mb-3'>
+										<label class='control-label d-flex align-items-center'>
+											<span>Cell Phone Number</span>
+											<a v-if="form.cellNumber" @click="cpnToHpn" class="ml-1 px-1 on-hover-opaque cpn-to-hpn c-pointer">
+												<i class="fa fa-arrow-left"></i>
+											</a>
+										</label>
+										<input class='form-control' stag-input-phone type='tel' name='cellNumber' v-model="form.cellNumber">
+									</div>
+								</div>
+								<div class="col-md-4">
+									<div class='form-group mb-3'>
+										<label class='control-label'>Email Address </label>
+										<input class='form-control' type='email' name='emailAddress'>
+									</div>
+								</div>
+							</div>
 
-                				<div v-if="!isPatientSubscriber && (planType == 'MEDICAID' || planType == 'COMMERCIAL')" class="row">
-                					<div class="col-md-12 bg-light p-3 mb-2">
-                						<h5 class="m-0 font-weight-bold">Subscriber Details:</h5>
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Subscriber First Name</label>
-                						<input type="text" name="subscriberNameFirst" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Subscriber Middle Name / MI</label>
-                						<input type="text" name="subscriberNameMiddle" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Subscriber Last Name</label>
-                						<input type="text" name="subscriberNameLast" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Subscriber Suffix</label>
-                						<input type="text" name="subscriberNameSuffix" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Subscriber Sex</label>
-                						<select class="form-control input-sm" name="subscriberSex">
-                							<option value="">--</option>
-                							<option value="M">Male</option>
-                							<option value="F">Female</option>
-                							<option value="UNKNOWN">Unknown</option>
-                						</select>
-                					</div>
-                					<div class="form-group col-md-4">
-                						<label class="control-label">Subscriber Dob</label>
-                						<input type="date" name="subscriberDob" value="" class="form-control input-sm">
-                					</div>
-                					<div class="form-group col-md-12">
-                						<label class="control-label">What is the patient's relationship to the subscriber?</label>
-                						<select name="patientRelationshipToSubscriber" class="form-control input-sm">
-                							<option value="">--</option>
-                							<option value="SPOUSE">Spouse</option>
-                							<option value="CHILD">Child</option>
-                							<option value="EMPLOYEE">Employee</option>
-                							<option value="ORGAN_DONOR">Organ Donor</option>
-                							<option value="CADAVER_DONOR">Cadaver Donor</option>
-                							<option value="LIFE_PARTNER">Life Partner</option>
-                							<option value="OTHER_RELATIONSHIP">Other Relationship</option>
-                							<option value="UNKNOWN">Unknown</option>
-                						</select>
-                					</div>
-                				</div>
-                        <div class="mb-1" v-if="planType == 'COMMERCIAL'">
-                					<h6 class="font-weight-bold">Does the patient also have either a Medicare or Medicaid #? (optional)</h6>
-                				</div>
-                        <div class="row" v-if="planType == 'MEDICAID' || planType == 'COMMERCIAL'" :class="planType == 'COMMERCIAL' ? 'mx-0' : ''">
-                					<div class="col-md-12 bg-light p-3 mb-2">
-                						<h5 class="m-0 font-weight-bold">Medicaid Information:</h5>
-                					</div>
-                					<div class="form-group col-md-6">
-                						<label for="" class="control-label">Medicaid State</label>
-                						<input class="form-control input-sm" list="mcdPayer" name="mcdPayerName" id="mcdPayerName">
-                						<datalist id="mcdPayer">
-                							<option value="">--</option>
-                							<option>MEDICAID ALABAMA</option>
-                							<option>MEDICAID ALASKA</option>
-                							<option>MEDICAID ARIZONA</option>
-                							<option>MEDICAID ARKANSAS</option>
-                							<option>MEDICAID CALIFORNIA MEDI-CAL</option>
-                							<option>MEDICAID COLORADO</option>
-                							<option>MEDICAID CONNECTICUT</option>
-                							<option>MEDICAID DELAWARE</option>
-                							<option>MEDICAID DISTRICT OF COLUMBIA</option>
-                							<option>MEDICAID FLORIDA</option>
-                							<option>MEDICAID GEORGIA</option>
-                							<option>MEDICAID HAWAII</option>
-                							<option>MEDICAID IDAHO</option>
-                							<option>MEDICAID ILLINOIS</option>
-                							<option>MEDICAID INDIANA</option>
-                							<option>MEDICAID IOWA</option>
-                							<option>MEDICAID KANSAS</option>
-                							<option>MEDICAID KENTUCKY</option>
-                							<option>MEDICAID LOUISIANA</option>
-                							<option>MEDICAID MAINE</option>
-                							<option>MEDICAID MARYLAND</option>
-                							<option>MEDICAID MARYLAND DHMH</option>
-                							<option>MEDICAID MASSACHUSETTS</option>
-                							<option>MEDICAID MICHIGAN</option>
-                							<option>MEDICAID MINNESOTA</option>
-                							<option>MEDICAID MISSISSIPPI</option>
-                							<option>MEDICAID MISSISSIPPI</option>
-                							<option>MEDICAID MISSOURI</option>
-                							<option>MEDICAID MONTANA</option>
-                							<option>MEDICAID NEBRASKA</option>
-                							<option>MEDICAID NEVADA</option>
-                							<option>MEDICAID NEW HAMPSHIRE</option>
-                							<option>MEDICAID NEW JERSEY</option>
-                							<option>MEDICAID NEW MEXICO</option>
-                							<option>MEDICAID NEW YORK</option>
-                							<option>MEDICAID NEW YORK</option>
-                							<option>MEDICAID NORTH CAROLINA</option>
-                							<option>MEDICAID NORTH DAKOTA</option>
-                							<option>MEDICAID OHIO</option>
-                							<option>MEDICAID OKLAHOMA</option>
-                							<option>MEDICAID OREGON</option>
-                							<option>MEDICAID OREGON (DHS OMAP)</option>
-                							<option>MEDICAID PENNSYLVANIA</option>
-                							<option>MEDICAID RHODE ISLAND</option>
-                							<option>MEDICAID SOUTH CAROLINA</option>
-                							<option>MEDICAID SOUTH DAKOTA</option>
-                							<option>MEDICAID TENNESSEE</option>
-                							<option>MEDICAID TEXAS</option>
-                							<option>MEDICAID TEXAS AND TEXAS HEALTH STEPS</option>
-                							<option>MEDICAID UTAH</option>
-                							<option>MEDICAID VERMONT</option>
-                							<option>MEDICAID VIRGINIA</option>
-                							<option>MEDICAID WASHINGTON (PROVIDER ONE)</option>
-                							<option>MEDICAID WEST VIRGINIA</option>
-                							<option>MEDICAID WISCONSIN</option>
-                							<option>MEDICAID WYOMING</option>
-                						</datalist>
-                					</div>
 
-                					<div class="form-group col-md-6">
-                						<label class="control-label">Medicaid Number</label>
-                						<input type="text" name="mcdNumber" class="form-control input-sm">
-                					</div>
-                				</div>
+							<div class='form-group mb-3'>
+								<label class='control-label'>How did you hear about us?</label>
+								<textarea class='form-control' type='text' required="" name='initiative'></textarea>
+							</div>
 
-                				<div class="row" v-if="planType == 'MEDICARE' || planType == 'COMMERCIAL'" :class="planType == 'COMMERCIAL' ? 'mx-0' : ''">
-                					<div class="col-md-12 bg-light p-3 mb-2">
-                						<h5 class="m-0 font-weight-bold">Medicare Information:</h5>
-                					</div>
-                					<div class="form-group col-md-6">
-                						<label class="control-label">Medicare Number</label>
-                						<input type="text" name="mcrNumber" class="form-control input-sm">
-                					</div>
+						</div>
+						<div class="col-md-6">
+							<div class="col-md-12 bg-light p-3 mb-2">
+								<h5 class="m-0 font-weight-bold">Insurance Cover Details:</h5>
+							</div>
+							<div class="px-1">
+								<div class="row">
+									<div class="form-group col-md-12">
+										<p class="mb-1 font-weight-bold">Type of insurance card:</p>
+										<div class="form-check form-check-inline">
+											<label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="MEDICARE">Medicare Part B (Primary)</label>
+										</div>
+										<div class="form-check form-check-inline">
+											<label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="MEDICAID">Medicaid (Primary)</label>
+										</div>
+										<div class="form-check form-check-inline">
+											<label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="COMMERCIAL">Commercial / Third Party (Primary)</label>
+										</div>
+									</div>
+								</div>
+								<div class="px-1">
+									<div class="row" v-show="planType == 'COMMERCIAL'">
+										<div class="form-group col-md-12">
+											<label for="" class="control-label">Commercial Payer</label>
+											<input name="commercialPayerUidSuggest" class="form-control input-sm" value="" stag-suggest stag-suggest-ep="/search-payer/json" />
+											<input type="hidden" name="commercialPayerUid" />
+										</div>
+										<div class="form-group col-md-6">
+											<label class="control-label">Patient Member Identifier</label>
+											<input type="text" name="commercialMemberIdentifier" class="form-control input-sm">
+										</div>
+										<div class="form-group col-md-6">
+											<label class="control-label">Patient Group Number</label>
+											<input type="text" name="commercialGroupNumber" class="form-control input-sm">
+										</div>
+									</div>
+									<div class="row">
+										<div class="form-group col-md-12" v-if="planType == 'MEDICAID' || planType == 'COMMERCIAL'">
+											<div class="form-check form-check-inline">
+												<label class="form-check-label"><input class="form-check-input" type="checkbox" name="isPatientSubscriber" v-model="isPatientSubscriber">Is Patient The Subscriber?</label>
+											</div>
+										</div>
+									</div>
 
-                				</div>
+									<div v-if="!isPatientSubscriber && (planType == 'MEDICAID' || planType == 'COMMERCIAL')" class="row">
+										<div class="col-md-12 bg-light p-3 mb-2">
+											<h5 class="m-0 font-weight-bold">Subscriber Details:</h5>
+										</div>
+										<div class="form-group col-md-4">
+											<label class="control-label">Subscriber First Name</label>
+											<input type="text" name="subscriberNameFirst" value="" class="form-control input-sm">
+										</div>
+										<div class="form-group col-md-4">
+											<label class="control-label">Subscriber Middle Name / MI</label>
+											<input type="text" name="subscriberNameMiddle" value="" class="form-control input-sm">
+										</div>
+										<div class="form-group col-md-4">
+											<label class="control-label">Subscriber Last Name</label>
+											<input type="text" name="subscriberNameLast" value="" class="form-control input-sm">
+										</div>
+										<div class="form-group col-md-4">
+											<label class="control-label">Subscriber Suffix</label>
+											<input type="text" name="subscriberNameSuffix" value="" class="form-control input-sm">
+										</div>
+										<div class="form-group col-md-4">
+											<label class="control-label">Subscriber Sex</label>
+											<select class="form-control input-sm" name="subscriberSex">
+												<option value="">--</option>
+												<option value="M">Male</option>
+												<option value="F">Female</option>
+												<option value="UNKNOWN">Unknown</option>
+											</select>
+										</div>
+										<div class="form-group col-md-4">
+											<label class="control-label">Subscriber Dob</label>
+											<input type="date" name="subscriberDob" value="" class="form-control input-sm">
+										</div>
+										<div class="form-group col-md-12">
+											<label class="control-label">What is the patient's relationship to the subscriber?</label>
+											<select name="patientRelationshipToSubscriber" class="form-control input-sm">
+												<option value="">--</option>
+												<option value="SPOUSE">Spouse</option>
+												<option value="CHILD">Child</option>
+												<option value="EMPLOYEE">Employee</option>
+												<option value="ORGAN_DONOR">Organ Donor</option>
+												<option value="CADAVER_DONOR">Cadaver Donor</option>
+												<option value="LIFE_PARTNER">Life Partner</option>
+												<option value="OTHER_RELATIONSHIP">Other Relationship</option>
+												<option value="UNKNOWN">Unknown</option>
+											</select>
+										</div>
+									</div>
+									<div class="mb-1" v-if="planType == 'COMMERCIAL'">
+										<h6 class="font-weight-bold">Does the patient also have either a Medicare or Medicaid #? (optional)</h6>
+									</div>
+									<div class="row" v-if="planType == 'MEDICAID' || planType == 'COMMERCIAL'" :class="planType == 'COMMERCIAL' ? 'mx-0' : ''">
+										<div class="col-md-12">
+											<div class="bg-light p-3 mb-2">
+											<h5 class="m-0 font-weight-bold">Medicaid Information:</h5>
+											</div>
+											
+										</div>
+										<div class="form-group col-md-6">
+											<label for="" class="control-label">Medicaid State</label>
+											<input class="form-control input-sm" list="mcdPayer" name="mcdPayerName" id="mcdPayerName">
+											<datalist id="mcdPayer">
+												<option value="">--</option>
+												@foreach($medicaidStates as $state)
+												<option>{{ $state }}</option>
+												@endforeach
+											</datalist>
+										</div>
 
-                        <hr class="m-neg-4">
-			                     <div class='form-group mb-3'>
-                            <label class='control-label'>How did you hear about us?</label>
-                            <textarea class='form-control' type='text' required="" name='initiative'></textarea>
-                          </div>
-                    </form>
-                </div>
-                <div class="card-footer">
-                    <button class="btn btn-primary" submit>Create New Patient</button>
-                </div>
-            </div>
-        </div>
-    </div>
+										<div class="form-group col-md-6">
+											<label class="control-label">Medicaid Number</label>
+											<input type="text" name="mcdNumber" class="form-control input-sm">
+										</div>
+									</div>
 
-    <link href="/select2/select2.min.css" rel="stylesheet" />
-    <script src="/select2/select2.min.js"></script>
-    <script src="/inputmask-5.x/dist/inputmask.js"></script>
-    <script>
-        (function() {
-            function init() {
-                let im = new Inputmask("(999) 999-9999").mask('[stag-input-phone]');
-                $(document)
-                    .off('click.hpn-to-cpn', '.hpn-to-cpn')
-                    .on('click.hpn-to-cpn', '.hpn-to-cpn', function() {
-                        $('[name="cellNumber"]').val($('[name="homeNumber"]').val());
-                        $('[name="homeNumber"]').val('');
-                        return false;
-                    });
-                $(document)
-                    .off('click.cpn-to-hpn', '.cpn-to-hpn')
-                    .on('click.cpn-to-hpn', '.cpn-to-hpn', function() {
-                        $('[name="homeNumber"]').val($('[name="cellNumber"]').val());
-                        $('[name="cellNumber"]').val('');
-                        return false;
-                    });
-                $(document)
-                    .off('click.swap-pns', '.swap-pns')
-                    .on('click.swap-pns', '.swap-pns', function() {
-                        let hpn = $('[name="homeNumber"]').val();
-                        $('[name="homeNumber"]').val($('[name="cellNumber"]').val());
-                        $('[name="cellNumber"]').val(hpn);
-                        return false;
-                    });
-                $(document)
-                    .off('change.insurance', '.insurance')
-                    .on('change.insurance', '.insurance', function() {
-                        $('[data-insurance]').addClass('d-none');
-                        $('[data-insurance="' + $(this).val() + '"]').removeClass('d-none');
-                        $(this).closest('form').attr('url', '/api/client/' + ($(this).val() === 'medicare' ? 'create' : 'createNonMcn'))
-                        $(this).closest('[moe]').removeAttr('initialized');
-                        initMoes();
-                        return false;
-                    });
-                $('.select2').select2({
-                    width: '100%'
-                });
-            }
-            addMCInitializer('new-patient', init, '#newPatientContainer');
-        }).call(window);
+									<div class="row" v-if="planType == 'MEDICARE' || planType == 'COMMERCIAL'" :class="planType == 'COMMERCIAL' ? 'mx-0' : ''">
+										<div class="col-md-12">
+											<div class="bg-light p-3 mb-2">
+											<h5 class="m-0 font-weight-bold">Medicare Information:</h5>
+											</div>
+										</div>
+										<div class="form-group col-md-6">
+											<label class="control-label">Medicare Number</label>
+											<input type="text" name="mcrNumber" class="form-control input-sm">
+										</div>
 
-        var newPatientContainer = new Vue({
-          el: '#newPatientContainer',
-          data: {
-            planType: 'MEDICARE',
-            isPatientSubscriber: true
-          },
-          methods: {
-            onCommercialPayerChange: function() {
-							var input = $('input[name=commercialPayerUidSuggest]');
-							var hiddenInput = $('input[name=commercialPayerUid]');
-							input
-								.off('stag-suggest-selected')
-								.on('stag-suggest-selected', (e, input, _data) => {
-									hiddenInput.val(_data.uid);
-								});
-						},
-            init: function() {
-							this.onCommercialPayerChange();
-						}
-          },
-          mounted: function() {
-						this.init();
-					}
-        });
-    </script>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+				</form>
+			</div>
+			<div class="card-footer text-center">
+				<button class="btn btn-primary" submit>Create New Patient</button>
+			</div>
+		</div>
+	</div>
+</div>
 
-@endsection
+<link href="/select2/select2.min.css" rel="stylesheet" />
+<script src="/select2/select2.min.js"></script>
+<script src="/inputmask-5.x/dist/inputmask.js"></script>
+<script>
+	(function() {
+		function init() {
+			let im = new Inputmask("(999) 999-9999").mask('[stag-input-phone]');
+			$(document)
+				.off('change.insurance', '.insurance')
+				.on('change.insurance', '.insurance', function() {
+					$('[data-insurance]').addClass('d-none');
+					$('[data-insurance="' + $(this).val() + '"]').removeClass('d-none');
+					$(this).closest('form').attr('url', '/api/client/' + ($(this).val() === 'medicare' ? 'create' : 'createNonMcn'))
+					$(this).closest('[moe]').removeAttr('initialized');
+					initMoes();
+					return false;
+				});
+			$('.select2').select2({
+				width: '100%'
+			});
+		}
+		addMCInitializer('new-patient', init, '#newPatientContainer');
+	}).call(window);
+
+	var newPatientContainer = new Vue({
+		el: '#newPatientContainer',
+		data: {
+			form: {},
+			planType: 'MEDICARE',
+			isPatientSubscriber: true
+		},
+		methods: {
+			hpnToCpn: function() {
+				this.form.cellNumber = this.form.homeNumber;
+				this.form.homeNumber = null;
+			},
+			cpnToHpn: function() {
+				this.form.homeNumber = this.form.cellNumber;
+				this.form.cellNumber = null;
+			},
+			swapHpnCpn: function() {
+				var data = $.extend({}, this.form);
+				this.form.homeNumber = data.cellNumber;
+				this.form.cellNumber = data.homeNumber;
+			},
+			onCommercialPayerChange: function() {
+				var input = $('input[name=commercialPayerUidSuggest]');
+				var hiddenInput = $('input[name=commercialPayerUid]');
+				input
+					.off('stag-suggest-selected')
+					.on('stag-suggest-selected', (e, input, _data) => {
+						hiddenInput.val(_data.uid);
+					});
+			},
+			init: function() {
+				this.onCommercialPayerChange();
+			}
+		},
+		mounted: function() {
+			this.init();
+		}
+	});
+</script>
+
+@endsection

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

@@ -161,7 +161,7 @@
                         </td>
                         <td class="px-2">
                             <div class="d-flex">
-                                @if($accountInvite->status !== 'PENDING')
+                                @if($accountInvite->status === 'PENDING')
                                     <span moe class="ml-1" relative>
                                         <a class="" href="" show start>Cancel</a>
                                         <form url="/api/accountInvite/markAsCancelled" right>

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

@@ -311,16 +311,6 @@ foreach ($days as $k => $day) {
 <script>
     (function() {
         function init() {
-            $('a[tab-link]')
-                .off('click')
-                .on('click', function () {
-                    let tab = $(this).attr('tab-link');
-                    $(this).siblings().removeClass('tab-link-active');
-                    $(this).addClass('tab-link-active');
-                    $('.cm-tab').addClass('d-none');
-                    $('.cm-tab[tab-key="' + tab + '"]').removeClass('d-none');
-                    return false;
-                });
 
             $('.btn-stamp')
                 .off('click')

+ 41 - 25
resources/views/app/patient/dashboard.blade.php

@@ -228,7 +228,7 @@
 
                 {{-- canvas based dx --}}
                 @if($isOldClient)
-                    <div class="pt-2 mt-2 border-top">
+                    <div class="pt-2 mb-2 border-top">
                         <div class="d-flex align-items-center pb-2">
                             <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
                             <div class="px-2 font-weight-bold alert alert-warning text-sm my-0 ml-2 py-1">Deprecated</div>
@@ -536,13 +536,14 @@
                         <table class="table table-striped table-sm table-bordered mb-0">
                             @if($patient->memos && count($patient->memos))
                                 <thead>
-                                <tr>
+                                <tr class="text-nowrap">
                                     <th class="px-2 text-secondary">Category</th>
-                                    <th class="px-2 text-secondary w-75">Summary</th>
+                                    <th class="px-2 text-secondary w-50">Summary</th>
                                     <th class="px-2 text-secondary">Created</th>
                                     @if($performer->pro->pro_type === 'ADMIN')
                                     <th class="px-2 text-secondary">Admins Only</th>
                                     @endif
+                                    <th class="px-2 text-secondary">Ack. by MCP</th>
                                     <th class="px-2 text-secondary delete-column">&nbsp;</th>
                                 </tr>
                                 </thead>
@@ -554,27 +555,29 @@
                                         <td class="px-2">
                                             <pre class="m-0 break-spaces">{{ $memo->content }}</pre>
                                             @if($performer->pro->pro_type == 'ADMIN')
-                                            <div moe>
-                                                <a start show>Show Changelog</a>
-                                                <div action="" url>
-                                                    <table class="table table-condensed table-striped table-sm">
-                                                        <thead>
-                                                        <th>Category</th>
-                                                        <th>Summary</th>
-                                                        <th>Created</th>
-                                                        
-                                                        </thead>
-                                                        <tbody>
-                                                        @foreach($memo->updates as $update)
-                                                            <tr>
-                                                                <td>{{$update->category}}</td>
-                                                                <td>{{$update->content}}</td>
-                                                                <td><strong>{{$update->createdBy->proname_first}} {{$update->createdBy->pro->name_last}}</strong><br/>{{ friendly_date_time($update->created_at) }}</td>
-                                                               
-                                                            </tr>
-                                                        @endforeach
-                                                        </tbody>
-                                                    </table>
+                                            <div class="d-flex justify-content-end align-items-center">
+                                                <div moe>
+                                                    <a start show><i class="fas fa-archive"></i> Show Changelog</a>
+                                                    <div action="" url>
+                                                        <table class="table table-condensed table-striped table-sm">
+                                                            <thead>
+                                                            <th>Category</th>
+                                                            <th>Summary</th>
+                                                            <th>Created</th>
+                                                            
+                                                            </thead>
+                                                            <tbody>
+                                                            @foreach($memo->updates as $update)
+                                                                <tr>
+                                                                    <td>{{$update->category}}</td>
+                                                                    <td>{{$update->content}}</td>
+                                                                    <td><strong>{{$update->createdBy->proname_first}} {{$update->createdBy->pro->name_last}}</strong><br/>{{ friendly_date_time($update->created_at) }}</td>
+                                                                
+                                                                </tr>
+                                                            @endforeach
+                                                            </tbody>
+                                                        </table>
+                                                    </div>
                                                 </div>
                                             </div>
                                             @endif
@@ -586,8 +589,21 @@
                                             {{ friendly_date_time($memo->created_at) }}
                                         </td>
                                         @if($performer->pro->pro_type === 'ADMIN' )
-                                        <td class="px-2 text-secondary">{{$memo->is_admin_only?'Yes':'No'}}</td>
+                                        <td class="px-2 text-secondary">
+                                            @if($memo->is_admin_only)
+                                                <span class="text-success"><i class="fas fa-lock"></i> YES</span>
+                                            @else
+                                                <span><i class="fas fa-unlock"></i> NO</span>
+                                            @endif
+                                        </td>
                                         @endif
+                                        <td class="px-2">
+                                            @if($memo->mcp_stamp_id)
+                                            <span class="text-success">YES <i class="fas fa-info-circle c-pointer" data-toggle="tooltip" data-placement="bottom" title="{{ friendly_date_time($memo->stamp->created_at) }}"></i></span>
+                                            @else
+                                            <span class="text-secondary">NO</span>
+                                            @endif
+                                        </td>
                                         <td class="px-2 text-center delete-column">
                                             <div moe wide relative class="mr-2">
                                                 <a class="on-hover-opaque" start show title="Edit">

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

@@ -60,7 +60,7 @@
                 <tbody>
                 @foreach($patient->devices as $device)
                     <tr>
-                        <td class="px-2">{{ friendly_date_time($device->device->created_at) }}</td>
+                        <td class="px-2 text-nowrap">{{ friendly_date_time($device->device->created_at) }}</td>
                         <td class="px-2">{{ $device->device->category }}</td>
                         <td class="px-2"><pre class="m-0">{{ $device->device->imei }}</pre></td>
                         <td>

+ 3 - 33
resources/views/app/patient/documents.blade.php

@@ -6,9 +6,8 @@
             <span class="mx-2 text-secondary">|</span>
             <div moe>
                 <a start show class="">Upload</a>
-                <form url="dummy" action="/api/clientDocument/create"
+                <form url="/api/clientDocument/create"
                       method="post"
-                      onsubmit="return submitDocument(this)"
                       enctype="multipart/form-data">
                     <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
                     <div class="mb-2">
@@ -140,8 +139,8 @@
                         <textarea type="text" class="form-control form-control-sm" name="notes"></textarea>
                     </div>
                     <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" type="submit">Send</button>
-                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                        <button submit class="btn btn-sm btn-primary mr-2" type="button">Send</button>
+                        <button cancel class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
                     </div>
                 </form>
             </div>
@@ -326,33 +325,4 @@
             </tbody>
         </table>
     </div>
-    <script>
-        function submitDocument(_form) {
-            showMask();
-            $.ajax({
-                type: "POST",
-                enctype: 'multipart/form-data',
-                url: _form.action,
-                data: new FormData(_form),
-                processData: false,
-                contentType: false,
-                cache: false,
-                timeout: 600000,
-                success: function (data) {
-                    hideMask();
-                    if(data.success) {
-                        fastReload();
-                    }
-                    else {
-                        toastr.error(data.message);
-                    }
-                },
-                error: function (e) {
-                    hideMask();
-                    toastr.error('Unable to upload document!');
-                }
-            });
-            return false;
-        }
-    </script>
 @endsection

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

@@ -9,6 +9,9 @@
                 <a start show class="">Add</a>
                 <form url="/api/handoutClient/create">
                     <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                    @if(request()->input('noteUid'))
+                        <input type="hidden" name="noteUid" value="{{ request()->input('noteUid') }}">
+                    @endif
                     <div class="mb-2">
                         <select name="handoutUid" class="form-control form-control-sm">
                             <option value=""> --select--</option>

+ 14 - 33
resources/views/app/patient/incoming-reports.blade.php

@@ -6,11 +6,13 @@
             <span class="mx-2 text-secondary">|</span>
             <div moe>
                 <a start show class="">Upload</a>
-                <form url="dummy" action="/api/incomingReport/create"
+                <form url="/api/incomingReport/create"
                       method="post"
-                      onsubmit="return submitIncomingReport(this)"
                       enctype="multipart/form-data">
                     <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                    @if(request()->input('noteUid'))
+                        <input type="hidden" name="noteUid" value="{{ request()->input('noteUid') }}">
+                    @endif
                     <div class="mb-2">
                         <label for="" class="text-sm text-secondary mb-1">Category</label>
                         <input type="text" class="form-control form-control-sm" name="category"
@@ -48,7 +50,7 @@
                                value="" placeholder="Memo">
                     </div>
                     <div class="d-flex align-items-center">
-                        <button class="btn btn-sm btn-primary mr-2" type="submit">Save</button>
+                        <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
                         <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
                     </div>
                 </form>
@@ -70,12 +72,18 @@
                     <tbody>
                     @foreach($patient->incomingReports as $document)
                         <tr class="{{$document->is_entry_error ? 'entry-error' : ''}} {{@$currentReport->uid === $document->uid ? 'bg-aliceblue' : ''}}">
-                            <td class="px-2">{{ friendly_date_time($document->created_at, false) }}</td>
+                            <td class="px-2">
+                                {{ friendly_date_time($document->created_at, false) }}
+                                @if(request()->input('noteUid') && $document->note && $document->note->uid === request()->input('noteUid'))
+                                    <div class="mt-1 text-info text-sm">Created on this note</div>
+                                @endif
+                            </td>
                             <td class="px-2">
                                 {{$document->hcp ? $document->hcp->displayName() : '-'}}
                             </td>
                             <td class="px-2">
-                                <a mc-initer="incoming-reports" href="{{route('patients.view.incoming-reports', ['patient' => $patient, 'currentReport' => $document])}}"
+                                <a mc-initer="incoming-reports"
+                                   href="{{route('patients.view.incoming-reports', ['patient' => $patient, 'currentReport' => $document])}}{{request()->input('noteUid') ? '?noteUid=' . request()->input('noteUid') : ''}}"
                                    class="{{@$currentReport->uid === $document->uid ? 'font-weight-bold' : ''}}">
                                     {{ $document->title ? $document->title : '(not set)' }}
                                 </a>
@@ -206,7 +214,7 @@
                                 @endif
                             @endif
                         </div>
-                        <a class="ml-auto" mc-initer="incoming-reports" href="{{route('patients.view.incoming-reports', ['patient' => $patient, 'currentReport' => null])}}">
+                        <a class="ml-auto" mc-initer="incoming-reports" href="{{route('patients.view.incoming-reports', ['patient' => $patient, 'currentReport' => null])}}{{request()->input('noteUid') ? '?noteUid=' . request()->input('noteUid') : ''}}">
                             <i class="fa fa-times-circle on-hover-opaque"></i>
                         </a>
                     </div>
@@ -218,33 +226,6 @@
     </div>
     @include('app/pdf/viewer')
     <script>
-        function submitIncomingReport(_form) {
-            showMask();
-            $.ajax({
-                type: "POST",
-                enctype: 'multipart/form-data',
-                url: _form.action,
-                data: new FormData(_form),
-                processData: false,
-                contentType: false,
-                cache: false,
-                timeout: 600000,
-                success: function (data) {
-                    hideMask();
-                    if(data.success) {
-                        fastReload();
-                    }
-                    else {
-                        toastr.error(data.message);
-                    }
-                },
-                error: function (e) {
-                    hideMask();
-                    toastr.error('Unable to upload document!');
-                }
-            });
-            return false;
-        }
         (function() {
             function init() {
                 $('#incoming-reports').find('input.stag-dp')

+ 30 - 3
resources/views/app/patient/measurements.blade.php

@@ -5,6 +5,7 @@
         <div class="mt-0 pb-1">
             <div class="d-flex align-items-center mb-2">
                 <h6 class="my-0 font-weight-bold text-dark">Measurements</h6>
+                {{--
                 <span class="mx-2 text-secondary">|</span>
                 <div moe>
                     <a start show class="py-0 font-weight-normal">Add BP</a>
@@ -25,7 +26,7 @@
                         <div class="d-flex align-items-center">
                             <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
                             <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
-                        </div>Me
+                        </div>
                     </form>
                 </div>
                 <span class="mx-2 text-secondary">|</span>
@@ -47,6 +48,7 @@
                         </div>
                     </form>
                 </div>
+                --}}
 {{--                @if($performer->pro->pro_type == 'ADMIN')--}}
 {{--                <span class="mx-2 text-secondary">|</span>--}}
 {{--                <div moe>--}}
@@ -72,7 +74,7 @@
                     <th class="px-2 text-secondary w-25">Category</th>
                     <th class="px-2 text-secondary w-25">Value</th>
                     <th class="px-2 text-secondary">Source</th>
-                    {{--<th class="px-2 text-secondary">Memo</th>--}}
+                    <th class="px-2 text-secondary">Stamp</th>
                     <th class="px-2 text-secondary"></th>
                     <th class="px-2 text-secondary"></th>
                 </tr>
@@ -104,7 +106,32 @@
                                 @endif
                             </td>
                             <td class="px-2">{{$measurement->source}}</td>
-                            <td class="px-2">
+                            <td>
+                                @if($measurement->is_cellular_zero || !$measurement->ts)
+                                    -
+                                @else
+                                    @if($measurement->has_been_stamped_by_mcp)
+                                        <i class="fa fa-check text-success mr-2" title="Stamped"></i>
+                                    @else
+                                        <div moe relative>
+                                            <a href="#" start show>Stamp</a>
+                                            <form url="/api/measurement/stamp" class="width-300px" right>
+                                                <input type="hidden" name="uid" value="{{$measurement->uid}}">
+                                                <p class="mb-1">Stamp this measurement?</p>
+                                                <div class="mb-2">
+                                                    <label class="mb-1 text-secondary text-sm">Memo</label>
+                                                    <textarea class="form-control form-control-sm" name="memo"></textarea>
+                                                </div>
+                                                <div class="form-group m-0">
+                                                    <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                                    <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    @endif
+                                @endif
+                            </td>
+                            <td class="px-2 text-nowrap">
                                 <span moe relative class="mr-2">
                                     <a class="on-hover-opaque" start show title="Delete">
                                         <i class="font-size-11 fa fa-trash-alt text-danger"></i>

+ 1 - 1
resources/views/app/patient/note/dashboard-univ.blade.php

@@ -278,7 +278,7 @@
 
             <div class="px-2">
                 <div class="d-flex">
-                    <span class="mr-2"><span class="text-secondary">Method:</span> {{$note->method ? $note->method : '-'}}</span>
+                    <span class="mr-2"><span class="text-secondary">Method:</span> {{$note->method ? noteMethodDisplay($note->method) : '-'}}</span>
                     @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
                         <div moe class="ml-auto">
                             <a href="" show start><i class="fa fa-edit"></i></a>

+ 61 - 31
resources/views/app/patient/note/dashboard.blade.php

@@ -26,9 +26,13 @@
     $doesVisitTemplateUiConfigExist = $uiConfigsPath && file_exists($uiConfigsPath);
     $visitTemplateUiConfig = $doesVisitTemplateUiConfigExist ? json_decode(file_get_contents($uiConfigsPath), true) : null;
 
-    $visitLayoutPath = $note->visitTemplate? "app.patient.note.visit-template-ui-layouts.{$note->visitTemplate->internal_name}" : null;
+    $visitLayoutPath = '';
+    $doesVisitTemplateLayoutExist = false;
 
-    $doesVisitTemplateLayoutExist = $isVisitTemplateBased && \Illuminate\Support\Facades\View::exists($visitLayoutPath);
+    if($isVisitTemplateBased) {
+        $visitLayoutPath = "app.patient.note.visit-template-ui-layouts.{$note->visitTemplate->internal_name}";
+        $doesVisitTemplateLayoutExist = $isVisitTemplateBased && \Illuminate\Support\Facades\View::exists($visitLayoutPath);
+    }
 
     $segmentMap = [];
     foreach($note->segments as $segment):
@@ -298,7 +302,7 @@
 
             <div class="px-2">
                 <div class="d-flex">
-                    <span class="mr-2"><span class="text-secondary">Method:</span> {{$note->method ? $note->method : '-'}}</span>
+                    <span class="mr-2"><span class="text-secondary">Method:</span> {{$note->method ? noteMethodDisplay($note->method) : '-'}}</span>
                     @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
                         <div moe class="ml-auto">
                             <a href="" show start><i class="fa fa-edit"></i></a>
@@ -356,30 +360,34 @@
                             </div>
                         @endif
                         @if(!$note->is_signed_by_hcp )
-                            <div moe relative
-                                 class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
-                                 title="{{ $note->hcp_pro_id !== $pro->id ? 'Only the note\'s HCP can sign' : '' }}">
-                                <a class="" href="" show start>Sign Note As HCP</a>
-                                <form url="/api/note/signAsHcp" right>
-                                    <input type="hidden" name="uid" value="{{$note->uid}}">
-                                    <p>Sign this note as HCP?</p>
-                                    <div class="mb-0">
-                                        <button class="btn btn-success btn-sm" submit>Sign</button>
-                                        <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            @if($note->hcp_pro_id !== $pro->id)
+                                <span class="text-sm text-secondary">Only the note's HCP can sign</span>
+                            @else
+                                @if(!$isVisitTemplateBased)
+                                    <div moe relative
+                                         class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
+                                         title="{{ $note->hcp_pro_id !== $pro->id ? 'Only the note\'s HCP can sign' : '' }}">
+                                        <a class="" href="" show start>Sign Note As HCP</a>
+                                        <form url="/api/note/signAsHcp" right>
+                                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                                            <p>Sign this note as HCP?</p>
+                                            <div class="mb-0">
+                                                <button class="btn btn-success btn-sm" submit>Sign</button>
+                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                            </div>
+                                        </form>
                                     </div>
-                                </form>
-                            </div>
-                            @if($note->hcp_pro_id === $pro->id)
-                                <a native target="_blank"
-                                   open-in-stag-popup
-                                   update-parent
-                                   mc-initer="note-sign-confirmation-{{$note->id}}"
-                                   popup-style="stag-popup-md"
-                                   title="Confirm and Sign"
-                                   class="ml-2 text-info font-weight-bold"
-                                   href="{{route('patients.view.notes.view.sign-confirmation', compact('patient', 'note'))}}">
-                                    Sign Note As HCP
-                                </a>
+                                @else
+                                    <a native target="_blank"
+                                       open-in-stag-popup
+                                       update-parent
+                                       mc-initer="note-sign-confirmation-{{$note->id}}"
+                                       popup-style="stag-popup-md"
+                                       title="Confirm and Sign"
+                                       href="{{route('patients.view.notes.view.sign-confirmation', compact('patient', 'note'))}}">
+                                        Sign Note As HCP
+                                    </a>
+                                @endif
                             @endif
                         @endif
                     </div>
@@ -620,7 +628,7 @@
                   @if($isVisitTemplateBased && $doesVisitTemplateUiConfigExist)
 
                   @else
-                  <div class="p-2 border-bottom screen-only" data-non-segment-section="Prescriptions">
+                  <div class="p-2 border-bottom screen-only mt-3" data-non-segment-section="Prescriptions">
                     @include('app.patient.prescriptions.list', compact('patient', 'note'))
                   </div>
                   @endif
@@ -2377,10 +2385,30 @@
                                  mc-initer="incoming-reports"
                                  title="Incoming Reports"
                                  popup-style="wide overflow-visible"
-                                 href="/patients/view/{{$patient->uid}}/incoming-reports">
+                                 href="/patients/view/{{$patient->uid}}/incoming-reports?noteUid={{$note->uid}}">
                                 <span>Inc. Reports</span>
                             </div>
                         </div>
+                        <div class="nbt-container border-right border-info d-inline-flex align-self-stretch">
+                            <div native target="_blank"
+                                 class="c-pointer d-inline-flex align-items-center documents-trigger px-2 py-1"
+                                 open-in-stag-popup
+                                 title="Documents"
+                                 popup-style="wide overflow-visible"
+                                 href="/patients/view/{{$patient->uid}}/documents">
+                                <span>Documents</span>
+                            </div>
+                        </div>
+                        <div class="nbt-container border-right border-info d-inline-flex align-self-stretch">
+                            <div native target="_blank"
+                                 class="c-pointer d-inline-flex align-items-center handouts-trigger px-2 py-1"
+                                 open-in-stag-popup
+                                 title="Handouts"
+                                 popup-style="wide overflow-visible"
+                                 href="/patients/view/{{$patient->uid}}/handouts?noteUid={{$note->uid}}">
+                                <span>Handouts</span>
+                            </div>
+                        </div>
                         <div class="ml-auto mr-5 nbt-container border-info 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">
@@ -2392,9 +2420,11 @@
                     @endif
 
                 </div>
-                <div class="note-rhs-sidebar border-left" id="note-rhs-sidebar">
-                    @include('app.patient.note.rhs-sidebar')
-                </div>
+                @if($isVisitTemplateBased && !$note->is_signed_by_hcp)
+                    <div class="note-rhs-sidebar border-left" id="note-rhs-sidebar">
+                        @include('app.patient.note.rhs-sidebar')
+                    </div>
+                @endif
             </div>
         </div>
     </div>

+ 5 - 3
resources/views/app/patient/note/dashboard_script.blade.php

@@ -388,9 +388,11 @@
                     .on('keydown.collapse-active-segment', function(e) {
                         if(e.which === 27) {
                             if(!isEventConsumed(e)) {
-                                $('.visit-segment.edit').first().find('.edit-trigger').first().click();
-                                markEventAsConsumed(e);
-                                return false;
+                                if($('.visit-segment.edit').length) {
+                                    $('.visit-segment.edit').first().find('.edit-trigger').first().click();
+                                    markEventAsConsumed(e);
+                                    return false;
+                                }
                             }
                             else {
                                 // event already consumed!

+ 1 - 1
resources/views/app/patient/note/hpi-log.blade.php

@@ -5,7 +5,7 @@
             <?php $numReviews++; ?>
             <div class="border mb-3">
                 <div class="border-bottom p-2">
-                    <span class="text-secondary text-sm">Reviewed on </span>
+                    <span class="text-secondary text-sm">Updated on </span>
                     @if($record->client->core_note_id !== $record->note->id)
                         <a native target="_blank" class="text-sm"
                            href="<?= route('patients.view.notes.view.dashboard', ['patient' => $record->client, 'note' => $record->note]) ?>">

+ 2 - 2
resources/views/app/patient/note/last-hpi.blade.php

@@ -10,10 +10,10 @@
     </div>
 
     <?php if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id): ?>
-    <span class="text-sm">(reviewed on the patient's chart)</span>
+    <span class="text-sm">(updated on the patient's chart)</span>
     <?php else: ?>
     <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
-    <span class="text-sm">(reviewed on this note)</span>
+    <span class="text-sm">(updated on this note)</span>
     <?php else: ?>
     <a native target="_blank"
        href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>">

+ 37 - 0
resources/views/app/patient/note/note-segment-list.blade.php

@@ -1,8 +1,45 @@
 <div class="segments-list" id="note-segments-list">
+
+    <?php
+    $previousHeading = null;
+    $previousSubHeading = null;
+    ?>
     @foreach($note->segments as $segment)
+        <?php
+//        if ($segment->subheading !== $previousSubHeading) {
+//            if (!empty($previousSubHeading)) {
+//                echo '</div></div>'; // <!-- end the previous parent section -->
+//            }
+//            if (!empty($segment->subheading)) {
+//                echo '<div class="note-content-node note-content-heading">' .
+//                    '<a class="c-pointer">' . $segment->subheading . '</a>' .
+//                    '<div class="note-content-children">'; // <!-- open new node -->
+//            }
+//            $previousSubHeading = $segment->subheading;
+//        }
+        if ($segment->heading !== $previousHeading) {
+            if (!empty($previousHeading)) {
+                echo '</div></div>'; // <!-- end the previous parent section -->
+            }
+            if (!empty($segment->heading)) {
+                echo '<div class="note-content-node note-content-heading">' .
+                    '<div class="py-2 px-3 border-bottom font-size-14 font-weight-bold text-secondary bg-light ' . ($previousHeading ? 'mt-4 border-top' : '') . '">' . $segment->heading . '</div>' .
+                    '<div class="note-content-children ml-4 border-left">'; // <!-- open new node -->
+            }
+            $previousHeading = $segment->heading;
+        }
+        ?>
         <div class="{{$segment->segmentTemplate->internal_name === 'medrisk_vigilence' ? 'd-none' : ''}}">
             @include('app.patient.note.segment')
         </div>
     @endforeach
+    <?php
+//    if (!empty($previousSubHeading)) {
+//        echo '</div></div>'; // <!-- close any open parent section -->
+//    }
+    if (!empty($previousHeading)) {
+        echo '</div></div>'; // <!-- close any open parent section -->
+    }
+    ?>
 </div>
 @include('app.patient.note.segment_script')

+ 2 - 2
resources/views/app/patient/note/review-log.blade.php

@@ -5,7 +5,7 @@
             <?php $numReviews++; ?>
             <div class="border mb-3">
                 <div class="border-bottom p-2">
-                    <span class="text-secondary text-sm">Reviewed on </span>
+                    <span class="text-secondary text-sm">Updated on </span>
                     @if($record->client->core_note_id !== $record->note->id)
                         <a native target="_blank" class="text-sm"
                            href="<?= route('patients.view.notes.view.dashboard', ['patient' => $record->client, 'note' => $record->note]) ?>">
@@ -18,7 +18,7 @@
                 <div class="p-2">
                     <?php
                         $review = json_decode($record->data);
-                        echo $review->value;
+                        echo @($review->value) ? $review->value : '-';
                     ?>
                 </div>
             </div>

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

@@ -170,9 +170,24 @@
         {!! $segment->summary_html !!}
     </div>
 
+    <?php
+    $wizardPowered = [
+        'intake_medications',
+        'plan_medications',
+        'intake_problems',
+        'plan_problems',
+        'intake_goals',
+        'plan_goals',
+        'intake_allergies',
+        'plan_allergies',
+        'intake_care_team',
+        'plan_care_team'
+    ];
+    if(!in_array($iName, $wizardPowered)) { ?>
     <div class="d-none if-edit edit-container">
         {!! $segment->edit_html !!}
     </div>
+    <?php } ?>
 
     <?php endif ?>
 

+ 1 - 1
resources/views/app/patient/note/sign-confirmation.blade.php

@@ -36,7 +36,7 @@
         <div class="mb-2 d-flex align-items-baseline">
         <span class="width-150px">Visit Method:</span>
         @if(!!$note->method)
-            <b class="mr-3 text-capitalize width-70px">{{strtolower(str_replace("_", " ", $note->method))}}</b>
+            <b class="mr-3 text-capitalize width-70px">{{noteMethodDisplay($note->method)}}</b>
         @else
             <span class="mr-3 text-danger width-70px">(not set)</span>
         @endif

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

@@ -188,7 +188,7 @@
                 </td>
                 @if($pro->pro_type == 'ADMIN')
                     <td class="px-2">
-                        {{ $note->method }}
+                        {{ noteMethodDisplay($note->method) }}
                     </td>
                 @endif
                 <td class="px-2">

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

@@ -1,5 +1,5 @@
 <div class="mt-0 pb-1">
-    <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
+    <div class="d-flex align-items-center mb-2 pt-2">
         <h6 class="my-0 font-weight-bold text-secondary">Appointments</h6>
         <span class="mx-2 text-secondary">|</span>
         <a href="/patients/view/{{$patient->uid}}/calendar">Calendar</a>

+ 3 - 1
resources/views/app/patient/partials/latest-vitals.blade.php

@@ -24,8 +24,9 @@ if (!!@$point->data) {
 }
 ?>
 
+<div class="row">
 @foreach ($vitalLabels as $k => $v)
-<div class="d-flex vital-item align-items-center">
+<div class="col-5 vital-item align-items-center mr-3">
     @if($contentData && @$contentData['date'])
         <span class="content-html text-nowrap">
             <?php $vital = @$contentData[$k]; ?>
@@ -59,4 +60,5 @@ if (!!@$point->data) {
     @endif
 </div>
 @endforeach
+</div>
 

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

@@ -2,6 +2,7 @@
     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
         <h6 class="my-0 font-weight-bold text-secondary">Measurements</h6>
 
+        {{--
         <span class="mx-2 text-secondary">|</span>
         <div moe>
             <a start show class="py-0 font-weight-normal">Add BP</a>
@@ -44,6 +45,7 @@
                 </div>
             </form>
         </div>
+        --}}
 
         <span class="mx-2 text-secondary">|</span>
         <a start show class="py-0 font-weight-normal"
@@ -67,6 +69,28 @@
                 <tr>
                     <td class="text-black p-0 border-0">
                         <div class="d-flex align-items-center">
+                            @if($measurement->has_been_stamped_by_mcp)
+                                <i class="fa fa-check text-success mr-2" title="Stamped"></i>
+                            @else
+                                <div moe relative>
+                                    <a href="#" start show>
+                                        <i class="fa fa-check text-secondary on-hover-opaque mr-2" title="Not Stamped. Click to stamp."></i>
+                                    </a>
+                                    <form url="/api/measurement/stamp" class="width-300px">
+                                        <input type="hidden" name="uid" value="{{$measurement->uid}}">
+                                        <p class="mb-1">Stamp this measurement?</p>
+                                        <div class="mb-2">
+                                            <label class="mb-1 text-secondary text-sm">Memo</label>
+                                            <textarea class="form-control form-control-sm" name="memo"></textarea>
+                                        </div>
+                                        <div class="form-group m-0">
+                                            <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                            <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                        </div>
+                                    </form>
+                                </div>
+                            @endif
+                            {{--
                             <div moe relative class="mr-2">
                                 <a class="on-hover-opaque" start show title="Delete">
                                     <i class="font-size-11 fa fa-trash-alt text-danger"></i>
@@ -101,12 +125,13 @@
                                     </div>
                                 </form>
                             </div>
-                            <span>
+                            --}}
+                            <span class="text-secondary">
                                 {{ $measurement->label == 'Wt. (lbs.)' ? 'WT' : $measurement->label}}:
                             </span>
-                            <span class="font-weight-bold ml-1">
+                            <span class="font-weight-normal ml-1">
                                 @if($measurement->label == 'BP')
-                                    {{ $measurement->sbp_mm_hg }}/{{ $measurement->dbp_mm_hg }} mm Hg <span class="font-weight-normal d-inline-block pl-2">Pulse:</span> {{ $measurement->value_pulse }} {{ $measurement->value_irregular === 0?'Irregular':'' }} {{ $measurement->value_irregular === 1?'Regular':'' }}
+                                    {{ $measurement->sbp_mm_hg }} / {{ $measurement->dbp_mm_hg }} <span class="font-weight-normal d-inline-block text-secondary pl-2">Pulse:</span> {{ $measurement->value_pulse }} {{ $measurement->value_irregular === 0?'Irregular':'' }} {{ $measurement->value_irregular === 1?'Regular':'' }}
                                 @elseif($measurement->label == 'Wt. (lbs.)')
                                     {{round($measurement->numeric_value, 1)}} lbs.
                                 @elseif($measurement->numeric_value)

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

@@ -1,7 +1,7 @@
 <?php
 $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
 ?>
-<div class="pt-2 mt-2">
+<div class="pt-2">
     <div class="d-flex align-items-center pb-2">
         <h6 class="my-0 font-weight-bold text-secondary">Current Problems / Focus Areas</h6>
         @if($isOldClient)

+ 1 - 1
resources/views/app/patient/prescriptions/list.blade.php

@@ -1286,7 +1286,7 @@ GROUP BY erx_category");
                         if(this.addDrugToErxMode === 'new') {
                             Vue.nextTick(() => {
 
-                                let parentSegment = $('#prescriptions-popup-{{$patient->id}}');
+                                let parentSegment = $('#prescriptions-{{$patient->id}}');
 
                                 parentSegment.find('[stag-suggest-initialized]').removeAttr('stag-suggest-initialized');
                                 initStagSuggest();

+ 22 - 6
resources/views/app/patient/prescriptions/pdf/IMAGING.blade.php

@@ -162,11 +162,19 @@
 
     <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
         <tr>
-            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
-            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
-            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
-            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
-                {{@$clinical->icds ? implode(", ", @$clinical->icds) : '-'}}
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75; vertical-align: top">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; vertical-align: top font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75; vertical-align: top">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold; vertical-align: top">
+                @if(@($clinical->items) && count($clinical->items))
+                    @foreach($clinical->items as $item)
+                        @if(@($item->icds) && count($item->icds))
+                            {!! implode("<br>", array_map(function($_x) { return $_x->code; }, $item->icds)) !!}<br>
+                        @endif
+                    @endforeach
+                @else
+                    -
+                @endif
             </td>
         </tr>
         <tr>
@@ -190,7 +198,15 @@
     <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
         <tr>
             <td style="vertical-align: top">
-                {!! @$clinical->tests ? implode("<br>", @$clinical->tests) : '-' !!}
+                @if(@($clinical->items) && count($clinical->items))
+                    @foreach($clinical->items as $item)
+                        @if(@($item->tests) && count($item->tests))
+                            {!! implode("<br>", array_map(function($_x) { return $_x->desc; }, $item->tests)) !!}<br>
+                        @endif
+                    @endforeach
+                @else
+                    -
+                @endif
             </td>
         </tr>
     </table>

+ 22 - 6
resources/views/app/patient/prescriptions/pdf/LAB.blade.php

@@ -162,11 +162,19 @@
 
     <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
         <tr>
-            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
-            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
-            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
-            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
-                {{@$clinical->icds ? implode(", ", @$clinical->icds) : '-'}}
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75; vertical-align: top">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; vertical-align: top font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75; vertical-align: top">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold; vertical-align: top">
+                @if(@($clinical->items) && count($clinical->items))
+                    @foreach($clinical->items as $item)
+                        @if(@($item->icds) && count($item->icds))
+                            {!! implode("<br>", array_map(function($_x) { return $_x->code; }, $item->icds)) !!}<br>
+                        @endif
+                    @endforeach
+                @else
+                    -
+                @endif
             </td>
         </tr>
         <tr>
@@ -190,7 +198,15 @@
     <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
         <tr>
             <td style="vertical-align: top">
-                {!! @$clinical->tests ? implode("<br>", @$clinical->tests) : '-' !!}
+                @if(@($clinical->items) && count($clinical->items))
+                    @foreach($clinical->items as $item)
+                        @if(@($item->tests) && count($item->tests))
+                            {!! implode("<br>", array_map(function($_x) { return $_x->desc; }, $item->tests)) !!}<br>
+                        @endif
+                    @endforeach
+                @else
+                    -
+                @endif
             </td>
         </tr>
     </table>

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

@@ -69,12 +69,25 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                 </td>
                 <td>
                     <div class="d-flex align-items-start">
-                        {{--<div class="flex-grow-1">
+                        <div class="flex-grow-1">
                             <?php
                             $point = $problem;
                             include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
                             ?>
-                        </div>--}}
+                        </div>
+                        <div class="d-inline-flex flex-nowrap">
+                            <a class="pl-2 view-review-log"
+                               native target="_blank"
+                               open-in-stag-popup
+                               popup-style="stag-popup-md"
+                               title="Review log<?= !!@($problem->data->name) ? ' for ' . @($problem->data->name) : '' ?>"
+                               href="/point/review-log/<?= $problem->uid ?>?popupmode=1">
+                                <i class="fa fa-history"></i>
+                            </a>
+                        </div>
+                    </div>
+                    {{--
+                    <div class="d-flex align-items-start">
                         <div class="flex-grow-1">
                             @include('app.patient.note.last-hpi')
                         </div>
@@ -103,6 +116,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                             </div>
                         </div>
                     </div>
+                    --}}
                 </td>
                 <td>
                     <div class="d-flex align-items-start">
@@ -111,7 +125,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                             include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
                             ?>
                         </div>
-                        <div class="">
+                        <div class="d-inline-flex flex-nowrap">
                             <a class="pl-2 view-review-log"
                                native target="_blank"
                                open-in-stag-popup
@@ -120,14 +134,6 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                                href="/point/plan-log/<?= $problem->uid ?>?popupmode=1">
                                 <i class="fa fa-history"></i>
                             </a>
-                            <div class="pl-2">
-                            <?php
-                            $segment = $note->getSegmentByInternalName('plan_problems');
-                            if($segment && $patient->core_note_id !== $note->id) {
-                                include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
-                            }
-                            ?>
-                            </div>
                         </div>
                     </div>
                 </td>
@@ -200,7 +206,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed', 'noReview' => true, 'noPlan' => true])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
 
                             <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                 <button type="submit" class="btn-save-problem btn btn-sm btn-primary mr-2">Save</button>
@@ -251,7 +257,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed', 'noReview' => true, 'noPlan' => true])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
 
                         </div>
                         <div class="col-4 border-left">
@@ -311,7 +317,7 @@ $ccSegment = $ccSegment ?? $note->getSegmentByInternalName('mc_cc');
                         icdSelect.empty().append('<option value="">-- select --</option>');
                         for (let i = 0; i < _data.length; i++) {
                             if(_data[i].icd_cd_type !== '01') {
-                                icdSelect.next('.data-option-list').append($('<div/>').text(_data[i].search_icd_cd));
+                                icdSelect.next('.data-option-list').append($('<div/>').text(_data[i].search_icd_cd).attr('desc', _data[i].icd_desc));
                             }
                         }
                         icdSelect.prop('disabled', false);

+ 9 - 2
resources/views/app/patient/pros.blade.php

@@ -17,8 +17,15 @@
                 @php $prevPro = ''; @endphp
                 @foreach($prosWithAccess as $aPro)
                     <tr>
-                        <td class="px-2 {{ $aPro['pro'] !== $prevPro ? 'font-weight-bold' : 'text-secondary' }}">{{ $aPro['pro'] }}</td>
-                        <td class="px-2">{{ $aPro['association'] }}</td>
+                        @if($pro->pro_type === 'ADMIN')
+                            <td class="px-2 {{ $aPro['pro'] !== $prevPro ? 'font-weight-bold' : 'text-secondary' }}">{{ $aPro['pro'] }}</td>
+                            <td class="px-2">{{ $aPro['association'] }}</td>
+                        @else
+                            @if($aPro['pro'] !== $prevPro)
+                                <td class="px-2 {{ $aPro['pro'] !== $prevPro ? 'font-weight-bold' : 'text-secondary' }}">{{ $aPro['pro'] }}</td>
+                                <td class="px-2">{{ $aPro['association'] }}</td>
+                            @endif
+                        @endif
                         @php $prevPro = $aPro['pro']; @endphp
                     </tr>
                 @endforeach

+ 0 - 142
resources/views/app/patient/sections.blade.php

@@ -1,142 +0,0 @@
-<?php
-/** @var App\Models\Note $note */
-/** @var App\Models\Pro $pro */
-/** @var App\Models\Section $section */
-/** @var $allSections */
-?>
-@extends ('layouts.patient')
-
-@section('inner-content')
-    <div class="card mb-0">
-        <div class="card-body p-0">
-            <div>
-                <div class="">
-                    <div>
-                        <?php
-                        $shortCutsObject = [];
-                        foreach ($pro->allShortcuts() as $shortcut) {
-
-                            // %replaceables%
-                            $shortcut->text = str_replace("%AGE%", $patient->age_in_years, $shortcut->text);
-                            $shortcut->text = str_replace("%GENDER%", $patient->sex, $shortcut->text);
-                            $shortcut->text = str_replace("%NAME%", $patient->displayName(), $shortcut->text);
-
-                            $shortCutsObject[] = [
-                                "name" => $shortcut->shortcut,
-                                "value" => $shortcut->text
-                            ];
-                        }
-                        ?>
-                        <script>window.userShortcuts = <?= json_encode($shortCutsObject); ?>;</script>
-                        <?php
-                        $shortcuts = "";
-                        $latestSectionTS = 0;
-                        ?>
-                        @include('app.patient.sections.client-section-list')
-                    </div>
-                </div>
-
-                <span class="d-none latest-section-ts">{{ $latestSectionTS }}</span>
-            </div>
-        </div>
-    </div>
-    <div class="note-templates-underlay"></div>
-    @include('app.patient.note.dashboard_script')
-@endsection
-
-@section('left-nav-content')
-    <div class="left-nav-content" id="client-sections-app">
-        <div class="note-widget-title px-2 py-1">Note Sections</div>
-        <input type="search" class="d-block w-100 border-0 outline-0 px-2 py-1"
-               v-model="q" placeholder="Filter">
-        <div class="border-top py-1">
-            <div v-for="section in sections"
-                 v-show="section.title.toLowerCase().indexOf(q.toLowerCase()) !== -1">
-                <div class="d-flex pr-1 align-items-center note-widget-item c-pointer"
-                     :title="section.title + ' - Click to remove'"
-                     v-if="section.used"
-                     v-on:click.once="remove(section.section_uid)">
-                    <span class="mx-2">
-                        <a class="font-12 text-secondary" href="#">
-                            <i class="fa fa-minus-circle"></i>
-                        </a>
-                    </span>
-                    <span class="font-smaller text-ellipsis">
-                        @{{section.title}}
-                    </span>
-                </div>
-                <div class="d-flex pr-1 align-items-center note-widget-item c-pointer"
-                     :title="section.title + ' - Click to add'"
-                     v-if="!section.used"
-                     v-on:click.once="add(section.uid, section.internal_name)">
-                    <span class="mx-2">
-                        <a class="font-12" href="#">
-                            <i class="fa fa-plus-circle"></i>
-                        </a>
-                    </span>
-                    <span class="font-smaller text-ellipsis">
-                        @{{section.title}}
-                    </span>
-                </div>
-            </div>
-        </div>
-    </div>
-    <script>
-        (function() {
-            function initSectionsWidget() {
-                var allSections = <?= json_encode($allSections) ?>;
-                new Vue({
-                    el: '#client-sections-app',
-                    delimiters: ['@{{', '}}'],
-                    data: {
-                        q: '',
-                        sections: allSections
-                    },
-                    methods: {
-                        add: function(_uid, _section) {
-                                $.post('/api/section/createForClient', {
-                                    clientUid: '{{$patient->uid}}',
-                                    sectionTemplateUid: _uid,
-                                }, function(_data) {
-                                    if(_data) {
-                                        if(_data.success) {
-                                            fastReload();
-                                        }
-                                        else {
-                                            toastr.error(_data.message);
-                                        }
-                                    }
-                                    else {
-                                        toastr.error('Unable to add section!');
-                                    }
-                                }, 'json');
-                        },
-                        remove: function(_uid) {
-                            $.post('/api/section/deactivate', {
-                                uid: _uid,
-                                memo: 'Deactivated from note',
-                            }, function(_data) {
-                                if(_data) {
-                                    if(_data.success) {
-                                        fastReload();
-                                    }
-                                    else {
-                                        toastr.error(_data.message);
-                                    }
-                                }
-                                else {
-                                    toastr.error('Unable to remove section!');
-                                }
-                            }, 'json');
-                        }
-                    }
-                });
-
-                $('div[embed]').each(function() {
-                    $(this).load($(this).attr('embed'));
-                });
-            }
-            addMCInitializer('client-sections-widget', initSectionsWidget, '#client-sections-app');
-        })();
-    </script>
-@endsection

+ 2 - 2
resources/views/app/patient/segment-templates/_child_plan/last-plan.php

@@ -5,10 +5,10 @@
         <div class="text-secondary text-sm"></div>
 
         <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>
-            <span class="text-sm">(added on the patient's chart)</span>
+            <span class="text-sm">(updated on the patient's chart)</span>
         <?php else: ?>
             <?php if ($point->last_child_plan_point_scoped_note_id === $note->id): ?>
-                <span class="text-sm">(added on this note)</span>
+                <span class="text-sm">(updated on this note)</span>
             <?php else: ?>
                 <a native target="_blank"
                    href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildPlanNote]) ?>">

+ 2 - 2
resources/views/app/patient/segment-templates/_child_review/last-review.php

@@ -4,10 +4,10 @@
         <div><?= @$parsedReview->value ?></div>
 
         <?php if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id): ?>
-            <span class="text-sm">(reviewed on the patient's chart)</span>
+            <span class="text-sm">(updated on the patient's chart)</span>
         <?php else: ?>
             <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
-                <span class="text-sm">(reviewed on this note)</span>
+                <span class="text-sm">(updated on this note)</span>
             <?php else: ?>
                 <a native target="_blank"
                    href="<?= route('patients.view.notes.view.dashboard', ['patient' => $patient, 'note' => $point->lastChildReviewNote]) ?>">

+ 1 - 1
resources/views/app/patient/segment-templates/history_family/edit.blade.php

@@ -279,7 +279,7 @@ if(!$contentData) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Close</button>
+                <button cancel class="btn btn-sm btn-default border" {!! @$closeOnSave ? 'onmousedown="return closeStagPopup()"' : '' !!}>Close</button>
             </div>
 
         </form>

+ 1 - 1
resources/views/app/patient/segment-templates/history_social/edit.blade.php

@@ -176,7 +176,7 @@ for ($i = 0; $i < count($fields); $i++) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                <button cancel class="btn btn-sm btn-default border" {!! @$closeOnSave ? 'onmousedown="return closeStagPopup()"' : '' !!}>Close</button>
             </div>
 
         </form>

+ 1 - 1
resources/views/app/patient/segment-templates/history_surgical/edit.blade.php

@@ -174,7 +174,7 @@ for ($i = 0; $i < count($fields); $i++) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                <button class="btn btn-sm btn-default border" {!! @$closeOnSave ? 'onmousedown="return closeStagPopup()"' : 'cancel' !!}>Close</button>
             </div>
 
         </form>

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

@@ -41,12 +41,7 @@ $numRelevant = 0;
             <?php if(!!$hpi): ?>
             <div class="pl-3 mt-1">
                 <div class="text-secondary font-weight-bold">HPI</div>
-                <?php
-                $point = $problem;
-                if(!@$template) $template = 'hpi/core.json';
-                $data = $hpi ? $hpi->data : null;
-                ?>
-                @include('app.dq-engine.read', compact('template', 'note', 'patient', 'point', 'data'))
+                <div>{!! $hpi->data && @($hpi->data->value) ? $hpi->data->value : '-' !!}</div>
             </div>
             <?php elseif($rel): ?>
             <div class="relevant-without-review block-signing text-danger mt-1 text-sm" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>"><i class="fa fa-exclamation-triangle mr-1"></i>Review missing</div>

+ 1 - 1
resources/views/app/patient/segment-templates/past_medical_history/edit.blade.php

@@ -216,7 +216,7 @@ for ($i = 0; $i < count($fields); $i++) {
 
             <div>
                 <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
-                <button cancel class="btn btn-sm btn-default border">Close</button>
+                <button cancel class="btn btn-sm btn-default border" {!! @$closeOnSave ? 'onmousedown="return closeStagPopup()"' : '' !!}>Close</button>
             </div>
 
         </form>

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

@@ -61,12 +61,7 @@ $numRelevantWithICD = 0;
             <?php if(!!$hpi): ?>
             <div class="pl-3 mt-1">
                 <div class="text-secondary font-weight-bold">HPI</div>
-                <?php
-                $point = $problem;
-                if(!@$template) $template = 'hpi/core.json';
-                $data = $hpi ? $hpi->data : null;
-                ?>
-                @include('app.dq-engine.read', compact('template', 'note', 'patient', 'point', 'data'))
+                <div>{!! $hpi->data && @($hpi->data->value) ? $hpi->data->value : '-' !!}</div>
             </div>
             <?php elseif($rel): ?>
             <div class="relevant-without-review block-signing text-danger text-sm mt-1" data-target-segment="<?= $segment->segmentTemplate->internal_name ?>">

+ 5 - 3
resources/views/app/patient/wizard-partials/common-fields.blade.php

@@ -131,7 +131,7 @@
                     if (@$point) {
                         if ($point->lastChildReview && $point->last_child_review_point_scoped_note_id === $note->id) {
                             $parsedReview = json_decode($point->lastChildReview->data);
-                            if (@$parsedReview->value) {
+                            if (@($parsedReview->value)) {
                                 $currentValue = $parsedReview->value;
                                 $previousChildReview = \App\Models\Point::where('id', '<', $point->lastChildReview->id)
                                     ->where('category', 'REVIEW')
@@ -140,7 +140,9 @@
                                     ->first();
                                 if ($previousChildReview && $previousChildReview->data) {
                                     $parsedReview = json_decode($previousChildReview->data);
-                                    $previousValue = $parsedReview->value;
+                                    if (@($parsedReview->value)) {
+                                        $previousValue = $parsedReview->value;
+                                    }
                                 }
                             }
                         } else {
@@ -181,7 +183,7 @@
                 if (@$point) {
                     if ($point->lastChildPlan && $point->last_child_plan_point_scoped_note_id === $note->id) {
                         $parsedPlan = json_decode($point->lastChildPlan->data);
-                        $currentValue = $parsedPlan->value;
+                        $currentValue = @($parsedPlan->value) ? $parsedPlan->value : '';
                         $previousChildPlan = \App\Models\Point::where('id', '<', $point->lastChildPlan->id)
                             ->where('category', 'PLAN')
                             ->where('parent_point_id', $point->id)

+ 1 - 1
resources/views/app/patient/wizard-partials/state-badge.blade.php

@@ -18,7 +18,7 @@
             <div class="text-sm text-secondary">(New Historic Record)</div>
         @endif
     @elseif($point->removed_in_note_id !== $note->id)
-        <div class="text-sm text-secondary">Historic Record Removed In A Previous Visit</div>
+        <div class="text-sm text-secondary">Historic Record Removed In Previous Visit</div>
     @endif
 @elseif($point->state === 'ENTRY_ERROR')
     @if($point->removed_in_note_id === $note->id)

+ 4 - 4
resources/views/app/practice-management/calendar.blade.php

@@ -70,7 +70,7 @@
             <div class="ml-auto d-inline-flex align-items-center">
                 <label class="mr-2 my-0 text-secondary">Show</label>
                 <select id="eventTypes"
-                        class="form-control form-control-sm w-180"
+                        class="form-control form-control-sm"
                         v-model="eventTypes"
                         v-on:change="refreshEvents()">
                     <option value="APPOINTMENTS">Active Appointments</option>
@@ -83,7 +83,7 @@
             <div class="ml-3 d-inline-flex align-items-center">
                 <label class="mr-2 my-0 text-secondary">Timezone</label>
                 <select id="eventTz" name="timeZone"
-                        class="form-control form-control-sm w-180"
+                        class="form-control form-control-sm min-width-unset"
                         v-model="timezone">
                     <option value="EASTERN" selected>Eastern</option>
                     <option value="CENTRAL">Central</option>
@@ -397,11 +397,11 @@
                         initSelect2: function () {
                             let self = this;
                             $('#eventTz')
-                                .select2({
+                                /*.select2({
                                     templateResult: function(_state) {
                                         return $('<span class="mcp-theme-1"><span>' + _state.text + '</span></span>');
                                     }
-                                })
+                                })*/
                                 .on('change', function() {
                                     self.timezone = $(this).val();
                                     @if($pro->pro_type == 'ADMIN')

+ 216 - 91
resources/views/app/practice-management/my-text-shortcuts.blade.php

@@ -2,7 +2,7 @@
 
 @section('content')
 
-    <div class="p-3 mcp-theme-1">
+<div class="p-3 mcp-theme-1">
     <div class="card">
 
         <div class="card-header px-3 py-2 d-flex align-items-center">
@@ -10,102 +10,227 @@
                 <i class="fas fa-user"></i>
                 Text Shortcuts
             </strong>
-            <span class="mx-2 text-secondary">|</span>
-            <div moe wide class="mr-2">
-                <a start show>
-                    Add
-                </a>
-                <form url="/api/proTextShortcut/create">
-                    @if($performer->pro->pro_type !== 'ADMIN')
-                        <input type="hidden" name="proUid" value="{{$pro->uid}}">
-                    @else
-                        <p><b>Add Global Shortcut</b></p>
-                    @endif
-                    <div class="mb-2">
-                        <input type="text" class="form-control form-control-sm" name="shortcut"
-                               placeholder="Shortcut *">
-                    </div>
-                    <div class="mb-2">
-                        <textarea type="text"
-                                  rows="10" class="form-control form-control-sm" name="text"
-                                  placeholder="Content *"></textarea>
-                    </div>
-                    <div class="form-group m-0">
-                        <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
-                        <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
-                    </div>
-                </form>
-            </div>
         </div>
-        <div class="card-body p-0">
-            <table class="table table-condensed table-hover p-0 m-0">
-                <thead class="bg-light">
-                <tr>
-                    <th class="px-3 border-0">Pro</th>
-                    <th class="border-0 width-200px">Shortcut</th>
-                    <th class="border-0">Text</th>
-                    <th class="border-0 width-200px">&nbsp;</th>
-                </tr>
-                </thead>
-                <tbody>
-                @foreach($myTextShortcuts as $textShortcut)
-                    <tr>
-                        <td class="px-3 text-nowrap">
-                            @if($textShortcut->name_first || $textShortcut->name_last)
-                                {{ $textShortcut->name_first ? $textShortcut->name_first : '' }}
-                                {{ $textShortcut->name_last ? $textShortcut->name_last : '' }}
-                            @else
-                                <span class="text-secondary">(global)</span>
-                            @endif
-                        </td>
-                        <td>{{ $textShortcut->shortcut }}</td>
-                        <td><pre class="max-width-700px my-0" style="white-space: break-spaces;">{{ $textShortcut->text }}</pre></td>
-                        <td>
-                            <div class="d-flex align-items-center">
-                                <div moe large relative class="mr-3">
-                                    <a start show>
-                                        <i class="fa fa-pencil-alt"></i>
-                                    </a>
-                                    <form url="/api/proTextShortcut/update" right>
-                                        <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
-                                        <div class="mb-2">
-                                            <input type="text" class="form-control form-control-sm" name="shortcut"
-                                                   value="{{$textShortcut->shortcut}}"
-                                                   placeholder="Shortcut *">
-                                        </div>
-                                        <div class="mb-2">
-                                            <textarea type="text" rows="10" class="form-control form-control-sm" name="text"
-                                                      placeholder="Content *">{{$textShortcut->text}}</textarea>
+        <div class="card-body p-3">
+
+            <div class="d-flex align-items-baseline" tab-links="">
+                <a class="tab-link-active" href="#" tab-link="personal">Personal Text Shortcuts</a>
+                <a class="" href="#" tab-link="global">Global Text Shortcuts</a>
+            </div>
+
+            <!-- personal shortcuts -->
+            <div tab-key="personal" class="cm-tab">
+                <div class="d-flex align-items-baseline">
+                    <div class="py-3 font-weight-bold font-size-14">Personal Text Shortcuts</div>
+                    <span class="mx-2 text-secondary">|</span>
+                    <div moe wide class="mr-2">
+                        <a start show>Add</a>
+                        <form url="/api/proTextShortcut/create">
+                            <input type="hidden" name="proUid" value="{{$pro->uid}}">
+                            <p><b>Add Personal Shortcut</b></p>
+                            <div class="mb-2">
+                                Pro: <b>{{$pro->displayName()}}</b>
+                            </div>
+                            <div class="mb-2">
+                                <input type="text" class="form-control form-control-sm" name="shortcut" placeholder="Shortcut *" required>
+                            </div>
+                            <div class="mb-2">
+                                <textarea type="text" rows="10" class="form-control form-control-sm" name="text" placeholder="Content *" required></textarea>
+                            </div>
+                            <div class="form-group m-0">
+                                <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+                @if($personalShortcuts && count($personalShortcuts))
+                    <table class="table table-condensed table-hover table-bordered p-0 m-0">
+                        <thead class="bg-light">
+                        <tr>
+                            <th class="px-3 border-0 width-200px">Pro</th>
+                            <th class="border-0 width-200px">Shortcut</th>
+                            <th class="border-0">Text</th>
+                            <th class="border-0 width-200px">&nbsp;</th>
+                        </tr>
+                        <tr>
+                            <th class="p-0 border-top border-bottom-0">
+                                @if($performer->pro->pro_type === 'ADMIN')
+                                    <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0" stag-table-filter placeholder="Filter">
+                                @endif
+                            </th>
+                            <th class="p-0 border-top border-bottom-0 width-200px">
+                                <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0" stag-table-filter placeholder="Filter">
+                            </th>
+                            <th class="p-0 border-top border-bottom-0">
+                                <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0" stag-table-filter placeholder="Filter">
+                            </th>
+                            <th class="p-0 border-top border-bottom-0 width-200px"></th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @foreach($personalShortcuts as $textShortcut)
+                            <tr>
+                                <td class="px-3 text-nowrap">
+                                    @if($textShortcut->name_first || $textShortcut->name_last)
+                                        {{ $textShortcut->name_first ? $textShortcut->name_first : '' }}
+                                        {{ $textShortcut->name_last ? $textShortcut->name_last : '' }}
+                                    @endif
+                                </td>
+                                <td>{{ $textShortcut->shortcut }}</td>
+                                <td><pre class="max-width-700px my-0" style="white-space: break-spaces;">{{ $textShortcut->text }}</pre></td>
+                                <td>
+                                    <div class="d-flex align-items-center">
+                                        <div moe large relative class="mr-3">
+                                            <a start show>
+                                                <i class="fa fa-pencil-alt"></i>
+                                            </a>
+                                            <form url="/api/proTextShortcut/update" right>
+                                                <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
+                                                <div class="mb-2">
+                                                    <input type="text" class="form-control form-control-sm" name="shortcut"
+                                                           value="{{$textShortcut->shortcut}}"
+                                                           placeholder="Shortcut *">
+                                                </div>
+                                                <div class="mb-2">
+                                                <textarea type="text" rows="10" class="form-control form-control-sm" name="text"
+                                                          placeholder="Content *">{{$textShortcut->text}}</textarea>
+                                                </div>
+                                                <div class="form-group m-0">
+                                                    <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                                    <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                                </div>
+                                            </form>
                                         </div>
-                                        <div class="form-group m-0">
-                                            <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
-                                            <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                        <div moe relative wide class="mr-2">
+                                            <a start show class="text-danger">
+                                                <i class="fa fa-trash-alt"></i>
+                                            </a>
+                                            <form url="/api/proTextShortcut/remove" right>
+                                                <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
+                                                <p>
+                                                    Are you sure you want to remove this shortcut?
+                                                </p>
+                                                <div class="form-group m-0">
+                                                    <button submit class="btn btn-danger btn-sm mr-2">Yes</button>
+                                                    <button cancel class="btn btn-default border btn-sm mr-2">No</button>
+                                                </div>
+                                            </form>
                                         </div>
-                                    </form>
+                                    </div>
+                                </td>
+                            </tr>
+                        @endforeach
+                        </tbody>
+                    </table>
+                @else
+                    <div class="px-3 py-3 text-secondary">No personal shortcuts</div>
+                @endif
+            </div>
+
+            <!-- global shortcuts -->
+            <div tab-key="global" class="cm-tab d-none">
+                <div class="d-flex align-items-baseline">
+                    <div class="py-3 font-weight-bold font-size-14">Global Text Shortcuts</div>
+                    @if($performer->pro->pro_type === 'ADMIN')
+                        <span class="mx-2 text-secondary">|</span>
+                        <div moe wide class="mr-2">
+                            <a start show>Add</a>
+                            <form url="/api/proTextShortcut/create">
+                                <p><b>Add Global Shortcut</b></p>
+                                <div class="mb-2">
+                                    <input type="text" class="form-control form-control-sm" name="shortcut" placeholder="Shortcut *" required>
                                 </div>
-                                <div moe relative wide class="mr-2">
-                                    <a start show class="text-danger">
-                                        <i class="fa fa-trash-alt"></i>
-                                    </a>
-                                    <form url="/api/proTextShortcut/remove" right>
-                                        <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
-                                        <p>
-                                            Are you sure you want to remove this shortcut?
-                                        </p>
-                                        <div class="form-group m-0">
-                                            <button submit class="btn btn-danger btn-sm mr-2">Yes</button>
-                                            <button cancel class="btn btn-default border btn-sm mr-2">No</button>
-                                        </div>
-                                    </form>
+                                <div class="mb-2">
+                                    <textarea type="text" rows="10" class="form-control form-control-sm" name="text" placeholder="Content *" required></textarea>
                                 </div>
-                            </div>
-                        </td>
-                    </tr>
-                @endforeach
-                </tbody>
-            </table>
+                                <div class="form-group m-0">
+                                    <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                    <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    @endif
+                </div>
+                @if($globalTextShortcuts && count($globalTextShortcuts))
+                    <table class="table table-condensed table-hover table-bordered p-0 m-0">
+                        <thead class="bg-light">
+                        <tr>
+                            <th class="border-0 width-200px">Shortcut</th>
+                            <th class="border-0">Text</th>
+                            @if($performer->pro->pro_type === 'ADMIN')
+                                <th class="border-0 width-200px">&nbsp;</th>
+                            @endif
+                        </tr>
+                        <tr>
+                            <th class="p-0 border-top border-bottom-0 width-200px">
+                                <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0" stag-table-filter placeholder="Filter">
+                            </th>
+                            <th class="p-0 border-top border-bottom-0">
+                                <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0" stag-table-filter placeholder="Filter">
+                            </th>
+                            @if($performer->pro->pro_type === 'ADMIN')
+                                <th class="p-0 border-top border-bottom-0 width-200px"></th>
+                            @endif
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @foreach($globalTextShortcuts as $textShortcut)
+                            <tr>
+                                <td>{{ $textShortcut->shortcut }}</td>
+                                <td><pre class="max-width-700px my-0" style="white-space: break-spaces;">{{ $textShortcut->text }}</pre></td>
+                                @if($performer->pro->pro_type === 'ADMIN')
+                                    <td>
+                                        <div class="d-flex align-items-center">
+                                            <div moe large relative class="mr-3">
+                                                <a start show>
+                                                    <i class="fa fa-pencil-alt"></i>
+                                                </a>
+                                                <form url="/api/proTextShortcut/update" right>
+                                                    <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
+                                                    <div class="mb-2">
+                                                        <input type="text" class="form-control form-control-sm" name="shortcut"
+                                                               value="{{$textShortcut->shortcut}}"
+                                                               placeholder="Shortcut *">
+                                                    </div>
+                                                    <div class="mb-2">
+                                                    <textarea type="text" rows="10" class="form-control form-control-sm" name="text"
+                                                              placeholder="Content *">{{$textShortcut->text}}</textarea>
+                                                    </div>
+                                                    <div class="form-group m-0">
+                                                        <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                                        <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+                                            <div moe relative wide class="mr-2">
+                                                <a start show class="text-danger">
+                                                    <i class="fa fa-trash-alt"></i>
+                                                </a>
+                                                <form url="/api/proTextShortcut/remove" right>
+                                                    <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
+                                                    <p>
+                                                        Are you sure you want to remove this shortcut?
+                                                    </p>
+                                                    <div class="form-group m-0">
+                                                        <button submit class="btn btn-danger btn-sm mr-2">Yes</button>
+                                                        <button cancel class="btn btn-default border btn-sm mr-2">No</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+                                        </div>
+                                    </td>
+                                @endif
+                            </tr>
+                        @endforeach
+                        </tbody>
+                    </table>
+                @else
+                    <div class="px-3 py-3 text-secondary">No global shortcuts</div>
+                @endif
+            </div>
         </div>
     </div>
-    </div>
+</div>
 
 @endsection

+ 1 - 1
resources/views/app/practice-management/notes-processing-center.blade.php

@@ -141,7 +141,7 @@
                             <td>
                                 {{$note->new_or_fu_or_na}}
                                 @if($note->method)
-                                    <span class="text-secondary text-sm ml-1">({{$note->method}})</span>
+                                    <span class="text-secondary text-sm ml-1">({{noteMethodDisplay($note->method)}})</span>
                                 @endif
                             </td>
                             <td>

+ 109 - 0
resources/views/app/practice-management/patients-accounts-invites-filters.blade.php

@@ -0,0 +1,109 @@
+<style>
+	#patients-accounts-invites-filters label {
+		font-weight: bold;
+	}
+
+	#patients-accounts-invites-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;
+	}
+</style>
+<form id="patients-accounts-invites-filters" method="GET" action="{{ route('practice-management.patientsAccountsInvites') }}" class="filter-container" v-cloak>
+	<!-- DATE	 -->
+	<div>
+		<div class="form-group">
+			<label>Date:</label>
+			<select name="date_category" class="form-control input-sm" v-model="filters.date_category">
+				<option value="">All</option>
+				<option value="EXACTLY">Exactly</option>
+				<option value="LESS_THAN">Less Than</option>
+				<option value="GREATER_THAN">Greater Than</option>
+				<option value="BETWEEN">Between</option>
+				<option value="NOT_BETWEEN">Not Between</option>
+			</select>
+			<div v-show="filters.date_category" class="mt-2">
+				<div>
+					<input name="date_value_1" v-model="filters.date_value_1" type="date" class="form-control input-sm"/>
+				</div>
+				<div v-show="filters.date_category === 'BETWEEN' || filters.date_category === 'NOT_BETWEEN'" class="mt-2">
+					<input name="date_value_2" v-model="filters.date_value_2" type="date" class="form-control input-sm"/>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!-- STATUS -->
+	<div>
+		<div class="form-group">
+			<label>Status:</label>
+			<select name="status" class="form-control input-sm" v-model="filters.status">
+				<option value="">All</option>
+				<option value="ACCEPTED">Accepted</option>
+				<option value="PENDING">Pending</option>
+				<option value="REJECTED">Rejected</option>
+				<option value="CANCELLED">Cancelled</option>
+			</select>
+		</div>
+	</div>
+
+	<div>
+		<div class="form-group">
+			<label>&nbsp;</label>
+			<div class="d-flex">
+				<button type="submit" 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('practice-management.patientsAccountsInvites') }}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
+			</div>
+		</div>
+	</div>
+</form>
+<?php
+$loadedFilters = $filters;
+$allFilterKeys = [
+	'date_category',
+	'date_value_1',
+	'date_value_2',
+	'status'
+];
+for ($i = 0; $i < count($allFilterKeys); $i++) {
+	if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
+		$loadedFilters[$allFilterKeys[$i]] = '';
+	}
+}
+?>
+<script>
+	(function() {
+		function init() {
+			window.apapp = new Vue({
+				el: '#patients-accounts-invites-filters',
+				delimiters: ['@{{', '}}'],
+				data: {
+					filters: <?= json_encode($loadedFilters) ?>
+				},
+				methods: {
+					doSubmit: function() {
+						fastLoad('{{ route("practice-management.patientsAccountsInvites") }}?' + $('#patients-accounts-invites-filters').serialize());
+						return false;
+					},
+					init: function() {
+
+					}
+				},
+				mounted: function() {
+					this.init();
+				},
+			});
+
+
+		}
+		addMCInitializer('patients-accounts-invites-filters', init, '#patients-accounts-invites-filters');
+	})();
+</script>

+ 90 - 0
resources/views/app/practice-management/patients-accounts-invites.blade.php

@@ -0,0 +1,90 @@
+@extends ('layouts/template')
+
+@section('content')
+
+<div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-user"></i>
+                Accounts Invites ({{ $accountInvites->total() }})
+            </strong>
+        </div>
+        <div class="card-body p-0">
+        <div class="p-3">
+                @include('app.practice-management.patients-accounts-invites-filters')
+            </div>
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                    <tr>
+                        <th class="px-2 text-secondary border-bottom-0">Created At</th>
+                        <th class="px-2 text-secondary border-bottom-0">Client</th>
+                        <th class="px-2 text-secondary border-bottom-0">Name</th>
+                        <th class="px-2 text-secondary border-bottom-0">Email</th>
+                        <th class="px-2 text-secondary border-bottom-0">Cell Number</th>
+                        <th class="px-2 text-secondary border-bottom-0">Status</th>
+                        <th class="px-2 text-secondary border-bottom-0">&nbsp;</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    @foreach($accountInvites as $accountInvite)
+                    <tr>                        
+                        <td class="px-2">
+                            {{ friendlier_date_time($accountInvite->created_at) }}
+                            @if($accountInvite->status === 'CANCELLED')
+                            <span class="text-sm text-secondary">(CANCELLED)</span>
+                            @endif
+                        </td>
+                        <td class="px-2">{{ $accountInvite->client->displayName() }}</td>
+                        <td class="px-2">{{ $accountInvite->first_name }} {{ $accountInvite->last_name }}</pre>
+                        </td>
+                        <td class="px-2">{{ $accountInvite->to_email_address }}</td>
+                        <td class="px-2">{{ $accountInvite->cell_number }}</td>
+                        <td class="px-2">{{ $accountInvite->status }} <span class="text-sm text-secondary">(Updated: {{friendlier_date_time($accountInvite->status_updated_at)}})</span>
+                            @if($accountInvite->status_memo)
+                            <div class="py-1 font-italic text-secondary text-sm">{{$accountInvite->status_memo}}</div>
+                            @endif
+                        </td>
+                        <td class="px-2">
+                            <div class="d-flex">
+                                @if($accountInvite->status === 'PENDING')
+                                <span moe class="ml-1" relative>
+                                    <a class="" href="" show start>Cancel</a>
+                                    <form url="/api/accountInvite/markAsCancelled" right>
+                                        <input type="hidden" name="uid" value="{{$accountInvite->uid}}">
+                                        <p>Cancel this invite?</p>
+                                        <div class="mb-0">
+                                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                @endif
+                                @if($accountInvite->status == 'CANCELLED')
+                                <span moe class="ml-1" relative>
+                                    <a class="" href="" show start>Undo Cancel</a>
+                                    <form url="/api/accountInvite/undoMarkAsCancelled" right>
+                                        <input type="hidden" name="uid" value="{{$accountInvite->uid}}">
+                                        <p>Un-cancel this invite?</p>
+                                        <div class="mb-0">
+                                            <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </span>
+                                @endif
+                            </div>
+                        </td>
+                    </tr>
+                    @endforeach
+                </tbody>
+            </table>
+            <div class="ml-2 mt-2">
+                {{ $accountInvites->appends(request()->input())->links() }}
+            </div>
+        </div>
+    </div>
+</div>
+
+@endsection

+ 147 - 141
resources/views/layouts/patient.blade.php

@@ -40,6 +40,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 							<a class="nav-link {{ strpos($routeName, 'patients.view.appointments') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.appointments', ['patient' => $patient, 'forPro' => 'all', 'status' => 'all']) }}">Appointments</a>
 						</li>
+						{{--
 						<li class="nav-item">
 							<a class="nav-link {{ strpos($routeName, 'patients.view.programs') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.programs', ['patient' => $patient]) }}">Programs</a>
@@ -48,6 +49,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 							<a class="nav-link {{ strpos($routeName, 'patients.view.flowsheets') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.flowsheets', ['patient' => $patient]) }}">Flowsheets</a>
 						</li>
+						--}}
 						<li class="nav-item">
 							<a class="nav-link {{ strpos($routeName, 'patients.view.vitals-settings') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.vitals-settings', ['patient' => $patient]) }}">Vitals Settings</a>
@@ -76,10 +78,6 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 							<a class="nav-link {{ strpos($routeName, 'patients.view.generic-bills') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.generic-bills', ['patient' => $patient]) }}">Generic Bills</a>
 						</li>
-						<li class="nav-item">
-							<a class="nav-link {{ strpos($routeName, 'patients.view.sections') === 0 ? 'active' : '' }}"
-							   href="{{ route('patients.view.sections', ['patient' => $patient]) }}">Sections</a>
-						</li>
 						<li class="nav-item">
 							<a class="nav-link {{ strpos($routeName, 'patients.view.handouts') === 0 ? 'active' : '' }}"
 							   href="{{ route('patients.view.handouts', ['patient' => $patient]) }}">Handouts</a>
@@ -371,9 +369,10 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 											data-patient-uid="{{$patient->uid}}"
 											style="background-image:<?=$thumbnail?>"><?=$initials?></div>
 											<i class=chart>[#{{$patient->chart_number}}]</i>
+											<i class="fas fa-info-circle text-primary" data-toggle="tooltip" data-placement="right" title="Joined <?=$memberSince?>"></i>
 										</div>
 										<div class=separators>
-											<div>{{friendly_date_time($patient->dob, false,null, true)}}({{$patient->age_in_years}}
+											<div>{{friendly_date_time($patient->dob, false,null, true)}} ({{$patient->age_in_years}}
 												y.o {{$patient->sex}})
 											</div>
 											@if($patient->getPrimaryCoverage() &&  $patient->getPrimaryCoverageStatus() === 'YES')
@@ -382,48 +381,62 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 													{{$patient->getPrimaryCoverage()->insuranceDisplayName()}}
 												</div>
 											@endif
+											<div>
+												<label>Status:</label>
+												<b>{{$patient->client_engagement_status_category ? ucwords(strtolower(str_replace('_', ' ', $patient->client_engagement_status_category == 'DUMMY' ? 'Test Chart' : $patient->client_engagement_status_category))) : '-'}}</b>
+												<div moe class="ml-2 hide-inside-popup">
+													<a start show><i class="fa fa-edit"></i></a>
+													<form url="/api/client/updateClientEngagementAssessmentStatus" class="mcp-theme-1">
+														<input type="hidden" name="uid" value="{{$patient->uid}}">
+														<div class="mb-2">
+															<label class="mb-1 text-secondary text-sm">Status</label>
+															<select name="category" class="form-control form-control-sm">
+																<option value=""> --select--</option>
+																<option {{ $patient->client_engagement_status_category === 'ACTIVE' ? 'selected' : '' }} value="ACTIVE">Active</option>
+																<option {{ $patient->client_engagement_status_category === 'INACTIVE' ? 'selected' : '' }} value="INACTIVE">Inactive</option>
+																<option {{ $patient->client_engagement_status_category === 'ENTRY_ERROR' ? 'selected' : '' }} value="ENTRY_ERROR">Entry Error</option>
+																<option {{ $patient->client_engagement_status_category === 'DUMMY' ? 'selected' : '' }} value="DUMMY">Test Chart</option>
+																<option {{ $patient->client_engagement_status_category === 'DECEASED' ? 'selected' : '' }} value="DECEASED">Deceased</option>
+																<option {{ $patient->client_engagement_status_category === 'DUPLICATE' ? 'selected' : '' }} value="DUPLICATE">Duplicate</option>
+																<option {{ $patient->client_engagement_status_category === 'NO_LONGER_INTERESTED' ? 'selected' : '' }} value="NO_LONGER_INTERESTED">No Longer Interested</option>
+																<option {{ $patient->client_engagement_status_category === 'BAD_RECORD' ? 'selected' : '' }} value="BAD_RECORD">Bad Record</option>
+															</select>
+														</div>
+														<div class="mb-2">
+															<label class="mb-1 text-secondary text-sm">Memo</label>
+															<textarea class="form-control form-control-sm" name="memo"></textarea>
+														</div>
+														<div>
+															<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+															<button cancel class="btn btn-sm btn-default border">Cancel</button>
+														</div>
+													</form>
+												</div>
+											</div>
 										</div>
 										<div class="screen-only">
-										<div class=separators>
-											<div>Joined <?=$memberSince?></div>
-											<div><label>MCP:</label> {{$mcpName}}
-												@if($patient->has_mcp_done_onboarding_visit !== 'YES' && $pro->pro_type == 'ADMIN')
-													<div moe class="ml-2 hide-inside-popup">
-														<a start show><i class="fa fa-edit"></i></a>
-														<form url="/api/client/putMcp" class="mcp-theme-1">
-															<input type="hidden" name="uid" value="{{$patient->uid}}">
-															<div class="mb-2">
-																<label class="text-secondary text-sm">MCP Pro</label>
-																<select name="mcpProUid" provider-search data-pro-uid="{{ @$patient->mcp->uid }}"
-																		class="form-control form-control-sm">
-																	<option value=""> --select--</option>
-																	@foreach($pros as $iPro)
-																		<option
-																			value="{{$iPro->uid}}" {{ $patient->mcp && $iPro->uid === $patient->mcp->uid ? 'selected' : '' }}>{{$iPro->displayName()}}</option>
-																	@endforeach
-																</select>
-															</div>
-															<div>
-																<button submit class="btn btn-sm btn-primary mr-1">
-																	Submit
-																</button>
-																<button cancel class="btn btn-sm btn-default border">
-																	Cancel
-																</button>
-															</div>
-														</form>
-													</div>
-													@if($patient->mcp)
+											<div class=separators>											
+												<div>
+													<label>MCP:</label> {{$mcpName}}
+													@if($patient->has_mcp_done_onboarding_visit !== 'YES' && $pro->pro_type == 'ADMIN')
 														<div moe class="ml-2 hide-inside-popup">
-															<a start show><i class="fa fa-times"></i></a>
-															<form url="/api/client/removeMcp" class="mcp-theme-1">
+															<a start show><i class="fa fa-edit"></i></a>
+															<form url="/api/client/putMcp" class="mcp-theme-1">
 																<input type="hidden" name="uid" value="{{$patient->uid}}">
 																<div class="mb-2">
-																	<label class="text-secondary text-sm">Remove MCP Pro</label>
-
+																	<label class="text-secondary text-sm">MCP Pro</label>
+																	<select name="mcpProUid" provider-search data-pro-uid="{{ @$patient->mcp->uid }}"
+																			class="form-control form-control-sm">
+																		<option value=""> --select--</option>
+																		@foreach($pros as $iPro)
+																			<option
+																				value="{{$iPro->uid}}" {{ $patient->mcp && $iPro->uid === $patient->mcp->uid ? 'selected' : '' }}>{{$iPro->displayName()}}</option>
+																		@endforeach
+																	</select>
 																</div>
 																<div>
-																	<button submit class="btn btn-sm btn-primary mr-1">Submit
+																	<button submit class="btn btn-sm btn-primary mr-1">
+																		Submit
 																	</button>
 																	<button cancel class="btn btn-sm btn-default border">
 																		Cancel
@@ -431,75 +444,94 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 																</div>
 															</form>
 														</div>
+														@if($patient->mcp)
+															<div moe class="ml-2 hide-inside-popup">
+																<a start show><i class="fa fa-times"></i></a>
+																<form url="/api/client/removeMcp" class="mcp-theme-1">
+																	<input type="hidden" name="uid" value="{{$patient->uid}}">
+																	<div class="mb-2">
+																		<label class="text-secondary text-sm">Remove MCP Pro</label>
+
+																	</div>
+																	<div>
+																		<button submit class="btn btn-sm btn-primary mr-1">Submit
+																		</button>
+																		<button cancel class="btn btn-sm btn-default border">
+																			Cancel
+																		</button>
+																	</div>
+																</form>
+															</div>
+														@endif
 													@endif
-												@endif
-											</div>
-										</div>
-										<div>
-											@if($patient->has_mcp_done_onboarding_visit !== 'YES')
-												<span class="text-dark d-inline-flex align-items-center">
-													<span class="mr-2">
-														<i class="fa fa-exclamation-triangle"></i>
-														MCP Onboarding Visit Pending
+													</div>
+												<div>
+												@if($patient->has_mcp_done_onboarding_visit !== 'YES')
+													<span class="text-dark d-inline-flex align-items-center">
+														<span class="mr-2">
+															<i class="fa fa-exclamation-triangle"></i>
+															MCP Onboarding Visit Pending
+														</span>
 													</span>
-												</span>
-												<span moe class="hide-inside-popup">
-													<a start show><i class="fa fa-edit"></i></a>
-													<form url="/api/client/updateMcpOnboardingVisitInfo" class="mcp-theme-1">
-														<input type="hidden" name="uid" value="{{$patient->uid}}">
-														<div class="mb-2">
-															<select name="hasMcpDoneOnboardingVisit"
-																	class="form-control form-control-sm"
-																	onchange="toggleDisabledAsNeeded(this, 'YES', 'if-visit-done')">
-																<option value="">-- Select Status --</option>
-																<option value="YES" {{ $patient->has_mcp_done_onboarding_visit === 'YES' ? 'selected' : '' }}>YES</option>
-																<option value="NO" {{ $patient->has_mcp_done_onboarding_visit === 'NO' ? 'selected' : '' }}>NO</option>
-																<option value="UNKNOWN" {{ $patient->has_mcp_done_onboarding_visit === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
-															</select>
-														</div>
-														<div class="mb-2">
-															<input type="date"
-																   class="if-visit-done form-control form-control-sm" disabled
-																   name="mcpOnboardingVisitDate" value="{{ date('Y-m-d') }}"
-																   max="{{ date('Y-m-d') }}">
-														</div>
-														<div class="mb-2">
-															<select name="mcpOnboardingVisitNoteUid" disabled
-																	class="form-control form-control-sm if-visit-done"
-																	onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
-																<option value="">-- Visit Note --</option>
-																<?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
-																@foreach ($notes as $note)
-																	@if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
-																		<option
-																			{{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
-																			value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
-																	@endif
-																@endforeach
-																{{--<option value="-- create --">-- Create Note --</option>--}}
-															</select>
-														</div>
-														<div class="mb-2 if-note-outside-system">
-															<textarea class="form-control form-control-sm"
-																	  name="reasonOnboardingVisitNoteOutsideSystem"
-																	  placeholder="Visit note outside the system reason"
-																	  spellcheck="false" data-gramm="false"></textarea>
-														</div>
-														<div>
-															<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
-															<button cancel class="btn btn-sm btn-default border">Cancel</button>
-														</div>
-													</form>
-												</span>
-											@else
-												<span class="text-dark d-inline-flex align-items-center">
-													<span class="mr-2 text-secondary">
-														<i class="fa fa-check text-sm"></i>
-														MCP Onboarding Visit Completed
+													<span moe class="hide-inside-popup">
+														<a start show><i class="fa fa-edit"></i></a>
+														<form url="/api/client/updateMcpOnboardingVisitInfo" class="mcp-theme-1">
+															<input type="hidden" name="uid" value="{{$patient->uid}}">
+															<div class="mb-2">
+																<select name="hasMcpDoneOnboardingVisit"
+																		class="form-control form-control-sm"
+																		onchange="toggleDisabledAsNeeded(this, 'YES', 'if-visit-done')">
+																	<option value="">-- Select Status --</option>
+																	<option value="YES" {{ $patient->has_mcp_done_onboarding_visit === 'YES' ? 'selected' : '' }}>YES</option>
+																	<option value="NO" {{ $patient->has_mcp_done_onboarding_visit === 'NO' ? 'selected' : '' }}>NO</option>
+																	<option value="UNKNOWN" {{ $patient->has_mcp_done_onboarding_visit === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
+																</select>
+															</div>
+															<div class="mb-2">
+																<input type="date"
+																	class="if-visit-done form-control form-control-sm" disabled
+																	name="mcpOnboardingVisitDate" value="{{ date('Y-m-d') }}"
+																	max="{{ date('Y-m-d') }}">
+															</div>
+															<div class="mb-2">
+																<select name="mcpOnboardingVisitNoteUid" disabled
+																		class="form-control form-control-sm if-visit-done"
+																		onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
+																	<option value="">-- Visit Note --</option>
+																	<?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
+																	@foreach ($notes as $note)
+																		@if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
+																			<option
+																				{{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
+																				value="{{$note->uid}}">{{$note->hcpPro->displayName()}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
+																		@endif
+																	@endforeach
+																	{{--<option value="-- create --">-- Create Note --</option>--}}
+																</select>
+															</div>
+															<div class="mb-2 if-note-outside-system">
+																<textarea class="form-control form-control-sm"
+																		name="reasonOnboardingVisitNoteOutsideSystem"
+																		placeholder="Visit note outside the system reason"
+																		spellcheck="false" data-gramm="false"></textarea>
+															</div>
+															<div>
+																<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+																<button cancel class="btn btn-sm btn-default border">Cancel</button>
+															</div>
+														</form>
 													</span>
-												</span>
-											@endif
-										</div>
+												@else
+													<span class="text-dark d-inline-flex align-items-center">
+														<span class="mr-2 text-secondary">
+															<i class="fa fa-check text-sm"></i>
+															MCP Onboarding Visit Completed
+														</span>
+													</span>
+												@endif
+											</div>
+											</div>
+										
 										<div>
 											<label>Physician:</label> {{$patient->pcp ? $patient->pcp->displayName() : '-' }}
 											@if($pro->pro_type == 'ADMIN')
@@ -549,38 +581,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
                               @endif
                           @endif
                       </div>
-											<div>
-												<label>Engagement Status:</label>
-												<b>{{$patient->client_engagement_status_category ? ucwords(strtolower(str_replace('_', ' ', $patient->client_engagement_status_category == 'DUMMY' ? 'Test Chart' : $patient->client_engagement_status_category))) : '-'}}</b>
-												<div moe class="ml-2 hide-inside-popup">
-													<a start show><i class="fa fa-edit"></i></a>
-													<form url="/api/client/updateClientEngagementAssessmentStatus" class="mcp-theme-1">
-														<input type="hidden" name="uid" value="{{$patient->uid}}">
-														<div class="mb-2">
-															<label class="mb-1 text-secondary text-sm">Status</label>
-															<select name="category" class="form-control form-control-sm">
-																<option value=""> --select--</option>
-																<option {{ $patient->client_engagement_status_category === 'ACTIVE' ? 'selected' : '' }} value="ACTIVE">Active</option>
-																<option {{ $patient->client_engagement_status_category === 'INACTIVE' ? 'selected' : '' }} value="INACTIVE">Inactive</option>
-																<option {{ $patient->client_engagement_status_category === 'ENTRY_ERROR' ? 'selected' : '' }} value="ENTRY_ERROR">Entry Error</option>
-																<option {{ $patient->client_engagement_status_category === 'DUMMY' ? 'selected' : '' }} value="DUMMY">Test Chart</option>
-																<option {{ $patient->client_engagement_status_category === 'DECEASED' ? 'selected' : '' }} value="DECEASED">Deceased</option>
-																<option {{ $patient->client_engagement_status_category === 'DUPLICATE' ? 'selected' : '' }} value="DUPLICATE">Duplicate</option>
-																<option {{ $patient->client_engagement_status_category === 'NO_LONGER_INTERESTED' ? 'selected' : '' }} value="NO_LONGER_INTERESTED">No Longer Interested</option>
-																<option {{ $patient->client_engagement_status_category === 'BAD_RECORD' ? 'selected' : '' }} value="BAD_RECORD">Bad Record</option>
-															</select>
-														</div>
-														<div class="mb-2">
-															<label class="mb-1 text-secondary text-sm">Memo</label>
-															<textarea class="form-control form-control-sm" name="memo"></textarea>
-														</div>
-														<div>
-															<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
-															<button cancel class="btn btn-sm btn-default border">Cancel</button>
-														</div>
-													</form>
-												</div>
-											</div>
+											
                                         </div>
                                     </section>
                                     {{--<section>
@@ -640,7 +641,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
                                         </div>
                                     </section>--}}
                                     <section class="hide-inside-popup screen-only vbox mt-2 align-self-start ml-4">
-
+										@if(false)
                                         <div moe>
                                             <button class="col-2-button" start show><i class="fa fa-plus text-sm text-secondary"></i>&nbsp;Note
                                             </button>
@@ -691,6 +692,7 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
                                                 </div>
                                             </form>
                                         </div>
+										@endif
                                         <div>
                                             <div moe relative>
                                                 <button class="col-2-button" start show><i class="fa fa-plus text-sm text-secondary"></i>&nbsp;SMS
@@ -906,8 +908,6 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 					}
 				});
 
-				$('[data-toggle="tooltip"]').tooltip('hover');
-
 				$('.note-method-select').each(function() {
 					let form = $(this).closest('form');
 					if(this.value === 'IN_CLINIC') {
@@ -917,6 +917,8 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 						form.find('.if-in-clinic').hide();
 					}
 				});
+
+				$('[data-toggle="tooltip"]').tooltip('hover');
 			}
 			addMCInitializer('patient-add-note-popup', init, '#patient-header')
 		}).call(window);
@@ -932,6 +934,10 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
 				if(localStorage.sidebarMenuScrollTop) {
 					$('#sidebarMenu').scrollTop(+localStorage.sidebarMenuScrollTop);
 				}
+
+				$(function () {
+					$('[data-toggle="tooltip"]').tooltip();
+				});
 			}
 			addMCInitializer('sidebarMenu', init, '#sidebarMenu')
 		}).call(window);

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

@@ -180,6 +180,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.statTrees.list') }}">Stat Trees</a>
 
                             <a class="dropdown-item" href="/practice-management/rates/all">Payment Rates</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.patientsAccountsInvites') }}">Patients Accounts Invites</a>
 
                         @elseif($pro->is_enrolled_as_mcp)
 
@@ -197,6 +198,7 @@
                             <a class="dropdown-item" href="{{ route('mcp.reports') }}">Reports</a>
                             <a class="dropdown-item" href="{{ route('mcp.supply_orders') }}">Supply Orders</a>
                             <a class="dropdown-item" href="{{ route('mcp.client_messages') }}">Messages</a>
+                            <a class="dropdown-item" href="{{ route('mcp.patients_accounts_invites') }}">Patients Accounts Invites</a>
 
                         @elseif($pro && $pro->isDefaultNA())
 
@@ -398,11 +400,22 @@
                 fastLoad('/patients/view/' + $(this).attr('data-target-uid'), true, false, false);
                 return false;
             });
+            $(document)
+                .off('click.tab-link', 'a[tab-link]')
+                .on('click.tab-link', 'a[tab-link]', function () {
+                    let tab = $(this).attr('tab-link');
+                    $(this).siblings().removeClass('tab-link-active');
+                    $(this).addClass('tab-link-active');
+                    $('.cm-tab').addClass('d-none');
+                    $('.cm-tab[tab-key="' + tab + '"]').removeClass('d-none');
+                    return false;
+                });
         });
     </script>
     <script src="/js/click-to-copy.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/stag-popup.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/stag-suggest.js?v={{config('app.asset_version')}}"></script>
+    <script src="/js/stag-table-filter.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/option-list.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/show-on-click.js?v={{config('app.asset_version')}}"></script>
     <script src="/js/dq.js?v={{config('app.asset_version')}}"></script>

+ 4 - 1
routes/web.php

@@ -82,6 +82,8 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('reports', 'McpController@reports')->name('reports');
         Route::get('supply-orders', 'McpController@supply_orders')->name('supply_orders');
         Route::get('client-messages', 'McpController@client_messages')->name('client_messages');
+        Route::get('patients-accounts-invites', 'McpController@patients_accounts_invites')->name('patients_accounts_invites');
+
 
         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');
@@ -94,6 +96,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('cancelled-supply-orders-pending-review', 'McpController@cancelled_supply_orders_pending_review')->name('cancelled_supply_orders_pending_review');
         Route::get('erx-and-orders-pending-signature', 'McpController@erx_and_orders_pending_signature')->name('erx_and_orders_pending_signature');
         Route::get('supply-orders-pending-signature', 'McpController@supply_orders_pending_signature')->name('supply_orders_pending_signature');
+        Route::get('supply-orders-awaiting-shipment', 'McpController@supply_orders_awaiting_shipment')->name('supply_orders_awaiting_shipment');
 
         Route::get('measurements-pending-stamping', 'McpController@measurements_pending_stamping')->name('measurements_pending_stamping');
 
@@ -173,6 +176,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('get-next-note/{mode}', 'PracticeManagementController@getNextNote')->name('get-next-note');
 
         Route::get('my-teams', 'PracticeManagementController@myTeams')->name('my-teams');
+        Route::get('patients-accounts-invites', 'PracticeManagementController@patientsAccountsInvites')->name('patientsAccountsInvites');
 
         Route::middleware('pro.auth.admin')->group(function () {
 
@@ -322,7 +326,6 @@ Route::middleware('pro.auth')->group(function () {
                 Route::get('section-view/{section}/{view}/{page?}', 'NoteController@sectionView')->name('section-view');
             });
             Route::get('generic-bills', 'PatientController@genericBills')->name('generic-bills');
-            Route::get('sections', 'PatientController@sections')->name('sections');
             Route::get('handouts', 'PatientController@handouts')->name('handouts');
             Route::get('rm-setup', 'PatientController@rmSetup')->name('rm-setup');
             Route::get('settings', 'PatientController@settings')->name('settings');