|
@@ -292,14 +292,22 @@ $medications = $points;
|
|
|
include resource_path('views/app/patient/segment-templates/_child_review/last-review.php');
|
|
|
?>
|
|
|
</div>
|
|
|
- <a class="px-2 view-review-log"
|
|
|
- native target="_blank"
|
|
|
- open-in-stag-popup
|
|
|
- popup-style="stag-popup-md"
|
|
|
- title="Review log<?= !!@($medication->data->name) ? ' for ' . @($medication->data->name) : '' ?>"
|
|
|
- href="/point/review-log/<?= $medication->uid ?>?popupmode=1">
|
|
|
- <i class="fa fa-history"></i>
|
|
|
- </a>
|
|
|
+ <div class="d-inline-flex flex-nowrap">
|
|
|
+ <a class="px-2 view-review-log"
|
|
|
+ native target="_blank"
|
|
|
+ open-in-stag-popup
|
|
|
+ popup-style="stag-popup-md"
|
|
|
+ title="Review 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');
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</td>
|
|
|
<td>
|
|
@@ -428,6 +436,49 @@ $medications = $points;
|
|
|
|
|
|
<script>
|
|
|
(function() {
|
|
|
+ function initVisitMoeRTEs() {
|
|
|
+ $('.stag-popup [visit-moe]').find('[note-rte]:not(.ql-container)').each(function() {
|
|
|
+
|
|
|
+ $(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
|
|
|
+ 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;
|
|
|
+
|
|
|
+ quill.on('text-change', function(delta, oldDelta, source) {
|
|
|
+ var content = quill.root.innerHTML;
|
|
|
+ let dataObject = {};
|
|
|
+ dataObject[fieldName] = content;
|
|
|
+ var dataValue = JSON.stringify(dataObject);
|
|
|
+ $(el).closest('[visit-moe]').find('input[name=data]').val(dataValue);
|
|
|
+ });
|
|
|
+
|
|
|
+ $(quill.container)
|
|
|
+ .find('.ql-editor[contenteditable]')
|
|
|
+ .attr('data-field', fieldName)
|
|
|
+ .attr('data-editor-id', editorID)
|
|
|
+ .attr('with-shortcuts', 1);
|
|
|
+ });
|
|
|
+ }
|
|
|
function init() {
|
|
|
let parentSegment = $('#medications-center-{{$note->id}}');
|
|
|
parentSegment.find('input[stag-suggest][data-name="name"]')
|
|
@@ -625,7 +676,10 @@ $medications = $points;
|
|
|
.appendTo(buttonContainer);
|
|
|
|
|
|
buttonContainer.insertAfter(titleElem);
|
|
|
+
|
|
|
+ initSegmentMoes($('#medications-center-{{$note->id}}'));
|
|
|
+ initVisitMoeRTEs();
|
|
|
}
|
|
|
- addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}')
|
|
|
+ addMCInitializer('medications-center-{{$note->id}}', init, '#medications-center-{{$note->id}}');
|
|
|
}).call(window);
|
|
|
</script>
|