|
@@ -8,21 +8,7 @@ use App\Models\Segment;
|
|
|
/** @var Client $patient */
|
|
|
/** @var Note $note */
|
|
|
|
|
|
-$points = Point
|
|
|
- ::where('client_id', $patient->id)
|
|
|
- ->where('category', 'PROBLEM')
|
|
|
- ->where('is_removed_due_to_entry_error', false)
|
|
|
- ->orderBy('is_removed')
|
|
|
- ->orderBy('removal_effective_date', 'DESC')
|
|
|
- ->orderBy('created_at')
|
|
|
- ->get();
|
|
|
-foreach ($points as $point) {
|
|
|
- if ($point->data) {
|
|
|
- $point->data = json_decode($point->data);
|
|
|
- }
|
|
|
-}
|
|
|
-$problems = $points;
|
|
|
-
|
|
|
+$problems = Point::getPointsOfCategoryExtended($patient, 'PROBLEM', $note);
|
|
|
$ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
?>
|
|
|
|
|
@@ -49,24 +35,24 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
@endif
|
|
|
<th class="border-bottom-0 text-secondary">Name</th>
|
|
|
<th class="border-bottom-0 text-secondary">Active?</th>
|
|
|
- <th class="border-bottom-0 text-secondary">Edit</th>
|
|
|
<th class="border-bottom-0 text-secondary">Started</th>
|
|
|
<th class="border-bottom-0 text-secondary">Ended</th>
|
|
|
- <th class="border-bottom-0 text-secondary w-25">Last Review</th>
|
|
|
- <th class="border-bottom-0 text-secondary w-25">Last Plan</th>
|
|
|
+ <th class="border-bottom-0 text-secondary w-25">HPI</th>
|
|
|
+ <th class="border-bottom-0 text-secondary w-25">Plan</th>
|
|
|
+ <th class="border-bottom-0 text-secondary">Edit</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
- <?php $prevRowRemoved = -1; ?>
|
|
|
+ <?php $prevRowState = -1; ?>
|
|
|
<?php foreach($problems as $problem): ?>
|
|
|
<?php $point = $problem; ?>
|
|
|
- @if($prevRowRemoved !== -1 && $prevRowRemoved !== $problem->is_removed)
|
|
|
+ @if($prevRowState !== -1 && $prevRowState !== $problem->state)
|
|
|
<tr>
|
|
|
<td colspan="9" class="px-0 pt-1 pb-0 on-hover-opaque bg-secondary"></td>
|
|
|
</tr>
|
|
|
@endif
|
|
|
- <?php $prevRowRemoved = $problem->is_removed; ?>
|
|
|
+ <?php $prevRowState = $problem->state; ?>
|
|
|
<?php $rel = $problem->relevanceToNote($note); ?>
|
|
|
- <tr class="">
|
|
|
+ <tr class="{{$rel ? 'relevant-to-visit' : ''}}">
|
|
|
@if($patient->core_note_id !== $note->id)
|
|
|
<td class="text-center">
|
|
|
<a href="#" class="toggle-relevance"
|
|
@@ -84,10 +70,14 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
@endif
|
|
|
<td>
|
|
|
<div class="d-flex align-items-baseline">
|
|
|
- @if($problem->is_removed)
|
|
|
- <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
|
- @else
|
|
|
- <i class="text-success fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
|
+ @if($problem->state === 1)
|
|
|
+ <i class="text-success fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
|
+ @elseif($problem->state === 2)
|
|
|
+ <i class="text-info fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
|
+ @elseif($problem->state === 3)
|
|
|
+ <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque mr-2 active-record"></i>
|
|
|
+ @elseif($problem->state === 4)
|
|
|
+ <i class="text-secondary fa fa-circle text-sm on-hover-opaque mr-2"></i>
|
|
|
@endif
|
|
|
<div>
|
|
|
<b><?= !!@($problem->data->name) ? @($problem->data->name) : '-' ?></b>
|
|
@@ -116,6 +106,11 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
@endif
|
|
|
</div>
|
|
|
@endif
|
|
|
+ @if($rel)
|
|
|
+ <div class="mt-1">
|
|
|
+ <span class="text-sm text-white bg-info rounded px-2 py-1 font-weight-bold">Visit reason</span>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
@@ -126,143 +121,11 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
<b>YES</b>
|
|
|
@endif
|
|
|
</td>
|
|
|
- <td>
|
|
|
- <div moe wide>
|
|
|
- <a start show href="#" title="Edit">Edit</a>
|
|
|
- <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1 frm-edit-problem">
|
|
|
- <input type="hidden" name="uid" value="<?= $problem->uid ?>">
|
|
|
- <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
- <p class="mb-2"><b>Update Problem</b></p>
|
|
|
-
|
|
|
- @if($problem->added_in_note_id === $note->id)
|
|
|
-
|
|
|
- <input type="hidden" name="data">
|
|
|
- <input type="hidden" data-name="dxid" value="{{@$problem->data->dxid}}">
|
|
|
- <input type="hidden" data-name="icd-type" value="{{@$problem->data->{'icd-type'} }}">
|
|
|
-
|
|
|
- <div class="mb-2">
|
|
|
- <label class="text-sm text-secondary mb-1">Problem</label>
|
|
|
- <input type="text" class="form-control form-control-sm min-width-unset"
|
|
|
- data-name="name"
|
|
|
- value="{{@$problem->data->name}}"
|
|
|
- stag-suggest
|
|
|
- stag-suggest-ep="/fdb-dx-suggest/json">
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="mb-2">
|
|
|
- <label class="text-sm text-secondary mb-0">ICD</label>
|
|
|
- <select data-name="icd"
|
|
|
- class="form-control form-control-sm"
|
|
|
- disabled>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="row mb-2">
|
|
|
- <div class="col-6 pr-0">
|
|
|
- <label class="text-sm mb-0">Start Date</label>
|
|
|
- <input type="date"
|
|
|
- data-name="start_date"
|
|
|
- value="{{@$problem->data->start_date}}"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- <div class="col-6">
|
|
|
- <label class="text-sm mb-0">Added By</label>
|
|
|
- <input type="text"
|
|
|
- data-name="prescriber"
|
|
|
- value="{{@$problem->data->prescriber}}"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- @else
|
|
|
-
|
|
|
- <div class="mb-2 bg-light p-2 border">
|
|
|
- <p class="mb-1 font-weight-bold">
|
|
|
- {{ @$problem->data->name }}
|
|
|
- </p>
|
|
|
- @if($patient->core_note_id !== $note->id)
|
|
|
- <div class="text-secondary text-sm">Clinical details cannot be modified since the problem was added prior to this visit.</div>
|
|
|
- @else
|
|
|
- <div class="text-secondary text-sm">Clinical details cannot be modified since the problem was added on a previous visit.</div>
|
|
|
- @endif
|
|
|
- </div>
|
|
|
-
|
|
|
- @endif
|
|
|
-
|
|
|
- <hr class="my-3">
|
|
|
-
|
|
|
- <div class="row mb-2">
|
|
|
- <div class="col-4 pr-0">
|
|
|
- <label class="text-sm mb-0">When Added</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="additionReasonCategory" required>
|
|
|
- <option value="">-- select --</option>
|
|
|
- <option value="ON_INTAKE" {{$problem->addition_reason_category === 'ON_INTAKE' ? 'selected' : ''}}>On Intake</option>
|
|
|
- <option value="DURING_VISIT" {{$problem->addition_reason_category === 'DURING_VISIT' ? 'selected' : ''}}>During Visit</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-8">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Addition Memo</label>
|
|
|
- <input type="text"
|
|
|
- name="additionReasonMemo"
|
|
|
- value="{{$problem->addition_reason_memo}}"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <hr class="my-3">
|
|
|
-
|
|
|
- <div class="row mb-2">
|
|
|
- <div class="col-6 pr-0">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Is problem active?</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="isRemoved" required>
|
|
|
- <option value="">-- select --</option>
|
|
|
- <option value="0" {{!$problem->is_removed ? 'selected' : ''}}>Yes</option>
|
|
|
- <option value="1" {{$problem->is_removed ? 'selected' : ''}}>No</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-6 is_removed_ui_1" style="display: none">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Is entry error?</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="isRemovedDueToEntryError">
|
|
|
- <option value="1" {{$problem->is_removed_due_to_entry_error ? 'selected' : ''}}>Yes</option>
|
|
|
- <option value="0" {{!$problem->is_removed_due_to_entry_error ? 'selected' : ''}}>No</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="row mb-2 is_removed_ui_2" style="display: none">
|
|
|
- <div class="col-4 pr-0">
|
|
|
- <label class="text-sm mb-0 min-width-unset">When Removed</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="removalReasonCategory">
|
|
|
- <option value="">-- select --</option>
|
|
|
- <option value="ON_INTAKE" {{$problem->removal_reason_category === 'ON_INTAKE' ? 'selected' : ''}}>On Intake</option>
|
|
|
- <option value="DURING_VISIT" {{$problem->removal_reason_category === 'DURING_VISIT' ? 'selected' : ''}}>During Visit</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-4 pr-0">
|
|
|
- <label class="text-sm mb-0 min-width-unset">End Date</label>
|
|
|
- <input type="date"
|
|
|
- name="removalEffectiveDate"
|
|
|
- value="{{$problem->removal_effective_date ? $problem->removal_effective_date : ''}}"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- <div class="col-4">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Removal By/Memo</label>
|
|
|
- <input type="text"
|
|
|
- name="removalReasonMemo"
|
|
|
- value="{{$problem->removal_reason_memo}}"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div>
|
|
|
- <button type="submit" class="btn-save-problem btn btn-sm btn-primary mr-2">Save</button>
|
|
|
- <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
<td>
|
|
|
<?= !!@($problem->data->start_date) ? friendly_date($problem->data->start_date) : '-' ?>
|
|
|
+ @if(!!@($problem->data->prescriber))
|
|
|
+ <div class="mt-1 text-sm text-secondary">By: <?= !!@($problem->data->prescriber) ? @($problem->data->prescriber) : '-' ?></div>
|
|
|
+ @endif
|
|
|
</td>
|
|
|
<td>
|
|
|
<?= !!@($problem->removal_effective_date) ? friendly_date($problem->removal_effective_date) : '-' ?>
|
|
@@ -279,7 +142,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
?>
|
|
|
</div>
|
|
|
<div class="d-inline-flex flex-nowrap">
|
|
|
- <a class="px-2 view-review-log"
|
|
|
+ <a class="pl-2 view-review-log"
|
|
|
native target="_blank"
|
|
|
open-in-stag-popup
|
|
|
popup-style="stag-popup-md"
|
|
@@ -288,10 +151,10 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
<i class="fa fa-history"></i>
|
|
|
</a>
|
|
|
<?php
|
|
|
- $segment = $note->getSegmentByInternalName('intake_problems');
|
|
|
+ /*$segment = $note->getSegmentByInternalName('intake_problems');
|
|
|
if($segment) {
|
|
|
include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
|
|
|
- }
|
|
|
+ }*/
|
|
|
?>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -304,7 +167,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
?>
|
|
|
</div>
|
|
|
<div class="d-inline-flex flex-nowrap">
|
|
|
- <a class="px-2 view-review-log"
|
|
|
+ <a class="pl-2 view-review-log"
|
|
|
native target="_blank"
|
|
|
open-in-stag-popup
|
|
|
popup-style="stag-popup-md"
|
|
@@ -313,20 +176,78 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
<i class="fa fa-history"></i>
|
|
|
</a>
|
|
|
<?php
|
|
|
- $segment = $note->getSegmentByInternalName('plan_problems');
|
|
|
+ /*$segment = $note->getSegmentByInternalName('plan_problems');
|
|
|
if($segment) {
|
|
|
include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
|
|
|
- }
|
|
|
+ }*/
|
|
|
?>
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
+ <td>
|
|
|
+ <div moe huge relative>
|
|
|
+ <a start show href="#" title="Edit">Edit</a>
|
|
|
+ <form url="/api/visitPoint/updateTopLevel" class="mcp-theme-1 frm-edit-problem" right>
|
|
|
+ <input type="hidden" name="uid" value="<?= $problem->uid ?>">
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
+ <p class="mb-2"><b>Update Problem</b></p>
|
|
|
+
|
|
|
+ <input type="hidden" name="data" value='{{json_encode($problem->data)}}'>
|
|
|
+
|
|
|
+ @if($problem->added_in_note_id === $note->id)
|
|
|
+
|
|
|
+ <input type="hidden" data-name="dxid" value="{{@$problem->data->dxid}}">
|
|
|
+ <input type="hidden" data-name="icd-type" value="{{@$problem->data->{'icd-type'} }}">
|
|
|
+
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="text-sm text-secondary mb-1">Problem</label>
|
|
|
+ <input type="text" class="form-control form-control-sm min-width-unset"
|
|
|
+ data-name="name"
|
|
|
+ value="{{@$problem->data->name}}"
|
|
|
+ stag-suggest
|
|
|
+ stag-suggest-ep="/fdb-dx-suggest/json">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="text-sm text-secondary mb-0">ICD</label>
|
|
|
+ <input type="text"
|
|
|
+ data-name="icd"
|
|
|
+ data-option-list
|
|
|
+ class="form-control form-control-sm"
|
|
|
+ value="{{@$problem->data->icd}}">
|
|
|
+ <div class="data-option-list"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @else
|
|
|
+
|
|
|
+ <div class="mb-2 bg-light p-2 border">
|
|
|
+ <p class="mb-1 font-weight-bold">
|
|
|
+ {{ @$problem->data->name }}
|
|
|
+ </p>
|
|
|
+ @if($patient->core_note_id !== $note->id)
|
|
|
+ <div class="text-secondary text-sm">Clinical details cannot be modified since the problem was added prior to this visit.</div>
|
|
|
+ @else
|
|
|
+ <div class="text-secondary text-sm">Clinical details cannot be modified since the problem was added on a previous visit.</div>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @endif
|
|
|
+
|
|
|
+ @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
|
|
|
+
|
|
|
+ <div class="mt-3 pt-2 d-flex align-items-center border-top">
|
|
|
+ <button type="submit" class="btn-save-problem btn btn-sm btn-primary mr-2">Save</button>
|
|
|
+ <button cancel class="btn btn-sm bg-light btn-default border">Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
<?php endforeach; ?>
|
|
|
</table>
|
|
|
|
|
|
<div class="d-flex align-items-center">
|
|
|
- <div class="mt-1 w-100 border p-2 bg-aliceblue border-info rounded">
|
|
|
+ <div class="mt-1 w-100 border p-3 bg-aliceblue border-info rounded">
|
|
|
<form action="/api/visitPoint/addTopLevel" class="mcp-theme-1 w-100" id="frm-add-problem">
|
|
|
<input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
<input type="hidden" name="category" value="PROBLEM">
|
|
@@ -335,10 +256,11 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
<input type="hidden" data-name="dxid">
|
|
|
<input type="hidden" data-name="icd-type">
|
|
|
|
|
|
- <p class="mb-2"><b>Add Problem</b></p>
|
|
|
+ <input type="hidden" name="isRemovedDueToEntryError" value="0">
|
|
|
|
|
|
<div class="row">
|
|
|
- <div class="col-7">
|
|
|
+ <div class="col-8">
|
|
|
+ <p class="mb-2"><b>Add Problem</b></p>
|
|
|
<div class="row mb-2">
|
|
|
<div class="col-8 pr-0">
|
|
|
<label class="text-sm text-secondary mb-0">Name</label>
|
|
@@ -352,94 +274,28 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
</div>
|
|
|
<div class="col-4">
|
|
|
<label class="text-sm text-secondary mb-0">ICD</label>
|
|
|
- <select data-name="icd"
|
|
|
- class="form-control form-control-sm"
|
|
|
- disabled>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="row mb-2">
|
|
|
- <div class="col-6 pr-0">
|
|
|
- <label class="text-sm mb-0">Start Date</label>
|
|
|
- <input type="date"
|
|
|
- data-name="start_date"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- <div class="col-6">
|
|
|
- <label class="text-sm mb-0">Added By</label>
|
|
|
<input type="text"
|
|
|
- data-name="prescriber"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!--<div class="mb-2">
|
|
|
- <label class="text-sm mb-1">Description</label>
|
|
|
- <textarea rows="1" data-name="description" class="form-control form-control-sm"></textarea>
|
|
|
- </div>-->
|
|
|
-
|
|
|
- <hr class="my-3">
|
|
|
-
|
|
|
- <div class="row mb-2">
|
|
|
- <div class="col-4 pr-0">
|
|
|
- <label class="text-sm mb-0">When Added</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="additionReasonCategory" required>
|
|
|
- <option value="">-- select --</option>
|
|
|
- <option value="ON_INTAKE">On Intake</option>
|
|
|
- <option value="DURING_VISIT">During Visit</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-8">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Addition Memo</label>
|
|
|
- <input type="text"
|
|
|
- name="additionReasonMemo"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <hr class="my-3">
|
|
|
-
|
|
|
- <div class="row mb-2">
|
|
|
- <div class="col-6 pr-0">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Is problem active?</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="isRemoved" required>
|
|
|
- <option value="0" selected>Yes</option>
|
|
|
- <option value="1">No</option>
|
|
|
- </select>
|
|
|
+ data-name="icd"
|
|
|
+ data-option-list
|
|
|
+ class="form-control form-control-sm"
|
|
|
+ disabled>
|
|
|
+ <div class="data-option-list"></div>
|
|
|
</div>
|
|
|
- <input type="hidden" name="isRemovedDueToEntryError" value="0">
|
|
|
</div>
|
|
|
|
|
|
- <div class="row mb-2 is_removed_ui_2" style="display: none">
|
|
|
- <div class="col-4 pr-0">
|
|
|
- <label class="text-sm mb-0 min-width-unset">When Removed</label>
|
|
|
- <select class="form-control form-control-sm min-width-unset" name="removalReasonCategory">
|
|
|
- <option value="">-- select --</option>
|
|
|
- <option value="ON_INTAKE">On Intake</option>
|
|
|
- <option value="DURING_VISIT">During Visit</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="col-4 pr-0">
|
|
|
- <label class="text-sm mb-0 min-width-unset">End Date</label>
|
|
|
- <input type="date"
|
|
|
- name="removalEffectiveDate"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- <div class="col-4">
|
|
|
- <label class="text-sm mb-0 min-width-unset">Removal By/Memo</label>
|
|
|
- <input type="text"
|
|
|
- name="removalReasonMemo"
|
|
|
- class="form-control form-control-sm min-width-unset">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <?php $point = null; ?>
|
|
|
+ @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
|
|
|
|
|
|
</div>
|
|
|
- <div class="col-5 border-left">
|
|
|
+ <div class="col-4 border-left">
|
|
|
+ <div class="fdb-dx-vigilance max-height-400px overflow-auto">
|
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="d-flex align-items-center">
|
|
|
- <button type="submit" class="btn btn-sm btn-primary mr-2 my-1">Save Problem</button>
|
|
|
+ <button type="submit" class="btn btn-sm btn-primary mr-2 mt-1">Save Problem</button>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
@@ -449,278 +305,38 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
|
|
|
<script>
|
|
|
(function() {
|
|
|
- function initVisitMoeRTEs() {
|
|
|
- $('.stag-popup [visit-moe]').find('[note-rte]:not(.ql-container)').each(function() {
|
|
|
-
|
|
|
- let noteRTE = $(this);
|
|
|
-
|
|
|
- $(this).wrap(
|
|
|
- $('<div class="border-left border-right rte-holder"/>')
|
|
|
- .attr('data-shortcuts', '')
|
|
|
- );
|
|
|
-
|
|
|
- // give a unique id to this editor instance
|
|
|
- var editorID = Math.ceil(Math.random() * 99999),
|
|
|
- fieldName = $(this).attr('data-field-name') ? $(this).attr('data-field-name') : 'free_text';
|
|
|
-
|
|
|
- var el = this;
|
|
|
- var existingContent = $(el).html();
|
|
|
- var quill = new Quill(el, {
|
|
|
- theme: 'snow',
|
|
|
- modules: stagQuillConfig
|
|
|
- });
|
|
|
-
|
|
|
- var toolbar = $(quill.container).prev('.ql-toolbar');
|
|
|
-
|
|
|
- // add button for new shortcut
|
|
|
- if(!noteRTE.is('[use-shortcuts]') || !noteRTE.attr('use-shortcuts')) {
|
|
|
- var newSCButton = $('<button class="btn bg-white btn-sm btn-default text-primary w-auto px-2 border py-0 ' +
|
|
|
- 'text-sm add-shortcut" data-editor-id="' + editorID + '">+ Shortcut</button>');
|
|
|
- toolbar.append(newSCButton);
|
|
|
- }
|
|
|
-
|
|
|
- quill.root.innerHTML = existingContent;
|
|
|
-
|
|
|
- let onTextChange = function(delta, oldDelta, source) {
|
|
|
- var content = quill.root.innerHTML;
|
|
|
- let dataObject = {};
|
|
|
- dataObject[fieldName] = content;
|
|
|
- var dataValue = JSON.stringify(dataObject);
|
|
|
- let pElem = $(el).closest('[visit-moe]');
|
|
|
- if(!pElem.length) {
|
|
|
- pElem = $(el).closest('form');
|
|
|
- }
|
|
|
- pElem.find('input[name=data]').val(dataValue);
|
|
|
- };
|
|
|
-
|
|
|
- quill.on('text-change', onTextChange);
|
|
|
-
|
|
|
- $(quill.container)
|
|
|
- .find('.ql-editor[contenteditable]')
|
|
|
- .attr('data-field', fieldName)
|
|
|
- .attr('data-editor-id', editorID)
|
|
|
- .attr('with-shortcuts', 1);
|
|
|
-
|
|
|
- // set value initially
|
|
|
- onTextChange();
|
|
|
- });
|
|
|
- }
|
|
|
function init() {
|
|
|
let parentSegment = $('#problems-center-{{$note->id}}');
|
|
|
parentSegment.find('input[stag-suggest][data-name="name"]')
|
|
|
.off('stag-suggest-selected')
|
|
|
.on('stag-suggest-selected', (_e, _input, _data) => {
|
|
|
$(_input).closest('form').find('input[data-name="dxid"]').val(_data.dxid);
|
|
|
- let icdSelect = $(_input).closest('form').find('[data-name="icd"]').empty().prop('disabled', true);
|
|
|
+ let icdSelect = $(_input).closest('form').find('[data-name="icd"]').val('').prop('disabled', true);
|
|
|
+ icdSelect.next('.data-option-list').empty();
|
|
|
+
|
|
|
+ $('.fdb-dx-vigilance').html('<span class="text-secondary font-italic">Please wait ...</span>');
|
|
|
+ $.post('/fdb-dx-vigilance/{{$patient->uid}}', {
|
|
|
+ _token: '{{csrf_token()}}',
|
|
|
+ dxid: _data.dxid,
|
|
|
+ name: _input.val(),
|
|
|
+ }, _data => {
|
|
|
+ $('.fdb-dx-vigilance').html(_data);
|
|
|
+ });
|
|
|
+
|
|
|
$.get('/fdb-dx-icds-for-dxid?dxid=' + _data.dxid, _data => {
|
|
|
icdSelect.empty().append('<option value="">-- select --</option>');
|
|
|
for (let i = 0; i < _data.length; i++) {
|
|
|
- icdSelect.append('<option value="' + _data[i].search_icd_cd + '" data-icd-type="' + _data[i].icd_cd_type + '">' + _data[i].search_icd_cd + ' (' + (_data[i].icd_cd_type === '01' ? 'ICD-9' : 'ICD-10') + ') - ' + _data[i].icd_desc + '</option>')
|
|
|
- }
|
|
|
- icdSelect.prop('disabled', false);
|
|
|
- if (_data.length === 1) {
|
|
|
- icdSelect.val(_data[0].search_icd_cd).trigger('change');
|
|
|
- }
|
|
|
- }, 'json');
|
|
|
- });
|
|
|
-
|
|
|
- // on route selection
|
|
|
- parentSegment.find('input[data-name="icd"]')
|
|
|
- .off('change')
|
|
|
- .on('change', function () {
|
|
|
- $(this).closest('form').find('input[data-name="icd-type"]').val($(this).find('option:selected').attr('data-icd-type'));
|
|
|
- });
|
|
|
-
|
|
|
- parentSegment.find('.additionReasonCategory_ui')
|
|
|
- .off('change')
|
|
|
- .on('change', function() {
|
|
|
-
|
|
|
- let form = $(this).closest('form');
|
|
|
-
|
|
|
- // additionReasonCategory
|
|
|
- // isRemoved
|
|
|
- // removalReasonCategory
|
|
|
- form.find('[name="isRemovedDueToEntryError"]').val('0');
|
|
|
-
|
|
|
- form.find('.start_date_ui').hide();
|
|
|
- form.find('.removalEffectiveDate_ui').hide();
|
|
|
- form.find('.removalReasonMemo_ui').hide();
|
|
|
-
|
|
|
- if(this.value === 'HISTORIC') {
|
|
|
- form.find('[name="additionReasonCategory"]').val('ON_INTAKE');
|
|
|
- form.find('[name="isRemoved"]').val('1');
|
|
|
- form.find('.start_date_ui').show();
|
|
|
- form.find('.removalEffectiveDate_ui').show();
|
|
|
- form.find('.removalReasonMemo_ui').show();
|
|
|
- }
|
|
|
- else if(this.value === 'PRE_EXISTING') {
|
|
|
- form.find('[name="additionReasonCategory"]').val('ON_INTAKE');
|
|
|
- form.find('[name="isRemoved"]').val('0');
|
|
|
- form.find('.start_date_ui').show();
|
|
|
- }
|
|
|
- else if(this.value === 'NEW') {
|
|
|
- form.find('[name="additionReasonCategory"]').val('DURING_VISIT');
|
|
|
- form.find('[name="isRemoved"]').val('0');
|
|
|
- form.find('.start_date_ui').show().find('input').val('{{date('Y-m-d')}}');
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- parentSegment.find('[name="isRemoved"], [name="isRemovedDueToEntryError"]')
|
|
|
- .off('change')
|
|
|
- .on('change', function () {
|
|
|
- let form = $(this).closest('form');
|
|
|
-
|
|
|
- form.find('.is_removed_ui_1').hide();
|
|
|
- if(form.find('[name="isRemoved"]').val() === '1') {
|
|
|
- form.find('.is_removed_ui_1').show();
|
|
|
- }
|
|
|
-
|
|
|
- form.find('.is_removed_ui_2').hide();
|
|
|
- if(form.find('[name="isRemoved"]').val() === '1' && form.find('[name="isRemovedDueToEntryError"]').val() !== '1') {
|
|
|
- form.find('.is_removed_ui_2').show();
|
|
|
- }
|
|
|
- return false;
|
|
|
- });
|
|
|
-
|
|
|
- parentSegment.find('#frm-add-problem')
|
|
|
- .off('submit')
|
|
|
- .on('submit', function () {
|
|
|
-
|
|
|
- let form = $(this);
|
|
|
-
|
|
|
- if (!form[0].checkValidity()) {
|
|
|
- form[0].reportValidity();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // add [data-name] values to payload
|
|
|
- let dataField = form.find('[name="data"]').first();
|
|
|
- let parsed = null;
|
|
|
- if(dataField.val()) {
|
|
|
- parsed = JSON.parse(dataField.val());
|
|
|
- }
|
|
|
- form.find('[data-name]').each(function() {
|
|
|
- if(!parsed) parsed = {};
|
|
|
-
|
|
|
- let keys = $(this).attr('data-name').split('->');
|
|
|
- let currentNode = parsed;
|
|
|
- for (let i = 0; i < keys.length; i++) {
|
|
|
- if(i !== keys.length - 1) {
|
|
|
- if(typeof currentNode[keys[i]] === 'undefined') {
|
|
|
- currentNode[keys[i]] = {};
|
|
|
- }
|
|
|
- currentNode = currentNode[keys[i]];
|
|
|
- }
|
|
|
- else {
|
|
|
- if($(this).is(':checkbox')) {
|
|
|
- currentNode[keys[i]] = $(this).prop('checked');
|
|
|
- }
|
|
|
- else {
|
|
|
- currentNode[keys[i]] = $(this).val();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- if(parsed) {
|
|
|
- dataField.val(JSON.stringify(parsed));
|
|
|
- }
|
|
|
-
|
|
|
- $.post(form.attr('action'), form.serialize(), _data => {
|
|
|
- if(!hasResponseError(_data)) {
|
|
|
- hideMask();
|
|
|
- refreshDynamicStagPopup();
|
|
|
- $('.visit-segment[data-segment-template-name="intake_problems"]').find('.refresh-segment').trigger('click');
|
|
|
- }
|
|
|
- }, 'json');
|
|
|
- return false;
|
|
|
- });
|
|
|
-
|
|
|
- parentSegment.find('.frm-edit-problem')
|
|
|
- .off('submit')
|
|
|
- .on('submit', function () {
|
|
|
-
|
|
|
- let form = $(this);
|
|
|
-
|
|
|
- if (!form[0].checkValidity()) {
|
|
|
- form[0].reportValidity();
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // add [data-name] values to payload
|
|
|
- let dataField = form.find('[name="data"]').first();
|
|
|
- let parsed = null;
|
|
|
- if(dataField.val()) {
|
|
|
- parsed = JSON.parse(dataField.val());
|
|
|
- }
|
|
|
- form.find('[data-name]').each(function() {
|
|
|
- if(!parsed) parsed = {};
|
|
|
-
|
|
|
- let keys = $(this).attr('data-name').split('->');
|
|
|
- let currentNode = parsed;
|
|
|
- for (let i = 0; i < keys.length; i++) {
|
|
|
- if(i !== keys.length - 1) {
|
|
|
- if(typeof currentNode[keys[i]] === 'undefined') {
|
|
|
- currentNode[keys[i]] = {};
|
|
|
- }
|
|
|
- currentNode = currentNode[keys[i]];
|
|
|
- }
|
|
|
- else {
|
|
|
- if($(this).is(':checkbox')) {
|
|
|
- currentNode[keys[i]] = $(this).prop('checked');
|
|
|
- }
|
|
|
- else {
|
|
|
- currentNode[keys[i]] = $(this).val();
|
|
|
- }
|
|
|
+ if(_data[i].icd_cd_type !== '01') {
|
|
|
+ icdSelect.next('.data-option-list').append($('<div/>').text(_data[i].search_icd_cd));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- });
|
|
|
- if(parsed) {
|
|
|
- dataField.val(JSON.stringify(parsed));
|
|
|
- }
|
|
|
-
|
|
|
- $.post(form.attr('url'), form.serialize(), _data => {
|
|
|
- if(!hasResponseError(_data)) {
|
|
|
- hideMask();
|
|
|
- refreshDynamicStagPopup();
|
|
|
- $('.visit-segment[data-segment-template-name="intake_problems"]').find('.refresh-segment').trigger('click');
|
|
|
- }
|
|
|
+ icdSelect.prop('disabled', false);
|
|
|
}, 'json');
|
|
|
- return false;
|
|
|
});
|
|
|
|
|
|
- parentSegment.find('.toggle-relevance')
|
|
|
- .off('click.toggle-relevance')
|
|
|
- .on('click.toggle-relevance', function () {
|
|
|
- if(+$(this).attr('data-relevant') === 0) {
|
|
|
- $.post('/api/visitPoint/markPointRelevantToNote', {
|
|
|
- noteUid: '{{$note->uid}}',
|
|
|
- pointUid: $(this).attr('data-point-uid')
|
|
|
- }, _data => {
|
|
|
- if(!hasResponseError(_data)) {
|
|
|
- refreshDynamicStagPopup();
|
|
|
- }
|
|
|
- }, 'json');
|
|
|
- }
|
|
|
- else {
|
|
|
- if($(this).attr('data-rel-uid')) {
|
|
|
- $.post('/api/visitPoint/undoMarkPointRelevantToNote', {
|
|
|
- uid: $(this).attr('data-rel-uid')
|
|
|
- }, _data => {
|
|
|
- if(!hasResponseError(_data)) {
|
|
|
- refreshDynamicStagPopup();
|
|
|
- }
|
|
|
- }, 'json');
|
|
|
- }
|
|
|
- else {
|
|
|
- console.log('Error - missing rel uid');
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
- });
|
|
|
+ @include('app.patient.wizard-partials.common-script', ['label' => 'problem'])
|
|
|
|
|
|
+ @if($patient->core_note_id !== $note->id)
|
|
|
parentSegment.find('.regenerate-cc')
|
|
|
.off('click.regenerate-cc')
|
|
|
.on('click.regenerate-cc', function () {
|
|
@@ -743,14 +359,10 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
|
|
|
|
|
|
return false;
|
|
|
});
|
|
|
-
|
|
|
- initStagSuggest();
|
|
|
-
|
|
|
- parentSegment.find('.additionReasonCategory_ui').trigger('change');
|
|
|
- parentSegment.find('[name="isRemoved"]').trigger('change');
|
|
|
+ @endif
|
|
|
|
|
|
initSegmentMoes($('#problems-center-{{$note->id}}'));
|
|
|
- initVisitMoeRTEs();
|
|
|
+ __initRTEs(parentSegment.find('[note-rte]:not(.ql-container)'));
|
|
|
}
|
|
|
addMCInitializer('problems-center-{{$note->id}}', init, '#problems-center-{{$note->id}}');
|
|
|
}).call(window);
|