6 Commits 53aec769ee ... bbcbc7ff07

Autore SHA1 Messaggio Data
  = bbcbc7ff07 merged with rpm report fix 1 mese fa
  = 1d855ea909 fixed chat 1 mese fa
  = d248719e75 Merge branch 'rpm-report-fix' of https://rav.triplestart.com/tigerphp/stagfe2 into rpm-report-fix 1 mese fa
  = af07462c4d styling 1 mese fa
  Samson Mutunga 087dd78592 Hide nav 1 mese fa
  = bfa50ddf98 fixed tree scrolling 1 mese fa

+ 0 - 0
app/Helpers/grata.http


+ 20 - 0
app/Models/CareMonth.php

@@ -49,6 +49,15 @@ class CareMonth extends Model
             ->get();
             ->get();
     }
     }
 
 
+    public function entriesByProForCareMonth($_proId, $_careMonthId) {
+        return CareMonthEntry::where('care_month_id', $this->id)
+            ->where('pro_id', $_proId)
+            ->where('care_month_id', $_careMonthId)
+            ->where('cm_or_rm_or_rtm_msk_or_rtm_lung', 'RM')
+            ->orderBy('effective_date', 'DESC')
+            ->get();
+    }
+
     public function entriesNotByPro($_proId) {
     public function entriesNotByPro($_proId) {
         return CareMonthEntry::where('care_month_id', $this->id)
         return CareMonthEntry::where('care_month_id', $this->id)
             ->where('pro_id', '!=', $_proId)
             ->where('pro_id', '!=', $_proId)
@@ -135,6 +144,11 @@ class CareMonth extends Model
             ->where('status', '<>', 'CANCELLED');
             ->where('status', '<>', 'CANCELLED');
     }
     }
 
 
+    public function mcpPro()
+    {
+        return $this->hasOne(Pro::class, 'id', 'mcp_pro_id');
+    }
+
     public function mostRecentMcpNote()
     public function mostRecentMcpNote()
     {
     {
         return $this->hasOne(Note::class, 'id', 'most_recent_mcp_note_id');
         return $this->hasOne(Note::class, 'id', 'most_recent_mcp_note_id');
@@ -145,8 +159,14 @@ class CareMonth extends Model
         return $this->hasOne(Note::class, 'id', 'note_id');
         return $this->hasOne(Note::class, 'id', 'note_id');
     }
     }
 
 
+    public function mcpInteractionNote()
+    {
+        return $this->hasOne(Note::class, 'id', 'mcp_rm_interaction_note_id');
+    }
+
     public function mcpRmGenericBill()
     public function mcpRmGenericBill()
     {
     {
+
         return $this->hasOne(Bill::class, 'id', 'mcp_rm_generic_bill_id')->where('is_cancelled', false)->where('is_cancelled_by_administrator', false);
         return $this->hasOne(Bill::class, 'id', 'mcp_rm_generic_bill_id')->where('is_cancelled', false)->where('is_cancelled_by_administrator', false);
     }
     }
     public function rmmRmGenericBill()
     public function rmmRmGenericBill()

+ 4 - 0
app/Models/CompanyLocation.php

@@ -13,4 +13,8 @@ class CompanyLocation extends Model
         return implode(" ", [$this->line1, $this->city, $this->state]);
         return implode(" ", [$this->line1, $this->city, $this->state]);
     }
     }
 
 
+    public function format(){
+        return $this->line1.($this->line2? ', '.$this->line2: '').($this->city?', '.$this->city:'').($this->state?', '.$this->state:'').($this->zip? ' '.$this->zip:'');
+    }
+
 }
 }

+ 4 - 0
app/Providers/RouteServiceProvider.php

@@ -33,6 +33,10 @@ class RouteServiceProvider extends ServiceProvider
         //
         //
 
 
         parent::boot();
         parent::boot();
