Browse Source

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

Samson Mutunga 3 years ago
parent
commit
83d096abbc
24 changed files with 230 additions and 63 deletions
  1. 3 2
      app/Http/Controllers/FDBPGController.php
  2. 18 3
      app/Http/Controllers/HomeController.php
  3. 28 0
      public/css/style.css
  4. 11 0
      public/js/stag-suggest.js
  5. 2 2
      resources/views/app/patient/allergies-center.blade.php
  6. 16 6
      resources/views/app/patient/canvas-sections/vitals/form.blade.php
  7. 4 6
      resources/views/app/patient/care-month/_matrix.blade.php
  8. 2 2
      resources/views/app/patient/medications-center.blade.php
  9. 2 0
      resources/views/app/patient/notes.blade.php
  10. 8 3
      resources/views/app/patient/page-sections/vitals/form.blade.php
  11. 1 1
      resources/views/app/patient/prescriptions-popup/hcp-pro-form.blade.php
  12. 25 10
      resources/views/app/patient/prescriptions-popup/list-popup.blade.php
  13. 4 1
      resources/views/app/patient/prescriptions-popup/logistics-form.blade.php
  14. 1 1
      resources/views/app/patient/prescriptions-popup/pro-status-form.blade.php
  15. 1 1
      resources/views/app/patient/prescriptions-popup/transmit-form.blade.php
  16. 1 1
      resources/views/app/patient/prescriptions/hcp-pro-form.blade.php
  17. 22 8
      resources/views/app/patient/prescriptions/list.blade.php
  18. 6 1
      resources/views/app/patient/prescriptions/logistics-form.blade.php
  19. 1 1
      resources/views/app/patient/prescriptions/pro-status-form.blade.php
  20. 2 2
      resources/views/app/patient/problems-center.blade.php
  21. 8 3
      resources/views/app/patient/segment-templates/vitals/edit.blade.php
  22. 5 3
      resources/views/app/patient/wizard-partials/common-fields.blade.php
  23. 27 6
      resources/views/app/patient/wizard-partials/common-script.blade.php
  24. 32 0
      resources/views/layouts/patient.blade.php

+ 3 - 2
app/Http/Controllers/FDBPGController.php

