Parcourir la source

Add multi pre-existing: favorites feature

Vijayakrishnan il y a 3 ans
Parent
commit
6215c2269e

+ 11 - 0
resources/views/app/patient/allergies-center.blade.php

@@ -389,6 +389,17 @@ if(!@$summaryView) {
                     return false;
                 });
 
+            parentSegment.find('.multi-favorite-item')
+                .off('click.add-from-multi-favorite')
+                .on('click.add-from-multi-favorite', function () {
+                    let row = $(this).closest('tr');
+                    row.find('input[key="name"]').val($(this).attr('data-name')).focus();
+                    row.find('input[data-name="damConceptId"]').val($(this).attr('data-damConceptId'));
+                    row.find('input[data-name="damConceptIdType"]').val($(this).attr('data-damConceptIdType'));
+                    $(this).closest('.on-click-menu').find('[menu]').hide();
+                    return false;
+                });
+
             let mode = 'read';
 
             // custom buttons on title bar

+ 13 - 0
resources/views/app/patient/medications-center.blade.php

@@ -452,6 +452,19 @@ if(!@$summaryView) {
                 return false;
             });
 
+        parentSegment.find('.multi-favorite-item')
+            .off('click.add-from-multi-favorite')
+            .on('click.add-from-multi-favorite', function () {
+                let row = $(this).closest('tr');
+                row.find('input[key="name"]').val($(this).attr('data-name')).focus();
+                row.find('input[key="medId"]').val($(this).attr('data-medId'));
+                row.find('input[key="routedMedId"]').val($(this).attr('data-routedMedId'));
+                row.find('input[key="routedDosageFormMedId"]').val($(this).attr('data-routedDosageFormMedId'));
+                row.find('input[key="gcnSeqno"]').val($(this).attr('data-gcnSeqno'));
+                $(this).closest('.on-click-menu').find('[menu]').hide();
+                return false;
+            });
+
         let mode = 'read';
 
         button

+ 12 - 0
resources/views/app/patient/problems-center.blade.php

@@ -493,6 +493,18 @@ if(!@$summaryView) {
                     return false;
                 });
 
+            parentSegment.find('.multi-favorite-item')
+                .off('click.add-from-multi-favorite')
+                .on('click.add-from-multi-favorite', function () {
+                    let row = $(this).closest('tr');
+                    row.find('input[key="name"]').val($(this).attr('data-name')).focus();
+                    row.find('input[key="dxid"]').val($(this).attr('data-dxid'));
+                    row.find('input[key="icd"]').val($(this).attr('data-icd'));
+                    row.find('input[key="icd-type"]').val($(this).attr('data-icd-type'));
+                    $(this).closest('.on-click-menu').find('[menu]').hide();
+                    return false;
+                });
+
             let mode = 'read';
 
             $('.button-container').remove();

+ 32 - 0
resources/views/app/patient/wizard-partials/add-multiple-pre-existing.blade.php

@@ -7,6 +7,9 @@
         <table class="table table-sm table-bordered stag-sheet allow-row-addition bg-white mb-2 point-table read" style="table-layout: fixed">
             <thead>
             <tr class="bg-light">
+                @if(in_array($label, ['allergy', 'medication', 'problem']) && @$favorites && count($favorites))
+                    <th class="border-bottom-0 text-secondary width-30px text-center"><i class="fa fa-bookmark text-info text-sm on-hover-opaque"></i></th>
+                @endif
                 <th class="border-bottom-0 text-secondary text-nowrap">{{ucwords($label)}}</th>
                 @if($label === 'problem')
                     <th class="border-bottom-0 text-secondary width-70px">ICD</th>
@@ -23,6 +26,35 @@
             </thead>
             <tbody>
             <tr>
+                @if(in_array($label, ['allergy', 'medication', 'problem']) && @$favorites && count($favorites))
+                    <td class="text-center align-middle">
+                        <div class="d-inline position-relative on-click-menu">
+                            <span class="text-primary c-pointer"><i class="fa fa-caret-down"></i></span>
+                            <div menu right class="bg-white border">
+                                @foreach($favorites as $favorite)
+                                    <a native target="_blank" href="#"
+                                       data-name="{{@($favorite->data->name)}}"
+                                       @if($label === 'allergy')
+                                       data-damConceptId="{{@($favorite->data->damConceptId)}}"
+                                       data-damConceptIdType="{{@($favorite->data->damConceptIdType)}}"
+                                       @elseif($label === 'medication')
+                                       data-medId="{{@($favorite->data->medId)}}"
+                                       data-routedMedId="{{@($favorite->data->routedMedId)}}"
+                                       data-routedDosageFormMedId="{{@($favorite->data->routedDosageFormMedId)}}"
+                                       data-gcnSeqno="{{@($favorite->data->gcnSeqno)}}"
+                                       @elseif($label === 'problem')
+                                       data-dxid="{{@($favorite->data->dxid)}}"
+                                       data-icd="{{@($favorite->data->icd)}}"
+                                       data-icd-type="{{@($favorite->data->{'icd-type'})}}"
+                                       @endif
+                                       class="px-2 py-1 d-block text-nowrap text-sm multi-favorite-item text-left">
+                                        {{$favorite->data->name}}
+                                    </a>
+                                @endforeach
+                            </div>
+                        </div>
+                    </td>
+                @endif
                 <td class="p-0">
                     <input type="text" key="{{$label === 'goal' ? 'goal' : 'name'}}" bucket="data" required
                            @if($label === 'medication')