+        if (config('app.env') !== 'local') {
+           // \URL::forceScheme('http');
+        }
+
     }
     }
 
 
     /**
     /**

+ 155 - 0
resources/views/app/patient/care-month/partials/print/chart.blade.php

@@ -0,0 +1,155 @@
+
+<link href="/c3/c3.min.css" rel="stylesheet">
+<script src="/c3/d3.v5.min.js" charset="utf-8"></script>
+<script src="/c3/c3.min.js"></script>
+
+<div id="vitalsGraphComponentUnified_{{$careMonth->id}}{{@$suffix ?: ''}}" class="stag-chart mb-4 pt-3">
+    <div id="unified-chart_{{$careMonth->id}}{{@$suffix ?: ''}}"></div>
+</div>
+
+<?php
+$dates = [];
+$startDate = $careMonth->start_date;
+$nextMonthFirstDay = date_format(date_add(date_create($startDate), date_interval_create_from_date_string("1 month")), 'Y-m-d');
+
+$nextDay = $startDate;
+while ($nextDay !== $nextMonthFirstDay) {
+    $dates[] = $nextDay;
+    $nextDay = date_format(date_add(date_create($nextDay), date_interval_create_from_date_string('1 day')), 'Y-m-d');
+}
+
+/** @var \App\Models\Client $patient */
+
+// BP
+$bpMeasurements = $patient->getNonZeroBpMeasurements->toArray();
+$weightMeasurements = $patient->getNonZeroWeightMeasurements->toArray();
+
+$bpData = [];
+$weightData = [];
+
+for ($i=0; $i<count($dates); $i++) {
+
+    $date = $dates[$i];
+
+    // bp
+    $bp = array_filter($bpMeasurements, function($_measurement) use ($date) {
+        return $_measurement['effective_date'] === $date;
+    });
+    if(count($bp)) {
+        $bp = array_values($bp);
+        $bp = $bp[count($bp) - 1];
+    }
+    else {
+        $bp = null;
+    }
+
+
+    if ($bp) {
+        $bpData[] = [
+            "date" => $date,
+            "sbp" => $bp["sbp_mm_hg"],
+            "dbp" => $bp["dbp_mm_hg"]
+        ];
+    }
+
+    // weight
+    $weight = array_filter($weightMeasurements, function($_measurement) use ($date) {
+        return $_measurement['effective_date'] === $date;
+    });
+    if(count($weight)) {
+        $weight = array_values($weight);
+        $weight = $weight[count($weight) - 1];
+        $weightData[] = [
+            "date" => $date,
+            "weight" => $weight["numeric_value"]
+        ];
+    }
+
+}
+
+$bpDates = [];
+$sbpValues = [];
+$dbpValues = [];
+for ($i = 0; $i < count($bpData); $i++) {
+    $bpDates[] = $bpData[$i]['date'];
+    $sbpValues[] = round($bpData[$i]['sbp'], 1);
+    $dbpValues[] = round($bpData[$i]['dbp'], 1);
+}
+
+$weightDates = [];
+$weightValues = [];
+for ($i = 0; $i < count($weightData); $i++) {
+    $weightDates[] = $weightData[$i]['date'];
+    $weightValues[] = round($weightData[$i]['weight'], 1);
+}
+
+?>
+
+<script>
+    (function() {
+        init();
+        function init() {
+            unifiedChart();
+        }
+        function unifiedChart() {
+            $('#vitalsGraphComponentUnified_{{$careMonth->id}}{{@$suffix ?: ''}}')
+                .empty()
+                .append('<div id="unified-chart_{{$careMonth->id}}{{@$suffix ?: ''}}"></div>');
+            window['vgUnifiedChart_{{$careMonth->id}}{{@$suffix ?: ''}}'] = c3.generate({
+                bindto: '#unified-chart_{{$careMonth->id}}{{@$suffix ?: ''}}',
+                data: {
+                    xs: {
+                        'Systolic BP' : 'x1',
+                        'Diastolic BP' : 'x1',
+                        'Weight': 'x2',
+                    },
+                    axes: {
+                        'Systolic BP' : 'y',
+                        'Diastolic BP' : 'y',
+                        'Weight': 'y2',
+                    },
+                    columns: [
+                        ['x1', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $bpDates)) ?>],
+                        ['x2', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $weightDates)) ?>],
+                        ['Systolic BP', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $sbpValues)) ?>],
+                        ['Diastolic BP', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $dbpValues)) ?>],
+                        ['Weight', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $weightValues)) ?>]
+                    ]
+                },
+                axis: {
+                    x: {
+                        type: 'timeseries',
+                        tick: {
+                            format: '%Y-%m-%d',
+                            multiline: true,
+                            fit: true,
+                            rotate: -45
+                        },
+                    },
+                    y: {
+                        show: true,
+                        label: {
+                            text: 'Blood Pressure (mmHg)',
+                            position: 'outer-middle'
+                        },
+                        min: 60,
+                        max: 220
+                    },
+                    y2: {
+                        show: true,
+                        label: {
+                            text: 'Weight (lbs)',
+                            position: 'outer-middle'
+                        },
+                        min: 80,
+                        max: 280
+                    },
+                },
+                regions: [
+                    {axis: 'y', start: 100, end: 130, class: 'safe-region', label: 'Safe Systolic BP: 100 to 130 mmHg'},
+                    {axis: 'y', start: 60, end: 90, class: 'safe-region', label: 'Safe Diastolic BP: 60 to 90 mmHg'}
+                ]
+            });
+        }
+    }).call(window);
+</script>

+ 83 - 48
resources/views/app/patient/care-month/partials/print/measurements.blade.php

@@ -1,33 +1,37 @@
-<h6 class="font-weight-bold">Measurements</h6>
-<table class="table table-striped table-sm table-bordered mt-2 mb-0">
+<h3 style="font-weight: bolder; font-size: 18px; line-height:18px; margin:0px;" class="mb-3"><b>Remote Monitoring:</b>
+</h3>
+<table class="table table-sm table-bordered mt-2 mb-0">
     <thead>
     <thead>
-        <tr>
-            <th class="px-2 text-secondary">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">Stamped</th>
-        </tr>
+    <tr>
+        <th class="px-1 text-nowrap"><b>Date & Time</b></th>
+        <th class="px-1"><b>Measurement</b></th>
+        <th class="px-1"><b>Type</b></th>
+        <th class="px-1"><b>Interaction</b></th>
+        <th class="px-4 w-100"><b>Comments</b></th>
+    </tr>
     </thead>
     </thead>
     <tbody>
     <tbody>