@@ -245,8 +245,9 @@ ORDER BY r1.dam_concept_id_desc
         $term = $request->input('term') ? trim($request->input('term')) : '';
         if (empty($term)) return '';
         $matches = DB::connection('pgsql_fdb')->select("
-SELECT r1.dam_concept_id, r1.dam_concept_id_typ, r1.dam_concept_id_desc as text
-FROM rdamca0_concept r1
+SELECT r1.dam_concept_id, r1.dam_concept_id_typ, r1.dam_concept_id_desc as text,
+r2.dam_concept_id_typ_desc as sub_text
+FROM rdamca0_concept r1 join rdamcd0_picklist_con_typ_desc r2 on r1.dam_concept_id_typ = r2.dam_concept_id_typ
 WHERE (r1.dam_concept_id_desc ILIKE :term)
 ORDER BY r1.dam_concept_id_desc
 ",

+ 18 - 3
app/Http/Controllers/HomeController.php

@@ -1592,10 +1592,25 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
     {
         $term = $request->input('term') ? trim($request->input('term')) : '';
         if (empty($term)) return '';
+
+        $terms = explode(' ', $term);
+        $terms = array_filter($terms, function($_x) {
+            return !!trim($_x);
+        });
+
+        $whereCondition = [];
+        $whereParams = [];
+        for ($i = 0; $i < count($terms); $i++) {
+            $whereCondition[] = "(name ILIKE :term{$i} OR address_city ILIKE :term{$i} OR address_state ILIKE :term{$i} OR address_zip ILIKE :term{$i})";
+            $whereParams["term{$i}"] = '%' . $terms[$i] . '%';
+        }
+        $whereCondition = implode(" AND ", $whereCondition);
+
         $matches = DB::select(
-            "SELECT (name || ' ' || address_city || ' ' || address_state) as text, name, address_city as city, address_state as state, address_zip as zip, phone, fax FROM facility WHERE name ILIKE :term ORDER BY name",
-            ['term' => '%' . $term . '%']
-        );
+            "SELECT (name || ' ' || address_city || ' ' || address_state || ' ' || address_zip) as text, 
+       address_line1 as tooltip,
+       name, address_city as city, address_state as state, address_zip as zip, phone, fax FROM facility 
+       WHERE {$whereCondition} ORDER BY name", $whereParams);
         return json_encode([
             "success" => true,
             "data" => $matches

+ 28 - 0
public/css/style.css

@@ -1623,6 +1623,9 @@ canvas.pdf-viewer-page.pdf-preview-page {
 .bg-aliceblue {
     background: aliceblue !important;
 }
+.text-danger-dark {
+    color: #8b1621 !important;
+}
 .filter-head input[type="date"]::-webkit-calendar-picker-indicator {
     display: none;
     -webkit-appearance: none;
@@ -1988,6 +1991,11 @@ body.in-iframe .main-row > .sidebar {
 .strike-through {
     text-decoration: line-through;
 }
+.visit-segment .strike-through {
+    color: #8b1621 !important;
+    text-decoration: none !important;
+    opacity: 0.9;
+}
 
 /* visit-moe */
 [visit-moe] [url]:not([show]){
@@ -2181,4 +2189,24 @@ body.in-iframe .main-row > .sidebar {
 }
 .visit-segment tr:hover .vitals-copy-trigger {
     display: flex;
+}
+[tab-links] {
+
+}
+[tab-links] [tab-link] {
+    padding: 0.5rem 0.75rem;
+    border: 1px solid #ccc;
+    color: #222;
+    background: #eee;
+    text-decoration: none;
+}
+[tab-links] [tab-link]:not(:last-child) {
+    border-right: 0;
+}
+[tab-links] [tab-link]:not(.tab-link-active):hover {
+    background: #f7f7f7;
+}
+[tab-links] [tab-link].tab-link-active {
+    font-weight: bold;
+    background: #fff;
 }

+ 11 - 0
public/js/stag-suggest.js

@@ -53,6 +53,17 @@
                             }
                             item.data('suggest-data', _data.data[i]);
                             item.html(_data.data[i].text);
+                            if(_data.data[i].sub_text) {
+                                item.append($('<span/>')
+                                    .addClass('ml-1 text-sm text-secondary')
+                                    .append('(')
+                                    .append(_data.data[i].sub_text)
+                                    .append(')')
+                                );
+                            }
+                            if(_data.data[i].tooltip) {
+                                item.attr('title', _data.data[i].tooltip);
+                            }
                             suggestionsOuter.append(item);
                         }
                     }

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

@@ -142,7 +142,7 @@ $allergies = Point::getPointsOfCategoryExtended($patient, 'ALLERGY', $note);
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'allergy', 'point' => $allergy])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'allergy', 'point' => $allergy, 'addVerbPT' => 'Diagnosed'])
 
                             <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                 <button type="submit" class="btn-save-allergy btn btn-sm btn-primary mr-2">Save</button>
@@ -242,7 +242,7 @@ $allergies = Point::getPointsOfCategoryExtended($patient, 'ALLERGY', $note);
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'allergy'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'allergy', 'addVerbPT' => 'Diagnosed'])
 
                         </div>
                         <div class="col-5 border-left">

+ 16 - 6
resources/views/app/patient/canvas-sections/vitals/form.blade.php

@@ -125,9 +125,14 @@ $formID = rand(0, 100000);
                                data-option-list="smokingStatus"
                                v-on:change="autoDate(items['smokingStatus'], 'smokingStatus')" v-on:keyup="autoDate(items['smokingStatus'], 'smokingStatus')">
                         <div id="smoking-status-options" class="data-option-list">
