ソースを参照

merged with master

= 4 年 前
コミット
c6663fca86

+ 28 - 0
app/Helpers/helpers.php

@@ -28,6 +28,20 @@ if(!function_exists('friendly_date_time')) {
     }
 }
 
+if(!function_exists('friendlier_date_time')) {
+    function friendlier_date_time($value, $includeTime = true, $default = '-') {
+        if(!$value || empty($value)) return $default;
+        try {
+            $result = strtotime($value);
+            $result = date("j M" . ($includeTime ? ", h:i a" : ""), $result);
+            return $result;
+        }
+        catch (Exception $e) {
+            return $value;
+        }
+    }
+}
+
 if(!function_exists('friendly_date_time_short')) {
     function friendly_date_time_short($value, $includeTime = true, $default = '-') {
         if(!$value || empty($value)) return $default;
@@ -113,6 +127,20 @@ if(!function_exists('friendly_date')) {
     }
 }
 
+if(!function_exists('friendlier_date')) {
+    function friendlier_date($value) {
+        if(!$value || empty($value)) return '';
+        try {
+            $result = strtotime($value);
+            $result = date("j M", $result);
+            return $result;
+        }
+        catch (Exception $e) {
+            return $value;
+        }
+    }
+}
+
 if(!function_exists('unfriendly_date')) {
     function unfriendly_date($value) {
         if(!$value || empty($value)) return '';

+ 14 - 0
app/Http/Controllers/PatientController.php

@@ -13,8 +13,11 @@ use App\Models\Handout;
 use App\Models\MBPayer;
 use App\Models\NoteTemplate;
 use App\Models\Pro;
+use App\Models\Product;
 use App\Models\ProProAccess;
 use App\Models\SectionTemplate;
+use App\Models\Shipment;
+use App\Models\SupplyOrder;
 use App\Models\Ticket;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\File;
@@ -344,6 +347,17 @@ class PatientController extends Controller
         return view('app.patient.tickets', compact('patient', 'pros', 'allPros', 'type'));
     }
 
+    public function supplyOrders(Request $request, Client $patient, SupplyOrder $supplyOrder = null)
+    {
+        $products = Product::where('is_active', true)->orderBy('title')->get();
+        return view('app.patient.supply-orders', compact('patient', 'supplyOrder', 'products'));
+    }
+
+    public function shipments(Request $request, Client $patient, Shipment $shipment = null)
+    {
+        return view('app.patient.shipments', compact('patient', 'shipment'));
+    }
+
     public function appointments(Request $request, Client $patient, $forPro = 'all', $status = 'all') {
         $pros = $this->pros;
         $appointments = $patient->appointmentsForProByStatus('all', 'ALL');

+ 110 - 3
app/Http/Controllers/PracticeManagementController.php

@@ -10,6 +10,7 @@ use App\Models\Client;
 use App\Models\McpRequest;
 use App\Models\Note;
 use App\Models\Pro;
+use App\Models\Product;
 use App\Models\ProFavorite;
 use App\Models\ProGeneralAvailability;
 use App\Models\ProProAccess;
@@ -18,6 +19,8 @@ use App\Models\ProSpecificAvailability;
 use App\Models\ProSpecificUnavailability;
 use App\Models\ProTextShortcut;
 use App\Models\ProTransaction;
+use App\Models\Shipment;
+use App\Models\SupplyOrder;
 use App\Models\Ticket;
 use Illuminate\Support\Facades\DB;
 use PDF;
@@ -355,16 +358,16 @@ class PracticeManagementController extends Controller
 
         $clients = Client::whereNotNull('active_mcp_request_id')->where(function($query) use ($myInitiativesList){
             $query->whereNull('initiative')->orWhereIn('initiative', $myInitiativesList);
-        }) 
+        })
         ->where(function($query) use ($myForeignLanguagesList) {
             $query->whereNull('preferred_foreign_language')->orWhereIn('preferred_foreign_language', $myForeignLanguagesList);
         })->limit(3)->get();
         $results = [];
-      
+
 
         foreach($clients as $client){
             $results[] = [
-                'clientUid' => $client->uid, 
+                'clientUid' => $client->uid,
                 'name' => $client->displayName(),
                 'initials'=> substr($client->name_first, 0, 1) . substr($client->name_last, 0, 1)
             ];
@@ -531,6 +534,110 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.tickets', compact('tickets'));
     }
 
+    public function supplyOrders(Request $request) {
+
+        // so clients
+        $soClientIDs = DB::table('supply_order')->select('client_id')->distinct()->get()->toArray();
+        $soClientIDs = array_map(function($_x) {
+            return $_x->client_id;
+        }, $soClientIDs);
+        $soClients = Client::whereIn('id', $soClientIDs)->get();
+
+        // so products
+        $soProductIDs = DB::table('supply_order')->select('product_id')->distinct()->get()->toArray();
+        $soProductIDs = array_map(function($_x) {
+            return $_x->product_id;
+        }, $soProductIDs);
+        $soProducts = Product::whereIn('id', $soProductIDs)->get();
+
+        $filters = [];
+        $filters['client'] = $request->input('client');
+        $filters['product'] = $request->input('product');
+        $filters['reason'] = $request->input('reason');
+        $filters['cu_memo'] = $request->input('cu_memo');
+        $filters['pro_sign'] = $request->input('pro_sign');
+        $filters['client_sign'] = $request->input('client_sign');
+        $filters['shipment'] = $request->input('shipment');
+        $filters['lot_number'] = $request->input('lot_number');
+        $filters['imei'] = $request->input('imei');
+        $filters['cancelled'] = $request->input('cancelled');
+
+        $supplyOrders = SupplyOrder::where('id', '>', 0);
+
+        // apply filters
+        if($filters['client']) $supplyOrders->where('client_id', $filters['client']);
+        if($filters['product']) $supplyOrders->where('product_id', $filters['product']);
+        if($filters['reason']) $supplyOrders->where('reason', 'ILIKE', '%' . $filters['reason'] . '%');
+        if($filters['cu_memo']) $supplyOrders->where('cu_memo', 'ILIKE', '%' . $filters['cu_memo'] . '%');
+        if($filters['pro_sign']) $supplyOrders->where('is_signed_by_pro', ($filters['pro_sign'] === 'signed'));
+
+        if($filters['client_sign']) {
+            if($filters['client_sign'] === 'signed')
+                $supplyOrders->where('is_signed_by_client', true);
+            elseif($filters['client_sign'] === 'waived')
+                $supplyOrders->where('is_client_signature_waived', true);
+            else
+                $supplyOrders->where('is_client_signature_waived', false)->where('is_signed_by_client', false);
+        }
+
+        if ($filters['shipment']) {
+            if ($filters['shipment'] === 'not_cleared_for_shipment')
+                $supplyOrders->whereNull('shipment_id')->where('is_cleared_for_shipment', false);
+            elseif ($filters['shipment'] === 'cleared_for_shipment')
+                $supplyOrders->whereNull('shipment_id')->where('is_cleared_for_shipment', true);
+            else
+                $supplyOrders
+                    ->whereNotNull('shipment_id')
+                    ->whereRaw('(SELECT status FROM shipment WHERE id = shipment_id LIMIT 1) = ?', [$filters['shipment']]);
+        }
+
+        if($filters['lot_number']) $supplyOrders->where('lot_number', 'ILIKE', '%' . $filters['lot_number'] . '%');
+        if($filters['imei']) $supplyOrders->where('imei', 'ILIKE', '%' . $filters['imei'] . '%');
+        if($filters['cancelled']) $supplyOrders->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
+
+        $supplyOrders = $supplyOrders->orderBy('created_at', 'desc')->paginate();
+
+        return view('app.practice-management.supply-orders',
+            compact('supplyOrders', 'filters',
+                'soClients', 'soProducts'
+            )
+        );
+    }
+
+    public function shipments(Request $request, $filter = null) {
+
+        // so clients
+        $shClientIDs = DB::table('shipment')->select('client_id')->distinct()->get()->toArray();
+        $shClientIDs = array_map(function($_x) {
+            return $_x->client_id;
+        }, $shClientIDs);
+        $shClients = Client::whereIn('id', $shClientIDs)->get();
+
+        $shipments = Shipment::where('id', '>', 0);
+
+        $filters = [];
+        $filters['client'] = $request->input('client');
+        $filters['courier'] = $request->input('courier');
+        $filters['tracking_num'] = $request->input('tracking_num');
+        $filters['status'] = $request->input('status');
+        $filters['cancelled'] = $request->input('cancelled');
+
+        if($filters['client']) $shipments->where('client_id', $filters['client']);
+        if($filters['courier']) $shipments->where('courier', 'ILIKE', '%' . $filters['courier'] . '%');
+        if($filters['tracking_num']) $shipments->where('tracking_number', 'ILIKE', '%' . $filters['tracking_num'] . '%');
+        if($filters['label']) {
+            if($filters['label'] === 'yes')
+                $shipments->whereNotNull('label_system_file_id');
+            else
+                $shipments->whereNull('label_system_file_id');
+        }
+        if($filters['status']) $shipments->where('status', $filters['status']);
+        if($filters['cancelled']) $shipments->where('is_cancelled', ($filters['cancelled'] === 'cancelled'));
+
+        $shipments = $shipments->orderBy('created_at', 'desc')->paginate();
+        return view('app.practice-management.shipments', compact('shipments', 'filters', 'shClients'));
+    }
+
     public function cellularMeasurements(Request $request){
         $measurements = Measurement::orderBy('ts', 'desc')->whereNotNull('ts')->paginate();
         return view('app.practice-management.cellular-measurements', compact('measurements'));

+ 42 - 0
app/Models/Client.php

@@ -130,6 +130,25 @@ class Client extends Model
             ->orderBy('effective_date', 'desc');
     }
 
+    public function getNonZeroBpMeasurements(){
+        return $this->hasMany(Measurement::class, 'client_id', 'id')
+            /*->distinct('label')*/
+            ->where('is_removed', false)
+            ->where('label', '=', 'BP')
+            ->where('sbp_mm_hg', '>', 0)
+            ->where('dbp_mm_hg', '>', 0)
+            ->orderBy('ts', 'desc');
+    }
+
+    public function getNonZeroWeightMeasurements(){
+        return $this->hasMany(Measurement::class, 'client_id', 'id')
+            /*->distinct('label')*/
+            ->where('is_removed', false)
+            ->where('label', '=', 'Wt. (lbs.)')
+            ->where('numeric_value', '>', 0)
+            ->orderBy('ts', 'desc');
+    }
+
     public function currentCareMonth()
     {
         $cmStartDate = strtotime(date('Y-m-d'));
@@ -415,4 +434,27 @@ class Client extends Model
         return $this->hasOne(MBPayer::class, 'id', 'mb_payer_id');
     }
 
+    public function supplyOrders()
+    {
+        return $this->hasMany(SupplyOrder::class, 'client_id', 'id')
+            ->where('is_cancelled', false)
+            ->orderBy('created_at', 'desc');
+    }
+
+    public function readyToShipSupplyOrders()
+    {
+        return $this->hasMany(SupplyOrder::class, 'client_id', 'id')
+            ->where('is_cancelled', false)
+            ->where('is_cleared_for_shipment', true)
+            ->whereNull('shipment_id')
+            ->orderBy('created_at', 'desc');
+    }
+
+    public function shipments()
+    {
+        return $this->hasMany(Shipment::class, 'client_id', 'id')
+            ->where('is_cancelled', false)
+            ->orderBy('created_at', 'desc');
+    }
+
 }

