Vijayakrishnan 4 жил өмнө
parent
commit
193d13e418

+ 5 - 5
app/Http/Controllers/PatientController.php

@@ -244,11 +244,6 @@ class PatientController extends Controller
         return view('app.patient.handouts', compact('patient', 'handouts'));
     }
 
-    public function flowSheets(Request $request, Client $patient )
-    {
-        return view('app.patient.flowsheets', compact('patient'));
-    }
-
     public function settings(Request $request, Client $patient )
     {
         return view('app.patient.settings', compact('patient'));
@@ -314,4 +309,9 @@ class PatientController extends Controller
         $pros = $this->pros;
         return view('app.patient.programs', compact('patient', 'pros', 'filter'));
     }
+
+    public function flowsheets(Request $request, Client $patient, $filter = '') {
+        $pros = $this->pros;
+        return view('app.patient.flowsheets', compact('patient', 'pros', 'filter'));
+    }
 }

+ 3 - 0
public/css/style.css

@@ -1209,3 +1209,6 @@ button.note-templates-trigger-assessment {
     left: 1rem;
     width: calc(100% - 2rem);
 }
+.flowsheets-table td {
+    padding: 9px 10px;
+}

+ 103 - 5
resources/views/app/patient/flowsheets.blade.php

@@ -1,10 +1,108 @@
 @extends ('layouts.patient')
+@section('inner-content')
+    <?php $pro->pro_type = 'ADMIN'; ?>
+    <link href="/select2/select2.min.css" rel="stylesheet" />
+    <script src="/select2/select2.min.js"></script>
+    <div>
+        <div class="d-flex align-items-center pb-3">
+            <h4 class="font-weight-bold m-0">Flowsheets</h4>
+            {{-- progams filter --}}
+{{--            <select class="ml-4 max-width-200px form-control form-control-sm"--}}
+{{--                    onchange="return flowsheetsFilterChanged()">--}}
+{{--                <option value="all" {{ $filter === 'all' ? 'selected' : '' }}>All Programs</option>--}}
+{{--                @foreach($patient->clientPrograms as $program)--}}
+{{--                    <option value="{{$program->uid}}" {{ $filter === $program->uid ? 'selected' : '' }}>--}}
+{{--                        {{$program->title}}--}}
+{{--                    </option>--}}
+{{--                @endforeach--}}
+{{--            </select>--}}
+        </div>
 
+    </div>
 
-@section('section-title')
-    Flowsheets
-@endsection
+    <?php
+    $dates = [];
+    // todo: get from filter/query
+    for ($i=30; $i>=0; $i--) {
+        $d = date_sub(date_create(), date_interval_create_from_date_string($i . " day" . ($i === 1 ? '' : 's')));
+        $dates[] = date_format($d, "Y-m-d");
+    }
+    ?>
 
-@section('inner-content')
-    CONTENT
+    <div class="d-flex align-items-stretch overflow-hidden flowsheets-table">
+        <div class="col-2 px-0 flex-grow-0">
+            <table class="table table-sm border border-top-0 m-0">
+                <thead>
+                <tr class="bg-light font-weight-bold text-secondary">
+                    <td class="pl-3">Measurement Type</td>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($patient->clientPrograms as $program)
+                    <?php
+                    $programCategories = explode('|', $program->measurement_labels);
+                    $programCategories = array_filter($programCategories, function($_item) {
+                        return !empty($_item);
+                    });
+                    $programICDs = explode('|', $program->icds);
+                    $programICDs = array_filter($programICDs, function($_item) {
+                        return !empty($_item);
+                    });
+                    $programMonth = $program->getProgramMonth(strtoupper(date('F')), date('Y'));
+                    ?>
+                    <tr>
+                        <td class="px-3 font-weight-bold text-nowrap">{{$program->title}}</td>
+                    </tr>
+                    @foreach($programCategories as $category)
+                        <tr>
+                            <td class="pl-5 text-nowrap">{{$category}}</td>
+                        </tr>
+                    @endforeach
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+        <div class="flex-grow-1 overflow-auto border-right">
+            <table class="table table-sm table-bordered border border-top-0 border-left-0 border-right-0 m-0">
+                <thead>
+                <tr class="bg-light font-weight-bold text-secondary">
+                    @foreach($dates as $date)
+                        <td class="text-nowrap border-bottom-0">{{ $date }}</td>
+                    @endforeach
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($patient->clientPrograms as $program)
+                    <?php
+                    $programCategories = explode('|', $program->measurement_labels);
+                    $programCategories = array_filter($programCategories, function($_item) {
+                        return !empty($_item);
+                    });
+                    $programICDs = explode('|', $program->icds);
+                    $programICDs = array_filter($programICDs, function($_item) {
+                        return !empty($_item);
+                    });
+                    $programMonth = $program->getProgramMonth(strtoupper(date('F')), date('Y'));
+                    ?>
+                    <tr>
+                        <td colspan="{{count($dates)}}">&nbsp;</td>
+                    </tr>
+                    @foreach($programCategories as $category)
+                        <tr>
+                            @foreach($dates as $date)
+                                <td>100 gm</td>
+                            @endforeach
+                        </tr>
+                    @endforeach
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+
+    <script>
+        function flowsheetsFilterChanged() {
+            alert(1);
+        }
+    </script>
 @endsection

+ 5 - 42
resources/views/layouts/patient.blade.php

@@ -21,6 +21,10 @@
                             <a class="nav-link {{ strpos($routeName, 'patients.view.programs') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.programs', ['patient' => $patient]) }}">Programs</a>
                         </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.flowsheets') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.flowsheets', ['patient' => $patient]) }}">Flowsheets</a>
+                        </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.care-months') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.care-months', ['patient' => $patient]) }}">Care Months</a>
@@ -123,54 +127,13 @@
                         {{--<li class="nav-item">
                             <a class="nav-link" href="/patients/view/{{ $patient->uid }}/intake">Intake</a>
                         </li>--}}
-                        <?php /*
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.care-plan', ['patient' => $patient]) }}">Care Plan</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.measurements', ['patient' => $patient]) }}">Measurements</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.labs-and-studies', ['patient' => $patient]) }}">Labs and Studies</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.immunizations', ['patient' => $patient]) }}">Immunizations</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.allergies', ['patient' => $patient]) }}">Allergies</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.flowsheets', ['patient' => $patient]) }}">Flowsheets</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.demographics', ['patient' => $patient]) }}">Demographics</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.account', ['patient' => $patient]) }}">Account</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.care-checklist', ['patient' => $patient]) }}">Care Checklist</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.documents', ['patient' => $patient]) }}">Documents</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.education', ['patient' => $patient]) }}">Education</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.messaging', ['patient' => $patient]) }}">Messaging</a>
-                        </li>
-                        <li class="nav-item">
-                            <a class="nav-link" href="{{ route('patients.view.duplicate', ['patient' => $patient]) }}">Duplicate</a>
-                        </li>
-                        */ ?>
                     </ul>
                     <div class="mt-3 mcp-theme-1">
                         @yield('left-nav-content')
                     </div>
                 </div>
             </nav>
-            <main role="main" class="">
+            <main role="main" class="w-100">
                 <div class="card mt-3">
                     <div class="card-header py-1">
                         <?php

+ 3 - 0
routes/web.php

@@ -141,6 +141,9 @@ Route::middleware('pro.auth')->group(function () {
 
         // programs
         Route::get('programs/{filter?}', 'PatientController@programs')->name('programs');
+
+        // flowsheets
+        Route::get('flowsheets/{filter?}', 'PatientController@flowsheets')->name('flowsheets');
     });
 
     // pro dashboard events (ajax)