Prechádzať zdrojové kódy

new line layout for problems wizard (wip)

Vijayakrishnan 3 rokov pred
rodič
commit
ac8dabb207

+ 73 - 0
resources/views/app/patient/segment-templates/_child_plan/edit-plan-in-place-optimized-flat.php

@@ -0,0 +1,73 @@
+<?php
+$currentValue = '';
+$previousValue = '';
+$previousChildPlan = null;
+if ($point->last_child_plan_point_id && $point->last_child_plan_data && $point->last_child_plan_point_scoped_note_id === $note->id) {
+    $parsedPlan = json_decode($point->last_child_plan_data);
+    $currentValue = $parsedPlan->value;
+    $previousChildPlan = \App\Models\Point::where('id', '<', $point->last_child_plan_point_id)
+        ->where('category', 'PLAN')
+        ->where('parent_point_id', $point->id)
+        ->orderBy('id', 'DESC')
+        ->first();
+    if($previousChildPlan && $previousChildPlan->data) {
+        $parsedPlan = json_decode($previousChildPlan->data);
+        $previousValue = $parsedPlan->value;
+    }
+}
+else {
+    $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
+        ->where('category', 'PLAN')
+        ->orderBy('id', 'DESC')
+        ->first();
+    if($previousChildPlan && $previousChildPlan->data) {
+        $parsedPlan = json_decode($previousChildPlan->data);
+        $previousValue = $parsedPlan->value;
+    }
+}
+?>
+<div class="d-flex align-items-start">
+    <div visit-moe relative class="d-block flex-grow-1">
+        <form show url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100" left>
+            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            <input type="hidden" name="data">
+
+            <?php if($previousValue): ?>
+            <div class="mb-2">
+                <div class="d-flex align-items-baseline mb-1">
+                    <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
+                </div>
+                <div class="p-1 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
+            </div>
+            <?php endif; ?>
+
+            <div class="mb-0">
+                <div note-rte slim-rte
+                     class="form-group mb-0 border-left border-right rte-holder"
+                     data-field-name="value"><?= $currentValue ?></div>
+            </div>
+            <div class="d-none">
+                <button submit class="btn btn-sm btn-primary mr-2">Save</button>
+                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+            </div>
+        </form>
+    </div>
+    <?php if(!empty($currentValue)): ?>
+        <div visit-moe relative class="d-inline">
+            <a start show href="#" class="pl-2 pr-1 text-center d-block" title="Delete Plan">
+                <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+            </a>
+            <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1" right>
+                <input type="hidden" name="uid" value="<?= $point->uid ?>">
+
+                <p class="mb-2">Delete this plan?</p>
+
+                <div>
+                    <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                </div>
+            </form>
+        </div>
+    <?php endif; ?>
+</div>

+ 76 - 0
resources/views/app/patient/segment-templates/_child_plan/edit-plan-optimized-flat.php

@@ -0,0 +1,76 @@
+<?php
+$currentValue = '';
+$previousValue = '';
+$previousChildPlan = null;
+if ($point->last_child_plan_point_id && $point->last_child_plan_data && $point->last_child_plan_point_scoped_note_id === $note->id) {
+    $parsedPlan = json_decode($point->last_child_plan_data);
+    $currentValue = $parsedPlan->value;
+    $previousChildPlan = \App\Models\Point::where('id', '<', $point->last_child_plan_point_id)
+        ->where('category', 'PLAN')
+        ->where('parent_point_id', $point->id)
+        ->orderBy('id', 'DESC')
+        ->first();
+    if($previousChildPlan && $previousChildPlan->data) {
+        $parsedPlan = json_decode($previousChildPlan->data);
+        $previousValue = $parsedPlan->value;
+    }
+}
+else {
+    $previousChildPlan = \App\Models\Point::where('parent_point_id', $point->id)
+        ->where('category', 'PLAN')
+        ->orderBy('id', 'DESC')
+        ->first();
+    if($previousChildPlan && $previousChildPlan->data) {
+        $parsedPlan = json_decode($previousChildPlan->data);
+        $previousValue = $parsedPlan->value;
+    }
+}
+?>
+<div visit-moe large class="d-inline">
+    <a start show href="#" class="mr-2 text-sm text-center" title="<?= !empty($currentValue) ? 'Edit Plan' : 'Add Plan'?>">
+        <?= !empty($currentValue) ? 'Edit' : 'Add'?>
+    </a>
+    <form url="/api/visitPoint/upsertChildPlan" class="mcp-theme-1 w-100">
+        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="data">
+
+        <p class="mb-2"><b>Plan</b></p>
+
+        <?php if($previousValue): ?>
+        <div class="mb-2">
+            <div class="d-flex align-items-baseline mb-1">
+                <span class="text-sm text-secondary">Previous Plan / <?= friendlier_date($previousChildPlan->created_at) ?> (click to copy)</span>
+            </div>
+            <div class="p-1 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
+        </div>
+        <?php endif; ?>
+
+        <div class="mb-2">
+            <div note-rte
+                 class="form-group mb-2 border-left border-right rte-holder"
+                 data-field-name="value"><?= $currentValue ?></div>
+        </div>
+        <div>
+            <button submit class="btn btn-sm btn-primary mr-2">Save</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>
+<?php if(!empty($currentValue)): ?>
+    <div visit-moe relative class="d-inline">
+        <a start show href="#" class="mr-2 text-sm text-center" title="Delete Plan">
+            Undo
+        </a>
+        <form url="/api/visitPoint/destroyCurrentChildPlan" class="mcp-theme-1">
+            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+
+            <p class="mb-2 text-nowrap">Delete this plan?</p>
+
+            <div class="text-nowrap">
+                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+            </div>
+        </form>
+    </div>
+<?php endif; ?>

