Эх сурвалжийг харах

Rx <-> ERx link (completed)

Vijayakrishnan 4 жил өмнө
parent
commit
85e2bc14a5

+ 2 - 0
resources/views/app/dashboard.blade.php

@@ -482,12 +482,14 @@
             $(document)
                 .off('click', '.ticket-popup-trigger')
                 .on('click', '.ticket-popup-trigger', function() {
+                    showMask();
                     window.noMc = true;
                     $.get(this.href, (_data) => {
                         $('.ticket-popup').html(_data);
                         showStagPopup('ticket-popup');
                         $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
                         runMCInitializer('patient-tickets'); // run specific mc initer
+                        hideMask();
                     });
                     return false;
                 });

+ 31 - 0
resources/views/app/patient/dashboard.blade.php

@@ -50,11 +50,18 @@
                         <h6 class="my-0 font-weight-bold text-secondary">Current Medications</h6>
                         <span class="mx-2 text-secondary">|</span>
                         @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'rx', 'class' => 'wide'])
+                        <span class="mx-2 text-secondary">|</span>
+                        <a href="/patients/view/{{$patient->uid}}/tickets/erx?popupmode=1"
+                           native target="_blank"
+                           class="ticket-popup-trigger d-block text-nowrap mr-3">
+                            Erx/Orders
+                        </a>
                     </div>
                     <div class="bg-light border p-2 mb-3">
                         @include('app.patient.canvas-sections.rx.summary')
                     </div>
                 </div>
+                <div class="stag-popup stag-popup-lg ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
 
                 {{-- programs --}}
                 @if($pro->pro_type == 'ADMIN')
@@ -968,6 +975,30 @@
                 $('select[name="deviceUid"]').select2({
                     width: '100%'
                 });
+
+                // refresh once ticket popup is closed
+                $('body').off('stag-popup-closed')
+                /*$('body').on('stag-popup-closed', function() {
+                    if($('#client-rx-container').length) {
+                        fastReload();
+                    }
+                });*/
+                // ticket-popup
+                $(document)
+                    .off('click', '.ticket-popup-trigger')
+                    .on('click', '.ticket-popup-trigger', function() {
+                        showMask();
+                        window.noMc = true;
+                        $.get(this.href, (_data) => {
+                            $('.ticket-popup').html(_data);
+                            showStagPopup('ticket-popup', true);
+                            // $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
+                            runMCInitializer('patient-tickets'); // run specific mc initer
+                            hideMask();
+                        });
+                        return false;
+                    });
+
             }
             addMCInitializer('patient-dashboard-devices', init, '#patient-dashboard-devices');
         }).call(window);

+ 38 - 1
resources/views/app/patient/medications.blade.php

@@ -1,14 +1,51 @@
 @extends ('layouts.patient')
 @section('inner-content')
     {{-- canvas based rx --}}
-    <div class="client-single-dashboard">
+    <div class="client-single-dashboard" id="client-rx-container">
         <div class="d-flex align-items-center pb-2">
             <h6 class="my-0 font-weight-bold">Current Medications</h6>
             <span class="mx-2 text-secondary">|</span>
             @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'rx', 'class' => 'wide'])
+            <span class="mx-2 text-secondary">|</span>
+            <a href="/patients/view/{{$patient->uid}}/tickets/erx?popupmode=1"
+               native target="_blank"
+               class="ticket-popup-trigger d-block text-nowrap mr-3">
+                Erx/Orders
+            </a>
         </div>
         <div class="bg-light border p-2 mb-3">
             @include('app.patient.canvas-sections.rx.summary')
         </div>
     </div>
+    <div class="stag-popup stag-popup-lg ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
+
+    <script>
+        (function() {
+            function init() {
+                // refresh once ticket popup is closed
+                $('body').off('stag-popup-closed')
+                /*$('body').on('stag-popup-closed', function() {
+                    if($('#client-rx-container').length) {
+                        fastReload();
+                    }
+                });*/
+                // ticket-popup
+                $(document)
+                    .off('click', '.ticket-popup-trigger')
+                    .on('click', '.ticket-popup-trigger', function() {
+                        showMask();
+                        window.noMc = true;
+                        $.get(this.href, (_data) => {
+                            $('.ticket-popup').html(_data);
+                            showStagPopup('ticket-popup', true);
+                            // $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
+                            runMCInitializer('patient-tickets'); // run specific mc initer
+                            hideMask();
+                        });
+                        return false;
+                    });
+            }
+            addMCInitializer('client-erx-listing', init, '#client-rx-container');
+        }).call(window);
+    </script>
 @endsection

