Explorar o código

Leftnav link & individual page for allergies

Vijayakrishnan Krishnan %!s(int64=4) %!d(string=hai) anos
pai
achega
a132ff7c52

+ 56 - 5
resources/views/app/patient/allergies.blade.php

@@ -1,10 +1,61 @@
 @extends ('layouts.patient')
 
-
-@section('section-title')
-    Allergies
-@endsection
+<?php $infoLines = json_decode($patient->info_lines);?>
+<?php $infoLines = !$infoLines ? [] : $infoLines; ?>
 
 @section('inner-content')
-    CONTENT
+    <div class="">
+        <div class="d-flex align-items-center pb-2">
+            <h4 class="font-weight-bold m-0">Allergies</h4>
+            <span class="mx-2 text-secondary">|</span>
+            <div moe>
+                <a start show class="">Add</a>
+                <form url="/api/clientInfoLine/create">
+                    <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                    <input type="hidden" name="category" value="allergy">
+                    <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Allergy"></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>
+        <table class="table table-striped table-sm table-bordered">
+            <thead>
+            <tr>
+                <th class="px-2 text-secondary">Allergy</th>
+                <th class="px-2 text-secondary">Created By</th>
+                <th class="px-2 text-secondary">Created At</th>
+                <th class="px-2 text-secondary delete-column">&nbsp;</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($infoLines as $category => $lines)
+                @if($category === "allergy")
+                    @foreach ($lines as $line)
+                        <tr>
+                            <td class="px-2">{{$line->contentText}}</td>
+                            <td class="px-2">-</td>
+                            <td class="px-2">-</td>
+                            <td class="px-2 text-center delete-column">
+                                <div moe relative>
+                                    <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
+                                    <form url="/api/clientInfoLine/remove" right>
+                                        <input type="hidden" name="uid" value="{{ $line->uid }}">
+                                        <p class="small">Are you sure you want to delete this entry?</p>
+                                        <div class="d-flex align-items-center">
+                                            <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
+                                            <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                        </div>
+                                    </form>
+                                </div>
+                            </td>
+                        </tr>
+                    @endforeach
+                @endif
+            @endforeach
+            </tbody>
+        </table>
+    </div>
 @endsection

+ 3 - 0
resources/views/layouts/patient.blade.php

@@ -15,6 +15,9 @@
                         <li class="nav-item">
                             <a class="nav-link" href="{{ route('patients.view.notes', ['patient' => $patient]) }}">Notes</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.medications', ['patient' => $patient]) }}">Medications</a>
                         </li>