-        @php
-            $measurementsInCareMonth = $patient->measurementsInCareMonth($careMonth);
-            $plottableMeasurements = [];
-        @endphp
-        @foreach ($measurementsInCareMonth as $measurement)
-            @if($measurementType && stripos($measurement->label, $measurementType) === false ) @continue @endif
-            @if (!empty($measurement->label) && !in_array($measurement->label, ['SBP', 'DBP']) && !$measurement->is_cellular_zero)
-                <tr>
-                    <td class="px-2">
-                        @if ($measurement->ts)
+    @php
+        $measurementsInCareMonth = $patient->measurementsInCareMonth($careMonth);
+        $plottableMeasurements = [];
+    @endphp
+    @foreach ($measurementsInCareMonth as $measurement)
+        @if($measurementType && stripos($measurement->label, $measurementType) === false )
+            @continue
+        @endif
+        @if (!empty($measurement->label) && !in_array($measurement->label, ['SBP', 'DBP']) && !$measurement->is_cellular_zero)
+            <tr>
+                <td class="px-2 text-nowrap">
+                    @if ($measurement->ts)
                             <?php $timestampInSec = floor($measurement->ts / 1000); ?>
                             <?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') }}
-                        @endif
-                        EST
-                    </td>
-                    <td class="px-2">{{ $measurement->label }}</td>
-                    <td class="px-2">
+                        {{ friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN') }}
+                    @else
+                        {{ friendly_date_time_short_with_tz($measurement->effective_date, true, 'EASTERN') }}
+                    @endif
+                    EST
+                </td>
+                <td class="px-1 text-nowrap">
+                    <div class="text-nowrap">
                         @if ($measurement->is_cellular_zero)
                         @if ($measurement->is_cellular_zero)
                             <i class="font-size-11 fa fa-rss"></i>
                             <i class="font-size-11 fa fa-rss"></i>
                         @elseif($measurement->label === 'BP')
                         @elseif($measurement->label === 'BP')
@@ -37,30 +41,61 @@
                         @else
                         @else
                             {{ $measurement->value }}
                             {{ $measurement->value }}
                         @endif
                         @endif
-                    </td>
-                    <td colspan="px-2">
-                        <?php
-                        $stamps = ['has_been_stamped_by_mcp', 'has_been_stamped_by_non_hcp', 'has_been_stamped_by_rme', 'has_been_stamped_by_rmm'];
-                        $isStamped = false;
-                        foreach ($stamps as $stamp) {
-                            if ($measurement->{$stamp}) {
-                                $isStamped = true;
-                            }
-                        }
-                        ?>
-                        @if ($isStamped)
-                            ✓
-                        @endif
-                    </td>
-                </tr>
-            @endif
-        @endforeach
-        @if (!$patient->measurements || !count($patient->measurements) === 0)
-            <tr>
-                <td class="text-secondary p-0 border-0">
-                    No items to show
+                    </div>
+                </td>
+                <td class="px-1 text-nowrap">{{ $measurement->label }}</td>
+                <td class="text-nowrap">
+                    <div class="">
+                        @php $found = false; @endphp
+                        @foreach($careMonth->entries as $entry)
+                            @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date) && $entry->did_pro_interact_with_client_about_rm && !$found)
+                                Text/Audio call
+                                @php $found = true; @endphp
+                            @endif
+                        @endforeach
+                    </div>
+                </td>
+                {{--                    <td colspan="px-2">--}}
+                {{--                        <?php--}}
+                {{--                        $stamps = ['has_been_stamped_by_mcp', 'has_been_stamped_by_non_hcp', 'has_been_stamped_by_rme', 'has_been_stamped_by_rmm'];--}}
+                {{--                        $isStamped = false;--}}
+                {{--                        foreach ($stamps as $stamp) {--}}
+                {{--                            if ($measurement->{$stamp}) {--}}
+                {{--                                $isStamped = true;--}}
+                {{--                            }--}}
+                {{--                        }--}}
+                {{--                        ?>--}}
+                {{--                        @if ($isStamped)--}}
+                {{--                            ✓--}}
+                {{--                        @endif--}}
+                {{--                    </td>--}}
+                @php $rowSpan = 0 @endphp
+                @foreach($careMonth->entries() as $entry)
+                    @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date))
+                        @php $rowSpan = $rowSpan + 1; @endphp
+                    @endif
+                @endforeach
+                <td class="px-4">
+                    <div class="">
+                        @foreach($careMonth->entries as $entry)
+                            @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date))
+                                <div class="d-flex align-items-start">
+                                    <span class="mr-2">{{$entry->time_in_seconds/60}}m: </span>
+                                    <div>{!!  $entry->content_text  !!}</div>
+                                </div>
+                            @endif
+                        @endforeach
+                    </div>
                 </td>
                 </td>
             </tr>
             </tr>
         @endif
         @endif
+    @endforeach
+    @if (!$patient->measurements || !count($patient->measurements) === 0)
+        <tr>
+            <td class="text-secondary p-0 border-0">
+                No items to show
+            </td>
+        </tr>
+    @endif
     </tbody>
     </tbody>
 </table>
 </table>