+ 4 - 4
app/Models/Pro.php

@@ -290,7 +290,7 @@ class Pro extends Model
                     ->orWhere('rme_pro_id', $proID)
                     ->orWhere('physician_pro_id', $proID)
                     ->orWhereRaw('id IN (SELECT client_id FROM client_pro_access WHERE is_active AND pro_id = ?)', [$proID])
-                    ->orWhereRaw('id IN (SELECT client_id FROM appointment WHERE pro_id = ?)', [$proID])
+                    ->orWhereRaw('id IN (SELECT client_id FROM appointment WHERE status NOT IN (\'CANCELLED\', \'ABANDONED\') AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT mcp_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)')
                     ->orWhereRaw('id IN (SELECT manager_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)');
             });
@@ -348,9 +348,9 @@ class Pro extends Model
 
         // eager load stuff needed in JS
         foreach ($measurements as $measurement) {
-            if ($measurement->client_bdt_measurement_id) {
-                $measurement->bdtMeasurement = $measurement->clientBDTMeasurement->measurement;
-            }
+//            if ($measurement->client_bdt_measurement_id) {
+//                $measurement->bdtMeasurement = $measurement->clientBDTMeasurement->measurement;
+//            }
             unset($measurement->clientBDTMeasurement); // we do not need this travelling to the frontend
 
             $client = [

+ 10 - 0
app/Models/Product.php

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

+ 28 - 0
app/Models/Shipment.php

@@ -0,0 +1,28 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class Shipment extends Model
+{
+    protected $table = 'shipment';
+
+    public function client()
+    {
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
+    public function supplyOrders() {
+        return $this->hasMany(SupplyOrder::class, 'shipment_id', 'id');
+    }
+
+    public function labelFile() {
+        return $this->hasOne(SystemFile::class, 'id', 'label_system_file_id');
+    }
+
+    public function createdSession()
+    {
+        return $this->hasOne(AppSession::class, 'id', 'created_by_session_id');
+    }
+}

+ 42 - 0
app/Models/SupplyOrder.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class SupplyOrder extends Model
+{
+    protected $table = 'supply_order';
+
+    public function client()
+    {
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
+    public function product()
+    {
+        return $this->hasOne(Product::class, 'id', 'product_id');
+    }
+
+    public function shipment()
+    {
+        return $this->hasOne(Shipment::class, 'id', 'shipment_id');
+    }
+
+    public function signedPro() {
+        return $this->hasOne(Pro::class, 'id', 'signed_by_pro_id');
+    }
+
+    public function waiverPro() {
+        return $this->hasOne(Pro::class, 'id', 'client_signature_waived_by_pro_id');
+    }
+
+    public function clearedForShipmentPro() {
+        return $this->hasOne(Pro::class, 'id', 'cleared_for_shipment_by_pro_id');
+    }
+
+    public function createdSession()
+    {
+        return $this->hasOne(AppSession::class, 'id', 'created_by_session_id');
+    }
+}

+ 10 - 0
app/Models/SystemFile.php

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

+ 9 - 0
public/css/style.css

@@ -280,6 +280,9 @@ body>nav.navbar {
 .mcp-theme-1 .width-70px {
     width: 70px !important;
 }
+.mcp-theme-1 .width-90px {
+    width: 90px !important;
+}
 .mcp-theme-1 .min-width-140px {
     min-width: 140px !important;
 }
@@ -289,6 +292,9 @@ body>nav.navbar {
 .mcp-theme-1 .min-width-300px {
     min-width: 300px;
 }
+.mcp-theme-1 .min-width-500px {
+    min-width: 500px !important;
+}
 .mcp-theme-1 .width-100px {
     width: 100px;
     min-width: unset !important;
@@ -1458,3 +1464,6 @@ canvas.pdf-viewer-page.pdf-preview-page {
 .back-to-admin-button:hover {
     text-decoration: underline;
 }
+.bg-aliceblue {
+    background: aliceblue !important;
+}

+ 1 - 1
public/js/mc.js

@@ -52,7 +52,7 @@ $(document).ready(function () {
     // }
 
     // populate history on fresh load
-    var target = window.top.location.pathname;
+    var target = window.top.location.pathname + window.top.location.search;
     if (target.indexOf('/mc') === 0) {
         target = target.split('/mc')[1];
     }

+ 143 - 27
public/js/yemi.js

@@ -124,6 +124,67 @@ var doAjax = function (url, data, pre, post, onSuccess, onFailure, suppressError
         });
 };
 
+var doAjaxFormData = function (url, data, pre, post, onSuccess, onFailure, suppressErrorMessage, onHttpFailure, shouldHideMask, immediatelyHideMaskOnReply) {
+    console.log(data);
+    if (ajaxGoing) {
+        console.log('ajax stopped!');
+        //return; TODO: fix and re-enable return
+    }
+    ajaxGoing = true;
+    if (!shouldHideMask) {
+        showMask();
+    }
+    jQuery.ajax(url, {
+        dataType: 'json',
+        data: data,
+        processData: false,
+        contentType: false,
+        type: 'POST',
+        beforeSend: function () {
+            if (pre) {
+                pre();
+            }
+        }
+    })
+        .done(function (response, b) {
+            console.log(response);
+            var success = response.success;
+            if (success) {
+                if (onSuccess) {
+                    onSuccess(response.data);
+                }
+            } else {
+                if (onFailure) {
+                    onFailure(response.message);
+                }
+                if (!suppressErrorMessage) {
+                    //toast the error message
+                    //alert(response.message);
+                    toastr.error(response.message); // , toastr.success("message") ... .warning(), .error()
+                }
+                hideMask();
+            }
+            if (immediatelyHideMaskOnReply) {
+                hideMask();
+            }
+            ajaxGoing = false;
+        })
+        .fail(function (jqXHR, textStatus) {
+            hideMask();
+            toastr.error('Unable to process');
+            if (onHttpFailure) {
+                onHttpFailure(textStatus);
+            }
+            ajaxGoing = false;
+        })
+        .always(function () {
+            if (post) {
+                post();
+            }
+            ajaxGoing = false;
+        });
+};
+
 var justLog = false; //THIS IS FOR TEST MODE, FORMS WILL NOT TRIGGER REFRESH/REDIR
 
 var pageReload = function () {
@@ -134,7 +195,7 @@ var pageReload = function () {
 };
 
 var fastReload = function() {
-    var targetLocation = window.top.location.pathname;
+    var targetLocation = window.top.location.pathname + window.top.location.search;
     if(targetLocation.indexOf('/mc') === 0) {
         targetLocation = targetLocation.substr(3);
     }
@@ -420,36 +481,91 @@ var initMoes = function() {
                 });
                 console.log(data);
                 //var doAjax = function (url, data, pre, post, onSuccess, onFailure, suppressErrorMessage, onHttpFailure, shouldHideMask, immediatelyHideMaskOnReply)
-                doAjax(url, data, null, function () {
-                    moe.isProcessing = false;
-                }, function (data) {
-                    if (justLog) { // this is to test!
-                        console.log('RETURNED', data);
-                    } else if (redir) {
-                        if (redir == "back") {
-                            window.top.history.back();
+
+                // override with FormData if the form has any files
+                let useFormData = false;
+                if($(form).find('input[type="file"]').length) {
+                    let formData = new FormData();
+                    for(let x in data) {
+                        if(data.hasOwnProperty(x)) {
+                            formData.set(x, data[x]);
+                        }
+                    }
+                    $(form).find('input[type="file"]').each(function() {
+                        let fieldName = this.name;
+                        if(this.files && this.files.length) {
+                            formData.append(fieldName, this.files[0]);
+                        }
+                    });
+                    data = formData;
+                    useFormData = true;
+                }
+
+                if(!useFormData) {
+                    doAjax(url, data, null, function () {
+                        moe.isProcessing = false;
+                    }, function (data) {
+                        if (justLog) { // this is to test!
+                            console.log('RETURNED', data);
+                        } else if (redir) {
+                            if (redir == "back") {
+                                window.top.history.back();
+                            } else {
+                                if (redir.indexOf('[data]') > -1) {
+                                    redir = redir.replace('[data]', data);
+                                }
+                                fastLoad(redir, true, false);
+                            }
+                        } else if (moeParent.length) {
+                            showMask();
+                            $.get(moeParent.attr('url'), function (_data) {
+                                moeParent.html(_data);
+                                hideMask();
+                                hideMoeFormMask();
+                                initMoes();
+                                initFastLoad(moeParent);
+                                initAutoRxAndICDComplete();
+                            });
                         } else {
-                            if (redir.indexOf('[data]') > -1) {
-                                redir = redir.replace('[data]', data);
+                            pageReload();
+                        }
+                    }, function (errorMessage) {
+
+                    }, false);
+                }
+                else {
+                    doAjaxFormData(url, data, null, function () {
+                        moe.isProcessing = false;
+                    }, function (data) {
+                        if (justLog) { // this is to test!
+                            console.log('RETURNED', data);
+                        } else if (redir) {
+                            if (redir == "back") {
+                                window.top.history.back();
+                            } else {
+                                if (redir.indexOf('[data]') > -1) {
+                                    redir = redir.replace('[data]', data);
+                                }
+                                fastLoad(redir, true, false);
                             }
-                            fastLoad(redir, true, false);
+                        } else if (moeParent.length) {
+                            showMask();
+                            $.get(moeParent.attr('url'), function (_data) {
+                                moeParent.html(_data);
+                                hideMask();
+                                hideMoeFormMask();
+                                initMoes();
+                                initFastLoad(moeParent);
+                                initAutoRxAndICDComplete();
+                            });
+                        } else {
+                            pageReload();
                         }
-                    } else if (moeParent.length) {
-                        showMask();
-                        $.get(moeParent.attr('url'), function (_data) {
-                            moeParent.html(_data);
-                            hideMask();
-                            hideMoeFormMask();
-                            initMoes();
-                            initFastLoad(moeParent);
-                            initAutoRxAndICDComplete();
-                        });
-                    } else {
-                        pageReload();
-                    }
-                }, function (errorMessage) {
+                    }, function (errorMessage) {
+
+                    }, false);
+                }
 
-                }, false);
             }
         });
 

+ 7 - 14
resources/views/app/dashboard/measurements.blade.php

@@ -25,21 +25,14 @@
                     </td>
                     <td class="px-2">{{ $measurement->label }}</td>
                     <td class="px-2">
-                        @if(!$measurement->clientBDTMeasurement)
-                         <div><b>{{ $measurement->value }}</b></div>
+                        @if($measurement->is_cellular_zero)
+                            <i class="font-size-11 fa fa-rss"></i>
+                        @elseif($measurement->label === 'BP')
+                            {{ $measurement->sbp_mm_hg }}/{{ $measurement->dbp_mm_hg }} mmHg
+                        @elseif($measurement->label === 'Wt. (lbs.)')
+                            {{ $measurement->numeric_value }} lbs
                         @else
-                        <div>
-                            @if($measurement->label == 'BP')
-                            <div>
-                                <b>{{ $measurement->sbp_mm_hg }}</b>/<b>{{ $measurement->dbp_mm_hg }}</b> mmHg
-                            </div>
-                            @endif
-                            @if($measurement->label == 'Wt. (lbs.)')
-                            <div>
-                                <b>{{ round($measurement->numeric_value, 1)}}</b> lbs
-                            </div>
-                            @endif
-                        </div>
+                            {{ $measurement->value }}
                         @endif
                     </td>
                     <td>

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

@@ -33,6 +33,7 @@
                 <th class="px-2 text-secondary">Display Name</th>
                 <th class="px-2 text-secondary">View</th>
                 <th class="px-2 text-secondary w-50">Shareable Link</th>
+                <th class="px-2 text-secondary"></th>
             </tr>
             </thead>
             <tbody>
@@ -47,6 +48,30 @@
                         </a>
                     </td>
                     <td class="px-2"><b>{{ $downloadLink }}</b></td>
+                    <td class="px-2">
+                        <div moe="" relative="">
+                            <a start="" show="" href="#">SMS Link</a>
+                            <form url="/api/clientSms/createOutgoing" right="" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="d5de7592-14f1-4df8-aed3-988b1e50afb2">
+                                <div class="mb-2">
+                                    <label for="" class="text-sm text-secondary mb-1">Cell Number</label>
+                                    <input type="text" class="form-control form-control-sm" name="cellNumber" value="{{ $patient->cell_number }}">
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="text-sm text-secondary mb-1">Message</label>
+                                    <textarea type="text" rows="10" class="form-control form-control-sm" name="message"
+                                        >Dear {{$patient->displayName()}}, Access the handout ({{$handout->display_name}}) at the following link: {{$downloadLink}}
+                                    </textarea>
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" submit="">Send</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel="">
+                                        Cancel
+                                    </button>
+                                </div>
+                            </form>
+                        </div>
+                    </td>
                 </tr>
             @endforeach
             </tbody>

+ 37 - 22
resources/views/app/patient/measurements.blade.php

@@ -7,14 +7,36 @@
                 <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</a>
-                    <form url="/api/measurement/create">
+                    <a start show class="py-0 font-weight-normal">Add BP</a>
+                    <form url="/api/measurement/createForBP">
                         <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                        <p class="font-weight-bold text-secondary mb-2">Add BP Measurement</p>
+                        <div class="mb-2">
+                            <label class="text-secondary text-sm mb-1">Systolic BP (mmHg)</label>
+                            <input required autofocus type="number" class="form-control form-control-sm" name="sbpMmHg" value="" placeholder="Systolic BP">
+                        </div>
+                        <div class="mb-2">
+                            <label class="text-secondary text-sm mb-1">Diastolic BP (mmHg)</label>
+                            <input required autofocus type="number" class="form-control form-control-sm" name="dbpMmHg" value="" placeholder="Diastolic BP">
+                        </div>
                         <div class="mb-2">
-                            <input required autofocus type="text" class="form-control form-control-sm" name="label" value="" placeholder="Type">
+                            <input required type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
+                        </div>
+                        <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>
+                    </form>
+                </div>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe>
+                    <a start show class="py-0 font-weight-normal">Add Weight</a>
+                    <form url="/api/measurement/create">
+                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                        <input type="hidden" name="label" value="Wt. (lbs.)">
+                        <p class="font-weight-bold text-secondary mb-2">Add Weight Measurement</p>
                         <div class="mb-2">
-                            <input required type="text" class="form-control form-control-sm" name="value" value="" placeholder="Value">
+                            <input required type="number" class="form-control form-control-sm" name="value" value="" placeholder="Weight">
                         </div>
                         <div class="mb-2">
                             <input required type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
@@ -49,8 +71,8 @@
                     <th class="px-2 text-secondary w-25">Effective Date</th>
                     <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">Status</th>
-                    <th class="px-2 text-secondary">Memo</th>--}}
+                    <th class="px-2 text-secondary">Source</th>
+                    {{--<th class="px-2 text-secondary">Memo</th>--}}
                     <th class="px-2 text-secondary"></th>
                 </tr>
                 </thead>
@@ -60,8 +82,8 @@
                         @if(!in_array($measurement->label, ["SBP", "DBP"]))
                         <tr>
                             <td class="px-2">
-                                @if($measurement->client_bdt_measurement_id)
-                                    <?php $timestampInSec = floor($measurement->bdt_measurement_timestamp/1000); ?>
+                                @if($measurement->ts)
+                                    <?php $timestampInSec = floor($measurement->ts/1000); ?>
                                     {{ friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN') }}
                                 @else
                                     {{ friendly_date_time_short_with_tz($measurement->effective_date, true, 'EASTERN') }}
@@ -70,24 +92,17 @@
                             </td>
                             <td class="px-2">{{ $measurement->label }}</td>
                             <td class="px-2">
-                                @if(empty($measurement->client_bdt_measurement_id))
-                                    {{ $measurement->value }}
-                                @elseif($measurement->is_cellular_zero)
+                                @if($measurement->is_cellular_zero)
                                     <i class="font-size-11 fa fa-rss"></i>
+                                @elseif($measurement->label === 'BP')
+                                    {{ $measurement->sbp_mm_hg }}/{{ $measurement->dbp_mm_hg }} mmHg
+                                @elseif($measurement->label === 'Wt. (lbs.)')
+                                    {{ $measurement->numeric_value }} lbs
                                 @else
-                                    @if($measurement->label === 'BP')
-                                        {{ $measurement->clientBDTMeasurement->measurement->systolic_bp_in_mm_hg }}/{{ $measurement->clientBDTMeasurement->measurement->diastolic_bp_in_mm_hg }} mmHg
-                                    @elseif($measurement->label === 'SBP')
-                                        {{ $measurement->clientBDTMeasurement->measurement->systolic_bp_in_mm_hg }} mmHg
-                                    @elseif($measurement->label === 'DBP')
-                                        {{ $measurement->clientBDTMeasurement->measurement->diastolic_bp_in_mm_hg }} mmHg
-                                    @elseif($measurement->label === 'Wt. (lbs.)')
-                                        {{ round($measurement->clientBDTMeasurement->measurement->weight_in_pounds, 1) }} lbs
-                                    @endif
+                                    {{ $measurement->value }}
                                 @endif
                             </td>
-                            {{--<td></td>
-                            <td></td>--}}
+                            <td class="px-2">{{$measurement->source}}</td>
                             <td class="px-2">
                                 <span moe relative class="mr-2">
                                     <a class="on-hover-opaque" start show title="Delete">

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

@@ -173,7 +173,7 @@
             <div class="px-2">
                 <div class="d-flex">
                     <span class="mr-2"><span class="text-secondary">Method:</span> {{$note->method ? $note->method : '-'}}</span>
-                    @if(!$note->is_signed_by_hcp && $note->new_or_fu_or_na !== 'NEW')
+                    @if(!$note->is_signed_by_hcp)
                         <div moe class="ml-auto">
                             <a href="" show start><i class="fa fa-edit"></i></a>
                             <form url="/api/note/updateMethod">
@@ -182,7 +182,9 @@
                                     <select name="method" class="form-control form-control-sm" required>
                                         <option value="">-- select --</option>
                                         <option value="VIDEO" {{ $note->method === "VIDEO" ? "selected" : "" }}>Video</option>
+                                        @if($note->new_or_fu_or_na !== 'NEW')
                                         <option value="AUDIO" {{ $note->method === "AUDIO" ? "selected" : "" }}>Audio</option>
+                                        @endif
                                         <option value="IN_CLINIC" {{ $note->method === "IN_CLINIC" ? "selected" : "" }}>In-Clinic</option>
                                         <option value="HOUSE_CALL" {{ $note->method === "HOUSE_CALL" ? "selected" : "" }}>House Call</option>
                                     </select>

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

@@ -1,16 +1,39 @@
 <div class="mt-2 mb-3">
     <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</a>
-            <form url="/api/measurement/create">
+            <a start show class="py-0 font-weight-normal">Add BP</a>
+            <form url="/api/measurement/createForBP">
                 <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <p class="font-weight-bold text-secondary mb-2">Add BP Measurement</p>
+                <div class="mb-2">
+                    <label class="text-secondary text-sm mb-1">Systolic BP (mmHg)</label>
+                    <input required autofocus type="number" class="form-control form-control-sm" name="sbpMmHg" value="" placeholder="Systolic BP">
+                </div>
+                <div class="mb-2">
+                    <label class="text-secondary text-sm mb-1">Diastolic BP (mmHg)</label>
+                    <input required autofocus type="number" class="form-control form-control-sm" name="dbpMmHg" value="" placeholder="Diastolic BP">
+                </div>
                 <div class="mb-2">
-                    <input required autofocus type="text" class="form-control form-control-sm" name="label" value="" placeholder="Type">
+                    <input required type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
+                </div>
+                <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>
+            </form>
+        </div>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe>
+            <a start show class="py-0 font-weight-normal">Add Weight</a>
+            <form url="/api/measurement/create">
+                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <input type="hidden" name="label" value="Wt. (lbs.)">
+                <p class="font-weight-bold text-secondary mb-2">Add Weight Measurement</p>
                 <div class="mb-2">
-                    <input required type="text" class="form-control form-control-sm" name="value" value="" placeholder="Value">
+                    <input required type="number" class="form-control form-control-sm" name="value" value="" placeholder="Weight">
                 </div>
                 <div class="mb-2">
                     <input required type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
@@ -21,6 +44,7 @@
                 </div>
             </form>
         </div>
+
         <span class="mx-2 text-secondary">|</span>
         <a start show class="py-0 font-weight-normal"
            href="/patients/view/{{ $patient->uid }}/measurements">

+ 411 - 0
resources/views/app/patient/shipments.blade.php

@@ -0,0 +1,411 @@
+@extends ('layouts.patient')
+@section('inner-content')
+    <div class="">
+        <div class="d-flex align-items-center mb-3">
+            <h4 class="font-weight-bold m-0">Shipments</h4>
+            <span class="mx-2 text-secondary">|</span>
+            <div moe>
+                <a start show href="#">Add</a>
+                <form url="/api/shipment/create" redir="/patients/view/{{ $patient->uid }}/shipments/[data]">
+                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                    <label class="text-secondary font-weight-bold">Add Shipment</label>
+<!--                    <div class="mb-2">
+                        <label class="text-secondary text-sm">Requested Ship Date *</label>
+                        <input type="date" class="form-control form-control-sm" name="requestedShipDate" required>
+                    </div>-->
+                    <p>Add a new shipment?</p>
+                    <div class="d-flex align-items-center">
+                        <button class="btn btn-sm btn-primary mr-2" type="button" submit>Submit</button>
+                        <button class="btn btn-sm btn-default border mr-2" type="button" cancel>Cancel</button>
+                    </div>
+                </form>
+            </div>
+        </div>
+
+        <div class="d-flex align-items-start h-100">
+            <div class="flex-grow-1">
+
+            @if($patient->readyToShipSupplyOrders && count($patient->readyToShipSupplyOrders))
+            {{--<div class="mb-3 p-2 border bg-aliceblue">
+                <div class="font-weight-bold mb-2 text-info">Ready to Ship Supply Orders</div>
+                <table class="table table-sm table-bordered mb-0 bg-white">
+                    @if($patient->readyToShipSupplyOrders && count($patient->readyToShipSupplyOrders))
+                        <thead>
+                        <tr class="">
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0">Title</th>
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0">Reason</th>
+                            @if(!$shipment)
+                                <th class="px-2 text-nowrap text-secondary border-bottom-0">Created At</th>
+                                <th class="px-2 text-nowrap text-secondary border-bottom-0">Pro Signed?</th>
+                                <th class="px-2 text-nowrap text-secondary border-bottom-0">Cancelled?</th>
+                                <th class="px-2 text-nowrap text-secondary border-bottom-0">Shipment</th>
+                            @endif
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @foreach($patient->readyToShipSupplyOrders as $iSupplyOrder)
+                            <tr class="">
+                                <td class="px-2">
+                                    <a href="{{route('patients.view.supply-orders', ['patient' => $patient, 'supplyOrder' => $iSupplyOrder])}}">
+                                        {{ $iSupplyOrder->product->title }}
+                                    </a>
+                                </td>
+                                <td class="px-2">{{ $iSupplyOrder->reason }}</td>
+                                @if(!$shipment)
+                                    <td class="px-2">{{ friendlier_date_time($iSupplyOrder->created_at) }}</td>
+                                    <td class="px-2">{{ $iSupplyOrder->is_signed_by_pro ? $iSupplyOrder->signedPro->displayName() : '-' }}</td>
+                                    <td class="px-2">{{ $iSupplyOrder->is_cancelled ? 'Yes' : 'No' }}</td>
+                                    <td class="px-2">{{ $iSupplyOrder->shipment_id ? $iSupplyOrder->shipment->status : '-' }}</td>
+                                @endif
+                            </tr>
+                        @endforeach
+                        </tbody>
+                    @else
+                        <tbody>
+                        <tr>
+                            <td class="text-secondary p-3">No unshipped supply orders for this patient</td>
+                        </tr>
+                        </tbody>
+                    @endif
+                </table>
+            </div>--}}
+                <div class="alert alert-info px-3 rounded-0">
+                    There {{ count($patient->readyToShipSupplyOrders) === 1 ? 'is' : 'are' }}
+                    <b>{{ count($patient->readyToShipSupplyOrders) }}</b>
+                    supply order{{ count($patient->readyToShipSupplyOrders) === 1 ? '' : 's' }}
+                    cleared for shipment
+                </div>
+            @endif
+            <table class="table table-sm table-bordered mb-0" style="table-layout: fixed">
+                @if($patient->shipments && count($patient->shipments))
+                    <thead>
+                    <tr class="bg-light">
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Created At</div></th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Supply Orders</div></th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Label File</div></th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Courier</div></th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Tracking #</div></th>
+                        <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Status</div></th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach($patient->shipments as $iShipment)
+                        <tr class="{{@$shipment && @$shipment->uid === $iShipment->uid ? 'bg-aliceblue' : ''}}">
+                            <td class="px-2">
+                                <a href="{{route('patients.view.shipments', ['patient' => $patient, 'shipment' => $iShipment])}}">
+                                    {{ friendlier_date_time($iShipment->created_at) }}
+                                </a>
+                            </td>
+                            <td class="px-2">{{count($iShipment->supplyOrders)}}</td>
+                            <td class="px-2">
+                                @if($iShipment->label_system_file_id)
+                                    <a class="pdf-viewer-trigger" native="" target="_blank"
+                                       href="/api/shipment/downloadLabel/{{$iShipment->uid}}" title="View">
+                                        <i class="fa fa-file-pdf text-danger on-hover-opaque"></i>
+                                        View
+                                    </a>
+                                @endif
+                            </td>
+                            <td class="px-2">{{ $iShipment->courier }}</td>
+                            <td class="px-2">{{ $iShipment->tracking_number }}</td>
+                            <td class="px-2">{{ $iShipment->status }}</td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                @else
+                    <tbody>
+                        <tr>
+                            <td class="text-secondary p-3">No shipments have been created for this patient</td>
+                        </tr>
+                    </tbody>
+                @endif
+            </table>
+
+            </div>
+
+            @if($shipment)
+                <div class="min-width-500px ml-2 border align-self-stretch p-3">
+                    <div class="d-flex align-items-center mb-3">
+                        <h3 class="font-size-16 m-0">Shipment (created on {{ friendlier_date_time($shipment->created_at) }})</h3>
+                        <a class="ml-auto" href="{{route('patients.view.shipments', ['patient' => $patient])}}">
+                            <i class="fa fa-times-circle on-hover-opaque"></i>
+                        </a>
+                    </div>
+                    <hr class="my-3">
+
+{{--                    <div class="mb-4 d-flex align-items-baseline">--}}
+{{--                        <label class="text-secondary mb-0 min-width-140px mr-2">Requested Ship Date</label>--}}
+{{--                        <div moe bottom class="d-block">--}}
+{{--                            <a start show>{{friendlier_date($shipment->requested_ship_date)}}</a>--}}
+{{--                            <form url="/api/supplyOrder/setRequestedShipDate">--}}
+{{--                                <input type="hidden" name="uid" value="{{ $shipment->uid }}">--}}
+{{--                                <div class="mb-2">--}}
+{{--                                    <label class="text-secondary mb-1 text-sm">Requested Ship Date *</label>--}}
+{{--                                    <input type="date" class="form-control form-control-sm" required--}}
+{{--                                           name="requestedShipDate" value="{{$shipment->requested_ship_date}}">--}}
+{{--                                </div>--}}
+{{--                                <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>--}}
+{{--                            </form>--}}
+{{--                        </div>--}}
+{{--                    </div>--}}
+
+                    @if($patient->readyToShipSupplyOrders && count($patient->readyToShipSupplyOrders))
+                        <div class="mb-4">
+                            <label class="mb-2 font-weight-bold text-secondary">Supply orders cleared for shipment</label>
+                            <table class="table table-sm table-striped table-bordered mb-0 bg-white">
+                                <thead>
+                                <tr class="">
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">Title</th>
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">Requested Ship Date</th>
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">&nbsp;</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @foreach($patient->readyToShipSupplyOrders as $iSupplyOrder)
+                                    <tr class="">
+                                        <td class="px-2">{{ $iSupplyOrder->product->title }}</td>
+                                        <td class="px-2 text-secondary">-todo-</td>
+                                        <td class="px-2">
+                                            <div moe relative>
+                                                <a start show class="py-0 font-weight-bold">Add</a>
+                                                <form url="/api/supplyOrder/putInShipment" right>
+                                                    <input type="hidden" name="uid" value="{{ $iSupplyOrder->uid }}">
+                                                    <input type="hidden" name="shipmentUid" value="{{ $shipment->uid }}">
+                                                    <p class="small">Add this supply order?</p>
+                                                    <div class="d-flex align-items-center">
+                                                        <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+                                        </td>
+                                    </tr>
+                                @endforeach
+                                </tbody>
+                            </table>
+                        </div>
+                    @endif
+
+                    <div class="mb-4">
+<!--                        <label class="mb-2 font-weight-bold text-secondary">Supply Orders in this Shipment</label>-->
+                        <table class="table table-sm table-striped table-bordered mb-0 bg-white">
+                            @if($shipment->supplyOrders && count($shipment->supplyOrders))
+                                <thead>
+                                <tr class="">
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">Supply Order</th>
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">IMEI</th>
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">Lot #</th>
+                                    <th class="px-2 text-nowrap text-secondary border-bottom-0">&nbsp;</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @foreach($shipment->supplyOrders as $iSupplyOrder)
+                                    <tr class="">
+                                        <td class="px-2">{{ $iSupplyOrder->product->title }}</td>
+                                        <td class="px-2">
+                                            <div moe relative class="d-block">
+                                                <a start show>{{ $iSupplyOrder->imei ? $iSupplyOrder->imei : '(not set)' }}</a>
+                                                <form url="/api/supplyOrder/associateImei" right>
+                                                    <input type="hidden" name="uid" value="{{ $iSupplyOrder->uid }}">
+                                                    <div class="mb-2">
+                                                        <label class="text-secondary mb-1 text-sm">IMEI *</label>
+                                                        <input type="text" class="form-control form-control-sm" required
+                                                               name="imei" value="{{ $iSupplyOrder->imei }}">
+                                                    </div>
+                                                    <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>
+                                                </form>
+                                            </div>
+                                        </td>
+                                        <td class="px-2">
+                                            <div moe relative class="d-block">
+                                                <a start show>{{ $iSupplyOrder->lot_number ? $iSupplyOrder->lot_number : '(not set)' }}</a>
+                                                <form url="/api/supplyOrder/updateLotNumber" right>
+                                                    <input type="hidden" name="uid" value="{{ $iSupplyOrder->uid }}">
+                                                    <div class="mb-2">
+                                                        <label class="text-secondary mb-1 text-sm">Lot # *</label>
+                                                        <input type="text" class="form-control form-control-sm" required
+                                                               name="lotNumber" value="{{ $iSupplyOrder->lot_number }}">
+                                                    </div>
+                                                    <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>
+                                                </form>
+                                            </div>
+                                        </td>
+                                        <td class="px-2">
+                                            <div moe relative>
+                                                <a start show class="py-0 text-danger">Remove</a>
+                                                <form url="/api/supplyOrder/removeFromShipment" right>
+                                                    <input type="hidden" name="uid" value="{{ $iSupplyOrder->uid }}">
+                                                    <p class="small">Remove this supply order?</p>
+                                                    <div class="d-flex align-items-center">
+                                                        <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                                    </div>
+                                                </form>
+                                            </div>
+                                        </td>
+                                    </tr>
+                                @endforeach
+                                </tbody>
+                            @else
+                                <tbody>
+                                <tr>
+                                    <td class="text-secondary px-3 py-2">No supply orders in this shipment yet</td>
+                                </tr>
+                                </tbody>
+                            @endif
+                        </table>
+                    </div>
+
+                    <div class="mb-2 d-flex align-items-baseline">
+                        <label class="text-secondary text-sm mb-0 width-90px mr-2">Ship Date</label>
+                        <div moe bottom relative class="d-block">
+                            <a start show>{{$shipment->ship_date ? friendlier_date($shipment->ship_date) : '(not set)'}}</a>
+                            <form url="/api/shipment/setShipDate">
+                                <input type="hidden" name="uid" value="{{ $shipment->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Ship Date *</label>
+                                    <input type="date" class="form-control form-control-sm" required
+                                           name="shipDate" value="{{$shipment->ship_date}}">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+                    </div>
+
+                    <div class="mb-2 d-flex align-items-baseline">
+                        <label class="text-secondary text-sm mb-0 width-90px mr-2">Courier</label>
+                        <div moe bottom relative class="d-block">
+                            <a start show>{{$shipment->courier ? $shipment->courier : '(not set)'}}</a>
+                            <form url="/api/shipment/setCourier">
+                                <input type="hidden" name="uid" value="{{ $shipment->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Courier</label>
+                                    <input type="text" class="form-control form-control-sm"
+                                           name="courier" value="{{$shipment->courier}}">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+                    </div>
+
+                    <div class="mb-2 d-flex align-items-baseline">
+                        <label class="text-secondary text-sm mb-0 width-90px mr-2">Label File</label>
+                        @if($shipment->label_system_file_id)
+                            <a class="pdf-viewer-trigger" native target="_blank"
+                               href="/api/shipment/downloadLabel/{{ $shipment->uid }}"
+                               title="View">
+                                <i class="fa fa-file-pdf text-danger on-hover-opaque"></i>
+                                View
+                                {{--{{ $shipment->labelFile->file_name }}--}}
+                            </a>
+                            <span class="mx-2 text-secondary">|</span>
+                        @endif
+                        <div moe bottom relative class="d-block">
+                            <a start show>Upload</a>
+                            <form url="/api/shipment/setLabelSystemFile">
+                                <input type="hidden" name="uid" value="{{ $shipment->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Label File</label>
+                                    <input type="file" class="form-control form-control-sm"
+                                           name="labelSystemFile">
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" submit>Upload</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    </div>
+
+                    <div class="mb-2 d-flex align-items-baseline">
+                        <label class="text-secondary text-sm mb-0 width-90px mr-2">Tracking #</label>
+                        <div moe bottom relative class="d-block">
+                            <a start show>{{$shipment->tracking_number ? $shipment->tracking_number : '(not set)'}}</a>
+                            <form url="/api/shipment/setTrackingNumber">
+                                <input type="hidden" name="uid" value="{{ $shipment->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Tracking #</label>
+                                    <input type="text" class="form-control form-control-sm"
+                                           name="trackingNumber" value="{{$shipment->tracking_number}}">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+                    </div>
+
+                    <div class="mb-2 d-flex align-items-baseline">
+                        <label class="text-secondary text-sm mb-0 width-90px mr-2">Status</label>
+                        <div moe bottom relative class="d-block">
+                            <a start show>{{$shipment->status ? $shipment->status : '(not set)'}}</a>
+                            <form url="/api/shipment/setStatus">
+                                <input type="hidden" name="uid" value="{{ $shipment->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Status *</label>
+                                    <select class="form-control form-control-sm"
+                                           name="status">
+                                        <option value=""> -- select -- </option>
+                                        <option value="CREATED" {{$shipment->status === 'CREATED' ? 'selected' : '' }} >Created</option>
+                                        <option value="SHIPPED" {{$shipment->status === 'SHIPPED' ? 'selected' : '' }} >Shipped</option>
+                                        <option value="DELIVERED" {{$shipment->status === 'DELIVERED' ? 'selected' : '' }} >Delivered</option>
+                                        <option value="RETURNED_TO_SENDER" {{$shipment->status === 'RETURNED_TO_SENDER' ? 'selected' : '' }} >Returned to sender</option>
+                                        <option value="CANCELLED" {{$shipment->status === 'CANCELLED' ? 'selected' : '' }} >Cancelled</option>
+                                    </select>
+                                </div>
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Memo</label>
+                                    <input type="text" class="form-control form-control-sm"
+                                           name="statusMemo" value="{{$shipment->status_memo}}">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+                    </div>
+
+                    @if($shipment->status === 'DELIVERED')
+                        <div class="mb-2 d-flex align-items-baseline">
+                            <label class="text-secondary text-sm mb-0 width-90px mr-2">Delivered Date</label>
+                            <div moe bottom relative class="d-block">
+                                <a start show>{{$shipment->delivered_date ? friendlier_date($shipment->delivered_date) : '(not set)'}}</a>
+                                <form url="/api/shipment/setDeliveredDate">
+                                    <input type="hidden" name="uid" value="{{ $shipment->uid }}">
+                                    <div class="mb-2">
+                                        <label class="text-secondary mb-1 text-sm">Delivered Date</label>
+                                        <input type="date" class="form-control form-control-sm"
+                                               name="deliveredDate" value="{{$shipment->delivered_date}}">
+                                    </div>
+                                    <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>
+                                </form>
+                            </div>
+                        </div>
+                    @endif
+
+                </div>
+            @endif
+
+        </div>
+    </div>
+@endsection

+ 318 - 0
resources/views/app/patient/supply-orders.blade.php

@@ -0,0 +1,318 @@
+@extends ('layouts.patient')
+@section('inner-content')
+    <div class="">
+        <div class="d-flex align-items-center pb-2">
+            <h4 class="font-weight-bold m-0">Supply Orders</h4>
+            <span class="mx-2 text-secondary">|</span>
+            <div moe>
+                <a start show href="#">Add</a>
+                <form url="/api/supplyOrder/create" redir="/patients/view/{{ $patient->uid }}/supply-orders/[data]">
+                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                    <label class="text-secondary font-weight-bold">Add Supply Order</label>
+                    <div class="mb-2">
+                        <label class="text-secondary text-sm">Product</label>
+                        <select name="productUid" class="form-control form-control-sm">
+                            <option value=""> --select--</option>
+                            @foreach($products as $product)
+                                <option
+                                    value="{{$product->uid}}">{{$product->title}}</option>
+                            @endforeach
+                        </select>
+                    </div>
+                    <div class="mb-2">
+                        <label class="text-secondary text-sm">Reason</label>
+                        <input type="text" class="form-control form-control-sm" name="reason">
+                    </div>
+                    <div class="mb-2">
+                        <label class="text-secondary text-sm">Client Understanding Memo</label>
+                        <input type="text" class="form-control form-control-sm" name="clientUnderstandingMemo">
+                    </div>
+                    <div class="d-flex align-items-center">
+                        <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                    </div>
+                </form>
+            </div>
+        </div>
+        <div class="d-flex align-items-start h-100">
+            <div class="flex-grow-1">
+                <table class="table table-sm table-bordered mb-0" style="table-layout: fixed">
+                    @if($patient->supplyOrders && count($patient->supplyOrders))
+                        <thead>
+                        <tr class="bg-light">
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Title</div></th>
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Reason</div></th>
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Created At</div></th>
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Pro Signed?</div></th>
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Cancelled?</div></th>
+                            <th class="px-2 text-nowrap text-secondary border-bottom-0"><div class="text-ellipsis">Shipment</div></th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @foreach($patient->supplyOrders as $iSupplyOrder)
+                            <tr class="{{@$supplyOrder && @$supplyOrder->uid === $iSupplyOrder->uid ? 'bg-aliceblue' : ''}}">
+                                <td class="px-2">
+                                    <a href="{{route('patients.view.supply-orders', ['patient' => $patient, 'supplyOrder' => $iSupplyOrder])}}">
+                                        {{ $iSupplyOrder->product->title }}
+                                    </a>
+                                </td>
+                                <td class="px-2">{{ $iSupplyOrder->reason }}</td>
+                                <td class="px-2">{{ friendlier_date_time($iSupplyOrder->created_at) }}</td>
+                                <td class="px-2">{{ $iSupplyOrder->is_signed_by_pro ? $iSupplyOrder->signedPro->displayName() : '-' }}</td>
+                                <td class="px-2">{{ $iSupplyOrder->is_cancelled ? 'Yes' : 'No' }}</td>
+                                <td class="px-2">
+                                    @if($iSupplyOrder->shipment_id)
+                                        <i class="fa fa-building"></i>
+                                        {{$iSupplyOrder->shipment->status ? $iSupplyOrder->shipment->status : 'CREATED'}}
+                                    @elseif($iSupplyOrder->is_cleared_for_shipment)
+                                        <span class="text-info">
+                                            <i class="fa fa-user-nurse"></i>
+                                            Cleared for shipment
+                                        </span>
+                                    @else
+                                        <span class="text-warning-mellow">
+                                            <i class="fa fa-user-nurse"></i>
+                                            Not cleared for shipment
+                                        </span>
+                                    @endif
+                                </td>
+                            </tr>
+                        @endforeach
+                        </tbody>
+                    @else
+                        <tbody>
+                        <tr>
+                            <td class="text-secondary p-3">No supply orders have been created for this patient</td>
+                        </tr>
+                        </tbody>
+                    @endif
+                </table>
+            </div>
+            @if($supplyOrder)
+                <div class="min-width-500px ml-2 border align-self-stretch p-3">
+                    <div class="d-flex align-items-center">
+                        <h3 class="font-size-16 m-0">{{$supplyOrder->product->title}}</h3>
+                        <a class="ml-auto" href="{{route('patients.view.supply-orders', ['patient' => $patient])}}">
+                            <i class="fa fa-times-circle on-hover-opaque"></i>
+                        </a>
+                    </div>
+                    <hr class="my-3">
+                    <div class="mb-3">
+                        <label class="text-secondary text-sm mb-1">Reason</label>
+                        <div moe class="d-block">
+                            <a start show>{{$supplyOrder->reason ? $supplyOrder->reason : '(not set)'}}</a>
+                            <form url="/api/supplyOrder/updateReason">
+                                <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Reason *</label>
+                                    <input type="text" class="form-control form-control-sm" required
+                                           name="reason" value="{{$supplyOrder->reason}}">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+                    </div>
+                    <div class="mb-3">
+                        <label class="text-secondary text-sm mb-1">Requested Ship Date</label>
+                        <div moe class="d-block">
+                            <a start show>{{$supplyOrder->requested_date ? friendlier_date_time($supplyOrder->requested_date) : '(not set)'}}</a>
+                            <form url="/api/supplyOrder/updateRequestedDate">
+                                <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Requested Ship Date</label>
+                                    <input type="date" class="form-control form-control-sm"
+                                           name="requestedDate" value="">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+                    </div>
+                    <div class="mb-3">
+                        <label class="text-secondary text-sm mb-1">Client Understanding Memo</label>
+                        <div moe class="d-block">
+                            @if($supplyOrder->client_understanding_memo)
+                                <a start show>{{$supplyOrder->client_understanding_memo}}</a>
+                            @else
+                                <a start show>(not set)</a>
+                            @endif
+                            <form url="/api/supplyOrder/updateClientUnderstandingMemo">
+                                <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                <div class="mb-2">
+                                    <label class="text-secondary mb-1 text-sm">Client Understanding Memo</label>
+                                    <input type="text" class="form-control form-control-sm"
+                                           name="clientUnderstandingMemo" value="{{$supplyOrder->client_understanding_memo}}">
+                                </div>
+                                <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>
+                            </form>
+                        </div>
+
+                    </div>
+                    <div class="mb-3">
+                        <label class="text-secondary text-sm mb-1">Pro Signature</label>
+                        <div class="d-flex align-items-center">
+                            @if($supplyOrder->is_signed_by_pro)
+                                <div class="text-info">
+                                    Signed by <b>{{$supplyOrder->signedPro->displayName()}}</b>
+                                    on {{friendlier_date_time($supplyOrder->pro_signed_at)}}
+                                </div>
+                            @else
+                                <div class="text-warning-mellow font-weight-bold">Not Signed</div>
+                                <div class="ml-3">
+                                    <div moe>
+                                        <a start show class="py-0">Sign</a>
+                                        <form url="/api/supplyOrder/signAsPro">
+                                            <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                            <p class="small">Sign this supply order?</p>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-success mr-2" submit>Sign</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </div>
+                            @endif
+                        </div>
+                    </div>
+                    <div class="mb-3">
+                        <label class="text-secondary text-sm mb-1">Patient Signature</label>
+                        <div class="d-flex align-items-center">
+                            @if($supplyOrder->is_signed_by_client)
+                                <div class="text-info">
+                                    Signed by <b>{{$patient->displayName()}}</b>
+                                    on {{friendlier_date_time($supplyOrder->client_signed_at)}}
+                                </div>
+                            @elseif($supplyOrder->is_client_signature_waived)
+                                <div class="text-info">
+                                    Waived by <b>{{$supplyOrder->waiverPro->displayName()}}</b>
+                                    on {{friendlier_date_time($supplyOrder->client_signature_waived_at)}}
+                                </div>
+                                <div class="ml-3">
+                                    <div moe bottom relative="">
+                                        <a start show class="py-0">Undo</a>
+                                        <form url="/api/supplyOrder/undoWaiveClientSignature" right>
+                                            <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                            <p class="small">Undo waiving patient signature?</p>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-primary mr-2" submit>Yes</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>No</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </div>
+                            @else
+                                <div class="text-warning-mellow font-weight-bold">Not Signed</div>
+                                <div class="ml-3">
+                                    <div moe bottom relative="">
+                                        <a start show class="py-0">Email</a>
+                                        <form url="/api/supplyOrder/sendClientSignatureRequestByEmail">
+                                            <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                            <p class="small">Request patient signature via email?</p>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </div>
+                                <span class="mx-2 text-secondary">|</span>
+                                <div class="">
+                                    <div moe bottom relative="">
+                                        <a start show class="py-0">SMS</a>
+                                        <form url="/api/supplyOrder/sendClientSignatureRequestBySms">
+                                            <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                            <p class="small">Request patient signature via SMS?</p>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </div>
+                                <span class="mx-2 text-secondary">|</span>
+                                <div class="">
+                                    <a href="#" class="text-secondary on-hover-opaque">Problem Signing</a>
+                                </div>
+                                <span class="mx-2 text-secondary">|</span>
+                                <div class="">
+                                    <div moe bottom relative="">
+                                        <a start show class="py-0">Waive</a>
+                                        <form url="/api/supplyOrder/waiveClientSignature" right>
+                                            <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                            <p class="small mb-2">Waive patient signature?</p>
+                                            <div class="mb-2">
+                                                <label class="text-secondary mb-1 text-sm">Memo</label>
+                                                <input type="text" class="form-control form-control-sm"
+                                                       name="memo" value="{{$supplyOrder->client_signature_waiver_memo}}">
+                                            </div>
+                                            <div class="d-flex align-items-center">
+                                                <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                                                <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                            </div>
+                                        </form>
+                                    </div>
+                                </div>
+                            @endif
+                        </div>
+                        @if($supplyOrder->client_signature_last_requested_at &&
+                            !$supplyOrder->is_signed_by_client &&
+                            !$supplyOrder->is_client_signature_waived)
+                            <div class="text-sm my-1 text-info">Client signature last requested on {{friendlier_date_time($iSupplyOrder->client_signature_last_requested_at)}}</div>
+                        @endif
+                        @if($supplyOrder->does_client_have_problem_signing &&
+                            !$supplyOrder->is_signed_by_client &&
+                            !$supplyOrder->is_client_signature_waived)
+                            <div class="text-sm my-1 text-warning-mellow">
+                                Client has problem signing
+                                @if($supplyOrder->client_problem_signing)
+                                    <i class="text-sm">{{$supplyOrder->client_problem_signing}}</i></div>
+                                @endif
+                            </div>
+                        @endif
+                    </div>
+                    <hr class="my-3">
+                    <div class="d-flex align-items-center">
+                        @if($supplyOrder->is_cleared_for_shipment)
+                            <div class="text-info mb-2">
+                                <i class="fa fa-check"></i> Cleared for shipment by <b>{{$supplyOrder->clearedForShipmentPro->displayName()}}</b>
+                                on {{friendlier_date_time($supplyOrder->cleared_for_shipment_at)}}
+                            </div>
+                        @elseif($supplyOrder->is_signed_by_pro && ($supplyOrder->is_signed_by_client || $supplyOrder->is_client_signature_waived))
+                            <div moe bottom relative="" class="mb-2">
+                                <a start show class="py-0 text-success font-weight-bold">Clear for Shipment</a>
+                                <form url="/api/supplyOrder/clearForShipment">
+                                    <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                    <p class="small mb-2">Clear this supply order for shipment?</p>
+                                    <div class="d-flex align-items-center">
+                                        <button class="btn btn-sm btn-primary mr-2" submit>Submit</button>
+                                        <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                    </div>
+                                </form>
+                            </div>
+                        @endif
+                    </div>
+                    <div class="d-flex align-items-center">
+                        <div moe bottom relative="">
+                            <a start show class="py-0 text-danger">Cancel Supply Order</a>
+                            <form url="/api/supplyOrder/cancel">
+                                <input type="hidden" name="uid" value="{{ $supplyOrder->uid }}">
+                                <p class="small text-nowrap mb-2">Cancel this supply order?</p>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" submit>Yes</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel>No</button>
+                                </div>
+                            </form>
+                        </div>
+                    </div>
+                </div>
+            @endif
+        </div>
+    </div>
+@endsection

+ 0 - 4
resources/views/app/patient/tickets.blade.php

@@ -60,7 +60,6 @@
                 <option value="erx" {{$type === 'erx' ? 'selected' : ''}}>ERx</option>
                 <option value="lab" {{$type === 'lab' ? 'selected' : ''}}>Lab Orders</option>
                 <option value="imaging" {{$type === 'imaging' ? 'selected' : ''}}>Imaging Orders</option>
-                <option value="equipment" {{$type === 'equipment' ? 'selected' : ''}}>Equipment Orders</option>
             </select>
             <select class="ml-2 max-width-200px form-control form-control-sm pr-2"
                     v-model="statusFilter">
@@ -79,9 +78,6 @@
         @if($type === '' || $type === 'imaging')
             @include('app.patient.tickets.imaging')
         @endif
-        @if($type === '' || $type === 'equipment')
-            @include('app.patient.tickets.equipment')
-        @endif
 
         @include('app.patient.tickets.ticket_send_fax_form')
     </div>

+ 19 - 28
resources/views/app/patient/vitals-graph.blade.php

@@ -46,7 +46,11 @@
         $nextDay = date_format(date_add(date_create($nextDay), date_interval_create_from_date_string('1 day')), 'Y-m-d');
     }
 
-    $allMeasurements = $patient->nonZeroMeasurements->toArray();
+    /** @var \App\Models\Client $patient */
+
+    // BP
+    $bpMeasurements = $patient->getNonZeroBpMeasurements->toArray();
+    $weightMeasurements = $patient->getNonZeroWeightMeasurements->toArray();
 
     $bpData = [];
     $weightData = [];
@@ -55,43 +59,30 @@
 
         $date = $dates[$i];
 
-        // sbp
-        $sbp = array_filter($allMeasurements, function($_measurement) use ($date) {
-            return $_measurement['label'] === 'SBP' && $_measurement['effective_date'] === $date;
+        // bp
+        $bp = array_filter($bpMeasurements, function($_measurement) use ($date) {
+            return $_measurement['effective_date'] === $date;
         });
-        if(count($sbp)) {
-            $sbp = array_values($sbp);
-            $sbp = $sbp[count($sbp) - 1];
+        if(count($bp)) {
+            $bp = array_values($bp);
+            $bp = $bp[count($bp) - 1];
         }
         else {
-            $sbp = null;
-        }
-        // dbp
-        $dbp = null;
-        if($sbp) {
-            $dbp = array_filter($allMeasurements, function($_measurement) use ($date) {
-                $measurementDate = date('Y-m-d', strtotime($_measurement['effective_date']));
-                return $_measurement['label'] === 'DBP' && $measurementDate === $date;
-            });
-            if(count($dbp)) {
-                $dbp = array_values($dbp);
-                $dbp = $dbp[count($dbp) - 1];
-            }
-            else {
-                $dbp = null;
-            }
+            $bp = null;
         }
-        if ($sbp && $dbp) {
+
+
+        if ($bp) {
             $bpData[] = [
                 "date" => $date,
-                "sbp" => $sbp["numeric_value"],
-                "dbp" => $dbp["numeric_value"]
+                "sbp" => $bp["sbp_mm_hg"],
+                "dbp" => $bp["dbp_mm_hg"]
             ];
         }
 
         // weight
-        $weight = array_filter($allMeasurements, function($_measurement) use ($date) {
-            return $_measurement['label'] === 'Wt. (lbs.)' && $_measurement['effective_date'] === $date && !!$_measurement['numeric_value'];
+        $weight = array_filter($weightMeasurements, function($_measurement) use ($date) {
+            return $_measurement['effective_date'] === $date;
         });
         if(count($weight)) {
             $weight = array_values($weight);

+ 176 - 0
resources/views/app/practice-management/shipments.blade.php

@@ -0,0 +1,176 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div id="practice-shipments" 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-injured"></i>
+                Shipments
+            </strong>
+            <a href="/practice-management/shipments" class="ml-auto">Clear Filters</a>
+        </div>
+        <div class="card-body p-0">
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Client</th>
+                    <th class="border-0 w-25">Supply Orders</th>
+                    <th class="border-0">Courier</th>
+                    <th class="border-0">Tracking #</th>
+                    <th class="border-0">Label File</th>
+                    <th class="border-0">Status</th>
+                    <th class="border-0">Created At</th>
+                    <th class="border-0">Cancelled?</th>
+                </tr>
+                <tr>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="client">
+                            <option value="">All</option>
+                            @foreach($shClients as $shClient)
+                                <option value="{{$shClient->id}}"
+                                    {{$filters['client'] == $shClient->id ? 'selected' : ''}}>{{$shClient->displayName()}}</option>
+                            @endforeach
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right"></th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                               data-filter="courier"
+                               value="{{$filters['courier']}}" placeholder="Any">
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                               data-filter="tracking_num"
+                               value="{{$filters['tracking_num']}}" placeholder="Any">
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right"></th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="status">
+                            <option value="">All</option>
+                            <option {{$filters['status'] == 'CREATED' ? 'selected' : ''}} value="CREATED">Created</option>
+                            <option {{$filters['status'] == 'SHIPPED' ? 'selected' : ''}} value="SHIPPED">Shipped</option>
+                            <option {{$filters['status'] == 'DELIVERED' ? 'selected' : ''}} value="DELIVERED">Delivered</option>
+                            <option {{$filters['status'] == 'RETURNED_TO_SENDER' ? 'selected' : ''}} value="RETURNED_TO_SENDER">Returned to Sender</option>
+                            <option {{$filters['status'] == 'CANCELLED' ? 'selected' : ''}} value="CANCELLED">Cancelled</option>
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right"></th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="cancelled">
+                            <option value="">All</option>
+                            <option {{$filters['cancelled'] == 'not_cancelled' ? 'selected' : ''}} value="not_cancelled">Not Cancelled</option>
+                            <option {{$filters['cancelled'] == 'cancelled' ? 'selected' : ''}} value="cancelled">Cancelled</option>
+                        </select>
+                    </th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach ($shipments as $shipment)
+                    <tr class="{{$shipment->is_cancelled ? 'bg-light' : ''}}">
+                        <td>{{$shipment->client->displayName()}}</a></td>
+                        <td>
+                            @if($shipment->supplyOrders && count($shipment->supplyOrders))
+                                <table class="table table-sm table-striped table-bordered mb-0 bg-white">
+                                    <thead>
+                                    <tr class="">
+                                        <th class="text-nowrap text-secondary border-bottom-0">Supply Order</th>
+                                        <th class="text-nowrap text-secondary border-bottom-0">IMEI</th>
+                                        <th class="text-nowrap text-secondary border-bottom-0">Lot #</th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+                                    @foreach($shipment->supplyOrders as $iSupplyOrder)
+                                        <tr class="">
+                                            <td class="">{{ $iSupplyOrder->product->title }}</td>
+                                            <td class="">{{ $iSupplyOrder->imei }}</td>
+                                            <td class="">{{ $iSupplyOrder->lot_number }}</td>
+                                        </tr>
+                                    @endforeach
+                                    </tbody>
+                                </table>
+                            @else
+                                None
+                            @endif
+                        </td>
+                        <td>{{$shipment->courier}}</td>
+                        <td>{{$shipment->tracking_number}}</td>
+                        <td>
+                            @if($shipment->label_system_file_id)
+                            <a class="pdf-viewer-trigger" native="" target="_blank"
+                               href="/api/shipment/downloadLabel/{{$shipment->uid}}" title="View">
+                                <i class="fa fa-file-pdf text-danger on-hover-opaque"></i>
+                                View
+                            </a>
+                            @endif
+                        </td>
+                        <td>
+                            {{$shipment->status}}
+                            @if($shipment->status === 'DELIVERED' && $shipment->delivered_date)
+                                <div class="text-secondary text-sm mt-1">
+                                    on {{friendlier_date_time($shipment->delivered_date)}}
+                                </div>
+                            @endif
+                        </td>
+                        <td>
+                            {{friendlier_date_time($shipment->created_at)}}
+                            <div class="text-secondary text-sm mt-1">
+                                By {{$shipment->createdSession->pro->displayName()}}
+                            </div>
+                        </td>
+                        <td>{!! $shipment->is_cancelled ? '<b class="text-warning-mellow">Yes</b>' : 'No' !!}</td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+            <div>
+                {{$shipments->links()}}
+            </div>
+        </div>
+    </div>
+    </div>
+
+    <script>
+        (function() {
+
+            function applyFilters() {
+                let params = {}, queryLine = [];
+                $('[data-filter]').each(function() {
+                    if($.trim($(this).val())) {
+                        params[$(this).attr('data-filter')] = $.trim($(this).val());
+                    }
+                });
+                for(let x in params) {
+                    if(params.hasOwnProperty(x)) {
+                        queryLine.push(x + '=' + encodeURIComponent(params[x]));
+                    }
+                }
+                queryLine = queryLine.join('&');
+
+                fastLoad('/practice-management/shipments?' + queryLine);
+            }
+
+            function init() {
+                $('select[data-filter]')
+                    .off('change')
+                    .on('change', applyFilters);
+                $('input[data-filter]')
+                    .off('keyup')
+                    .on('keyup', function(_event) {
+                        if(_event.which === 13) {
+                            applyFilters();
+                            return false;
+                        }
+                    });
+            }
+
+            addMCInitializer('practice-shipments', init, '#practice-shipments')
+
+        }).call(window);
+    </script>
+@endsection

+ 233 - 0
resources/views/app/practice-management/supply-orders.blade.php

@@ -0,0 +1,233 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div id="practice-supply-orders" 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-injured"></i>
+                Supply Orders
+            </strong>
+            <a href="/practice-management/supply-orders" class="ml-auto">Clear Filters</a>
+        </div>
+        <div class="card-body p-0">
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="border-0">Client</th>
+                    <th class="border-0">Product</th>
+                    <th class="border-0">Reason</th>
+                    <th class="border-0">Client Understanding Memo</th>
+                    <th class="border-0">Pro Sign</th>
+                    <th class="border-0">Client Sign</th>
+                    <th class="border-0">Shipment</th>
+                    <th class="border-0">Lot #</th>
+                    <th class="border-0">IMEI</th>
+                    <th class="border-0">Created At</th>
+                    <th class="border-0">Cancelled?</th>
+                </tr>
+                <tr>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="client">
+                            <option value="">All</option>
+                            @foreach($soClients as $soClient)
+                                <option value="{{$soClient->id}}"
+                                    {{$filters['client'] == $soClient->id ? 'selected' : ''}}>{{$soClient->displayName()}}</option>
+                            @endforeach
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="product">
+                            <option value="">All</option>
+                            @foreach($soProducts as $soProduct)
+                                <option value="{{$soProduct->id}}"
+                                    {{$filters['product'] == $soProduct->id ? 'selected' : ''}}>{{$soProduct->title}}</option>
+                            @endforeach
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                               data-filter="reason"
+                               value="{{$filters['reason']}}" placeholder="Any">
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                               data-filter="cu_memo"
+                               value="{{$filters['cu_memo']}}" placeholder="Any">
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="pro_sign">
+                            <option value="">All</option>
+                            <option {{$filters['pro_sign'] == 'not_signed' ? 'selected' : ''}} value="not_signed">Not Signed</option>
+                            <option {{$filters['pro_sign'] == 'signed' ? 'selected' : ''}} value="signed">Signed</option>
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="client_sign">
+                            <option value="">All</option>
+                            <option {{$filters['client_sign'] == 'not_signed' ? 'selected' : ''}} value="not_signed">Not Signed</option>
+                            <option {{$filters['client_sign'] == 'signed' ? 'selected' : ''}} value="signed">Signed</option>
+                            <option {{$filters['client_sign'] == 'waived' ? 'selected' : ''}} value="waived">Waived</option>
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="shipment">
+                            <option value="">All</option>
+                            <optgroup label="Pro">
+                                <option {{$filters['shipment'] == 'not_cleared_for_shipment' ? 'selected' : ''}} value="not_cleared_for_shipment">Not Cleared for Shipment</option>
+                                <option {{$filters['shipment'] == 'cleared_for_shipment' ? 'selected' : ''}} value="cleared_for_shipment">Cleared for Shipment</option>
+                            </optgroup>
+                            <optgroup label="Warehouse">
+                                <option {{$filters['shipment'] == 'CREATED' ? 'selected' : ''}} value="CREATED">Created</option>
+                                <option {{$filters['shipment'] == 'SHIPPED' ? 'selected' : ''}} value="SHIPPED">Shipped</option>
+                                <option {{$filters['shipment'] == 'DELIVERED' ? 'selected' : ''}} value="DELIVERED">Delivered</option>
+                                <option {{$filters['shipment'] == 'RETURNED_TO_SENDER' ? 'selected' : ''}} value="RETURNED_TO_SENDER">Returned to Sender</option>
+                                <option {{$filters['shipment'] == 'CANCELLED' ? 'selected' : ''}} value="CANCELLED">Cancelled</option>
+                            </optgroup>
+                        </select>
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                               data-filter="lot_number"
+                               value="{{$filters['lot_number']}}" placeholder="Any">
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <input type="text" class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                               data-filter="imei"
+                               value="{{$filters['imei']}}" placeholder="Any">
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+
+                    </th>
+                    <th class="p-0 border-bottom-0 border-right">
+                        <select class="form-control form-control-sm bg-aliceblue min-width-unset rounded-0 shadow-none border-0"
+                                data-filter="cancelled">
+                            <option value="">All</option>
+                            <option {{$filters['cancelled'] == 'not_cancelled' ? 'selected' : ''}} value="not_cancelled">Not Cancelled</option>
+                            <option {{$filters['cancelled'] == 'cancelled' ? 'selected' : ''}} value="cancelled">Cancelled</option>
+                        </select>
+                    </th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach ($supplyOrders as $supplyOrder)
+                    <tr class="{{$supplyOrder->is_cancelled ? 'bg-light' : ''}}">
+                        <td>{{$supplyOrder->client->displayName()}}</a></td>
+                        <td>{{$supplyOrder->product->title}}</td>
+                        <td>{{$supplyOrder->reason}}</td>
+                        <td>{{$supplyOrder->client_understanding_memo}}</td>
+                        <td>
+                            @if($supplyOrder->is_signed_by_pro)
+                                <b>Signed</b>
+                                <div class="text-secondary text-sm mt-1">
+                                    By {{$supplyOrder->signedPro->displayName()}}<br>
+                                    {{friendlier_date_time($supplyOrder->pro_signed_at)}}
+                                </div>
+                            @else
+                                Not Signed
+                            @endif
+                        </td>
+                        <td>
+                            @if($supplyOrder->is_signed_by_client)
+                                <b>Signed</b>
+                                <div class="text-secondary text-sm mt-1">
+                                    By {{$patient->displayName()}}<br>
+                                    On {{friendlier_date_time($supplyOrder->client_signed_at)}}
+                                </div>
+                            @elseif($supplyOrder->is_client_signature_waived)
+                                <b>Waived</b>
+                                <div class="text-secondary text-sm mt-1">
+                                    By {{$supplyOrder->waiverPro->displayName()}}<br>
+                                    on {{friendlier_date_time($supplyOrder->client_signature_waived_at)}}
+                                </div>
+                            @else
+                                Not Signed
+                            @endif
+                        </td>
+                        <td>
+                            @if($supplyOrder->shipment_id)
+                                <i class="fa fa-building"></i>
+                                {{$supplyOrder->shipment->status}}
+                                @if($supplyOrder->shipment && $supplyOrder->shipment->status === 'DELIVERED' && $supplyOrder->shipment->delivered_date)
+                                    <div class="text-secondary text-sm mt-1">
+                                    on {{friendlier_date_time($supplyOrder->shipment->delivered_date)}}
+                                    </div>
+                                @endif
+                            @elseif($supplyOrder->is_cleared_for_shipment)
+                                <i class="fa fa-user-nurse"></i>
+                                Cleared for shipment
+                                <div class="text-secondary text-sm mt-1">
+                                    By {{$supplyOrder->clearedForShipmentPro->displayName()}}<br>
+                                    on {{friendlier_date_time($supplyOrder->cleared_for_shipment_at)}}
+                                </div>
+                            @else
+                                <i class="fa fa-user-nurse"></i>
+                                Not cleared for shipment
+                            @endif
+                        </td>
+                        <td>{{$supplyOrder->lot_number}}</td>
+                        <td>{{$supplyOrder->imei}}</td>
+                        <td>
+                            {{friendlier_date_time($supplyOrder->created_at)}}
+                            <div class="text-secondary text-sm mt-1">
+                                By {{$supplyOrder->createdSession->pro->displayName()}}
+                            </div>
+                        </td>
+                        <td>{!! $supplyOrder->is_cancelled ? '<b class="text-warning-mellow">Yes</b>' : 'No' !!}</td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+            <div>
+                {{$supplyOrders->links()}}
+            </div>
+        </div>
+    </div>
+    </div>
+
+    <script>
+        (function() {
+
+            function applyFilters() {
+                let params = {}, queryLine = [];
+                $('[data-filter]').each(function() {
+                    if($.trim($(this).val())) {
+                        params[$(this).attr('data-filter')] = $.trim($(this).val());
+                    }
+                });
+                for(let x in params) {
+                    if(params.hasOwnProperty(x)) {
+                        queryLine.push(x + '=' + encodeURIComponent(params[x]));
+                    }
+                }
+                queryLine = queryLine.join('&');
+
+                fastLoad('/practice-management/supply-orders?' + queryLine);
+            }
+
+            function init() {
+                $('select[data-filter]')
+                    .off('change')
+                    .on('change', applyFilters);
+                $('input[data-filter]')
+                    .off('keyup')
+                    .on('keyup', function(_event) {
+                        if(_event.which === 13) {
+                            applyFilters();
+                            return false;
+                        }
+                    });
+            }
+
+            addMCInitializer('practice-supply-orders', init, '#practice-supply-orders')
+
+        }).call(window);
+    </script>
+@endsection

+ 2 - 1
resources/views/app/video/call-minimal.blade.php

@@ -277,7 +277,8 @@
                 );
 
                 // refresh to non-client page
-                window.location.href = '/pro/meet/';
+                // window.location.href = '{{ config('app.url') }}/pro/meet/';
+                window.location.reload()
 
             },
 

+ 2 - 1
resources/views/app/video/check-video-minimal.blade.php

@@ -280,7 +280,8 @@
                 );
 
                 // refresh to non-client page
-                window.location.href = '/pro/meet/';
+                // window.location.href = '/pro/meet/';
+                window.location.reload()
 
             },
 

+ 10 - 4
resources/views/layouts/patient.blade.php

@@ -101,12 +101,16 @@
                                     <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'imaging' ? 'active' : '' }}"
                                        href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'imaging']) }}">Imaging</a>
                                 </li>
-                                <li class="nav-item">
-                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === 'equipment' ? 'active' : '' }}"
-                                       href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => 'equipment']) }}">Equipment</a>
-                                </li>
                             </ul>
                         </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.supply-orders') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.supply-orders', ['patient' => $patient]) }}">Supply Orders</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.shipments') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.shipments', ['patient' => $patient]) }}">Shipments</a>
