|
@@ -35,7 +35,7 @@ function isFavoriteMedication($_medication, $_favorites) {
|
|
|
</label>
|
|
|
</div>
|
|
|
|
|
|
- <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table">
|
|
|
+ <table class="table table-sm table-bordered mb-0 bg-white mb-2 point-table read">
|
|
|
<thead>
|
|
|
<tr class="">
|
|
|
@if($patient->core_note_id !== $note->id)
|
|
@@ -147,55 +147,73 @@ function isFavoriteMedication($_medication, $_favorites) {
|
|
|
</div>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <div class="d-flex align-items-start">
|
|
|
- <div class="flex-grow-1">
|
|
|
- <?php
|
|
|
- $point = $medication;
|
|
|
- include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
|
|
|
- ?>
|
|
|
- </div>
|
|
|
- <div class="d-inline-flex flex-column ml-1">
|
|
|
- <a class="px-1 view-review-log"
|
|
|
- native target="_blank"
|
|
|
- open-in-stag-popup
|
|
|
- popup-style="stag-popup-md"
|
|
|
- title="Subjective log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
|
|
|
- href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
|
|
|
- <i class="fa fa-history"></i>
|
|
|
- </a>
|
|
|
- <?php
|
|
|
- $segment = $note->getSegmentByInternalName('intake_medications');
|
|
|
- if($segment) {
|
|
|
- include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
|
|
|
- }
|
|
|
- ?>
|
|
|
+ <?php $segment = $note->getSegmentByInternalName('intake_medications'); ?>
|
|
|
+ <div if-read-mode>
|
|
|
+ <div class="d-flex align-items-start">
|
|
|
+ <div class="flex-grow-1">
|
|
|
+ <?php
|
|
|
+ $point = $medication;
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
+ <div class="d-inline-flex flex-column ml-1">
|
|
|
+ <a class="px-1 view-review-log"
|
|
|
+ native target="_blank"
|
|
|
+ open-in-stag-popup
|
|
|
+ popup-style="stag-popup-md"
|
|
|
+ title="Subjective log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
|
|
|
+ href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
|
|
|
+ <i class="fa fa-history"></i>
|
|
|
+ </a>
|
|
|
+ <?php
|
|
|
+ if($segment) {
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_review/edit-review.php');
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div if-edit-mode>
|
|
|
+ <?php
|
|
|
+ if($segment) {
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_review/edit-review-in-place.php');
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <div class="d-flex align-items-start position-relative">
|
|
|
- <div class="flex-grow-1">
|
|
|
- <?php
|
|
|
- include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
|
|
|
- ?>
|
|
|
- </div>
|
|
|
- <div class="d-inline-flex flex-column ml-1">
|
|
|
- <a class="px-1 view-review-log"
|
|
|
- native target="_blank"
|
|
|
- open-in-stag-popup
|
|
|
- popup-style="stag-popup-md"
|
|
|
- title="Plan log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
|
|
|
- href="/point/plan-log/<?= $medication->uid ?>?popupmode=1">
|
|
|
- <i class="fa fa-history"></i>
|
|
|
- </a>
|
|
|
- <?php
|
|
|
- $segment = $note->getSegmentByInternalName('plan_medications');
|
|
|
- if($segment) {
|
|
|
- include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
|
|
|
- }
|
|
|
- ?>
|
|
|
+ <?php $segment = $note->getSegmentByInternalName('plan_medications'); ?>
|
|
|
+ <div if-read-mode>
|
|
|
+ <div class="d-flex align-items-start position-relative">
|
|
|
+ <div class="flex-grow-1">
|
|
|
+ <?php
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_plan/last-plan.php');
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
+ <div class="d-inline-flex flex-column ml-1">
|
|
|
+ <a class="px-1 view-review-log"
|
|
|
+ native target="_blank"
|
|
|
+ open-in-stag-popup
|
|
|
+ popup-style="stag-popup-md"
|
|
|
+ title="Plan log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
|
|
|
+ href="/point/plan-log/<?= $medication->uid ?>?popupmode=1">
|
|
|
+ <i class="fa fa-history"></i>
|
|
|
+ </a>
|
|
|
+ <?php
|
|
|
+ if($segment) {
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan.php');
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div if-edit-mode>
|
|
|
+ <?php
|
|
|
+ if($segment) {
|
|
|
+ include resource_path('views/app/patient/segment-templates/_child_plan/edit-plan-in-place.php');
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
</td>
|
|
|
<td>
|
|
|
<div class="position-relative c-pointer stag-tooltip">
|
|
@@ -337,11 +355,25 @@ function isFavoriteMedication($_medication, $_favorites) {
|
|
|
|
|
|
// custom buttons on title bar
|
|
|
$('.button-container').remove();
|
|
|
- let buttonContainer = $('<div/>').addClass('button-container ml-auto mr-3');
|
|
|
+ let buttonContainer = $('<div/>').addClass('button-container ml-4 mr-2 d-inline-flex align-items-center flex-grow-1');
|
|
|
let titleElem = $('#medications-center-{{$note->id}}').closest('.stag-popup').find('.stag-popup-title>span');
|
|
|
- titleElem.next().removeClass('ml-auto');
|
|
|
+ titleElem.next().removeClass('ml-4');
|
|
|
titleElem.parent().addClass('align-items-baseline');
|
|
|
|
|
|
+ // add button for "Edit Mode"
|
|
|
+ $('.btn-toggle-edit-mode').remove();
|
|
|
+ let button = $('<a href="#" native target="_blank" data-mode="read" ' +
|
|
|
+ 'class="btn-toggle-edit-mode btn btn-sm btn-info text-white font-weight-bold shadow-none">Switch to Edit Mode</a>')
|
|
|
+ .appendTo(buttonContainer);
|
|
|
+
|
|
|
+ $('<div class="d-inline-flex align-self-stretch align-items-center ml-3 mr-auto">' +
|
|
|
+ '<span class="autosave-indicator saving text-sm text-secondary">Saving changes …</span>' +
|
|
|
+ '<span class="autosave-indicator saved text-sm text-secondary">' +
|
|
|
+ '<i class="fa fa-check"></i>' +
|
|
|
+ ' Saved' +
|
|
|
+ '</span>' +
|
|
|
+ '</div>').appendTo(buttonContainer);
|
|
|
+
|
|
|
// add button for "reconcile active medications"
|
|
|
if($('.active-record').length) {
|
|
|
$('.btn-reconcile-active').remove();
|
|
@@ -352,7 +384,7 @@ function isFavoriteMedication($_medication, $_favorites) {
|
|
|
'open-in-stag-popup ' +
|
|
|
'mc-initer="medications-reconcile-{{$note->id}}" ' +
|
|
|
'popup-style="medium" ' +
|
|
|
- 'class="btn-reconcile-active btn btn-sm mr-2 btn-info text-white font-weight-bold">Reconcile Active Medications</a>')
|
|
|
+ 'class="btn-reconcile-active btn btn-sm mr-2 btn-primary text-white font-weight-bold">Reconcile Active Medications</a>')
|
|
|
.appendTo(buttonContainer);
|
|
|
}
|
|
|
|
|
@@ -361,7 +393,7 @@ function isFavoriteMedication($_medication, $_favorites) {
|
|
|
$('<a ' +
|
|
|
'href="#" ' +
|
|
|
'data-non-segment-target="Prescriptions" ' +
|
|
|
- 'class="btn-manage-erx btn btn-sm mr-2 btn-info text-white font-weight-bold">Manage eRx</a>')
|
|
|
+ 'class="btn-manage-erx btn btn-sm mr-2 btn-primary text-white font-weight-bold">Manage eRx</a>')
|
|
|
.appendTo(buttonContainer);
|
|
|
|
|
|
buttonContainer.insertAfter(titleElem);
|
|
@@ -385,6 +417,23 @@ function isFavoriteMedication($_medication, $_favorites) {
|
|
|
$(this).closest('.on-click-menu').find('[menu]').hide();
|
|
|
return false;
|
|
|
});
|
|
|
+
|
|
|
+ let mode = 'read';
|
|
|
+
|
|
|
+ button
|
|
|
+ .off('click.toggle-edit')
|
|
|
+ .on('click.toggle-edit', function () {
|
|
|
+ if (mode === 'read') {
|
|
|
+ mode = 'edit';
|
|
|
+ $(this).text('Back to Read Mode');
|
|
|
+ $('#medications-center-{{$note->id}} .point-table').removeClass('read').addClass('edit');
|
|
|
+ } else {
|
|
|
+ refreshDynamicStagPopup();
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ buttonContainer.insertAfter(titleElem);
|
|
|
}
|
|
|
addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}');
|
|
|
}).call(window);
|