+ 7 - 11
resources/views/app/patient/care-month/partials/print/rm-reasons.blade.php

@@ -1,11 +1,7 @@
-<h6 class="font-weight-bold">RM Reasons</h6>
-<table class="table table-striped table-sm table-bordered mt-2 mb-0">
-    <tr>
-        <td>
-            @include('app.patient.partials.rm-reasons-print-display', [
-                'recordType' => 'CARE_MONTH',
-                'record' => $careMonth,
-            ])
-        </td>
-    </tr>
-</table>
+<h6 class="font-weight-bold">Diagnosis</h6>
+
+@include('app.patient.partials.rm-reasons-print-display', [
+    'recordType' => 'CARE_MONTH',
+    'record' => $careMonth,
+])
+

+ 142 - 30
resources/views/app/patient/care-month/print.blade.php

@@ -4,53 +4,164 @@
     <style>
     <style>
         html,
         html,
         body {
         body {
-            height: max-content
+            height: max-content;
+            display: flex;
+            margin: auto;
+        }
+
+        #printableScreen {
+            width: 11in;
         }
         }
     </style>
     </style>
     <div id="printableScreen" style="padding: 15px;">
     <div id="printableScreen" style="padding: 15px;">
-        <div class="d-flex align-items-start justify-content-center" style="margin-top:15px;margin-bottom: 30px;">
+        <div class="d-flex align-items-end justify-content-end" style="margin-top:15px;margin-bottom: 30px;">
             <div class="">
             <div class="">
-                <div class="border-bottom pb-2 mb-2 text-center">
-                    <h6 class="font-weight-bold text-uppercase">{{ $patient->displayName() }}</h6>
-                    <div style="margin-bottom: 5px;font-weight:bold;"><span style="color: #6c757d;">DOB</span>:  {{ $patient->dob ? friendly_date($patient->dob) : '---' }}</div>
-                    <div style="margin-bottom: 5px;font-weight:bold;"><span style="color: #6c757d;">NP</span>:  {{ $careMonth->mcp ? $careMonth->mcp->displayName() : '---' }}</div>
-                    <div>
-                        <span class="text-dark font-weight-bold">Care Month</span>&nbsp;for&nbsp;<span
-                            class="text-dark font-weight-bold">{{ friendly_month($careMonth->start_date) }}</span>
+                <div class="">
+                    <h6 class="font-weight-bold text-uppercase">
+                        <strong>{{$careMonth->companyPro && $careMonth->companyPro->company ? $careMonth->companyPro->company->name : '-'}}</strong>
+                    </h6>
+                    <div style="margin-bottom: 5px;font-weight:bold;"><span
+                            style="color: #6c757d;">{{$careMonth->companyLocation ? $careMonth->companyLocation->line1 . ', ' . $careMonth->companyLocation->line2 : '-'}}
                     </div>
                     </div>
-                </div>
-                <div>
-                    <div style="margin-bottom: 5px;font-weight:bold;"><span style="color: #6c757d;">Company</span>:  
-                        {{$careMonth->companyPro && $careMonth->companyPro->company ? $careMonth->companyPro->company->name : '-'}}
+                    <div style="margin-bottom: 5px;font-weight:bold;"><span
+                            style="color: #6c757d;">{{$careMonth->companyLocation ? $careMonth->companyLocation->city . ', ' . $careMonth->companyLocation->state.' '.$careMonth->companyLocation->zip : '-'}}
+                    </div>
+                    <div style="margin-bottom: 5px;font-weight:bold;"><span
+                            style="color: #6c757d;"><strong>Phone</strong></span>: {{$careMonth->companyPro && $careMonth->companyPro->company ? $careMonth->companyPro->company->phone_number : '-'}}
+                    </div>
+                    <div style="margin-bottom: 5px;font-weight:bold;"><span style="color: #6c757d;"><strong>Fax</strong></span>:
+                        (808)-878-1414
                     </div>
                     </div>
-                    <div style="margin-bottom: 5px;font-weight:bold;"><span style="color: #6c757d;">Location</span>:  
-                        {{$careMonth->companyLocation ? $careMonth->companyLocation->line1 . ', ' . $careMonth->companyLocation->city : '-'}}
-                    </div>                    
                 </div>
                 </div>
             </div>
             </div>
-            
         </div>
         </div>
-
-        @if($type === 'detailed')
-            <div style="margin-bottom: 30px;">
-                @include('app.patient.care-month.partials.print.rm-reasons')
+        <div
+            style="width: 100%  !important; background-color: black !important; color: snow  !important">
+            <div class="p-3 text-right">
+                <h3 style="font-weight: bolder; font-size: 18px; line-height:18px; margin:0px;">Remote Patient
+                    Monitoring</h3>
             </div>
             </div>