+ 38 - 0
resources/views/app/patient/segment-templates/_child_plan/last-plan-optimized-flat.php

@@ -0,0 +1,38 @@
+<?php if ($point->last_child_plan_point_id && $point->last_child_plan_data): ?>
+    <?php $parsedPlan = json_decode($point->last_child_plan_data); ?>
+    <span class="screen-only">
+    <?php if ($point->last_child_plan_point_scoped_note_id === $patient->core_note_id): ?>
+        <span class="text-sm text-secondary">(updated on the patient's chart)</span>
+    <?php else: ?>
+        <?php if ($point->last_child_plan_point_scoped_note_id === $note->id): ?>
+            <span class="text-sm text-secondary">(updated on this note)</span>
+        <?php else: ?>
+            <?php if(!@$summaryView): ?>
+                <div class="d-inline position-relative on-click-menu">
+                    <span class="text-sm text-secondary c-pointer">
+                        <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
+                        <?php if($point->last_child_plan_creator): ?>
+                            by <?= $point->last_child_plan_creator ?>
+                        <?php endif; ?>
+                    </span>
+                    <div menu right class="bg-white border">
+                        <a native target="_blank"
+                           href="/patients/view/<?= $patient->uid ?>/notes/view/<?= $point->last_child_plan_note_uid ?>"
+                           class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
+                    </div>
+                </div>
+            <?php else: ?>
+                <span class="text-sm text-secondary">
+                    <?= relative_friendly_date($point->last_child_plan_effective_date) ?>
+                    <?php if($point->last_child_plan_creator): ?>
+                        by <?= $point->last_child_plan_creator ?>
+                    <?php endif; ?>
+                </span>
+            <?php endif; ?>
+        <?php endif; ?>
+    <?php endif; ?>
+    </span>
+    <div class="inline-html-container ml-3 mt-1">
+        <div><?= $parsedPlan->value ?></div>
+    </div>
+<?php endif; ?>

+ 78 - 0
resources/views/app/patient/segment-templates/_child_review/edit-review-in-place-optimized-flat.php

@@ -0,0 +1,78 @@
+<?php
+$currentValue = '';
+$previousValue = '';
+$previousChildReview = null;
+if ($point->last_child_review_point_id && $point->last_child_review_data && $point->last_child_review_point_scoped_note_id === $note->id) {
+    $parsedReview = json_decode($point->last_child_review_data);
+    if(@$parsedReview->value) {
+        $currentValue = $parsedReview->value;
+        $previousChildReview = \App\Models\Point::where('id', '<', $point->last_child_review_point_id)
+            ->where('category', 'REVIEW')
+            ->where('parent_point_id', $point->id)
+            ->orderBy('id', 'DESC')
+            ->first();
+        if($previousChildReview && $previousChildReview->data) {
+            $parsedReview = json_decode($previousChildReview->data);
+            $previousValue = $parsedReview->value;
+        }
+    }
+}
+else {
+    $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
+        ->where('category', 'REVIEW')
+        ->orderBy('id', 'DESC')
+        ->first();
+    if($previousChildReview && $previousChildReview->data) {
+        $parsedReview = json_decode($previousChildReview->data);
+        if(@$parsedReview->value) {
+            $previousValue = $parsedReview->value;
+        }
+    }
+}
+?>
+<div class="d-flex align-items-start">
+    <div visit-moe relative class="d-block flex-grow-1">
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1" right>
+            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+            <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+            <input type="hidden" name="data">
+
+            <?php if($previousValue): ?>
+                <div class="mb-2">
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
+                    </div>
+                    <div class="p-1 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
+                </div>
+            <?php endif; ?>
+
+            <div class="mb-0">
+                <div note-rte slim-rte
+                     class="form-group mb-0 border-left border-right rte-holder"
+                     data-field-name="value"><?= $currentValue ?></div>
+            </div>
+            <div class="d-none">
+                <button submit class="btn btn-sm btn-primary mr-2">Save</button>
+                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+            </div>
+        </form>
+    </div>
+    <?php if(!empty($currentValue)): ?>
+        <div visit-moe relative class="d-inline">
+            <a start show href="#" class="pl-2 pr-1 text-center d-block" title="Undo Changes">
+                <i class="fa fa-trash-alt text-danger on-hover-opaque"></i>
+            </a>
+            <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1" right>
+                <input type="hidden" name="uid" value="<?= $point->uid ?>">
+
+                <p class="mb-2">Undo Changes?</p>
+
+                <div>
+                    <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                </div>
+            </form>
+        </div>
+    <?php endif; ?>
+</div>
+

+ 81 - 0
resources/views/app/patient/segment-templates/_child_review/edit-review-optimized-flat.php

@@ -0,0 +1,81 @@
+<?php
+$currentValue = '';
+$previousValue = '';
+$previousChildReview = null;
+if ($point->last_child_review_point_id && $point->last_child_review_data && $point->last_child_review_point_scoped_note_id === $note->id) {
+    $parsedReview = json_decode($point->last_child_review_data);
+    if(@$parsedReview->value) {
+        $currentValue = $parsedReview->value;
+        $previousChildReview = \App\Models\Point::where('id', '<', $point->last_child_review_point_id)
+            ->where('category', 'REVIEW')
+            ->where('parent_point_id', $point->id)
+            ->orderBy('id', 'DESC')
+            ->first();
+        if($previousChildReview && $previousChildReview->data) {
+            $parsedReview = json_decode($previousChildReview->data);
+            $previousValue = $parsedReview->value;
+        }
+    }
+}
+else {
+    $previousChildReview = \App\Models\Point::where('parent_point_id', $point->id)
+        ->where('category', 'REVIEW')
+        ->orderBy('id', 'DESC')
+        ->first();
+    if($previousChildReview && $previousChildReview->data) {
+        $parsedReview = json_decode($previousChildReview->data);
+        if(@$parsedReview->value) {
+            $previousValue = $parsedReview->value;
+        }
+    }
+}
+?>
+<div visit-moe large relative class="d-inline">
+    <a start show href="#" class="mr-2 text-sm text-center" title="<?= !empty($currentValue) ? 'Edit Subjective' : 'Add Subjective'?>">
+        <?= !empty($currentValue) ? 'Edit' : 'Add'?>
+    </a>
+    <form url="/api/visitPoint/upsertChildReview" class="mcp-theme-1">
+        <input type="hidden" name="uid" value="<?= $point->uid ?>">
+        <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
+        <input type="hidden" name="data">
+
+        <p class="mb-2"><b>Subjective</b></p>
+
+        <?php if($previousValue): ?>
+            <div class="mb-2">
+                <div class="d-flex align-items-baseline mb-1">
+                    <span class="text-sm text-secondary">Previous Subjective / <?= friendlier_date($previousChildReview->created_at) ?> (click to copy)</span>
+                </div>
+                <div class="p-1 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
+            </div>
+        <?php endif; ?>
+
+        <div class="mb-2">
+            <div note-rte
+                 class="form-group mb-2 border-left border-right rte-holder"
+                 data-field-name="value"><?= $currentValue ?></div>
+        </div>
+        <div>
+            <button submit class="btn btn-sm btn-primary mr-2">Save</button>
+            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+        </div>
+    </form>
+</div>
+<?php if(!empty($currentValue)): ?>
+    <div visit-moe relative class="d-inline">
+        <a start show href="#" class="mr-2 text-sm text-center" title="Undo Changes">
+            Undo
+        </a>
+        <form url="/api/visitPoint/destroyCurrentChildReview" class="mcp-theme-1">
+            <input type="hidden" name="uid" value="<?= $point->uid ?>">
+
+            <p class="mb-2 text-nowrap">Undo Changes?</p>
+
+            <div class="text-nowrap">
+                <button submit class="btn btn-sm btn-danger mr-2">Delete</button>
+                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+            </div>
+        </form>
+    </div>
+<?php endif; ?>
+

+ 38 - 0
resources/views/app/patient/segment-templates/_child_review/last-review-optimized-flat.php

@@ -0,0 +1,38 @@
+<?php if ($point->last_child_review_point_id && $point->last_child_review_data): ?>
+    <?php $parsedReview = json_decode($point->last_child_review_data); ?>
+    <span class="screen-only">
+        <?php if ($point->last_child_review_point_scoped_note_id === $patient->core_note_id): ?>
+            <span class="text-sm text-secondary">(updated on the patient's chart)</span>
+        <?php else: ?>
+            <?php if ($point->last_child_review_point_scoped_note_id === $note->id): ?>
+                <span class="text-sm text-secondary">(updated on this note)</span>
+            <?php else: ?>
+                <?php if(!@$summaryView): ?>
+                    <div class="d-inline position-relative on-click-menu">
+                        <span class="text-sm text-secondary c-pointer">
+                            <?= relative_friendly_date($point->last_child_review_effective_date) ?>
+                            <?php if($point->last_child_review_creator): ?>
+                                by <?= $point->last_child_review_creator ?>
+                            <?php endif; ?>
+                        </span>
+                        <div menu right class="bg-white border">
+                            <a native target="_blank"
+                               href="/patients/view/<?= $patient->uid ?>/notes/view/<?= $point->last_child_review_note_uid ?>"
+                               class="px-2 py-1 d-block text-nowrap text-sm">Go to note</a>
+                        </div>
+                    </div>
+                <?php else: ?>
+                    <span class="text-sm text-secondary">
+                        <?= relative_friendly_date($point->last_child_review_effective_date) ?>
+                        <?php if($point->last_child_review_creator): ?>
+                            by <?= $point->last_child_review_creator ?>
+                        <?php endif; ?>
+                    </span>
+                <?php endif; ?>
+            <?php endif; ?>
+        <?php endif; ?>
+        </span>
+    <div class="inline-html-container ml-3 mt-1">
+        <div><?= @$parsedReview->value ?></div>
+    </div>
+<?php endif; ?>

+ 13 - 0
resources/views/app/patient/wizard-partials/relevance-column-optimized-flat.blade.php

@@ -0,0 +1,13 @@
+<div class="text-center min-width-30px border-0 lh-16px">
+    <a href="#" class="toggle-relevance text-sm"
+       data-relevant="{{$rel ? '1' : '0'}}"
+       data-rel-uid="{{$rel ? $rel : ''}}"
+       data-point-uid="{{$point->uid}}"
+       title="Mark as{{$rel ? ' not ' : ' '}}relevant to this visit">
+        @if($rel)
+            <i class="fa fa-star text-info"></i>
+        @else
+            <i class="fa fa-star text-secondary on-hover-opaque"></i>
+        @endif
+    </a>
+</div>

+ 16 - 0
resources/views/app/patient/wizard-partials/state-row-flat.blade.php

@@ -0,0 +1,16 @@
+<tr>
+    <td colspan="10" class="bg-light pl-0">
+        <div class="d-lg-flex align-items-baseline on-hover-opaque">
+            <span class="width-30px text-center">
+                @if($point->state === 'ACTIVE')
+                    <i class="text-success fa fa-circle text-sm on-hover-opaque active-record"></i>
+                @elseif($point->state === 'HISTORIC')
+                    <i class="text-warning-mellow fa fa-circle text-sm on-hover-opaque active-record"></i>
+                @elseif($point->state === 'ENTRY_ERROR')
+                    <i class="text-secondary fa fa-circle text-sm on-hover-opaque"></i>
+                @endif
+            </span>
+            <span class="text-secondary text-sm font-weight-bold">{{sanitize_state_name($point->state)}} ({{$counts[$point->state]}})</span>
+        </div>
+    </td>
+</tr>