+                        </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.incoming-reports') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.incoming-reports', ['patient' => $patient]) }}">Incoming Reports</a>
@@ -610,9 +614,11 @@
                                         </div>
                                     </section>
                                     <section class="vbox mt-2 align-self-start ml-1">
+                                        @if($performer->pro->pro_type == 'ADMIN')
                                         <div>
                                             <button class="col-2-button" onclick="return openInRHS('/pro/check-video/{{ $patient->uid }}')">Check Video</button>
                                         </div>
+                                        @endif
                                         <div>
                                             <button class="col-2-button" onclick="return openInRHS('/pro/meet/{{ $patient->uid }}')">Join Video</button>
                                         </div>

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

@@ -123,7 +123,9 @@
                             <a class="dropdown-item" href="{{ route('practice-management.claims') }}">Claims</a>
                             <a class="dropdown-item" href="{{ route('practice-management.hcpBillMatrix') }}">HCP Bill Matrix</a>
                             <a class="dropdown-item" href="{{ route('practice-management.treatmentServiceUtil') }}">Treatment Service Util.</a>
-                            <a class="dropdown-item" href="/practice-management/tickets">Tickets</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.tickets') }}">Tickets</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.supply-orders') }}">Supply Orders</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.shipments') }}">Shipments</a>
                         @endif
                     </div>
                 </li>

+ 8 - 0
routes/web.php

@@ -107,6 +107,9 @@ Route::middleware('pro.auth')->group(function () {
 
             Route::get('treatment-service-util', 'PracticeManagementController@treatmentServiceUtil')->name('treatmentServiceUtil');
 
+            Route::get('supply-orders', 'PracticeManagementController@supplyOrders')->name('supply-orders');
+            Route::get('shipments', 'PracticeManagementController@shipments')->name('shipments');
+
         });
     });
 
@@ -180,6 +183,11 @@ Route::middleware('pro.auth')->group(function () {
 
         // appointments
         Route::get('appointments/{forPro}/{status}', 'PatientController@appointments')->name('appointments');
+
+        Route::get('supply-orders/{supplyOrder?}', 'PatientController@supplyOrders')->name('supply-orders');
+        Route::get('shipments/{shipment?}', 'PatientController@shipments')->name('shipments');
+
+
     });
 
     // pro dashboard events (ajax)