-        @endif
+        </div>
+        <div>
+            <div class="py-3 text-uppercase">
+                <h3 style="font-weight: bolder; font-size: 18px; line-height:18px; margin:0px;">{{$careMonth->client->displayName()}}</h3>
+            </div>
+            <table class="table-bordered table">
+                <tr>
+                    <td><b>Address 1:</b> {{$careMonth->client->mailing_address_line1}}</td>
+                    <td><b>Birth Date:</b> {{friendly_date($careMonth->client->dob)}}</td>
+                </tr>
+                <tr>
+                    <td><b>City, State, Zip:</b> {{$careMonth->client->mailing_address_city}}
+                        , {{$careMonth->client->mailing_address_state}} {{$careMonth->client->mailing_address_zip}}</td>
+                    <td><b>Cell Phone:</b> {{$careMonth->client->cell_number}}</td>
+                </tr>
+                <tr>
+                    <td><b>Gender:</b> {{$careMonth->client->sex}}</td>
+                    <td><b>Measurement Period:</b> {{friendly_month($careMonth->start_date)}}</td>
+                </tr>
+                <tr>
+                    <td><b>Date of Enrollment:</b> {{friendly_month($careMonth->client->enrolled_in_rm_at)}}</td>
+                    <td><b>Consent Received:</b> Yes</td>
+                </tr>
+            </table>
+        </div>
+
 
 
         <div>
         <div>
             <?php
             <?php
-                $measurementType = null;
-                if($type === 'measurements-bp'){
-                    $measurementType = 'BP';
-                }
-                if($type === 'measurements-wt'){
-                   $measurementType = 'Wt'; 
-                }
+            $measurementType = null;
+            if ($type === 'measurements-bp') {
+                $measurementType = 'BP';
+            }
+            if ($type === 'measurements-wt') {
+                $measurementType = 'Wt';
+            }
             ?>
             ?>
             @include('app.patient.care-month.partials.print.measurements', ['measurementType' => $measurementType])
             @include('app.patient.care-month.partials.print.measurements', ['measurementType' => $measurementType])
         </div>
         </div>
+
+        <div>
+            <h3 style="font-weight: bolder; font-size: 18px; line-height:18px; margin:0px;" class="mt-4 mb-3"><b>Remote
+                    Monitoring Measurements:</b>
+{{--            @include('app.patient.care-month._vitals_graph_unified')--}}
+            @include('app.patient.care-month.partials.print.chart')
+        </div>
+
+        <div>
+            @if($type === 'detailed')
+                <div style="margin-bottom: 30px;">
+                    @include('app.patient.care-month.partials.print.rm-reasons')
+                </div>
+            @endif
+        </div>
+
+        <div>
+            <h3 style="font-weight: bolder; font-size: 18px; line-height:18px; margin:0px;" class="mb-2"><b>Devices:</b>
+            </h3>
+            <ol>
+                @foreach($careMonth->client->devices as $device)
+                    @if($device->device->category == 'BP')
+                        <li>Cellular BP Cuff: IMEI# {{$device->device->imei}}</li>
+                    @endif
+                    @if($device->device->category == 'WEIGHT')
+                        <li>Cellular Weight Scale: IMEI# {{$device->device->imei}}</li>
+                    @endif
+                @endforeach
+            </ol>
+        </div>
+
+        <div>
+            <h3 style="font-weight: bolder; font-size: 18px; line-height:18px; margin:0px;" class="mb-3">
+                <b>Signature:</b>
+            </h3>
+
+            <table class="table table-sm">
+                <tr class="bg-light">
+                    <th>Date of Service</th>
+                    <th>Service</th>
+                    <th>Place of Service</th>
+                </tr>
+                <tr>
+                    <td>{{$careMonth->mcpRmGenericBill? friendly_date($careMonth->mcpRmGenericBill->signed_by_generic_pro_at): ''}}</td>
+                    <td>Remote Patient Monitoring</td>
+                    <td>{{$careMonth->companyLocation ? $careMonth->companyLocation->format()  : '-'}}</td>
+                </tr>
+                <tr class="bg-light">
+                    <th>Total Time Spent</th>
+                    <th>Provider(HCP)</th>
+                    <th>Signature</th>
+                </tr>
+                <tr>
+                    <td>{{$careMonth->rm_total_time_in_seconds_by_mcp/60}} Minutes</td>
+                    <td>
+                        @if($careMonth->mcpPro)
+                        {{$careMonth->mcpPro->displayName()}}
+                        @endif
+                    </td>
+                    <td>
+                        @if($careMonth->mcpRmGenericBill && $careMonth->mcpRmGenericBill->is_signed_by_generic_pro)
+                            Signed
+                        @else
+                            -
+                        @endif
+
+                    </td>
+                </tr>
+            </table>
+            <div>
+                Signed electronically on
+                @if($careMonth->mcpRmGenericBill)
+                    {{friendlier_date_time($careMonth->mcpRmGenericBill->signed_by_generic_pro_at)}}
+                @endif
+            </div>
+        </div>
     </div>
     </div>
     <script>
     <script>
+        const navBar = document.querySelector('nav.navbar');
+        if(navBar){
+            navBar.remove();
+        }
         function printDiv(divName) {
         function printDiv(divName) {
             var printContents = document.getElementById(divName).innerHTML;
             var printContents = document.getElementById(divName).innerHTML;
             var originalContents = document.body.innerHTML;
             var originalContents = document.body.innerHTML;
@@ -58,7 +169,8 @@
             window.print();
             window.print();
             document.body.innerHTML = originalContents;
             document.body.innerHTML = originalContents;
         }
         }