-                            <div>Current</div>
-                            <div>Former</div>
-                            <div>Never</div>
+                            <div>Current every day smoker</div>
+                            <div>Former some day smoker</div>
+                            <div>Former smoker</div>
+                            <div>Never smoker</div>
+                            <div>Smoker, current status unknown</div>
+                            <div>Unknown if ever smoked</div>
+                            <div>Heavy tobacco smoker</div>
+                            <div>Light tobacco smoker</div>
                         </div>
                     @else
                         <input type="text"
@@ -157,9 +162,14 @@ $formID = rand(0, 100000);
                        :data-option-list="index === 'smokingStatus'"
                        v-on:change="autoDate(item, index)" v-on:keyup="autoDate(item, index)">
                 <div id="smoking-status-options" class="data-option-list">
-                    <div>Current</div>
-                    <div>Former</div>
-                    <div>Never</div>
+                    <div>Current every day smoker</div>
+                    <div>Former some day smoker</div>
+                    <div>Former smoker</div>
+                    <div>Never smoker</div>
+                    <div>Smoker, current status unknown</div>
+                    <div>Unknown if ever smoked</div>
+                    <div>Heavy tobacco smoker</div>
+                    <div>Light tobacco smoker</div>
                 </div>
                 <input type="text" :data-index="index" v-if="index === 'bmi'" readonly
                        class="form-control form-control-sm vitals-title"

+ 4 - 6
resources/views/app/patient/care-month/_matrix.blade.php

@@ -28,11 +28,9 @@ foreach ($days as $k => $day) {
 ?>
 
 <div id="cm-matrix-{{$patient->id}}">
-<div class="d-flex align-items-baseline">
-    <a class="font-weight-bold" href="#" tab-link="matrix">Care Month Matrix</a>
-    <span class="mx-2 text-secondary text-sm">|</span>
+<div class="d-flex align-items-baseline" tab-links>
+    <a class="tab-link-active" href="#" tab-link="matrix">Care Month Matrix</a>
     <a class="" href="#" tab-link="bmi-summary">BMI/Weight Management Settings</a>
-    <span class="mx-2 text-secondary text-sm">|</span>
     <a class="" href="#" tab-link="bp-summary">BP Management Settings</a>
 </div>
 <table class="table table-condensed table-sm table-bordered my-3 cm-tab" tab-key="matrix">
@@ -307,8 +305,8 @@ foreach ($days as $k => $day) {
                 .off('click')
                 .on('click', function () {
                     let tab = $(this).attr('tab-link');
-                    $(this).siblings().removeClass('font-weight-bold');
-                    $(this).addClass('font-weight-bold');
+                    $(this).siblings().removeClass('tab-link-active');
+                    $(this).addClass('tab-link-active');
                     $('.cm-tab').addClass('d-none');
                     $('.cm-tab[tab-key="' + tab + '"]').removeClass('d-none');
                     return false;

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

@@ -170,7 +170,7 @@ $medications = Point::getPointsOfCategoryExtended($patient, 'MEDICATION', $note)
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'point' => $medication])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'point' => $medication, 'addVerbPT' => 'Prescribed'])
 
                             <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                 <button type="submit" class="btn-save-medication btn btn-sm btn-primary mr-2">Save</button>
@@ -251,7 +251,7 @@ $medications = Point::getPointsOfCategoryExtended($patient, 'MEDICATION', $note)
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'medication'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'medication', 'addVerbPT' => 'Prescribed'])
 
                         </div>
                         <div class="col-5 border-left">

+ 2 - 0
resources/views/app/patient/notes.blade.php

@@ -8,6 +8,7 @@
             <span class="font-weight-bold text-secondary">Notes</span>
             @if($patient->getPrimaryCoverageStatus() === 'YES')
                 <span class="mx-2 text-secondary">|</span>
