瀏覽代碼

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

= 4 年之前
父節點
當前提交
0140713c64

+ 55 - 0
.env-example

@@ -0,0 +1,55 @@
+APP_NAME=Stag
+APP_ENV=local
+APP_KEY=base64:1yKRgeLWTeEXTfh51vXtJaf6GJaRUn4NHzdlOdyDpRY=
+APP_DEBUG=true
+APP_URL=http://localhost
+
+LOG_CHANNEL=stack
+
+DB_CONNECTION=pgsql
+DB_HOST=127.0.0.1
+DB_PORT=5432
+DB_DATABASE=stag2
+DB_USERNAME=postgres
+DB_PASSWORD=pass
+
+BROADCAST_DRIVER=log
+CACHE_DRIVER=file
+QUEUE_CONNECTION=sync
+SESSION_DRIVER=file
+SESSION_LIFETIME=120
+
+REDIS_HOST=127.0.0.1
+REDIS_PASSWORD=null
+REDIS_PORT=6379
+
+MAIL_MAILER=smtp
+MAIL_HOST=smtp.mailtrap.io
+MAIL_PORT=2525
+MAIL_USERNAME=null
+MAIL_PASSWORD=null
+MAIL_ENCRYPTION=null
+MAIL_FROM_ADDRESS=null
+MAIL_FROM_NAME="${APP_NAME}"
+
+AWS_ACCESS_KEY_ID=
+AWS_SECRET_ACCESS_KEY=
+AWS_DEFAULT_REGION=us-east-1
+AWS_BUCKET=
+
+PUSHER_APP_ID=
+PUSHER_APP_KEY=
+PUSHER_APP_SECRET=
+PUSHER_APP_CLUSTER=mt1
+
+MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
+MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
+
+BACKEND_URL="http://localhost:8080/api"
+ADMIN_PORTAL_URL="http://localhost:3000"
+
+AUTH_URL="http://localhost:3002"
+
+BACKEND_WS_URL=http://localhost:8080/ws
+AGORA_APPID=9d04292b03524927a8fe9d937a448d85
+AGORA_MODE=screen

+ 4 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -988,6 +988,10 @@ class PracticeManagementController extends Controller
             }
         }
 
