Josh преди 4 години
родител
ревизия
85c543c23c

+ 9 - 3
app/Http/Controllers/PatientController.php

@@ -21,7 +21,12 @@ class PatientController extends Controller
         $mcpPros = Pro::where('is_enrolled_as_mcp', true)->get();
         $facilities = Facility::where('is_active', true)->get();
         $devices = BDTDevice::where('is_active', true)->orderBy('imei', 'asc')->get();
-        return view('app.patient.dashboard', compact('patient', 'facilities', 'devices'));
+        $dxInfoLines = ClientInfoLine::where('client_id', $patient->id)
+            ->where('category', 'dx')
+            ->where('is_removed', false)
+            ->orderBy('content_text', 'asc')
+            ->get();
+        return view('app.patient.dashboard', compact('patient', 'facilities', 'devices', 'dxInfoLines'));
     }
 
     public function actionItems(Request $request, Client $patient )
@@ -57,11 +62,12 @@ class PatientController extends Controller
 
     public function dxAndFocusAreas(Request $request, Client $patient )
     {
-        $infoLines = ClientInfoLine::where('client_id', $patient->id)
+        $dxInfoLines = ClientInfoLine::where('client_id', $patient->id)
             ->where('category', 'dx')
             ->where('is_removed', false)
+            ->orderBy('content_text', 'asc')
             ->get();
-        return view('app.patient.dx-and-focus-areas', compact('patient', 'infoLines'));
+        return view('app.patient.dx-and-focus-areas', compact('patient', 'dxInfoLines'));
     }
 
     public function careTeam(Request $request, Client $patient )

+ 4 - 2
public/css/style.css