+ 2 - 2
resources/views/app/patient/tickets.blade.php

@@ -54,14 +54,14 @@
     <div id="ticketsApp" v-cloak>
         <div class="d-flex align-items-end pb-0">
             <h4 class="font-weight-bold m-0 font-size-16">ERx / Orders</h4>
-            <select class="ml-auto max-width-200px form-control form-control-sm pr-2"
+            <select class="hide-inside-ticket-poppup ml-auto max-width-200px form-control form-control-sm pr-2"
                     onchange="return fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.value, true, false, false)">
                 <option value="" {{$type === '' ? 'selected' : ''}}>All</option>
                 <option value="erx" {{$type === 'erx' ? 'selected' : ''}}>ERx</option>
                 <option value="lab" {{$type === 'lab' ? 'selected' : ''}}>Lab Orders</option>
                 <option value="imaging" {{$type === 'imaging' ? 'selected' : ''}}>Imaging Orders</option>
             </select>
-            <select class="ml-2 max-width-200px form-control form-control-sm pr-2"
+            <select class="hide-inside-ticket-poppup ml-2 max-width-200px form-control form-control-sm pr-2"
                     v-model="statusFilter">
                 <option value="open">Open tickets (@{{ numOpen }})</option>
                 <option value="closed">Closed tickets (@{{ numClosed }})</option>

+ 2 - 2
resources/views/app/patient/tickets/erx.blade.php

@@ -72,8 +72,8 @@
                         <label class="text-secondary mb-0 font-weight-normal font-size-16">ERx</label>
                         <span class="text-secondary mx-2">|</span>
                         <a href="#" v-on:click.prevent="addERxLineItem()">Add</a>
-                        <span class="text-secondary mx-2">|</span>
-                        <a class="py-0 font-weight-normal c-pointer" onclick="showStagPopup('client-rx')">Patient Rx</a>
+                        <span class="text-secondary mx-2 hide-inside-ticket-poppup">|</span>
+                        <a class="py-0 font-weight-normal c-pointer hide-inside-ticket-poppup" onclick="showStagPopup('client-rx')">Patient Rx</a>
                     </div>
                 </div>
             </div>

+ 1 - 1
resources/views/layouts/patient.blade.php

@@ -219,7 +219,7 @@
                     </div>
                 @endif
                 <div class="card mt-3">
-                    <div class="card-header py-1">
+                    <div class="card-header py-1 hide-inside-ticket-poppup">
                         <?php
                         $thumbnail = $patient->profile_picture_base64;
                         $initials = !$thumbnail ? substr($patient->name_first, 0, 1) . substr($patient->name_last, 0, 1) : '';

+ 42 - 0
storage/sections/rx/actions.blade.php

@@ -0,0 +1,42 @@
+<div class="position-relative d-none if-edit mx-2 border-left border-right" id="note-rx-actions">
+    <div class="d-flex align-items-center px-2">
+        <a href="/patients/view/{{$patient->uid}}/tickets/erx?popupmode=1"
+           native target="_blank"
+           class="ticket-popup-trigger d-block text-nowrap">
+            Erx/Orders
+        </a>
+    </div>
+</div>
+<div class="stag-popup stag-popup-lg ticket-popup mcp-theme-1" stag-popup-key="ticket-popup"></div>
+<script>
+    (function() {
+        function init() {
+            // refresh once ticket popup is closed
+            $('body').off('stag-popup-closed')
+            /*$('body').on('stag-popup-closed', function() {
+                if($('#client-rx-container').length) {
+                    fastReload();
+                }
+            });*/
+            // ticket-popup
+            $(document)
+                .off('click', '.ticket-popup-trigger')
+                .on('click', '.ticket-popup-trigger', function() {
+                    showMask();
+                    window.noMc = true;
+                    $.get(this.href, (_data) => {
+                        $('.ticket-popup').html(_data);
+                        showStagPopup('ticket-popup', true);
+                        // $('.ticket-popup .stag-popup.stag-slide').attr('close-all-with-self', 1);
+                        runMCInitializer('patient-tickets'); // run specific mc initer
+                        hideMask();
+                    });
+                    return false;
+                });
+
+            console.log('ALIX boo')
+        }
+        addMCInitializer('note-rx-actions', init, '#note-rx-actions');
+    }).call(window);
+</script>
+