+                {{--
                 <div moe>
                     <a start show class="py-0 mb-3">Add</a>
 
@@ -60,6 +61,7 @@
                     </form>
                 </div>
                 <span class="mx-2 text-secondary">|</span>
+                --}}
                 <div moe>
                 <a start show class="py-0 mb-3 text-info font-weight-bold">Add Visit</a>
                 <form url="/api/visit/create"

+ 8 - 3
resources/views/app/patient/page-sections/vitals/form.blade.php

@@ -136,9 +136,14 @@ $formID = rand(0, 100000);
                                    data-option-list="smokingStatus"
                                    v-on:change="autoDate(items['smokingStatus'], 'smokingStatus')" v-on:keyup="autoDate(items['smokingStatus'], 'smokingStatus')">
                             <div id="smoking-status-options" class="data-option-list">
-                                <div>Current</div>
-                                <div>Former</div>
-                                <div>Never</div>
+                                <div>Current every day smoker</div>
+                                <div>Former some day smoker</div>
+                                <div>Former smoker</div>
+                                <div>Never smoker</div>
+                                <div>Smoker, current status unknown</div>
+                                <div>Unknown if ever smoked</div>
+                                <div>Heavy tobacco smoker</div>
+                                <div>Light tobacco smoker</div>
                             </div>
                         @else
                             <input type="text"

+ 1 - 1
resources/views/app/patient/prescriptions-popup/hcp-pro-form.blade.php

@@ -1,7 +1,7 @@
 <div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="pp-hcp-pro-popup">
     <form method="POST" action="" class="overflow-visible">
         <h3 class="stag-popup-title mb-2">
-            <span>HCP Pro</span>
+            <span>Prescribed By</span>
             <a href="#" class="ml-auto text-secondary"
                onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
         </h3>

+ 25 - 10
resources/views/app/patient/prescriptions-popup/list-popup.blade.php

@@ -270,7 +270,10 @@
 
             <hr class="my-3">
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Logistics</span>
+                <span v-if="currentPrescription.erx_category === 'DRUG'" class="min-width-140px text-secondary text-sm">Pharmacy</span>
+                <span v-else-if="currentPrescription.erx_category === 'LAB'" class="min-width-140px text-secondary text-sm">Lab</span>
+                <span v-else-if="currentPrescription.erx_category === 'IMAGING'" class="min-width-140px text-secondary text-sm">Lab</span>
+                <span v-else class="min-width-140px text-secondary text-sm">Logistics</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a class="mr-2" href="#" v-on:click.prevent="editLogisticsDetails(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.logistics_detail_json" class="d-flex align-items-baseline">
@@ -284,7 +287,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">HCP Pro</span>
+                <span class="min-width-140px text-secondary text-sm">Prescribed By</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a v-if="!currentPrescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editHcpPro(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
@@ -305,7 +308,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Pro Status</span>
+                <span class="min-width-140px text-secondary text-sm">Prescription Status</span>
                 <div class="d-inline-flex align-items-baseline">
                     <a class="mr-2" href="#" v-on:click.prevent="editProStatus(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.pro_declared_status" class="d-flex align-items-baseline">
@@ -906,7 +909,7 @@ GROUP BY erx_category");
                             _numPages = 1;
                             _page = 1;
 
-                            $('#transmit-pdf-preview>canvas').remove();
+                            $('#pp-transmit-pdf-preview>canvas').remove();
 
                             let url = _url;
                             let pdfjsLib = window['pdfjs-dist/build/pdf'];
@@ -928,7 +931,7 @@ GROUP BY erx_category");
                                 // create canvas
                                 let canvasElement = $('<canvas/>')
                                     .addClass('pdf-viewer-page pdf-preview-page')
-                                    .appendTo('#transmit-pdf-preview');
+                                    .appendTo('#pp-transmit-pdf-preview');
 
                                 let canvas = canvasElement[0];
                                 let viewport = page.getViewport({scale: 0.75});
