فهرست منبع

Merge branch 'dev' of rav.triplestart.com:jmudaka/stagfe2 into dev

= 3 سال پیش
والد
کامیت
b9e555f46a

+ 14 - 2
app/Models/Client.php

@@ -37,8 +37,20 @@ class Client extends Model
 
     public function displayName($_flat = true)
     {
-        if($_flat) return $this->name_first . ' ' . $this->name_last;
-        return $this->name_last . ', ' . $this->name_first;
+        $result = '';
+        if($_flat) {
+            $result = $this->name_first . ' ' . $this->name_last;
+        }
+        else {
+            $result = $this->name_last . ', ' . $this->name_first;
+        }
+        if($this->client_engagement_status_category == 'DUMMY') {
+            $result .= ' [Test Record]';
+        }
+        if($this->client_engagement_status_category == 'DUPLICATE') {
+            $result .= ' [Duplicate Record]';
+        }
+        return $result;
     }
 
     public function mcp()

+ 1 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 50,
+    'asset_version' => 52,
 
     'temp_dir' => env('TEMP_DIR'),
 

+ 6 - 2
js-dev/mc.js

@@ -590,10 +590,14 @@ window.saveVisitForm = function(_trigger, _silent = false, _close = false, _done
                 // if /api/visitPoint/upsertChildReview - refresh subjective_general_v2
                 // if /api/visitPoint/upsertChildPlan - refresh plan_free_text_v2
                 if(form.attr('url') === '/api/visitPoint/upsertChildReview') {
-                    $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
+                    if(!form.is('.frm-review-plan-lifestyle') && !form.is('.frm-upsert-review-plan-nutrition')) {
+                        $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
+                    }
                 }
                 else if(form.attr('url') === '/api/visitPoint/upsertChildPlan') {
-                    $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                    if(!form.is('.frm-review-plan-lifestyle') && !form.is('.frm-upsert-review-plan-nutrition')) {
+                        $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                    }
                 }
             }
             if(typeof window.refreshRHSSidebar !== 'undefined') {

+ 38 - 10
resources/views/app/dashboard-admin.blade.php

@@ -277,21 +277,30 @@
                     <div class="border-left border-right border-bottom p-3">
                         <div v-show="tab==='appointments'" class="appointments-tab">
                             <div v-show="selectedDate">
-                                <div class="d-flex align-items-end mb-3">
+                                <div class="d-flex align-items-baseline mb-3">
                                     <b class="large"><span class="text-secondary">Today:</span> @{{ selectedDate }}</b>
-                                    <div class="ml-auto d-inline-flex align-items-center">
-                                        <label class="text-secondary mr-2 my-0 text-nowrap">Filter by status:</label>
-                                        <select v-model="filterStatus"
-                                                class="form-control form-control-sm">
+
+                                    <div v-if="events && events.length" class="d-inline-flex align-items-baseline flex-grow-1">
+                                        <label class="my-0 ml-4 mr-1">Pro:</label>
+                                        <select v-if="events && events.length" class="form-control form-control-sm max-width-300px" v-model="filterPro">
                                             <option value="">All</option>
-                                            <option value="PENDING">Pending</option>
-                                            <option value="CONFIRMED">Confirmed</option>
-                                            <option value="CANCELLED">Cancelled</option>
-                                            <option value="COMPLETED">Completed</option>
+                                            <option v-for="(p, uid) in appointmentCountsByPro" :value="uid">@{{ p.name + ' (' + p.appointments + '/' + numEventsForDate + ')' }}</option>
                                         </select>
+                                        <div class="ml-auto d-inline-flex align-items-center">
+                                            <label class="text-secondary mr-2 my-0 text-nowrap">Filter by status:</label>
+                                            <select v-model="filterStatus"
+                                                    class="form-control form-control-sm">
+                                                <option value="">All</option>
+                                                <option value="PENDING">Pending</option>
+                                                <option value="CONFIRMED">Confirmed</option>
+                                                <option value="CANCELLED">Cancelled</option>
+                                                <option value="COMPLETED">Completed</option>
+                                            </select>
+                                        </div>
                                     </div>
                                 </div>
                                 <div v-for="event in events" class="align-items-end p-3 border rounded mb-3"
+                                     v-if="!filterPro || filterPro === event.proUid"
                                      :class="(event.dateYMD === selectedDate && (filterStatus === '' || filterStatus === event.status) ? 'd-flex' : 'd-none') + ' ' + (event.isClientShadowOfPro ? 'training-event' : '')">
                                     <div class="patient-avatar mr-3 align-self-center">
                                         <i v-if="event.isClientShadowOfPro" class="fa fa-graduation-cap training-icon"
@@ -611,6 +620,8 @@
                         measurementFilterStatus: 'ALL',
                         measurements: {!! $pro->pro_type === 'ADMIN' ? '[]' : json_encode($pro->getMeasurements()) !!},
                         appointmentsLoaded: false,
+                        appointmentCountsByPro: [],
+                        filterPro: '',
                     },
                     methods: {
                         formatDate: function (date) {
@@ -734,7 +745,24 @@
                             let self = this;
                             $.get('/pro-dashboard-events/' + _date + '/' + _date, function (_data) {
                                 self.events = _data;
-                                self.numEventsForDate = (_data && _data.length) ? 1 : 0;
+                                self.numEventsForDate = (_data && _data.length) ? _data.length : 0;
+
+                                // fill appointmentCountsByPro
+                                self.appointmentCountsByPro = {};
+                                if(_data && _data.length) {
+                                    for (let i = 0; i < _data.length; i++) {
+                                        if(!self.appointmentCountsByPro[_data[i].proUid]) {
+                                            self.appointmentCountsByPro[_data[i].proUid] = {
+                                                name: _data[i].proName,
+                                                appointments: 1
+                                            };
+                                        }
+                                        else {
+                                            self.appointmentCountsByPro[_data[i].proUid].appointments++;
+                                        }
+                                    }
+                                }
+
                                 _callback.call(self);
                             }, 'json');
                         },

+ 7 - 1
resources/views/app/dna/dashboard/encounters_pending_my_review.blade.php

@@ -11,6 +11,7 @@
                     <tr>
                         <th class="border-0">Chart#</th>
                         <th class="border-0">Patient</th>
+                        <th class="border-0">Encounter</th>
                         <th class="border-0">DOB</th>
                         <th class="border-0">Gender</th>
                         <th class="border-0">Coverage</th>
@@ -26,10 +27,15 @@
                             {{$row->client->chart_number}}
                         </td>
                         <td>
-                            <a href="{{route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row])}}">
+                            <a native target="_blank" href="{{ route('patients.view.dashboard', $row->client) }}">
                                 {{$row->client->displayName()}}
                             </a>
                         </td>
+                        <td>
+                            <a native target="_blank" href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
+                                {{friendly_date($row->effective_dateest)}}
+                            </a>
+                        </td>
                         <td class="text-nowrap">
                             {{friendly_date($row->client->dob)}}
                         </td>

+ 6 - 0
resources/views/app/dna/dashboard/encounters_pending_my_review_dashboard.blade.php

@@ -11,6 +11,7 @@
                     <tr>
                     <th class="border-0">Chart#</th>
                         <th class="border-0">Patient</th>
+                        <th class="border-0">Encounter</th>
                         <th class="border-0">DOB</th>
                         <th class="border-0">Gender</th>
                         <th class="border-0">Coverage</th>
@@ -30,6 +31,11 @@
                                 {{$row->client->displayName()}}
                             </a>
                         </td>
+                        <td>
+                            <a href="{{ route('patients.view.notes.view.dashboard', ['patient' => $row->client, 'note' => $row]) }}">
+                                {{friendly_date($row->effective_dateest)}}
+                            </a>
+                        </td>
                         <td class="text-nowrap">
                             {{friendly_date($row->client->dob)}}
                         </td>

+ 3 - 3
resources/views/app/generic-bills/add-bill-form/Note.blade.php

@@ -29,14 +29,14 @@
 
 <form url="/api/bill/createForGeneric">
     @if(hasActiveGenericBill($genericPro, @$patient, @$entityType, @$entityUid))
-        <div class="border rounded bg-aliceblue p-2 width-200px d-flex align-items-baseline">
+        <div class="border rounded bg-aliceblue p-2  d-flex align-items-baseline">
             <i class="fa fa-exclamation-triangle text-warning-mellow mr-2"></i>
             <span>An uncancelled NA bill already exists for this note!</span>
         </div>
     @elseif($note && !$note->hasTreatmentServicesBillByHCP())
-        <div class="border rounded bg-aliceblue p-2 width-200px d-flex align-items-baseline">
+        <div class="border rounded bg-aliceblue p-2  d-flex align-items-baseline">
             <i class="fa fa-exclamation-triangle text-warning-mellow mr-2"></i>
-            <span>Pending HCP Signing of Treatment Services</span>
+            <span>Awaiting completion by HCP</span>
         </div>
     @else
         @include('app.generic-bills.add-bill-form._default-fields')

+ 0 - 6
resources/views/app/patient-suggest.blade.php

@@ -7,12 +7,6 @@
        href="" data-target-uid="{{$client->uid}}" {!! $client->mcp ? '' : 'title="Unclaimed Patient"' !!}>
         <img src="/img/bluecircle.png" alt="Unclaimed Patient" class="mr-1 {{$client->mcp ? 'claimed' : 'unclaimed'}}">
         {{$client->displayName()}}
-        @if($client->client_engagement_status_category == 'DUMMY') 
-         [Test Record]
-        @endif 
-        @if($client->client_engagement_status_category == 'DUPLICATE') 
-         [Duplicate Record]
-        @endif 
         {!! $client->cell_number ? '<span class="text-sm text-secondary ml-1">(' . $client->cell_number . ')</span>' : '' !!}
     </a>
     <?php $activeSet = true; ?>

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

@@ -159,11 +159,11 @@
                             <button class="btn btn-default border btn-sm" cancel>Cancel</button>
                         </div>
                     </form>
-                </div>
-                <div class="d-inline border-left pl-2">
-                    @include('app.practice-management.visit-templates.change-note-visit-template')
                 </div>
                     @if($note->visit_template_id)
+                        <div class="d-inline border-left pl-2">
+                            @include('app.practice-management.visit-templates.change-note-visit-template')
+                        </div>
                         <div moe relative class="d-inline border-left pl-2 ml-2">
                             <a start show>Clone</a>
                             <form url="/api/visit/clone" class="mcp-theme-1" left
@@ -202,6 +202,8 @@
                                 </div>
                             </form>
                         </div>
+                    @else
+                        <a href="#" class="text-primary trigger-clone ml-2 pl-2 border-left" data-uid="{{$note->uid}}">Clone</a>
                     @endif
                 @endif
             </div>
@@ -467,7 +469,7 @@
                                     <div moe relative
                                          class="{{ $note->hcp_pro_id !== $pro->id ? 'moe-disabled' : '' }} screen-only"
                                          title="{{ $note->hcp_pro_id !== $pro->id ? 'Only the note\'s HCP can sign' : '' }}">
-                                        <a class="" href="" show start>Sign Note As HCP</a>
+                                        <a class="" href="" show start>Sign As HCP</a>
                                         <form url="/api/note/signAsHcp" right>
                                             <input type="hidden" name="uid" value="{{$note->uid}}">
                                             <p>Sign this note as HCP?</p>
@@ -494,7 +496,7 @@
                     </div>
                 </div>
                 @if($note->allyPro && $pro->id === $note->allyPro->id)
-                <div class="mx-3">
+                <div class="ml-3">
                     <div>
                         @if($note->is_signed_by_ally)
                             <span class="text-secondary">
@@ -518,7 +520,7 @@
                             <div moe
                                  class="{{ $note->ally_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
                                  title="{{ $note->ally_pro_id !== $pro->id ? 'Only the note\'s Ally can sign' : '' }}">
-                                <a class="" href="" show start>Sign Note As NA</a>
+                                <a class="" href="" show start>Sign As NA</a>
                                 <form url="/api/note/signAsAlly" right>
                                     <input type="hidden" name="uid" value="{{$note->uid}}">
                                     <p>Sign this NA?</p>
@@ -2472,6 +2474,33 @@
     @include('app.patient.note.dashboard_script')
     @if(!$isVisitTemplateBased)
     @include('app.patient.canvas-sections.canvas-editor-modal', ['key' => 'rx', 'class' => 'wide', 'noEditLink' => true])
+    <script>
+        (function() {
+            function init() {
+                $('.trigger-clone')
+                    .off('click.clone')
+                    .on('click.clone', function() {
+                        $.post('/api/note/clone', {
+                            uid: $(this).attr('data-uid')
+                        }, function(_data) {
+                            if(_data) {
+                                if(_data.success) {
+                                    toastr.success('Note cloned successfully');
+                                    fastLoad('/patients/view/{{$patient->uid}}/notes/view/' + _data.data);
+                                }
+                                else {
+                                    toastr.error(_data.message);
+                                }
+                            }
+                            else {
+                                toastr.error('Unable to clone the note!');
+                            }
+                        }, 'json');
+                    });
+            }
+            addMCInitializer('non-visit-template', init, '#note-single-header');
+        })();
+    </script>
     @endif
     @if($isVisitTemplateBased)
     <script>

+ 10 - 2
resources/views/app/patient/problems-center.blade.php

@@ -347,8 +347,7 @@ if(!@$summaryView) {
                                     <label class="text-sm mb-0 font-weight-bold">ICD</label>
                                     <input type="text"
                                            data-name="icd"
-                                           class="form-control form-control-sm min-width-unset"
-                                           readonly>
+                                           class="form-control form-control-sm min-width-unset">
                                 </div>
                             </div>
 
@@ -400,6 +399,7 @@ if(!@$summaryView) {
                 .on('stag-suggest-selected', (_e, _input, _data) => {
                     $(_input).closest('form').find('input[data-name="dxid"]').val(_data.dxid);
                     $(_input).closest('form').find('input[data-name="icd"]').val(_data.sub_text);
+                    $(_input).attr('stag-suggest-selection', _input.val());
 
                     $('.fdb-dx-vigilance').html('<span class="text-secondary font-italic">Please wait ...</span>');
                     $.post('/fdb-dx-vigilance/{{$patient->uid}}', {
@@ -409,6 +409,14 @@ if(!@$summaryView) {
                     }, _data => {
                         $('.fdb-dx-vigilance').html(_data);
                     });
+                })
+                .off('input.override paste.override cut.override')
+                .on('input.override paste.override cut.override', function() {
+                    let input = $(this);
+                    if($.trim(input.val()) !== input.attr('stag-suggest-selection')) {
+                        $(input).closest('form').find('input[data-name="dxid"]').val('');
+                        $(input).closest('form').find('input[data-name="icd"]').val('');
+                    }
                 });
 
             @include('app.patient.wizard-partials.common-script', ['label' => 'problem', 'segment_part' => 'problems'])

+ 1 - 1
resources/views/app/practice-management/visit-templates/change-note-visit-template.blade.php

@@ -9,7 +9,7 @@
 
 <div id="changeNoteVisitTemplateSegmentTemplate" class="d-inline">
 	<div moe>
-		<a class="" href="" show start>Change Visit Template</a>
+		<a class="" href="" show start>Change Template</a>
 		<form url="/api/visit/swapTemplate">
 			<input type="hidden" name="noteUid" value="{{ $note->uid }}">
 			<div id="changeNoteVisitTemplateSegmentTemplateComponent" v-cloak>

+ 1 - 1
resources/views/app/rm-bills/add-bill-form/Note.blade.php

@@ -36,7 +36,7 @@
     @elseif($note && !$note->hasTreatmentServicesBillByHCP())
         <div class="border rounded bg-aliceblue p-2 width-200px d-flex align-items-baseline">
             <i class="fa fa-exclamation-triangle text-warning-mellow mr-2"></i>
-            <span>Pending HCP Signing of Treatment Services</span>
+            <span>Awaiting completion by HCP</span>
         </div>
     @else
         @include('app.generic-bills.add-bill-form._default-fields')

+ 5 - 3
resources/views/layouts/patient.blade.php

@@ -829,9 +829,11 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 									</section>
 									@endif
 
-									<section class="mr-4 align-self-start mt-2 ml-auto">
-										<div>
-											<label>Sticky Note:</label> <span class="text-secondary">{{$patient->sticky_note ?? '-' }}</span>
+									<section class="mr-4 align-self-start mt-2 ml-auto mcp-theme-1">
+										<div class="d-flex align-items-start">
+											<div class="max-width-300px max-height-200px overflow-auto d-inline-block">
+												<label>Sticky Note:</label> <span class="text-secondary">{{$patient->sticky_note ?? '-' }}</span>
+											</div>
 											<div moe relative wide class="ml-2 hide-inside-popup">
 												<a start show><i class="fa fa-edit"></i></a>
 												<form url="/api/client/updateStickyNote" class="mcp-theme-1" right>

+ 4 - 2
resources/views/layouts/template.blade.php

@@ -337,7 +337,9 @@
                             .html('<span class="d-block no-suggest-items">Searching...</span>')
                             .removeClass('d-none');
                         $.get('/patients-suggest?term=' + term, function(_data) {
-                            $('.patient-search-results.suggestions-outer').html(_data).removeClass('d-none');
+                            if($.trim($('#patient-search').val()) === term) { // use returned data only if it's for the sent "term"
+                                $('.patient-search-results.suggestions-outer').html(_data).removeClass('d-none');
+                            }
                         });
                         lastTerm = term;
                     }
@@ -390,7 +392,7 @@
                     window.setTimeout(onQueryChange, 50);
                 })
                 .on('blur', function(e) {
-                    $('.patient-search-results.suggestions-outer').addClass('d-none');
+                    // $('.patient-search-results.suggestions-outer').addClass('d-none');
                     return false;
                 });