Pārlūkot izejas kodu

Sign confirmation popup - make pro add rpm entry

Vijayakrishnan 2 gadi atpakaļ
vecāks
revīzija
5efcc3b7db

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

@@ -653,7 +653,7 @@ use App\Models\Handout;
                                            open-in-stag-popup
                                            update-parent
                                            mc-initer="note-sign-confirmation-{{$note->id}}"
-                                           popup-style="stag-popup-md"
+                                           popup-style="stag-popup-md overflow-visible"
                                            title="Confirm and Sign"
                                            class="screen-only"
                                            href="{{route('patients.view.notes.view.sign-confirmation', compact('patient', 'note'))}}">

+ 78 - 0
resources/views/app/patient/note/sign-confirmation.blade.php

@@ -92,6 +92,40 @@
         </div>
     </div>
 
+
+    {{-- rpm time entry --}}
+    <?php
+    // resolve care month from the effective date of this note
+    $cmStartDate = date('Y-m-01', strtotime($note->effective_dateest));
+    $careMonth = \App\Models\CareMonth::where('client_id', $note->client->id)->where('start_date', $cmStartDate)->first();
+    ?>
+    @if($careMonth && $careMonth->is_client_enrolled_in_rm)
+        <div class="p-3 mt-3 border bg-aliceblue">
+            <p class="mb-2">Did you review the patient's remote measurements and/or had communication regarding RPM during this visit? If yes, please add a time entry to cover the same (if you have not already done it).</p>
+            <div class="d-flex align-items-center">
+                <h6 class="my-0 text-secondary font-weight-bold text-dark lh-24px"><span class="text-secondary">RPM time billed:</span> {{time_in_hrminsec($careMonth->rm_total_time_in_seconds_by_mcp)}}</h6>
+                <?php
+                $rmBills = $careMonth->getBillsOfType('RM');
+                $activeRMBill = false;
+                foreach ($rmBills as $rmBill) {
+                    if(!$rmBill->is_cancelled && $careMonth->rm_bill_id === $rmBill->id) {
+                        $activeRMBill = $rmBill;
+                        break;
+                    }
+                }
+                ?>
+                <span class="mx-2 text-secondary">|</span>
+                @include('app.practice-management.care_month_add_entry_form', [
+                    'right' => false,
+                    'defaultDate' => $note->effective_dateest,
+                    'defaultSeconds' => 120,
+                    'defaultInteracted' => true,
+                    'defaultComment' => 'I have discussed remote monitoring data to date and encouraged patient to regularly measure and follow the care plan.'
+                    ])
+            </div>
+        </div>
+    @endif
+
     {{-- fu appt --}}
     <div class="px-3 pt-3 mt-3 border bg-aliceblue">
         @include('app/patient/note/follow-up-appointment', ['noMinHeight' => true])
@@ -164,6 +198,50 @@
                 });
 
             runMCInitializer('icd-autocomplete');
+
+            @if($careMonth && $careMonth->is_client_enrolled_in_rm)
+            initMoes();
+            initProSuggest();
+            $('#note-sign-confirmation-{{$note->id}}').find('[cm-rte]').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-name');
+
+                var el = this;
+                var existingContent = $(el).attr('data-content') ? $(el).attr('data-content') : $(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;
+
+                $('<input type="hidden" name="' + fieldName + '">').val(existingContent).insertAfter(el);
+
+                quill.on('text-change', function(delta, oldDelta, source) {
+                    $(el).next('[name="' + fieldName + '"]').val(quill.root.innerHTML);
+                });
+
+                $(quill.container)
+                    .find('.ql-editor[contenteditable]')
+                    .attr('data-field', fieldName)
+                    .attr('data-editor-id', editorID)
+                    .attr('with-shortcuts', 1);
+
+            });
+            @endif
         }
 
         addMCInitializer('note-sign-confirmation-{{$note->id}}', init, '#note-sign-confirmation-{{$note->id}}')