@@ -995,17 +998,29 @@ GROUP BY erx_category");
                         return true;
                     },
                     addExistingDrugToERx: function(_uid) {
+                        let existing = this.existingDrugs.filter(_x => {
+                            return _x.uid === _uid;
+                        });
+                        if(!existing || !existing.length) return false;
+                        existing = existing[0];
+
+                        // require dispense and refills
+                        if(!existing.data.dispense) {
+                            toastr.error('Dispense cannot be blank');
+                            return false;
+                        }
+                        if(!existing.data.refills) {
+                            toastr.error('Refills cannot be blank');
+                            return false;
+                        }
+
                         if(!this.currentPrescription.clinical_detail_json) {
                             this.currentPrescription.clinical_detail_json = {};
                         }
                         if(!this.currentPrescription.clinical_detail_json.items) {
                             this.currentPrescription.clinical_detail_json.items = [];
                         }
-                        let existing = this.existingDrugs.filter(_x => {
-                            return _x.uid === _uid;
-                        });
-                        if(!existing || !existing.length) return false;
-                        existing = existing[0];
+
                         this.currentPrescription.clinical_detail_json.items.push({
                             medication: existing.data.name,
                             dispense: existing.data.dispense,

+ 4 - 1
resources/views/app/patient/prescriptions-popup/logistics-form.blade.php

@@ -1,7 +1,10 @@
 <div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="pp-logistics-popup">
     <form method="POST" action="" class="overflow-visible min-height-300px">
         <h3 class="stag-popup-title mb-2">
-            <span>Logistics</span>
+            <span v-if="currentPrescription && currentPrescription.erx_category === 'DRUG'">Pharmacy</span>
+            <span v-else-if="currentPrescription && currentPrescription.erx_category === 'LAB'">Lab</span>
+            <span v-else-if="currentPrescription && currentPrescription.erx_category === 'IMAGING'">Lab</span>
+            <span v-else>Logistics</span>
             <a href="#" class="ml-auto text-secondary"
                onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
         </h3>

+ 1 - 1
resources/views/app/patient/prescriptions-popup/pro-status-form.blade.php

@@ -1,7 +1,7 @@
 <div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="pp-pro-status-popup">
     <form method="POST" action="" class="overflow-visible">
         <h3 class="stag-popup-title mb-2">
-            <span>Pro Declared Status</span>
+            <span>Prescription Status</span>
             <a href="#" class="ml-auto text-secondary"
                onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
         </h3>

+ 1 - 1
resources/views/app/patient/prescriptions-popup/transmit-form.blade.php

@@ -7,7 +7,7 @@
         </h3>
         <div class="mb-3 pb-3 border-bottom">
             <p class="text-secondary text-sm mb-2 text-center">Document Preview</p>
-            <div id="transmit-pdf-preview">
+            <div id="pp-transmit-pdf-preview">
 
             </div>
         </div>

+ 1 - 1
resources/views/app/patient/prescriptions/hcp-pro-form.blade.php

@@ -1,7 +1,7 @@
 <div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="hcp-pro-popup">
     <form method="POST" action="" class="overflow-visible">
         <h3 class="stag-popup-title mb-2">
-            <span>HCP Pro</span>
+            <span>Prescribed By</span>
             <a href="#" class="ml-auto text-secondary"
                onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
         </h3>

+ 22 - 8
resources/views/app/patient/prescriptions/list.blade.php

@@ -279,7 +279,10 @@
 
             <hr class="my-3">
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Logistics</span>
+                <span v-if="currentPrescription.erx_category === 'DRUG'" class="min-width-140px text-secondary text-sm">Pharmacy</span>
+                <span v-else-if="currentPrescription.erx_category === 'LAB'" class="min-width-140px text-secondary text-sm">Lab</span>
+                <span v-else-if="currentPrescription.erx_category === 'IMAGING'" class="min-width-140px text-secondary text-sm">Lab</span>
+                <span v-else class="min-width-140px text-secondary text-sm">Logistics</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a class="mr-2" href="#" v-on:click.prevent="editLogisticsDetails(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.logistics_detail_json" class="d-flex align-items-baseline">
@@ -293,7 +296,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">HCP Pro</span>
+                <span class="min-width-140px text-secondary text-sm">Prescribed By</span>
                 <div class="d-inline-flex align-items-baseline flex-grow-1">
                     <a v-if="!currentPrescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editHcpPro(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
@@ -314,7 +317,7 @@
                 </div>
             </div>
             <div class="pb-2 d-flex align-items-center">
-                <span class="min-width-140px text-secondary text-sm">Pro Status</span>
+                <span class="min-width-140px text-secondary text-sm">Prescription Status</span>
                 <div class="d-inline-flex align-items-baseline">
                     <a class="mr-2" href="#" v-on:click.prevent="editProStatus(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
                     <div v-if="currentPrescription.pro_declared_status" class="d-flex align-items-baseline">
@@ -1013,17 +1016,28 @@ GROUP BY erx_category");
                         return true;
                     },
                     addExistingDrugToERx: function(_uid) {
+                        let existing = this.existingDrugs.filter(_x => {
+                            return _x.uid === _uid;
+                        });
+                        if(!existing || !existing.length) return false;
+                        existing = existing[0];
+
+                        // require dispense and refills
+                        if(!existing.data.dispense) {
+                            toastr.error('Dispense cannot be blank');
+                            return false;
+                        }
+                        if(!existing.data.refills) {
+                            toastr.error('Refills cannot be blank');
+                            return false;
+                        }
+
                         if(!this.currentPrescription.clinical_detail_json) {
                             this.currentPrescription.clinical_detail_json = {};
                         }
                         if(!this.currentPrescription.clinical_detail_json.items) {
                             this.currentPrescription.clinical_detail_json.items = [];
                         }
-                        let existing = this.existingDrugs.filter(_x => {
-                            return _x.uid === _uid;
-                        });
-                        if(!existing || !existing.length) return false;
-                        existing = existing[0];
                         this.currentPrescription.clinical_detail_json.items.push({
                             medication: existing.data.name,
                             dispense: existing.data.dispense,

+ 6 - 1
resources/views/app/patient/prescriptions/logistics-form.blade.php

@@ -1,7 +1,12 @@
 <div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="logistics-popup">
     <form method="POST" action="" class="overflow-visible min-height-300px">
         <h3 class="stag-popup-title mb-2">
-            <span>Logistics</span>
+
+            <span v-if="currentPrescription && currentPrescription.erx_category === 'DRUG'">Pharmacy</span>
+            <span v-else-if="currentPrescription && currentPrescription.erx_category === 'LAB'">Lab</span>
+            <span v-else-if="currentPrescription && currentPrescription.erx_category === 'IMAGING'">Lab</span>
+            <span v-else>Logistics</span>
+
             <a href="#" class="ml-auto text-secondary"
                onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
         </h3>

+ 1 - 1
resources/views/app/patient/prescriptions/pro-status-form.blade.php

@@ -1,7 +1,7 @@
 <div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="pro-status-popup">
     <form method="POST" action="" class="overflow-visible">
         <h3 class="stag-popup-title mb-2">
-            <span>Pro Declared Status</span>
+            <span>Prescription Status</span>
             <a href="#" class="ml-auto text-secondary"
                onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
         </h3>

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

@@ -165,7 +165,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
 
                             @endif
 
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'point' => $problem, 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
 
                             <div class="mt-3 pt-2 d-flex align-items-center border-top">
                                 <button type="submit" class="btn-save-problem btn btn-sm btn-primary mr-2">Save</button>
@@ -279,7 +279,7 @@ $ccSegment = $note->getSegmentByInternalName('chief_complaint');
                             </div>
 
                             <?php $point = null; ?>
-                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI'])
+                            @include('app.patient.wizard-partials.common-fields', ['label' => 'problem', 'reviewLabel' => 'HPI', 'addVerbPT' => 'Diagnosed'])
 
                         </div>
                         <div class="col-5 border-left">

+ 8 - 3
resources/views/app/patient/segment-templates/vitals/edit.blade.php

@@ -143,9 +143,14 @@ $copyTriggerAdded = [];
                                        placeholder="{{$v}}"
                                        data-option-list="smokingStatus" value="{{$contentData['smokingStatus']}}">
                                 <div id="smoking-status-options" class="data-option-list">
-                                    <div>Current</div>
-                                    <div>Former</div>
-                                    <div>Never</div>
+                                    <div>Current every day smoker</div>
+                                    <div>Former some day smoker</div>
+                                    <div>Former smoker</div>
+                                    <div>Never smoker</div>
+                                    <div>Smoker, current status unknown</div>
+                                    <div>Unknown if ever smoked</div>
+                                    <div>Heavy tobacco smoker</div>
+                                    <div>Light tobacco smoker</div>
                                 </div>
                             @elseif($k === 'systolicBP')
                                 <div class="d-flex align-items-center bg-white">

+ 5 - 3
resources/views/app/patient/wizard-partials/common-fields.blade.php

@@ -17,7 +17,7 @@
     <hr class="mb-2 mt-0">
 
     <div class="mb-2">
-        <span class="">Is this pre-existing, or being added during this visit?</span>
+        <span class="">Is this pre-existing, or being {{@$addVerbPT ?: 'added'}} during this visit?</span>
         <div class="d-flex align-items-baseline mt-1">
             <label class="my-0 d-inline-flex align-items-center">
                 <input type="radio" name="additionReasonCategory" value="ON_INTAKE"
@@ -29,7 +29,7 @@
                 <input type="radio" name="additionReasonCategory" value="DURING_VISIT"
                         {{$point && $point->addition_reason_category === 'DURING_VISIT' ? 'checked' : ''}}
                         {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
-                <span class="ml-1">Added during this visit (as part of my plan)</span>
+                <span class="ml-1">{{@$addVerbPT ? ucwords($addVerbPT) : 'Added'}} during this visit (as part of my plan)</span>
             </label>
         </div>
     </div>
@@ -87,7 +87,7 @@
                        class="form-control form-control-sm min-width-unset">
             </div>
             <div class="col-6">
-                <label class="text-sm mb-0">Added By</label>
+                <label class="text-sm mb-0">{{@$addVerbPT ? ucwords($addVerbPT) : 'Added'}} By</label>
                 <input type="text"
                        data-name="prescriber"
                        value="{{@$point->data ? @$point->data->prescriber : ''}}"
@@ -163,6 +163,7 @@
                 </div>
                 <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
             </div>
+            <div class="d-none disallow-if-review-same-as" compare-width="reviewValue"><?= str_compact($previousValue) ?></div>
             <?php endif; ?>
             <div note-rte
                  class="form-group mb-2 border-left border-right rte-holder bg-white"
@@ -207,6 +208,7 @@
                 </div>
                 <div class="p-2 bg-light border inline-html-container click-to-copy"><?= $previousValue ?></div>
             </div>
+            <div class="d-none disallow-if-plan-same-as" compare-width="planValue"><?= str_compact($previousValue) ?></div>
             <?php endif; ?>
             <div note-rte
                  class="form-group mb-2 border-left border-right rte-holder bg-white"

+ 27 - 6
resources/views/app/patient/wizard-partials/common-script.blade.php

@@ -253,13 +253,34 @@ parentSegment.find('.frm-edit-{{$label}}')
         }
 
         @if($patient->core_note_id !== $note->id)
-        // store plan content
-        let planContent = parsed && parsed.planValue ? parsed.planValue : '';
         let reviewContent = parsed && parsed.reviewValue ? parsed.reviewValue : '';
-        // if(!$.trim($('<div/>').html(planContent).text())) {
-        //     toastr.error('Directions cannot be empty');
-        //     return false;
-        // }
+
+        let compareWith = false;
+        if(form.find('.disallow-if-review-same-as')) {
+            compareWith = $.trim(form.find('.disallow-if-review-same-as').text());
+            if(compareWith && reviewContent) {
+                let newValue = $('<div/>').html(reviewContent).text().replace(/[^a-zA-Z0-9]/g, '');
+                if(newValue === compareWith) {
+                    alert('New review should be different from the previous review!');
+                    return false;
+                }
+            }
+        }
+
+        let planContent = parsed && parsed.planValue ? parsed.planValue : '';
+
+        compareWith = false;
+        if(form.find('.disallow-if-plan-same-as')) {
+            compareWith = $.trim(form.find('.disallow-if-plan-same-as').text());
+            if(compareWith && planContent) {
+                let newValue = $('<div/>').html(planContent).text().replace(/[^a-zA-Z0-9]/g, '');
+                if(newValue === compareWith) {
+                    alert('New plan should be different from the previous plan!');
+                    return false;
+                }
+            }
+        }
+
         if(parsed.planValue) delete parsed.planValue;
         if(parsed.reviewValue) delete parsed.reviewValue;
         @endif

+ 32 - 0
resources/views/layouts/patient.blade.php

@@ -532,6 +532,38 @@ $isVisitNote = ($routeName === 'patients.view.notes.view.dashboard' && @$note &&
                                                 @endif
                                             @endif
                                         </div>
+											<div>
+												<label>Engagement Status:</label>
+												<b>{{$patient->client_engagement_status_category ? ucwords(strtolower(str_replace('_', ' ', $patient->client_engagement_status_category))) : '-'}}</b>
+												<div moe class="ml-2 hide-inside-popup">
+													<a start show><i class="fa fa-edit"></i></a>
+													<form url="/api/client/updateClientEngagementAssessmentStatus" class="mcp-theme-1">
+														<input type="hidden" name="uid" value="{{$patient->uid}}">
+														<div class="mb-2">
+															<label class="mb-1 text-secondary text-sm">Status</label>
+															<select name="category" class="form-control form-control-sm">
+																<option value=""> --select--</option>
+																<option {{ $patient->client_engagement_status_category === 'ACTIVE' ? 'selected' : '' }} value="ACTIVE">Active</option>
+																<option {{ $patient->client_engagement_status_category === 'INACTIVE' ? 'selected' : '' }} value="INACTIVE">Inactive</option>
+																<option {{ $patient->client_engagement_status_category === 'ENTRY_ERROR' ? 'selected' : '' }} value="ENTRY_ERROR">Entry Error</option>
+																<option {{ $patient->client_engagement_status_category === 'DUMMY' ? 'selected' : '' }} value="DUMMY">Dummy</option>
+																<option {{ $patient->client_engagement_status_category === 'DECEASED' ? 'selected' : '' }} value="DECEASED">Deceased</option>
+																<option {{ $patient->client_engagement_status_category === 'DUPLICATE' ? 'selected' : '' }} value="DUPLICATE">Duplicate</option>
+																<option {{ $patient->client_engagement_status_category === 'NO_LONGER_INTERESTED' ? 'selected' : '' }} value="NO_LONGER_INTERESTED">No Longer Interested</option>
+																<option {{ $patient->client_engagement_status_category === 'BAD_RECORD' ? 'selected' : '' }} value="BAD_RECORD">Bad Record</option>
+															</select>
+														</div>
+														<div class="mb-2">
+															<label class="mb-1 text-secondary text-sm">Memo</label>
+															<textarea class="form-control form-control-sm" name="memo"></textarea>
+														</div>
+														<div>
+															<button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+															<button cancel class="btn btn-sm btn-default border">Cancel</button>
+														</div>
+													</form>
+												</div>
+											</div>
                                         </div>
                                     </section>
                                     {{--<section>