ソースを参照

Merge branch 'cleanup' of https://rav.triplestart.com/tigerphp/stagfe2 into cleanup

root 1 年間 前
コミット
11e7775cca

+ 2 - 6
app/Http/Controllers/CareMonthController.php

@@ -36,12 +36,8 @@ class CareMonthController extends Controller
         return view('app.patient.care-month.dashboard', compact('patient', 'careMonth', 'pros', 'cmTemplates', 'rmTemplates'));
     }
 
-    public function measurementsPrint(Request $request, Client $patient, CareMonth $careMonth )
+    public function print(Request $request, Client $patient, CareMonth $careMonth, $type = 'detailed' )
     {
-        return view('app.patient.care-month.measurements-print', compact('patient', 'careMonth'));
-    }
-    public function detailedPrint(Request $request, Client $patient, CareMonth $careMonth )
-    {
-        return view('app.patient.care-month.detailed-print', compact('patient', 'careMonth'));
+        return view('app.patient.care-month.print', compact('patient', 'careMonth', 'type'));
     }
 }

+ 4 - 2
resources/views/app/patient/care-month/dashboard.blade.php

@@ -88,8 +88,10 @@
                     <div class="d-flex align-items-center">
                         <span class="text-dark font-weight-bold font-size-14">Care Month</span>&nbsp;for&nbsp;<span class="text-dark font-weight-bold">{{friendly_month($careMonth->start_date)}}</span>
                         <div class="ml-3">
-                            <a href="{{ route('patients.view.care-months.view.detailed-print', ['patient' => $patient, 'careMonth' => $careMonth]) }}" class="mr-2" target="_blank" native><i class="fas fa-print fa-fw"></i> Print Detailed</a>
-                            <a href="{{ route('patients.view.care-months.view.measurements-print', ['patient' => $patient, 'careMonth' => $careMonth]) }}" class="" target="_blank" native><i class="fas fa-print fa-fw"></i> Print Summary</a>
+                            <a href="{{ route('patients.view.care-months.view.print', ['patient' => $patient, 'careMonth' => $careMonth, 'type' => 'detailed']) }}" class="mr-2" target="_blank" native><i class="fas fa-print fa-fw"></i> Print Detailed</a>
+                            <a href="{{ route('patients.view.care-months.view.print', ['patient' => $patient, 'careMonth' => $careMonth, 'type' => 'measurements']) }}" class="mr-2" target="_blank" native><i class="fas fa-print fa-fw"></i> Print All Measurements Summary</a>
+                            <a href="{{ route('patients.view.care-months.view.print', ['patient' => $patient, 'careMonth' => $careMonth, 'type' => 'measurements-bp']) }}" class="mr-2" target="_blank" native><i class="fas fa-print fa-fw"></i> Print Measurements (BP)</a>
+                            <a href="{{ route('patients.view.care-months.view.print', ['patient' => $patient, 'careMonth' => $careMonth, 'type' => 'measurements-wt']) }}" class="mr-2" target="_blank" native><i class="fas fa-print fa-fw"></i> Print Measurements (Wt.)</a>
                         </div>
                     </div>
                 </div>

+ 66 - 0
resources/views/app/patient/care-month/partials/print/measurements.blade.php

@@ -0,0 +1,66 @@
+<h6 class="font-weight-bold">Measurements</h6>
+<table class="table table-striped table-sm table-bordered mt-2 mb-0">
+    <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>
+    </thead>
+    <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 $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">
+                        @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.)')
+                            {{ round(floatval($measurement->numeric_value), 2) }} lbs
+                        @else
+                            {{ $measurement->value }}
+                        @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
+                </td>
+            </tr>
+        @endif
+    </tbody>
+</table>

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

@@ -0,0 +1,11 @@
+<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>

+ 65 - 0
resources/views/app/patient/care-month/print.blade.php

@@ -0,0 +1,65 @@
+@extends('layouts.print')
+
+@section('content')
+    <style>
+        html,
+        body {
+            height: max-content
+        }
+    </style>
+    <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="">
+                <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>
+                </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>
+                    <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>
+
+        @if($type === 'detailed')
+            <div style="margin-bottom: 30px;">
+                @include('app.patient.care-month.partials.print.rm-reasons')
+            </div>
+        @endif
+
+        <div>
+            <?php
+                $measurementType = null;
+                if($type === 'measurements-bp'){
+                    $measurementType = 'BP';
+                }
+                if($type === 'measurements-wt'){
+                   $measurementType = 'Wt'; 
+                }
+            ?>
+            @include('app.patient.care-month.partials.print.measurements', ['measurementType' => $measurementType])
+        </div>
+    </div>
+    <script>
+        function printDiv(divName) {
+            var printContents = document.getElementById(divName).innerHTML;
+            var originalContents = document.body.innerHTML;
+            document.body.innerHTML = printContents;
+            window.print();
+            document.body.innerHTML = originalContents;
+        }
+        document.addEventListener("DOMContentLoaded", function(event) {
+            //printDiv('printableScreen');
+        });
+    </script>
+@endsection

+ 1 - 2
routes/web.php

@@ -636,8 +636,7 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('care-months', 'PatientController@careMonths')->name('care-months');
             Route::name('care-months.view.')->prefix('care-months/view/{careMonth}')->group(function () {
                 Route::get('', 'CareMonthController@dashboard')->name('dashboard');
-                Route::get('/measurements-print', 'CareMonthController@measurementsPrint')->name('measurements-print');
-                Route::get('/detailed-print', 'CareMonthController@detailedPrint')->name('detailed-print');
+                Route::get('/print/{type?}', 'CareMonthController@print')->name('print');
             });
 
             // appointment calendar