@@ -202,7 +202,7 @@ body>nav.navbar {
     min-width: unset;
 }
 [wide] .form-control.form-control-sm {
-    min-width: 350px;
+    min-width: 480px;
 }
 [moe][center] [url]:not([show]) {
     position: fixed;
@@ -825,4 +825,6 @@ body .node input[type="number"] {
     padding: 3px 8px;
     border-bottom-left-radius: 5px;
 }
-
+.w-60px {
+    width: 60px;
+}

+ 18 - 10
resources/views/app/patient/dashboard.blade.php

@@ -8,11 +8,25 @@
         <?php $infoLines = !$infoLines ? [] : $infoLines; ?>
         <?php $vitalLabels = ['Ht. (in.)','Wt. (lbs.)','Temp. (F)','Pulse','Resp.','Pulse Ox.','SBP','DBP','Smoking Status', 'BMI']; ?>
 
+        <div class="row mb-2">
+            <div class="col-12">
+                {{-- appointments --}}
+                @include('app/patient/partials/appointments')
+            </div>
+        </div>
+
+        <div class="row mb-3">
+            <div class="col-12">
+                {{-- dx --}}
+                @include('app/patient/partials/dx-table')
+            </div>
+        </div>
+
 	    <div class="row">
             <div class="col-6">
 
-                {{-- appointments --}}
-                @include('app/patient/partials/appointments')
+                {{-- rx --}}
+                @include('app/patient/partials/rx')
 
                 {{-- devices --}}
                 <?php $availableDevices = 0; ?>
@@ -284,15 +298,9 @@
                 {{-- allergies --}}
                 @include('app/patient/partials/allergies')
 
-                {{-- rx --}}
-                @include('app/patient/partials/rx')
-
             </div>
             <div class="col-6">
 
-                {{-- dx --}}
-                @include('app/patient/partials/dx')
-
                 <div class="mt-2">
                     <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
                         <h6 class="my-0 font-weight-bold text-secondary">History</h6>
@@ -305,7 +313,7 @@
                 </div>
 
                 {{-- history_medical --}}
-                <div class="mt-2">
+                {{--<div class="mt-2">
                     <div class="d-flex align-items-center pb-2">
                         <h6 class="my-0 font-weight-bold">Medical</h6>
                         <span class="mx-2 text-secondary">|</span>
@@ -379,7 +387,7 @@
                         @endforeach
                         </tbody>
                     </table>
-                </div>
+                </div>--}}
 
                 {{-- history_surgical --}}
                 <div class="mt-2">

+ 21 - 62
resources/views/app/patient/dx-and-focus-areas.blade.php

@@ -19,6 +19,12 @@
                             <option value="Acute">Acute</option>
                         </select>
                     </div>
+                    <div class="mb-2">
+                        <label class="m-0 text-left d-flex align-items-center">
+                            <input type="checkbox" name="IsCurrent" value="">
+                            <span class="ml-1">Is Current?</span>
+                        </label>
+                    </div>
                     <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Prognosis" value="" placeholder="Prognosis"></div>
                     <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="Treatment Goal" value="" placeholder="Treatment Goal"></textarea></div>
                     <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="Treatment Plan" value="" placeholder="Treatment Plan"></textarea></div>
@@ -32,10 +38,10 @@
         <table class="table table-striped table-sm table-bordered mb-0">
             <thead>
             <tr>
-                {{--<th class="px-2 text-secondary">Category</th>--}}
                 <th class="px-2 text-secondary">Title</th>
                 <th class="px-2 text-secondary">ICD</th>
                 <th class="px-2 text-secondary">Chronic or Acute</th>
+                <th class="px-2 text-secondary">Current?</th>
                 <th class="px-2 text-secondary">Prognosis</th>
                 <th class="px-2 text-secondary">Treatment Goal</th>
                 <th class="px-2 text-secondary">Treatment Plan</th>
@@ -45,67 +51,20 @@
             </tr>
             </thead>
             <tbody>
-            @foreach($infoLines as $line)
-                <tr>
-                    <td class="px-2">{{$line->content_text}}</td>
-                    <td class="px-2">{{ @$line->contentDetail()->{"ICD"} }}</td>
-                    <td class="px-2">{{ @$line->contentDetail()->{"Chronic or Acute"} }}</td>
-                    <td class="px-2">{{ @$line->contentDetail()->{"Prognosis"} }}</td>
-                    <td class="px-2">{{ @$line->contentDetail()->{"Treatment Goal"} }}</td>
-                    <td class="px-2">{{ @$line->contentDetail()->{"Treatment Plan"} }}</td>
-                    <td class="px-2">{{ $line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
-                    <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
-                    <td class="px-2 text-center delete-column">
-                        <span moe relative class="mr-2">
-                            <a class="on-hover-opaque" start show title="Edit">
-                                <i class="font-size-11 fa fa-edit"></i>
-                            </a>
-                            <form url="/api/clientInfoLine/updateContent" right>
-                                <input type="hidden" name="uid" value="{{ $line->uid }}">
-                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                                <input type="hidden" name="category" value="dx">
-                                <div class="mb-2">
-                                    <input type="text" class="form-control form-control-sm" name="ICD" value="{{ @$line->contentDetail()->{"ICD"} }}" placeholder="ICD">
-                                </div>
-                                <div class="mb-2">
-                                    <input type="text" class="form-control form-control-sm" name="contentText" value="{{$line->content_text}}" placeholder="Title">
-                                </div>
-                                <div class="mb-2">
-                                    <select name="Chronic or Acute" class="form-control form-control-sm pl-1">
-                                        <option value="">Chronic or Acute (select one)</option>
-                                        <option {{ @$line->contentDetail()->{"Chronic or Acute"} === 'Chronic' ? 'selected' : '' }} value="Chronic">Chronic</option>
-                                        <option {{ @$line->contentDetail()->{"Chronic or Acute"} === 'Acute' ? 'selected' : '' }} value="Acute">Acute</option>
-                                    </select>
-                                </div>
-                                <div class="mb-2">
-                                    <input type="text" class="form-control form-control-sm" name="Prognosis" value="{{ @$line->contentDetail()->{"Prognosis"} }}" placeholder="Prognosis">
-                                </div>
-                                <div class="mb-2">
-                                    <textarea type="text" class="form-control form-control-sm" name="Treatment Goal" placeholder="Treatment Goal">{{ @$line->contentDetail()->{"Treatment Goal"} }}</textarea>
-                                </div>
-                                <div class="mb-2">
-                                    <textarea type="text" class="form-control form-control-sm" name="Treatment Plan" placeholder="Treatment Plan">{{ @$line->contentDetail()->{"Treatment Plan"} }}</textarea>
-                                </div>
-                                <div class="d-flex align-items-center">
-                                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
-                                    <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </span>
-                        <span 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>
-                        </span>
-                    </td>
-                </tr>
-            @endforeach
+            <?php
+            $currentDxs = new \Illuminate\Support\Collection();
+            $previousDxs = new \Illuminate\Support\Collection();
+            foreach($dxInfoLines as $line) {
+                if(@$line->contentDetail()->{"IsCurrent"}) {
+                    $currentDxs->add($line);
+                }
+                else {
+                    $previousDxs->add($line);
+                }
+            }
+            ?>
+            @include('app.patient.partials.dx-table-row', ['dxRows' => $currentDxs, 'showCreated' => true])
+            @include('app.patient.partials.dx-table-row', ['dxRows' => $previousDxs, 'showCreated' => true])
             </tbody>
         </table>
     </div>

+ 7 - 0
resources/views/app/patient/manage-appointment.blade.php

@@ -72,6 +72,13 @@
                        value="{{ $appointment && $appointment->title ? $appointment->title : '' }}"
                        placeholder="(optional)">
             </div>
+            <div class="mb-3">
+                <label class="text-secondary mb-1">Description</label>
+                <textarea name="description" class="form-control form-control-sm"
+                          type="text"
+                          placeholder="(optional)"
+                >{{ $appointment && $appointment->description ? $appointment->description : '' }}</textarea>
+            </div>
             <div class="mb-3">
                 <button class="btn btn-sm btn-primary d-block w-100 font-weight-bold apply-appt-button" disabled>
                     @if($appointment && $appointment->uid)

+ 12 - 6
resources/views/app/patient/note/dashboard.blade.php

@@ -155,7 +155,7 @@
                                  class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
                                  title="{{ $note->hcp_pro_id !== $pro->id ? 'Only the note\'s HCP can sign' : '' }}">
                                 <a class="" href="" show start>Sign Note</a>
-                                <form url="/api/note/signAsHcp">
+                                <form url="/api/note/signAsHcp" right>
                                     <input type="hidden" name="uid" value="{{$note->uid}}">
                                     <p>Sign this note as HCP?</p>
                                     <div class="mb-0">
@@ -231,11 +231,17 @@
                              data-section-template-uid="{{ $section->sectionTemplate->uid }}"
                              data-section-template-name="{{ $section->sectionTemplate->internal_name }}">
                             <div class="d-flex align-items-start">
-                                <a class="font-weight-bold mb-2 d-flex align-items-center c-pointer">
-                                    {{$section->sectionTemplate->title}}
-                                    <span class="d-none if-not-edit"><i class="fa fa-edit ml-2"></i></span>
-                                    <span class="edit-trigger"></span>
-                                </a>
+                                @if(!$note->is_signed_by_hcp)
+                                    <a class="font-weight-bold mb-2 d-flex align-items-center c-pointer">
+                                        {{$section->sectionTemplate->title}}
+                                        <span class="d-none if-not-edit"><i class="fa fa-edit ml-2"></i></span>
+                                        <span class="edit-trigger"></span>
+                                    </a>
+                                @else
+                                    <span class="font-weight-bold mb-2 d-flex align-items-center">
+                                        {{$section->sectionTemplate->title}}
+                                    </span>
+                                @endif
                                 <?php $sectionInternalName = $section->sectionTemplate->internal_name; ?>
                                 @if($sectionInternalName === "exam" || $sectionInternalName === "objective")
                                     @include('app/patient/note/_templates-exam-index')

+ 34 - 21
resources/views/app/patient/partials/appointments.blade.php

@@ -1,5 +1,5 @@
-<div class="mt-2 pb-1">
-    <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
+<div class="mt-0 pb-1">
+    <div class="d-flex align-items-center mb-2 pb-2 border-bottom">
         <h6 class="my-0 font-weight-bold text-secondary">Appointments</h6>
         {{--<span class="mx-2 text-secondary">|</span>
         <div moe center>
@@ -9,36 +9,49 @@
         <span class="mx-2 text-secondary">|</span>
         <a href="/patients/view/{{$patient->uid}}/manage-appointment">Add</a>
     </div>
-    <table class="table table-sm border-0 my-0 mx-2">
+    <table class="table table-sm border-0 m-0">
         <tbody>
         @foreach($patient->appointments as $appointment)
             <tr>
-                <td class="text-black p-0 border-0">
-                    <div class="pb-0">
-                        {{--<div relative moe center>
-                            <a class="on-hover-opaque" start show title="Update">
-                                <i class="font-size-11 fa fa-edit text-primary"></i>
-                            </a>
-                            @include('app/patient/partials/_appointment-form', ['appointment' => $appointment])
-                        </div>--}}
-                        <a class="on-hover-opaque"
+                <td class="text-black p-0 border-0 pb-1">
+                    <div class="pb-0 d-flex align-items-center">
+                        <a class="on-hover-opaque mr-1"
                            href="/patients/view/{{$patient->uid}}/manage-appointment/{{$appointment->uid}}"
                            title="Update">
                             <i class="font-size-11 fa fa-edit text-primary"></i>
                         </a>
-
-                        {{ $appointment->raw_date }}
+                        <span class="mr-1">{{ $appointment->raw_date }}</span>
                         @if($appointment->raw_start_time)
-                            &nbsp;{{ friendly_time($appointment->raw_start_time, false) }}
+                            <span class="mr-1">{{ friendly_time($appointment->raw_start_time, false) }}</span>
                         @endif
                         @if($appointment->timezone)
-                            &nbsp;<span class="text-secondary text-sm">({{ str_replace("_", " ", $appointment->timezone) }})</span>
+                            <span class="text-secondary text-sm mr-1">({{ str_replace("_", " ", $appointment->timezone) }})</span>
                         @endif
-                        &nbsp;/&nbsp;
-                        {{--<span class="d-inline-block ml- 2 text-secondary">{{ $appointment->title }}</span>
-                        &nbsp;/&nbsp;--}}
-                        <b class="mr-1">{{$appointment->pro->displayName()}}</b>
-                        <span class="text-secondary text-sm">({{ $appointment->status }})</span>
+                        <span class="mr-1">/</span>
+                        <span class="font-weight-bold mr-1">{{$appointment->pro->displayName()}}</span>
+                        <div moe>
+                            <a href="#" start show class="text-sm">({{ $appointment->status }})</a>
+                            <form url="/api/appointment/updateStatus">
+                                <input type="hidden" name="uid" value="{{ $appointment->uid }}">
+                                <div class="mb-2">
+                                    <select class="form-control form-control-sm bg-light" name="status" required>
+                                        <option value="">-- select --</option>
+                                        <option {{ $appointment->status === 'CREATED' ? 'selected' : '' }} value="CREATED">CREATED</option>
+                                        <option {{ $appointment->status === 'CONFIRMED' ? 'selected' : '' }} value="CONFIRMED">CONFIRMED</option>
+                                        <option {{ $appointment->status === 'CANCELLED' ? 'selected' : '' }} value="CANCELLED">CANCELLED</option>
+                                        <option {{ $appointment->status === 'COMPLETED' ? 'selected' : '' }} value="COMPLETED">COMPLETED</option>
+                                        <option {{ $appointment->status === 'ABANDONED' ? 'selected' : '' }} value="ABANDONED">ABANDONED</option>
+                                    </select>
+                                </div>
+                                <div>
+                                    <button submit class="btn btn-sm btn-primary mr-1">Update</button>
+                                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                        <span class="text-sm ml-2">{{ $appointment->title ? $appointment->title : '' }}</span>
+                        @if($appointment->title && $appointment->description)<span class="text-secondary mx-1">/</span>@endif
+                        <span class="text-sm">{{ $appointment->description ? $appointment->description : '' }}</span>
                     </div>
                 </td>
             </tr>

+ 77 - 0
resources/views/app/patient/partials/dx-table-row.blade.php

@@ -0,0 +1,77 @@
+@foreach($dxRows as $line)
+    <tr>
+        <td class="px-2">{{$line->content_text}}</td>
+        <td class="px-2">{{ @$line->contentDetail()->{"ICD"} }}</td>
+        <td class="px-2">{{ @$line->contentDetail()->{"Chronic or Acute"} }}</td>
+        <td class="px-2">{{ @$line->contentDetail()->{"Prognosis"} }}</td>
+        <td class="px-2">{{ @$line->contentDetail()->{"History"} }}</td>
+        <td class="px-2">{{ @$line->contentDetail()->{"Treatment Goal"} }}</td>
+        <td class="px-2">{{ @$line->contentDetail()->{"Treatment Plan"} }}</td>
+        @if(@$showCreated)
+        <td class="px-2">{{ $line->createdBySession && $line->createdBySession->pro ? $line->createdBySession->pro->displayName() : '-'}}</td>
+        <td class="px-2">{{ friendly_date_time($line->created_at) }}</td>
+        @endif
+        <td class="px-2 text-center delete-column">
+                        <span moe wide relative class="mr-2">
+                            <a class="on-hover-opaque" start show title="Edit">
+                                <i class="font-size-11 fa fa-edit"></i>
+                            </a>
+                            <form url="/api/clientInfoLine/updateContent" right>
+                                <input type="hidden" name="uid" value="{{ $line->uid }}">
+                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                                <input type="hidden" name="category" value="dx">
+                                <input type="hidden" name="IsCurrent" value="1">
+                                <div class="mb-2">
+                                    <input type="text" class="form-control form-control-sm" name="ICD"
+                                           value="{{ @$line->contentDetail()->{"ICD"} }}" placeholder="ICD">
+                                </div>
+                                <div class="mb-2">
+                                    <input type="text" class="form-control form-control-sm" name="contentText"
+                                           value="{{$line->content_text}}" placeholder="Title">
+                                </div>
+                                <div class="mb-2">
+                                    <select name="Chronic or Acute" class="form-control form-control-sm pl-1">
+                                        <option value="">Chronic or Acute (select one)</option>
+                                        <option
+                                            {{ @$line->contentDetail()->{"Chronic or Acute"} === 'Chronic' ? 'selected' : '' }} value="Chronic">Chronic</option>
+                                        <option
+                                            {{ @$line->contentDetail()->{"Chronic or Acute"} === 'Acute' ? 'selected' : '' }} value="Acute">Acute</option>
+                                    </select>
+                                </div>
+                                <div class="mb-2">
+                                    <input type="text" class="form-control form-control-sm" name="Prognosis"
+                                           value="{{ @$line->contentDetail()->{"Prognosis"} }}" placeholder="Prognosis">
+                                </div>
+                                <div class="mb-2">
+                                    <textarea type="text" class="form-control form-control-sm" name="History"
+                                              placeholder="History">{{ @$line->contentDetail()->{"History"} }}</textarea>
+                                </div>
+                                <div class="mb-2">
+                                    <textarea type="text" class="form-control form-control-sm" name="Treatment Goal"
+                                              placeholder="Treatment Goal">{{ @$line->contentDetail()->{"Treatment Goal"} }}</textarea>
+                                </div>
+                                <div class="mb-2">
+                                    <textarea type="text" class="form-control form-control-sm" name="Treatment Plan"
+                                              placeholder="Treatment Plan">{{ @$line->contentDetail()->{"Treatment Plan"} }}</textarea>
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" type="button"
+                                            cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </span>
+            <span 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>
+                        </span>
+        </td>
+    </tr>
+@endforeach

+ 165 - 0
resources/views/app/patient/partials/dx-table.blade.php

@@ -0,0 +1,165 @@
+<?php
+$currentDxs = new \Illuminate\Support\Collection();
+$previousDxs = new \Illuminate\Support\Collection();
+foreach($dxInfoLines as $line) {
+    if(@$line->contentDetail()->{"IsCurrent"}) {
+        $currentDxs->add($line);
+    }
+    else {
+        $previousDxs->add($line);
+    }
+}
+?>
+<div class="pt-3 mb-3">
+    <div class="d-flex align-items-center pb-2">
+        <h4 class="font-weight-bold m-0">Current Dx / Focus Areas</h4>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe wide>
+            <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="dx">
+                <input type="hidden" name="IsCurrent" value="1">
+                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="ICD" value="" placeholder="ICD"></div>
+                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Title"></div>
+                <div class="mb-2">
+                    <select name="Chronic or Acute" class="form-control form-control-sm pl-1">
+                        <option value="">Chronic or Acute (select one)</option>
+                        <option value="Chronic">Chronic</option>
+                        <option value="Acute">Acute</option>
+                    </select>
+                </div>
+                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Prognosis" value="" placeholder="Prognosis"></div>
+                <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="History" value="" placeholder="History"></textarea></div>
+                <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="Treatment Goal" value="" placeholder="Treatment Goal"></textarea></div>
+                <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="Treatment Plan" value="" placeholder="Treatment Plan"></textarea></div>
+                <div class="d-flex align-items-center">
+                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                    <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+                </div>
+            </form>
+        </div>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe>
+            <a start show class="">Multi</a>
+            <form url="/api/clientInfoLine/createMultiple">
+                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <input type="hidden" name="category" value="dx">
+                <input type="hidden" name="IsCurrent" value="1">
+                <div class="mb-2">
+                    <textarea class="form-control form-control-sm" rows="8" name="contentTexts" value="" placeholder="Dx & Focus Areas *" required></textarea>
+                </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 mb-0">
+        <thead>
+        <tr>
+            <th class="px-2 text-secondary">Title</th>
+            <th class="px-2 text-secondary">ICD</th>
+            <th class="px-2 text-secondary w-60px">Chr/Act</th>
+            <th class="px-2 text-secondary">Prognosis</th>
+            <th class="px-2 text-secondary">History</th>
+            <th class="px-2 text-secondary">Goal</th>
+            <th class="px-2 text-secondary w-25">Plan</th>
+            <th class="px-2 text-secondary delete-column">&nbsp;</th>
+        </tr>
+        </thead>
+        <tbody>
+        @include('app.patient.partials.dx-table-row', ['dxRows' => $currentDxs])
+        </tbody>
+    </table>
+</div>
+<div class="pt-3">
+    <div class="d-flex align-items-center pb-2">
+        <h4 class="font-weight-bold m-0">PMHx</h4>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe wide>
+            <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="dx">
+                <input type="hidden" name="IsCurrent" value="0">
+                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="ICD" value="" placeholder="ICD"></div>
+                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="contentText" value="" placeholder="Title"></div>
+                <div class="mb-2">
+                    <select name="Chronic or Acute" class="form-control form-control-sm pl-1">
+                        <option value="">Chronic or Acute (select one)</option>
+                        <option value="Chronic">Chronic</option>
+                        <option value="Acute">Acute</option>
+                    </select>
+                </div>
+                <div class="mb-2"><input type="text" class="form-control form-control-sm" name="Prognosis" value="" placeholder="Prognosis"></div>
+                <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="History" value="" placeholder="History"></textarea></div>
+                <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="Treatment Goal" value="" placeholder="Treatment Goal"></textarea></div>
+                <div class="mb-2"><textarea type="text" class="form-control form-control-sm" name="Treatment Plan" value="" placeholder="Treatment Plan"></textarea></div>
+                <div class="d-flex align-items-center">
+                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                    <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+                </div>
+            </form>
+        </div>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe>
+            <a start show class="">Multi</a>
+            <form url="/api/clientInfoLine/createMultiple">
+                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <input type="hidden" name="category" value="dx">
+                <input type="hidden" name="IsCurrent" value="1">
+                <div class="mb-2">
+                    <textarea class="form-control form-control-sm" rows="8" name="contentTexts" value="" placeholder="Dx & Focus Areas *" required></textarea>
+                </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 mb-0">
+        <thead>
+        <tr>
+            <th class="px-2 text-secondary">Title</th>
+            <th class="px-2 text-secondary">ICD</th>
+            <th class="px-2 text-secondary w-60px">Chr/Act</th>
+            <th class="px-2 text-secondary">Prognosis</th>
+            <th class="px-2 text-secondary">History</th>
+            <th class="px-2 text-secondary">Goal</th>
+            <th class="px-2 text-secondary w-25">Plan</th>
+            <th class="px-2 text-secondary delete-column">&nbsp;</th>
+        </tr>
+        </thead>
+        <tbody>
+        @include('app.patient.partials.dx-table-row', ['dxRows' => $previousDxs])
+        </tbody>
+    </table>
+</div>
+<script>
+    (function() {
+        function init() {
+            $('input[type="text"][name="ICD"]').each(function() {
+                var elem = this, dynID = 'icd-' + Math.ceil(Math.random() * 1000000);
+                $(elem).attr('id', dynID);
+                new window.Def.Autocompleter.Search(dynID,
+                    'https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?sf=code,name&ef=name',
+                    {
+                        tableFormat: true,
+                        valueCols: [0],
+                        colHeaders: ['Code', 'Name'],
+                    }
+                );
+                window.Def.Autocompleter.Event.observeListSelections(dynID, function() {
+                    var autocomp = elem.autocomp;
+                    var name = autocomp.getSelectedItemData()[0].data['name'];
+                    $(elem).closest('form').find('[name="contentText"]').val(name);
+                    return false;
+                });
+            });
+        }
+        addMCInitializer('patient-dx-list', init);
+    })();
+</script>

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

@@ -43,7 +43,7 @@
                         </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.dx-and-focus-areas') === 0 ? 'active' : '' }}"
-                               href="{{ route('patients.view.dx-and-focus-areas', ['patient' => $patient]) }}">Current Focus Areas</a>
+                               href="{{ route('patients.view.dx-and-focus-areas', ['patient' => $patient]) }}">Dx and Focus Areas</a>
                         </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.care-team') === 0 ? 'active' : '' }}"
@@ -492,51 +492,26 @@
                             </div>
                         </div></div> <!-- z -->
                     </div>
-                    {{--<div>
-                        <pre>
-                            <?php
-                            dump($patient->activeMcpRequest ? $patient->activeMcpRequest->toArray() : 'null');
-                            ?>
-                        </pre>
-                        <pre>
-                            patient->active_mcp_request_id:
-                            <?php
-                            dump($patient->active_mcp_request_id);
-                            ?>
-                        </pre>
-                        <pre>
-                            pro->last_mcp_request_id:
-                            <?php
-                            dump($pro->last_mcp_request_id);
-                            ?>
-                        </pre>
-                    </div>--}}
                     <div class="text-container border-bottom d-flex align-items-center mcp-theme-1 px-3">
 
                         <div class="mr-auto py-2">
                             @if($pro->isWorkingOnClient($patient))
                                 {{-- stop work on client --}}
                                 <div moe>
-                                    <a href="" start show  class="btn btn-sm btn-danger text-white font-weight-bold small">Stop working on this client</a>
-                                    <form url="/api/proClientWork/KillRunningWorkForSelf" class="mcp-theme-1">
+                                    <form url="/api/proClientWork/KillRunningWorkForSelf" class="mcp-theme-1" show>
                                         <input type="hidden" name="uid" value="{{$patient->uid}}">
-                                        <p>Stop working on this patient?</p>
                                         <div>
-                                            <button submit class="btn btn-sm btn-primary mr-2">Yes</button>
-                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                            <button submit class="btn btn-sm btn-danger text-white font-weight-bold small">Stop working on this client</button>
                                         </div>
                                     </form>
                                 </div>
                             @else
                                 {{-- start work on client --}}
                                 <div moe>
-                                    <a href="" start show  class="btn btn-sm btn-primary text-white font-weight-bold small">Start working on this client</a>
-                                    <form url="/api/proClientWork/create" class="mcp-theme-1">
+                                    <form url="/api/proClientWork/create" class="mcp-theme-1" show>
                                         <input type="hidden" name="clientUid" value="{{$patient->uid}}">
-                                        <p>Start working on this patient?</p>
                                         <div>
-                                            <button submit class="btn btn-sm btn-primary mr-2">Yes</button>
-                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                            <button submit class="btn btn-sm btn-primary text-white font-weight-bold small">Start working on this client</button>
                                         </div>
                                     </form>
                                 </div>