+        $patientsQuery->whereRaw('(SELECT COUNT(*) FROM note where note.client_id = client.id) > 0');
+
+        $patientsQuery->orderBy('notes_without_claiming_closed', 'DESC');
+
         $patients = $patientsQuery->paginate(50);
 
         $data = [

+ 50 - 23
resources/views/app/patient/canvas-sections/dx/form.blade.php

@@ -12,8 +12,11 @@ if(!$contentData || !isset($contentData['items']) || !count($contentData['items'
                 "title" => "",
                 "icd" => "",
                 "coa" => "Chronic",
-                "detail" => "",
+                "previous_hpi" => "",
+                "detail" => "", // actually HPI (name retained to avoid breakage)
+                "previous_plan" => "",
                 "plan" => "",
+                "note_uid" => "",
             ]
         ]
     ];
@@ -68,7 +71,7 @@ $formID = rand(0, 100000);
             </th>
             <th class="px-2 text-secondary border-bottom-0 w-35">
                 <div class="d-flex align-items-center font-weight-normal">
-                    <span>Title</span>
+                    <span class="font-weight-bold">Title</span>
                     <div class="hide-if-dashboard ml-auto">
                         <div v-if="favorites && favorites.length" class="d-inline-flex2">
                             <div moe relative>
@@ -112,7 +115,7 @@ $formID = rand(0, 100000);
                            v-on:change="includeChanged()">
                 </label>
             </td>
-            <td>
+            <td v-show="inclusion[index]" >
                 <input type="text" :data-index="index"
                        class="form-control form-control-sm font-weight-bold font-size-14"
                        data-field="title" placeholder="Title" v-model="item.title" autofocus required>
@@ -126,27 +129,22 @@ $formID = rand(0, 100000);
                         <option value="Acute">Acute</option>
                     </select>
                 </div>
-                <textarea type="text" class="form-control form-control-sm" v-model="item.detail" placeholder="Detail"></textarea>
-            </td>
-            {{--<td>
-                <input type="text" :data-index="index"
-                       class="form-control form-control-sm canvas-dx-title"
-                       data-field="icd" placeholder="ICD" v-model="item.icd">
-                <select v-model="item.coa" class="form-control form-control-sm pl-1" required>
-                    <option value="">-- select --</option>
-                    <option value="Chronic" selected>Chronic</option>
-                    <option value="Acute">Acute</option>
-                </select>
+                <div class="px-2 py-1 bg-white border-bottom text-secondary" v-if="item.previous_hpi">
+                    <b><i class="fa fa-clock mr-1 text-sm"></i>Previous HPI: </b><br>
+                    <div v-html="item.previous_hpi"></div>
+                </div>
+                <textarea type="text" class="form-control form-control-sm" v-model="item.detail" placeholder="Updated HPI *"></textarea>
             </td>
-            <td><textarea type="text" class="form-control form-control-sm"
-                          dx-rte :data-index="index" data-field="detail"
-                          v-model="item.detail"></textarea>
-            </td>--}}
-            <td><textarea type="text" class="form-control form-control-sm"
+            <td v-show="inclusion[index]" >
+                <div class="px-2 py-1 bg-white border-bottom text-secondary" v-if="item.previous_plan">
+                    <b><i class="fa fa-clock mr-1 text-sm"></i>Previous Plan: </b><br>
+                    <div v-html="item.previous_plan"></div>
+                </div>
+                <textarea type="text" class="form-control form-control-sm"
                           dx-rte :data-index="index" data-field="plan"
                           v-model="item.plan"></textarea>
             </td>
-            <td class="px-2 text-nowrap">
+            <td v-show="inclusion[index]" class="px-2 text-nowrap">
                 <a href="#"
                    v-if="!isFavorite(item)" v-on:click.prevent="addToFavorites(item)"
                    class="mt-1 d-inline-block mr-1 text-secondary on-hover-opaque"
@@ -164,6 +162,9 @@ $formID = rand(0, 100000);
                     <i class="fa fa-trash-alt"></i>
                 </a>
             </td>
+            <td v-show="!inclusion[index]" colspan="3" class="align-middle pl-2">
+                <span v-html="item.title"></span>
+            </td>
         </tr>
         </tbody>
     </table>
@@ -186,19 +187,44 @@ $formID = rand(0, 100000);
         for (let i = 0; i < favorites.length; i++) {
             favorites[i].data = JSON.parse(favorites[i].data);
         }
+
+        let saved = <?= json_encode($contentData['items']) ?>;
+        // if FU, copy hpi into previous_hpi for each item, and empty out hpi
+        @if(@$note && $note->new_or_fu_or_na === 'FU')
+            for (let i = 0; i < saved.length; i++) {
+                if(saved[i].note_uid !== '{{$note->uid}}') {
+                    if(saved[i].detail) saved[i].previous_hpi = saved[i].detail;
+                    if(saved[i].plan) saved[i].previous_plan = saved[i].plan;
+                    saved[i].detail = '';
+                    saved[i].plan = '';
+                    saved[i].note_uid = '{{$note->uid}}';
+                }
+            }
+        console.log('ALIX', saved)
+        @endif
+
         function init() {
             window.clientDXApp = new Vue({
                 el: '#dxSection',
                 data: {
                     includeAll: false,
-                    items: <?= json_encode($contentData['items']) ?>,
+                    items: saved,
                     inclusion: [],
                     favorites: favorites,
                 },
                 mounted: function() {
                     this.inclusion = [];
                     for (let i = 0; i < this.items.length; i++) {
-                        this.inclusion[i] = this.items[i].included;
+                        @if(@$note && $note->new_or_fu_or_na === 'FU')
+                            if(this.items[i].note_uid !== '{{$note->uid}}') {
+                                this.inclusion[i] = this.items[i].included = false;
+                            }
+                            else {
+                                this.inclusion[i] = this.items[i].included;
+                            }
+                        @else
+                            this.inclusion[i] = this.items[i].included;
+                        @endif
                     }
                     this.initRTE();
                     this.initTitleAutoSuggest();
@@ -302,6 +328,8 @@ $formID = rand(0, 100000);
 
                             var toolbar = $(qe.container).prev('.ql-toolbar');
 
+                            toolbar.append('<b class="float-left text-secondary ml-1 mr-2 pt-1">Updated Plan *</b>');
+
                             // add button for new shortcut
                             var newSCButton = $('<button type="button" tabindex="-1" ' +
                                 'class="btn bg-white btn-sm btn-default text-primary w-auto px-2 border py-0 ' +
@@ -314,7 +342,6 @@ $formID = rand(0, 100000);
                                 'text-sm show-templates">Templates</button>');
                             templatesButton.attr('data-editor-id', editorID);
                             toolbar.append(templatesButton);
-                            // $(this).closest('tr').find('.assessment-detail-template').appendTo(templatesButton);
 
                             qe.on('text-change', function() {
                                 // ti.val(qe.root.innerHTML);

+ 1 - 1
resources/views/app/patient/canvas-sections/dx/summary.php

@@ -29,7 +29,7 @@ if(count($contentData['items'])) {
             $detailPlain = trim(strip_tags($detailPlain));
             if(!empty($detailPlain)):
             ?>
-                <div class="text-secondary font-weight-bold">Detail</div>
+                <div class="text-secondary font-weight-bold">HPI</div>
                 <div class="ml-2"><?= $detailPlain ?></div>
             <?php endif; ?>
             <?php

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

@@ -113,7 +113,45 @@
                     dataToPost['guest_access_code'] = '{{$guestAccessCode}}';
                 @endif
                 $.post("/process_form_submit", dataToPost, function(resp) {
-                    handleSubmitResponse(resp,_section, summaryContainer)
+                    handleSubmitResponse(resp,_section, summaryContainer);
+
+                    // if "dx", refresh "cc" if it exists in the note
+                    if(_section.attr('data-section-template-name') === 'dx') {
+                        let ccSection = $('[data-section-template-name="cc"]').first();
+                        if(ccSection.length) {
+                            let ccSectionUid = ccSection.attr('data-section-uid');
+                            let items = JSON.parse(value);
+                            if(items && items.items) {
+                                items = items.items
+                                    .filter((_x) => {
+                                        return !!_x.included;
+                                    })
+                                    .map((_x) => {
+                                        return _x.title;
+                                    });
+                            }
+                            let itemsText = '';
+                            if(items.length > 1) {
+                                let lastItem = items[items.length - 1];
+                                items.splice(items.length - 1, 1);
+                                itemsText = items.join(', ') + ' and ' + lastItem;
+                            }
+                            else {
+                                itemsText = items[0];
+                            }
+                            if(!!itemsText && !!ccSectionUid) {
+                                let ccValue = 'Patient {{$patient->name_first . ' ' . $patient->name_last}} ' +
+                                    'is a {{$patient->age_in_years}} year old {{$patient->sex}} with a history of ' +
+                                    itemsText + ' ' +
+                                    '{{ @$note ? (@$note->new_or_fu_or_na === 'NEW' ? 'presenting for establishing care' : 'presenting for follow-up') : '' }}';
+                                let para = $('<p/>').text(ccValue)[0].outerHTML;
+                                ccSection.find('[name="data"]').first().val(JSON.stringify({value: para}));
+                                ccSection.find('.ql-editor').html(para);
+                                ccSection.find('[btn-save-form]').click();
+                            }
+                        }
+                    }
+
                 }, 'json');
             }
         }