-        document.addEventListener("DOMContentLoaded", function(event) {
+
+        document.addEventListener("DOMContentLoaded", function (event) {
             //printDiv('printableScreen');
             //printDiv('printableScreen');
         });
         });
     </script>
     </script>

+ 16 - 18
resources/views/app/patient/partials/rm-reasons-print-display.blade.php

@@ -58,25 +58,23 @@ if($recordType === 'NOTE'){
 }
 }
 ?>
 ?>
 <div>
 <div>
-	<div class="d-flex">
+	<div>
 		<?php $emptyICDs = true; ?>
 		<?php $emptyICDs = true; ?>
-		<ol class="pl-3 mb-2">
-			@foreach($displayData as $rmKey=>$rmData)
-				<?php
-				$emptyICD = true;
-				if (!empty($rmData['reason']) || !empty($rmData['description'])) {
-					$emptyICDs = false;
-					$emptyICD = false;
-				}
-				?>
-				@if(!$emptyICD)
-					<li  style="margin-bottom: 10px;">
-					{{$rmData['reason']}} 
-					@if(!empty($rmData['description']))({{ $rmData['description'] }})@endif
-					</li>
-				@endif
-			@endforeach
-		</ol>
+        @foreach($displayData as $rmKey=>$rmData)
+                <?php
+                $emptyICD = true;
+                if (!empty($rmData['reason']) || !empty($rmData['description'])) {
+                    $emptyICDs = false;
+                    $emptyICD = false;
+                }
+                ?>
+            @if(!$emptyICD)
+                <div>
+                    {{$rmData['reason']}}
+                    @if(!empty($rmData['description']))({{ $rmData['description'] }})@endif
+                </div>
+            @endif
+        @endforeach
 		@if($emptyICDs)
 		@if($emptyICDs)
 			Relevant RM reason(s) not specified.
 			Relevant RM reason(s) not specified.
 		@endif
 		@endif

+ 9 - 1
resources/views/layouts/print.blade.php

@@ -20,11 +20,19 @@
     <!-- Styles -->
     <!-- Styles -->
 
 
 
 
+
+
+
     {{-- inline bootstrap datepicker --}}
     {{-- inline bootstrap datepicker --}}
 {{--    <link href='/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css' rel="stylesheet">
 {{--    <link href='/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css' rel="stylesheet">
     <script src='/bootstrap-datepicker/js/bootstrap-datepicker.min.js'></script>--}}
     <script src='/bootstrap-datepicker/js/bootstrap-datepicker.min.js'></script>--}}
+    <script src="/js/jquery-3.5.1.min.js"></script>
 
 
     <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
     <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
+    {{-- mc initializers --}}
+    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
+
+    <script src="/js/mc-init.js?v={{config('app.asset_version')}}"></script>
 
 
     @yield('head')
     @yield('head')
 </head>
 </head>
@@ -33,10 +41,10 @@
 
 
     <main role="main" class="stag-content px-0 mcp-theme-1">
     <main role="main" class="stag-content px-0 mcp-theme-1">
         @yield('content')
         @yield('content')
-
     </main><!-- /.container -->
     </main><!-- /.container -->
 
 
     <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.css"/>
     <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.css"/>
+
 </body>
 </body>
 
 
 </html>
 </html>

+ 308 - 0
resources/views/layouts/print2.blade.php

@@ -0,0 +1,308 @@
+<!DOCTYPE html>
+<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <meta name="csrf-token" content="{{ csrf_token() }}">
+
+    <title>{{ config('app.name') }}</title>
+    <link rel="icon" href="/img/icon.svg">
+
+    <!-- Fonts -->
+    <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">
+
+    {{-- mc initializers --}}
+    <script src="/js/mc-init.js?v={{config('app.asset_version')}}"></script>
+
+    {{-- vue --}}
+    <script src="/js/vue.js"></script>
+
+    {{-- Quill RTE --}}
+    <script>
+        window.stagQuillConfig = {
+            toolbar: ['bold', 'italic', 'underline', { 'list': 'ordered'}, { 'list': 'bullet' }],
+            keyboard: {
+                bindings: {
+                    handleEnter: {
+                        key: 13,
+                        handler: function() {
+                            if(!$('.stag-shortcuts:visible').length) return true;
+                        }
+                    }
+                }
+            }
+        };
+    </script>
+    <link href="/quill/quill.snow.css" rel="stylesheet">
+    <script src="/quill/quill.js"></script>
+
+    <!-- <link href="{{ asset('bootstrap-4.5.0/css/bootstrap.css') }}" rel="stylesheet"> -->
+    <link rel="stylesheet" href="/fontawesome-free-5.13.1-web/css/all.min.css">
+    <link href="{{ asset('/css/app.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link href="{{ asset('/css/style.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link href="{{ asset('/css/yemi.css') }}?v={{config('app.asset_version')}}" rel="stylesheet">
+    <link rel="stylesheet" href="{{ asset('/css/toastr.min.css') }}">
+    <link href="{{asset('/css/z.css')}}?v={{config('app.asset_version')}}" rel=stylesheet>
+    <!-- Styles -->
+
+    <script src="{{ asset('js/app.js') }}?v={{config('app.asset_version')}}" type="application/javascript"></script>
+    <script src="/js/jquery-3.5.1.min.js"></script>
+    <script src="/js/jquery.form.min.js"></script>
+    <script src="{{ asset('js/toastr.min.js') }}" type="application/javascript"></script>
+    <script src="/js/yemi.js?v={{config('app.asset_version')}}" type="application/javascript"></script>
+
+    {{-- med ac --}}
+    <link href='/css/autocomplete-lhc.min.css' rel="stylesheet">
+    <script src='/js/autocomplete-lhc.js'></script>
+
+    {{-- inline bootstrap datepicker --}}
+    {{--    <link href='/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css' rel="stylesheet">
+        <script src='/bootstrap-datepicker/js/bootstrap-datepicker.min.js'></script>--}}
+
+    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
+    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
+
+    {{-- pdfjs --}}
+    <script src="/js/pdfjs-2.12.313/build/pdf.js"></script>
+
+    <script src="{{ asset('js/tsvToArray.js') }}"></script>
+
+    {{-- WebSockets --}}
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/sockjs-client/1.5.0/sockjs.min.js"
+            integrity="sha512-5yJ548VSnLflcRxWNqVWYeQZnby8D8fJTmYRLyvs445j1XmzR8cnWi85lcHx3CUEeAX+GrK3TqTfzOO6LKDpdw=="
+            crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"
+            integrity="sha512-iKDtgDyTHjAitUDdLljGhenhPwrbBfqTKWO1mkhSFH3A7blITC9MhYon6SjnMhp4o0rADGw9yAC6EW4t5a4K3g=="
+            crossorigin="anonymous"></script>
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/TableDnD/1.0.5/jquery.tablednd.min.js"></script>
+
+    <script>
+        window.segmentRefreshConfig = {!! json_encode(config('stag.segmentRefreshConfig')) !!};
+    </script>
+    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
+
+    <script type="text/javascript">
+        $(function() {
+            $.ajaxSetup({
+                headers: {
+                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
+                }
+            });
+        });
+    </script>
+
+    @yield('head')
+</head>
+
+<body>
+<div id="mask" style="background: rgba(0, 0, 0, 0) url(&quot;/vanillaspin.gif&quot;) no-repeat scroll center center; position: fixed; top: 0px; left: 0px; z-index: 9999; width: 100%; height: 100%; display: none;">
+</div>
+<div id="moe-form-mask" style="background: rgba(0, 0, 0, .1) no-repeat scroll center center; position: fixed; top: 0px; left: 0px; z-index: 97; width: 100%; height: 100%; display: none;">
+</div>
+
+
+
+<main role="main" class="stag-content px-0">
+    @yield('content')
+
+</main><!-- /.container -->
+
+<!-- shortcut/suggest component -->
+<link href="/css/shortcut.css?v={{config('app.asset_version')}}" rel=stylesheet>
+<script src="/js/shortcut.js?v={{config('app.asset_version')}}" type="application/javascript"></script>
+
+<!-- pro suggest component -->
+<script src="/js/pro-suggest.js?v={{config('app.asset_version')}}" type="application/javascript"></script>
+
+<!-- script to handle history/back/forward for mc/xxx pages
++ all other JS initialization needed in fastLoaded pages  -->
+<script src="/js/find-event-handlers.js?v={{config('app.asset_version')}}" type="application/javascript"></script>
+<script src="/js/mc.js?v={{config('app.asset_version')}}" type="application/javascript"></script>
+
+<form url="/api/proTextShortcut/create" id="create-shortcut-form" class="mcp-theme-1">
+    <input type="hidden" name="proUid" value="{{ $pro->uid  }}">
+    <div class="mb-2">
+        <input type="text" class="form-control form-control-sm" name="shortcut" value="" placeholder="Shortcut Name" required>
+    </div>
+    <div class="mb-2">
+        <textarea name="text" class="form-control form-control-sm" rows="3" id="selected-sc-text" placeholder="Content" required></textarea>
+    </div>
+    <div class="mb-0">
+        <button class="btn btn-primary btn-sm" type="submit">Save</button>
+        <button class="btn btn-default border btn-sm ml-1" type="reset">Cancel</button>
+    </div>
+</form>
+
+<script>
+    $(document).ready(function() {
+        console.log({navBar});
+        window.toggleChildLinks = function(_element) {
+            $(_element).closest('.nav-item').toggleClass('nav-child-collapsed');
+            return false;
+        }
+        const debounce = (func, wait) => {
+            let timeout;
+            return function executedFunction(...args) {
+                const later = () => {
+                    clearTimeout(timeout);
+                    func(...args);
+                };
+                clearTimeout(timeout);
+                timeout = setTimeout(later, wait);
+            };
+        };
+        var lastTerm = '';
+        var returnedFunction = debounce(function() {
+            var term = $.trim($('#patient-search').val());
+            if (!!term) {
+                if(lastTerm !== term) {
+                    $('.patient-search-results.suggestions-outer')
+                        .html('<span class="d-block no-suggest-items">Searching...</span>')
+                        .removeClass('d-none');
+                    $.get('/patients-suggest?term=' + term, function(_data) {
+                        if($.trim($('#patient-search').val()) === term) { // use returned data only if it's for the sent "term"
+                            $('.patient-search-results.suggestions-outer').html(_data).removeClass('d-none');
+                        }
+                    });
+                    lastTerm = term;
+                }
+            } else {
+                $('.patient-search-results.suggestions-outer').addClass('d-none');
+            }
+        }, 250);
+        $('#patient-search')
+            .off('keydown')
+            .on('keydown', function(e) {
+                var activeItem = $('.patient-search-results.suggestions-outer .suggest-item.active');
+                switch (e.which) {
+                    case 27:
+                        $('.patient-search-results.suggestions-outer').addClass('d-none');
+                        markEventAsConsumed(e);
+                        return false;
+                    case 38:
+                        if (activeItem.prev().length) {
+                            activeItem.prev()
+                                .addClass('active')
+                                .siblings().removeClass('active');
+                            activeItem = $('.patient-search-results.suggestions-outer .suggest-item.active');
+                            if (activeItem.length) {
+                                activeItem[0].scrollIntoView();
+                            }
+                        }
+                        return false;
+                    case 40:
+                        if (activeItem.next().length) {
+                            activeItem.next()
+                                .addClass('active')
+                                .siblings().removeClass('active');
+                            activeItem = $('.patient-search-results.suggestions-outer .suggest-item.active');
+                            if (activeItem.length) {
+                                activeItem[0].scrollIntoView();
+                            }
+                        }
+                        return false;
+                    case 13:
+                        if (activeItem.length) {
+                            activeItem.first().trigger('mousedown');
+                        }
+                        return false;
+                    default:
+                        window.setTimeout(onQueryChange, 50);
+                        break;
+                }
+            })
+            .on('keypress paste', function(e) {
+                window.setTimeout(onQueryChange, 50);
+            })
+            .on('blur', function(e) {
+                $('.patient-search-results.suggestions-outer').addClass('d-none');
+                return false;
+            })
+            .on('focus', function(e) {
+                if (lastTerm) { //if search has content
+                    $('.patient-search-results.suggestions-outer').removeClass('d-none');
+                }
+                return false;
+            });
+
+        $(document)
+            .off('click.on-click-menu', '.on-click-menu>span')
+            .on('click.on-click-menu', '.on-click-menu>span', function() {
+                $(this).parent().find('[menu]').first().show();
+                return false;
+            });
+
+        $('body')
+            .off('mousedown.on-click-menu-outside-click')
+            .on('mousedown.on-click-menu-outside-click', function (e) {
+                if ($(e.target).closest('.on-click-menu').length && $(e.target).closest('.on-click-menu').find('[menu]').is(':visible')) {
+                    return;
+                }
+                $('.on-click-menu [menu]').hide();
+            });
+
+        function onQueryChange() {
+            returnedFunction();
+        }
+        $(document).on('mousedown', '.suggest-item.patient-suggest[data-target-uid]', function() {
+            $('#patient-search').val('');
+            $('.patient-search-results.suggestions-outer').addClass('d-none');
+            fastLoad('/patients/view/' + $(this).attr('data-target-uid'), true, false, false);
+            return false;
+        });
+        $(document)
+            .off('click.tab-link', 'a[tab-link]')
+            .on('click.tab-link', 'a[tab-link]', function () {
+                let tab = $(this).attr('tab-link');
+                $(this).siblings().removeClass('tab-link-active');
+                $(this).addClass('tab-link-active');
+                $(this).closest('[tab-links]').siblings('.cm-tab').addClass('d-none');
+                $(this).closest('[tab-links]').siblings('.cm-tab[tab-key="' + tab + '"]').removeClass('d-none');
+                // TODO: move to context
+                if(window.vgBPChart) window.vgBPChart.flush();
+                if(window.vgWtChart) window.vgWtChart.flush();
+                return false;
+            });
+
+        addMCInitializer('hide-moes', function() {
+            $('div[moe] form:not([show])').hide();
+        });
+
+        (function() {
+            function init() {
+                $(window).on('resize', adjustStickyHeader);
+                $(window).on('scroll', adjustStickyHeader);
+            }
+            function adjustStickyHeader() {
+                if($(window).scrollTop() > 0) {
+                    $('.sticky-note-header').addClass('sticky');
+                }
+                else {
+                    $('.sticky-note-header').removeClass('sticky');
+                }
+            }
+            addMCInitializer('sticky-note-header', init, '.sticky-note-header');
+        })();
+
+    });
+</script>
+<script src="/js/click-to-copy.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/stag-popup.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/stag-suggest.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/stag-table-filter.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/option-list.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/show-on-click.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/dq.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/icd-autocomplete.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/stag-collapsible-card.js?v={{config('app.asset_version')}}"></script>
+<script src="/js/stag-scrollbar.js?v={{config('app.asset_version')}}"></script>
+@include('app/pdf/viewer')
+<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.css"/>
+<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.24/fc-3.3.2/fh-3.1.8/datatables.min.js"></script>
+<link href="/v-splitter-px/v-splitter.css?v={{config('app.asset_version')}}" rel="stylesheet" >
+<script src="/v-splitter-px/v-splitter.js?v={{config('app.asset_version')}}"></script>
+</body>
+
+</html>