Peter Muturi 3 tahun lalu
induk
melakukan
c974a026d8
36 mengubah file dengan 509 tambahan dan 238 penghapusan
  1. 3 0
      app/Http/Controllers/HomeController.php
  2. 3 0
      app/Http/Controllers/PracticeManagementController.php
  3. 3 1
      config/app.php
  4. 65 1
      config/stag.php
  5. 54 50
      js-dev/mc.js
  6. 2 1
      js-dev/pro-suggest.js
  7. 2 0
      js-dev/stag-popup.js
  8. 14 18
      resources/views/app/admin/patients_filters.blade.php
  9. 11 0
      resources/views/app/patient/allergies-center.blade.php
  10. 58 0
      resources/views/app/patient/care-month/put-rm-reasons.blade.php
  11. 44 56
      resources/views/app/patient/care-month/rm-reasons.blade.php
  12. 62 0
      resources/views/app/patient/care-month/rm-reasons_depricated.blade.php
  13. 13 0
      resources/views/app/patient/medications-center.blade.php
  14. 1 3
      resources/views/app/patient/medications-reconcile.blade.php
  15. 1 1
      resources/views/app/patient/modules/lifestyle_general/edit.blade.php
  16. 1 1
      resources/views/app/patient/modules/lifestyle_nutrition/edit.blade.php
  17. 1 1
      resources/views/app/patient/modules/lifestyle_physical_activity/edit.blade.php
  18. 1 1
      resources/views/app/patient/modules/lifestyle_sleep/edit.blade.php
  19. 1 1
      resources/views/app/patient/modules/lifestyle_social/edit.blade.php
  20. 1 1
      resources/views/app/patient/modules/lifestyle_stress/edit.blade.php
  21. 1 1
      resources/views/app/patient/modules/lifestyle_substances/edit.blade.php
  22. 2 1
      resources/views/app/patient/modules/weight_loss_intake/edit.blade.php
  23. 16 16
      resources/views/app/patient/note/dashboard.blade.php
  24. 53 5
      resources/views/app/patient/notes.blade.php
  25. 1 1
      resources/views/app/patient/partials/put-rm-reasons.blade.php
  26. 3 8
      resources/views/app/patient/partials/rm-setup.blade.php
  27. 0 4
      resources/views/app/patient/prescriptions/list.blade.php
  28. 12 0
      resources/views/app/patient/problems-center.blade.php
  29. 1 1
      resources/views/app/patient/problems-quick-add.blade.php
  30. 6 6
      resources/views/app/patient/segment-templates/_common_actions/toggle-relevance.blade.php
  31. 1 1
      resources/views/app/patient/segment-templates/mc_weight_loss_intake_subjective/edit.blade.php
  32. 32 0
      resources/views/app/patient/wizard-partials/add-multiple-pre-existing.blade.php
  33. 6 56
      resources/views/app/patient/wizard-partials/common-script.blade.php
  34. 5 1
      resources/views/app/practice-management/notes_filters.blade.php
  35. 25 1
      resources/views/layouts/patient.blade.php
  36. 4 0
      resources/views/layouts/template.blade.php

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

@@ -1882,6 +1882,9 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
                 case 'hcp':
                     $pros->where('is_hcp', true);
                     break;
+                case 'non-hcp':
+                    $pros->where('is_hcp', false);
+                    break;
                 case 'default-na': // TODO: fix condition for NA
                     $pros->where('is_hcp', false)->where('pro_type', '!=', 'ADMIN');
                     break;

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

@@ -326,6 +326,9 @@ SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE c
         $status = $request->get('status');
         if($status){
             if($status == 'CANCELLED') $query = $query->where('is_cancelled', true);
+            if($status == 'NOT_YET_SIGNED') $query = $query->where('is_signed_by_hcp', false);
+            if($status == 'NOT_YET_SIGNED_BUT_ALLY_SIGNED') $query = $query->where('is_signed_by_hcp', false)->where('is_signed_by_ally', true);
+            if($status == 'WITHOUT_BILLS') $query = $query->where('is_signed_by_hcp', true)->where('is_cancelled', false)->whereDoesntHave('bills');
         }
 
         

+ 3 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 72,
+    'asset_version' => 73,
 
     'temp_dir' => env('TEMP_DIR'),
 
@@ -146,6 +146,8 @@ return [
     'googleSpreadsheetId' => env('GOOGLE_SPREADSHEET_ID'),
     'googleSpreadsheetProductsSheetName' => env('GOOGLE_SPREADSHEET_PRODUCTS_SHEET_NAME'),
 
+    'adminNoteHcpProUid' => env('ADMIN_NOTE_HCP_PRO_UID'),
+
     /*
     |--------------------------------------------------------------------------
     | Autoloaded Service Providers

+ 65 - 1
config/stag.php

@@ -3,5 +3,69 @@
 return [
     'authUrl' => env('AUTH_URL'),
     'adminPortalUrl' => env('ADMIN_PORTAL_URL', 'https://fe.scholar.securecpu.com'),
-    'backendUrl' => env('BACKEND_URL','https://scholar.securecpu.com')
+    'backendUrl' => env('BACKEND_URL','https://scholar.securecpu.com'),
+
+    'segmentRefreshConfig' => [
+        'typeToSegments' => [
+            'allergy' => [
+                'intake_allergies',
+                'plan_allergies',
+                'allergies',
+                'omega_allergies',
+                'omega_subjective_system',
+                'omega_plan_system',
+            ],
+            'medication' => [
+                'intake_medications',
+                'plan_medications',
+                'omega_medications',
+                'medications',
+                'omega_subjective_system',
+                'omega_plan_system',
+            ],
+            'problem' => [
+                'intake_problems',
+                'plan_problems',
+                'omega_problems',
+                'problems',
+                'omega_subjective_system',
+                'omega_plan_system',
+            ],
+            'goal' => [
+                'intake_goals',
+                'plan_goals',
+                'omega_goals',
+                'goals',
+                'omega_subjective_system',
+                'omega_plan_system',
+            ],
+            'care-team-member' => [
+                'intake_care_team',
+                'plan_care_team',
+                'omega_care_team',
+                'care_team',
+                'omega_subjective_system',
+                'omega_plan_system',
+            ],
+        ],
+
+        'wizardToTypes' => [
+            'allergies-center' => ['allergy'],
+            'medications-center' => ['medication'],
+            'problems-center' => ['problem'],
+            'goals-center' => ['goal'],
+            'careteam-center' => ['care-team-member']
+        ],
+
+        'wizardToSegments' => [
+            'past_medical_history/edit' => ['omega_history_past_medical'],
+            'history_family/edit' => ['omega_history_family'],
+            'history_social/edit' => ['omega_history_social'],
+            'history_surgical/edit' => ['omega_history_surgical'],
+            'weight_loss_intake/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'nutrition-center' => ['omega_subjective_system', 'omega_plan_system'],
+            'exercise-center' => ['omega_subjective_system', 'omega_plan_system'],
+            'behavior-center' => ['omega_subjective_system', 'omega_plan_system'],
+        ],
+    ]
 ];

+ 54 - 50
js-dev/mc.js

@@ -557,7 +557,50 @@ window.fillJsonDataField = function(form, field = "data") {
     }
     return parsed;
 }
+window.refreshSegment = function(_segment) {
+    $('.visit-segment[data-segment-template-name="' + _segment + '"]').find('.refresh-segment').trigger('click');
+};
+window.refreshAffectedSegmentsByType = function(_type) {
+    if(!_type) {
+        console.error('refreshAffectedSegmentsByType: _type cannot be empty!');
+        return;
+    }
+    let segments = window.segmentRefreshConfig.typeToSegments[_type];
+    if(segments && segments.length) {
+        for (let i = 0; i < segments.length; i++) {
+            refreshSegment(segments[i]);
+        }
+    }
+    else {
+        if(!_type) {
+            console.error('refreshAffectedSegmentsByType: no segments to refresh for type:', _type);
+        }
+    }
+};
+window.refreshAffectedSegmentsByPopupKey = function(_key) {
+    let types = [];
+    for(let x in window.segmentRefreshConfig.wizardToTypes) {
+        if(window.segmentRefreshConfig.wizardToTypes.hasOwnProperty(x) && _key.indexOf(x) !== -1) {
+            types.push(window.segmentRefreshConfig.wizardToTypes[x]);
+            break;
+        }
+    }
+    for (let i = 0; i < types.length; i++) {
+        refreshAffectedSegmentsByType(types[i]);
+    }
+    let segments = [];
+    for(let x in window.segmentRefreshConfig.wizardToSegments) {
+        if(window.segmentRefreshConfig.wizardToSegments.hasOwnProperty(x) && _key.indexOf(x) !== -1) {
+            segments = window.segmentRefreshConfig.wizardToSegments[x];
+            break;
+        }
+    }
+    for (let i = 0; i < segments.length; i++) {
+        refreshSegment(segments[i]);
+    }
+};
 window.saveVisitForm = function(_trigger, _silent = false, _close = false, _doneCallback = null) {
+    console.info("saveVisitForm");
     let form = $(_trigger).closest('form');
 
     if (!_silent && !form[0].checkValidity()) {
@@ -599,56 +642,17 @@ window.saveVisitForm = function(_trigger, _silent = false, _close = false, _done
         if(!hasResponseError(_data)) {
             if(typeof window.updateAllSegmentsInResponse !== 'undefined') {
                 window.updateAllSegmentsInResponse(_data, true, _silent);
-
-                // if /api/visitPoint/upsertChildReview - refresh subjective_general_v2
-                // if /api/visitPoint/upsertChildPlan - refresh plan_free_text_v2
-
-                let parentPopup = form.closest('.stag-popup');
-
-                let eps = [
-                    '/api/visitPoint/upsertChildReview',
-                    '/api/visitPoint/upsertChildPlan',
-                    '/api/visitPoint/destroyCurrentChildReview',
-                    '/api/visitPoint/destroyCurrentChildPlan',
-                    '/api/visitPoint/addTopLevelBulkPreExisting'
-                ];
-
-                if(parentPopup.length && eps.indexOf(form.attr('url')) !== -1) {
-                    if(parentPopup.attr('stag-popup-key').indexOf('past_medical_history/edit') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_history_past_medical"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('history_family/edit') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_history_family"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('history_social/edit') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_history_social"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('history_surgical/edit') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_history_surgical"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('allergies-center') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_allergies"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('medications-center') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_medications"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('problems-center') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_problems"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('goals-center') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_goals"]').find('.refresh-segment').trigger('click');
-                    }
-                    else if(parentPopup.attr('stag-popup-key').indexOf('careteam-center') !== -1) {
-                        $('.visit-segment[data-segment-template-name="omega_care_team"]').find('.refresh-segment').trigger('click');
-                    }
-                }
-
-                // refresh omega_xxx_system on ALL changes
-                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                // $('.visit-segment[data-segment-template-name="omega_objective_system"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_assessment_system"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
-
+            }
+            let parentPopup = form.closest('.stag-popup');
+            let eps = [
+                '/api/visitPoint/upsertChildReview',
+                '/api/visitPoint/upsertChildPlan',
+                '/api/visitPoint/destroyCurrentChildReview',
+                '/api/visitPoint/destroyCurrentChildPlan',
+                '/api/visitPoint/addTopLevelBulkPreExisting'
+            ];
+            if(parentPopup.length && eps.indexOf(form.attr('url')) !== -1) {
+                refreshAffectedSegmentsByPopupKey(parentPopup.attr('stag-popup-key'));
             }
             if(typeof window.refreshRHSSidebar !== 'undefined') {
                 window.refreshRHSSidebar();

+ 2 - 1
js-dev/pro-suggest.js

@@ -104,7 +104,8 @@
             let elem = $(this);
             elem.next('.pro-suggest-input').remove();
             elem.next('.pro-suggestions-container').remove();
-            let input = $('<input type="text" placeholder="Pro">').addClass('pro-suggest-input form-control form-control-sm').insertAfter(elem);
+            let input = $('<input type="text" placeholder="Pro">').addClass('pro-suggest-input form-control').insertAfter(elem);
+            if($(this).is('.form-control-sm')) input.addClass('form-control-sm');
             input.attr('provider-type', elem.attr('provider-type'));
             $('<div class="pro-suggestions-container position-relative">' +
                 '<div class="suggestions-outer pro-suggestions position-absolute d-none"></div>' +

+ 2 - 0
js-dev/stag-popup.js

@@ -93,6 +93,8 @@ function openDynamicStagPopup(_url, initer, title, updateParent, style = '', rep
     if(url.indexOf('popupmode') === -1) {
         url += (url.indexOf('?') !== -1 ? '&' : '?') + 'popupmode=1';
     }
+    // close out any open inline visit-segment
+    $('.note-section.visit-segment.edit').removeClass('edit');
     showMask();
     window.noMc = true;
     $.get(url, (_data) => {

+ 14 - 18
resources/views/app/admin/patients_filters.blade.php

@@ -30,30 +30,14 @@
 	</div>
 
 	<div class="sm-section">
-		<div class="">
+		<div class="mcp-filter-container">
 			<label>MCP:</label>
-			<select name="mcp" class="form-control min-width-unset" v-model="filters.mcp">
-				<option value="">--select--</option>
-				<option value="NO_MCP">No MCP</option>
-				<?php $mcpPros = \App\Models\Pro::where('is_active', true)->where('is_enrolled_as_mcp', true)->orderBy('name_display')->get(); ?>
-				@foreach($mcpPros as $mcpPro)
-					<option value="{{$mcpPro->uid}}">{{$mcpPro->displayName()}}</option>
-				@endforeach
-			</select>
 		</div>
 	</div>
 
 	<div class="sm-section">
-		<div class="">
+		<div class="na-filter-container">
 			<label>NA:</label>
-			<select name="na" class="form-control min-width-unset" v-model="filters.na">
-				<option value="">--select--</option>
-				<option value="NO_NA">No NA</option>
-				<?php $naPros = \App\Models\Pro::where('is_active', true)->where('is_considered_for_dna', true)->orWhere('pro_type', '=', 'ADMIN')->orderBy('name_display')->get(); ?>
-				@foreach($naPros as $naPro)
-					<option value="{{$naPro->uid}}">{{$naPro->name_display}}</option>
-				@endforeach
-			</select>
 		</div>
 	</div>
 
@@ -416,6 +400,18 @@ for ($i=0; $i < count($allFilterKeys); $i++) {
 				mounted: function() {
 					console.log(this.filters);
 					this.init();
+
+					let mcpSelect = $('<select name="mcp" class="form-control min-width-unset input-sm" provider-search data-pro-uid="{{request()->input('mcp')}}" provider-type="hcp"><option value="">--select--</option></select>').appendTo('.mcp-filter-container');
+					let naSelect = $('<select name="na" class="form-control min-width-unset input-sm" provider-search data-pro-uid="{{request()->input('na')}}" provider-type="non-hcp"><option value="">--select--</option></select>').appendTo('.na-filter-container');
+					initProSuggest();
+
+					/*let self = this;
+					mcpSelect.off('change').on('change', function() {
+						self.doSubmit();
+					});
+					naSelect.off('change').on('change', function() {
+						self.doSubmit();
+					});*/
 				},
 			});
 

+ 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

+ 58 - 0
resources/views/app/patient/care-month/put-rm-reasons.blade.php

@@ -0,0 +1,58 @@
+<div moe>
+	<a start show><i class="fas fa-edit"></i></a>
+	<form url="/api/careMonth/putRmReasons" class="mcp-theme-1">
+		<input type="hidden" name="uid" value="{{$careMonth->uid}}">
+		<div class="bg-light p-3 mb-2">
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 1</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-code data-target="input[name=rmReasonIcd1Description]" name="rmReasonIcd1" value="{{ $careMonth->rm_reason_icd1 }}" />
+			</div>
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 1 Description</label>
+				<input id="" type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd1Description" value="{{ $careMonth->rm_reason_icd1description }}">
+			</div>
+		</div>
+
+		<div class="bg-light p-3 mb-2">
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 2</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-code name="rmReasonIcd2" data-target="input[name=rmReasonIcd2Description]" value="{{ $careMonth->rm_reason_icd2 }}" />
+			</div>
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 2 Description</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd2Description" value="{{ $careMonth->rm_reason_icd2description }}">
+			</div>
+		</div>
+
+		<div class="bg-light p-3 mb-2">
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 3</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-code name="rmReasonIcd3" data-target="input[name=rmReasonIcd3Description]" value="{{ $careMonth->rm_reason_icd3 }}" />
+			</div>
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 3 Description</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd3Description" value="{{ $careMonth->rm_reason_icd3description }}">
+			</div>
+		</div>
+		<div class="bg-light p-3 mb-2">
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 4</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-code name="rmReasonIcd4" data-target="input[name=rmReasonIcd4Description]" value="{{ $careMonth->rm_reason_icd4 }}" />
+			</div>
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Icd 4 Description</label>
+				<input type="text" class="form-control form-control-sm" icd-autocomplete-description name="rmReasonIcd4Description" value="{{ $careMonth->rm_reason_icd4description }}">
+			</div>
+		</div>
+		<div class="bg-light p-3 mb-2">
+			<div class="mb-2">
+				<label class="text-sm mb-1 text-secondary">RM Reason Memo</label>
+				<input type="text" class="form-control form-control-sm" name="rmReasonMemo" value="{{ $careMonth->rm_reason_memo }}">
+			</div>
+		</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>

+ 44 - 56
resources/views/app/patient/care-month/rm-reasons.blade.php

@@ -1,62 +1,50 @@
+<div class="d-flex align-items-center mb-1">
+    <span class="mr-2">RM Reasons:</span>
+    @include('app.patient.care-month.put-rm-reasons')
+</div>
 <div class="">
-    <div class="">
-        <div class="d-flex align-items-center mb-2 border-bottom pb-2">
-            <p class="font-weight-bold text-secondary m-0 mr-2">RM Reasons</p>
-        </div>
-        @if(!$careMonth->rmReasons || !count($careMonth->rmReasons))
-            <span class="text-secondary">None</span>
-        @else
-            <div>
-                @foreach($careMonth->rmReasons as $reason)
-                    <div class="border-bottom pb-1 mb-1 d-flex align-items-start">
-                        <b class="width-90px">{{$reason->code}}</b>
-                        <span class="width-200px">{{$reason->description}}</span>
-                        <div moe class="ml-3">
-                            <a start show><i class="fa fa-edit on-hover-opaque"></i></a>
-                            <form url="/api/careMonthCmRmReason/updateBasic" class="mcp-theme-1">
-                                <input type="hidden" name="uid" value="{{$reason->uid}}">
-                                <div class="mb-2">
-                                    <label class="text-sm mb-1 text-secondary">Code *</label>
-                                    <input type="text" class="form-control form-control-sm"
-                                           name="code" value="{{$reason->code}}" required>
-                                </div>
-                                <div class="mb-2">
-                                    <label class="text-sm mb-1 text-secondary">Description</label>
-                                    <input type="text" class="form-control form-control-sm"
-                                           name="description" value="{{$reason->description}}">
-                                </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>
+    <table class="table table-sm table-striped table-bordered">
+        <tbody>
+            <tr>
+                <td class="text-nowrap">RM Reason Icd 1</td>
+                <td>
+                    <div class="d-flex flex-column">
+                        <span class="font-weight-bold">{{ $careMonth->rm_reason_icd1 }}</span>
+                        <small class="text-muted">{{ $careMonth->rm_reason_icd1description }}</small>
                     </div>
-                @endforeach
-            </div>
-        @endif
-        <div>
-            <div moe>
-                <a start show>+ Add</a>
-                <form url="/api/careMonthCmRmReason/create" class="mcp-theme-1">
-                    <input type="hidden" name="careMonthUid" value="{{$careMonth->uid}}">
-                    <input type="hidden" name="cmOrRm" value="RM">
-                    <div class="mb-2">
-                        <label class="text-sm mb-1 text-secondary">Code *</label>
-                        <input type="text" class="form-control form-control-sm"
-                               name="code" value="" required>
+                </td>
+            </tr>
+            <tr>
+                <td class="text-nowrap">RM Reason Icd 2</td>
+                <td>
+                    <div class="d-flex flex-column">
+                        <span class="font-weight-bold">{{ $careMonth->rm_reason_icd2 }}</span>
+                        <small class="text-muted">{{ $careMonth->rm_reason_icd2description }}</small>
                     </div>
-                    <div class="mb-2">
-                        <label class="text-sm mb-1 text-secondary">Description</label>
-                        <input type="text" class="form-control form-control-sm"
-                               name="description" value="">
+                </td>
+            </tr>
+            <tr>
+                <td class="text-nowrap">RM Reason Icd 3</td>
+                <td>
+                    <div class="d-flex flex-column">
+                        <span class="font-weight-bold">{{ $careMonth->rm_reason_icd3 }}</span>
+                        <small class="text-muted">{{ $careMonth->rm_reason_icd3description }}</small>
                     </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>
+                </td>
+            </tr>
+            <tr>
+                <td class="text-nowrap">RM Reason Icd 4</td>
+                <td>
+                    <div class="d-flex flex-column">
+                        <span class="font-weight-bold">{{ $careMonth->rm_reason_icd4 }}</span>
+                        <small class="text-muted">{{ $careMonth->rm_reason_icd4description }}</small>
                     </div>
-                </form>
-            </div>
-        </div>
-    </div>
+                </td>
+            </tr>
+            <tr>
+                <td class="text-nowrap">RM Reason Memo</td>
+                <td>{{ $careMonth->rm_reason_memo }}</td>
+            </tr>
+        </tbody>
+    </table>
 </div>

+ 62 - 0
resources/views/app/patient/care-month/rm-reasons_depricated.blade.php

@@ -0,0 +1,62 @@
+<div class="">
+    <div class="">
+        <div class="d-flex align-items-center mb-2 border-bottom pb-2">
+            <p class="font-weight-bold text-secondary m-0 mr-2">RM Reasons</p>
+        </div>
+        @if(!$careMonth->rmReasons || !count($careMonth->rmReasons))
+            <span class="text-secondary">None</span>
+        @else
+            <div>
+                @foreach($careMonth->rmReasons as $reason)
+                    <div class="border-bottom pb-1 mb-1 d-flex align-items-start">
+                        <b class="width-90px">{{$reason->code}}</b>
+                        <span class="width-200px">{{$reason->description}}</span>
+                        <div moe class="ml-3">
+                            <a start show><i class="fa fa-edit on-hover-opaque"></i></a>
+                            <form url="/api/careMonthCmRmReason/updateBasic" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="{{$reason->uid}}">
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Code *</label>
+                                    <input type="text" class="form-control form-control-sm"
+                                           name="code" value="{{$reason->code}}" required>
+                                </div>
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Description</label>
+                                    <input type="text" class="form-control form-control-sm"
+                                           name="description" value="{{$reason->description}}">
+                                </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>
+                @endforeach
+            </div>
+        @endif
+        <div>
+            <div moe>
+                <a start show>+ Add</a>
+                <form url="/api/careMonthCmRmReason/create" class="mcp-theme-1">
+                    <input type="hidden" name="careMonthUid" value="{{$careMonth->uid}}">
+                    <input type="hidden" name="cmOrRm" value="RM">
+                    <div class="mb-2">
+                        <label class="text-sm mb-1 text-secondary">Code *</label>
+                        <input type="text" class="form-control form-control-sm"
+                               name="code" value="" required>
+                    </div>
+                    <div class="mb-2">
+                        <label class="text-sm mb-1 text-secondary">Description</label>
+                        <input type="text" class="form-control form-control-sm"
+                               name="description" value="">
+                    </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>
+</div>

+ 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

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

@@ -207,9 +207,7 @@ $medications = $points;
                         success: function(_data) {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="intake_medications"]').find('.refresh-segment').trigger('click');
-                                $('.visit-segment[data-segment-template-name="plan_medications"]').find('.refresh-segment').trigger('click');
-                                $('.visit-segment[data-segment-template-name="omega_medications"]').find('.refresh-segment').trigger('click');
+                                refreshAffectedSegmentsByType('medication');
                             }
                         }
                     }).then(() => {

+ 1 - 1
resources/views/app/patient/modules/lifestyle_general/edit.blade.php

@@ -442,7 +442,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 1 - 1
resources/views/app/patient/modules/lifestyle_nutrition/edit.blade.php

@@ -1298,7 +1298,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 1 - 1
resources/views/app/patient/modules/lifestyle_physical_activity/edit.blade.php

@@ -410,7 +410,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 1 - 1
resources/views/app/patient/modules/lifestyle_sleep/edit.blade.php

@@ -806,7 +806,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 1 - 1
resources/views/app/patient/modules/lifestyle_social/edit.blade.php

@@ -290,7 +290,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 1 - 1
resources/views/app/patient/modules/lifestyle_stress/edit.blade.php

@@ -695,7 +695,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 1 - 1
resources/views/app/patient/modules/lifestyle_substances/edit.blade.php

@@ -964,7 +964,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
                             }
                         });
                         return false;

+ 2 - 1
resources/views/app/patient/modules/weight_loss_intake/edit.blade.php

@@ -908,7 +908,8 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         }, _data => {
                             if(!hasResponseError(_data)) {
                                 closeStagPopup();
-                                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
+                                refreshSegment('omega_subjective_system');
+								refreshSegment('omega_plan_system');
                             }
                         });
                         return false;

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

@@ -149,20 +149,20 @@ use App\Models\Handout;
             <div class="pr-2">
                 {{$note->title}}
                 @if(!$note->is_signed_by_hcp || $pro->pro_type === 'ADMIN')
-                <div moe class="ml-1">
-                    <a href="" show start><i class="fa fa-edit"></i></a>
-                    <form url="/api/note/putTitle">
-                        <input type="hidden" name="uid" value="{{$note->uid}}">
-                        <div class="mb-2">
-                            <input type="text" name="title" value="{{$note->title}}" class="form-control form-control-sm"
-                                   placeholder="Title">
-                        </div>
-                        <div class="form-group mb-0">
-                            <button class="btn btn-primary btn-sm" submit>Submit</button>
-                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                        </div>
-                    </form>
-                </div>
+                    <div moe class="ml-1">
+                        <a href="" show start><i class="fa fa-edit"></i></a>
+                        <form url="/api/note/putTitle">
+                            <input type="hidden" name="uid" value="{{$note->uid}}">
+                            <div class="mb-2">
+                                <input type="text" name="title" value="{{$note->title}}" class="form-control form-control-sm"
+                                       placeholder="Title">
+                            </div>
+                            <div class="form-group mb-0">
+                                <button class="btn btn-primary btn-sm" submit>Submit</button>
+                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                            </div>
+                        </form>
+                    </div>
                     @if($note->visitTemplate && $note->visitTemplate->internal_name == 'omega_soap_visit' &&  $note->new_or_fu_or_na !== 'NEW')
                         <div moe relative class="d-inline border-left pl-2 ml-2">
                             <a start show>Clone</a>
@@ -2679,7 +2679,7 @@ use App\Models\Handout;
                 // update disclaimers on fastReload()
                 // NOTE: this is NOT the ideal place to put this
                 @if(!$note->is_signed_by_hcp)
-                $('.visit-segment[data-segment-template-name="disclaimers"]').find('.refresh-segment').trigger('click');
+                refreshSegment('disclaimers');
                 @endif
             }
             function fixTreeTopAndHeight() {
@@ -2743,7 +2743,7 @@ use App\Models\Handout;
                     initStagScrollbar({{$note->is_signed_by_hcp ? 1 : 34}});
                     @endif
                     addMCHook('onNoteMethodUpdate', function() {
-                        $('.visit-segment[data-segment-template-name="disclaimers"]').find('.refresh-segment').trigger('click');
+                        refreshSegment('disclaimers');
                         fastReload();
                     });
                     $(document)

+ 53 - 5
resources/views/app/patient/notes.blade.php

@@ -142,11 +142,37 @@
                         <label for="" class="text-secondary text-sm mb-1">Effective Date *</label>
                         <input type="date" name="effectiveDate" class="form-control" value="{{get_current_date($pro->display_timezone)}}">
                     </div>
-                    <div class="form-group">
-                        <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
-                        <select name="hcpProUid" class="form-control" provider-search required data-pro-uid="{{$pro->is_hcp ? $pro->uid : ''}}">
-                        </select>
-                    </div>
+
+                    @if($pro->pro_type === 'ADMIN')
+                        <div class="form-group mb-2 pt-2 d-flex">
+                            <label class="my-0 mr-3 d-flex align-items-center">
+                                <input type="radio" class="mr-1" name="noteType" value="regular" required>
+                                Regular Note
+                            </label>
+                            <label class="my-0 mr-3 d-flex align-items-center">
+                                <input type="radio" class="mr-1" name="noteType" value="admin" required>
+                                Admin Note
+                            </label>
+                        </div>
+
+                        <div if-admin-note class="d-none">
+                            <input type="hidden" x-name="hcpProUid" value="{{config('app.adminNoteHcpProUid')}}">
+                        </div>
+
+                        <div class="form-group d-none" if-regular-note>
+                            <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
+                            <select x-name="hcpProUid" class="form-control" provider-search required data-pro-uid="{{$pro->is_hcp ? $pro->uid : ''}}">
+                            </select>
+                        </div>
+                    @else
+                        <div class="form-group mb-2">
+                            <label for="" class="text-secondary text-sm mb-1">HCP Pro *</label>
+                            <select name="hcpProUid" class="form-control" provider-search required data-pro-uid="{{$pro->is_hcp ? $pro->uid : ''}}">
+                            </select>
+                        </div>
+                    @endif
+
+
                     <div class="form-group mb-2">
                         <label for="" class="text-secondary text-sm mb-1">Note Template *</label>
                         <select name="visitTemplateUid" class="form-control form-control-sm"
@@ -406,6 +432,28 @@
                         form.find('.if-in-clinic').hide();
                     }
                 });
+
+                $('[name="noteType"]').change(function() {
+                    let form = $(this).closest('form');
+                    form.find('[if-regular-note]').addClass('d-none');
+                    form.find('[if-regular-note] [x-name]').removeAttr('name');
+                    form.find('[if-admin-note]').addClass('d-none');
+                    form.find('[if-admin-note] [x-name]').removeAttr('name');
+                    if(form.find('[name="noteType"]:checked').attr('value') === 'regular') {
+                        form.find('[if-regular-note]').removeClass('d-none');
+                        form.find('[if-regular-note] [x-name]').each(function() {
+                            $(this).attr('name', $(this).attr('x-name'));
+                        });
+                    }
+                    else if(form.find('[name="noteType"]:checked').attr('value') === 'admin') {
+                        form.find('[if-admin-note]').removeClass('d-none');
+                        form.find('[if-admin-note] [x-name]').each(function() {
+                            $(this).attr('name', $(this).attr('x-name'));
+                        });
+                    }
+                    return false;
+                });
+
             }
             addMCInitializer('notes-list', initNotesList, '#notes-list-{{$patient->id}}');
         })();

+ 1 - 1
resources/views/app/patient/partials/put-rm-reasons.blade.php

@@ -47,7 +47,7 @@
 		<div class="bg-light p-3 mb-2">
 			<div class="mb-2">
 				<label class="text-sm mb-1 text-secondary">RM Reason Memo</label>
-				<input type="text" class="form-control form-control-sm" name="rmResonMemo" value="{{ $patient->rm_reason_memo }}">
+				<input type="text" class="form-control form-control-sm" name="rmReasonMemo" value="{{ $patient->rm_reason_memo }}">
 			</div>
 		</div>
 		<div>

+ 3 - 8
resources/views/app/patient/partials/rm-setup.blade.php

@@ -104,14 +104,9 @@
                 </div>
             </div>
         </div>
-        <div class="d-flex align-items-baseline mb-1">
-            <span class="width-200px">RM Reasons:</span>
-            <div class="ml-3">
-                <div>
-                    <span class="text-secondary mr-1">None</span>
-                    @include('app.patient.partials.put-rm-reasons')
-                </div>
-            </div>
+        <div class="d-flex align-items-center mb-1">
+            <span class="mr-2">RM Reasons:</span>
+            @include('app.patient.partials.put-rm-reasons')
         </div>
         <div class="pl-3" style="width: 400px;">
             <table class="table table-sm table-striped table-bordered">

+ 0 - 4
resources/views/app/patient/prescriptions/list.blade.php

@@ -1565,10 +1565,6 @@ GROUP BY erx_category");
                                         $.post(form.attr('action'), form.serialize(), _data => {
                                             if (!hasResponseError(_data)) {
 
-                                                // refreshDynamicStagPopup();
-                                                // $('.visit-segment[data-segment-template-name="intake_medications"]').find('.refresh-segment').trigger('click');
-
-
                                                 if(!self.currentPrescription.clinical_detail_json) {
                                                     self.currentPrescription.clinical_detail_json = {};
                                                 }

+ 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();

+ 1 - 1
resources/views/app/patient/problems-quick-add.blade.php

@@ -197,7 +197,7 @@ $formID = rand(100000, 999999);
                     $.post(form.attr('action'), form.serialize(), _data => {
                         if (!hasResponseError(_data)) {
                             hideMask();
-                            $('.visit-segment[data-segment-template-name="intake_problems"]').find('.refresh-segment').trigger('click');
+                            refreshAffectedSegmentsByType('problem');
                             closeStagPopup();
                         }
                     }, 'json');

+ 6 - 6
resources/views/app/patient/segment-templates/_common_actions/toggle-relevance.blade.php

@@ -16,10 +16,10 @@ if(parentPopup.length) {
             }, _data => {
                 if(!hasResponseError(_data)) {
                     refreshDynamicStagPopup();
-                    $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                    refreshSegment('omega_subjective_system');
+                    refreshSegment('omega_plan_system');
                     @if(@$segmentName)
-                    $('.visit-segment[data-segment-template-name="{{$segmentName}}"]').find('.refresh-segment').trigger('click');
+                    refreshSegment('{{$segmentName}}');
                     @endif
                 }
             }, 'json');
@@ -30,10 +30,10 @@ if(parentPopup.length) {
             }, _data => {
                 if(!hasResponseError(_data)) {
                     refreshDynamicStagPopup();
-                    $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                    refreshSegment('omega_subjective_system');
+                    refreshSegment('omega_plan_system');
                     @if(@$segmentName)
-                    $('.visit-segment[data-segment-template-name="{{$segmentName}}"]').find('.refresh-segment').trigger('click');
+                    refreshSegment('{{$segmentName}}');
                     @endif
                 }
             }, 'json');

+ 1 - 1
resources/views/app/patient/segment-templates/mc_weight_loss_intake_subjective/edit.blade.php

@@ -267,7 +267,7 @@ if ($point && $point->lastChildReview && $point->last_child_review_point_scoped_
                 additionReasonCategory: 'ON_INTAKE'
             }, _data => {
                 if(!hasResponseError(_data)) {
-                    $('.visit-segment[data-segment-template-name="mc_weight_loss_intake_subjective"]').find('.refresh-segment').trigger('click');
+                    refreshSegment('mc_weight_loss_intake_subjective')
                 }
             }, 'json');
 

+ 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')

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

@@ -320,15 +320,7 @@ parentSegment.find('#frm-add-{{$label}}')
             if(!hasResponseError(_data)) {
                 hideMask();
                 refreshDynamicStagPopup();
-                $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                refreshAffectedSegmentsByType('{{$label}}');
                 if(typeof refreshRHSSidebar !== 'undefined') refreshRHSSidebar();
 
                 // only for canvas-migrate
@@ -451,15 +443,7 @@ parentSegment.find('.frm-edit-{{$label}}')
             if(!hasResponseError(_data)) {
                 hideMask();
                 refreshDynamicStagPopup();
-                $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                refreshAffectedSegmentsByType('{{$label}}');
                 if(typeof refreshRHSSidebar !== 'undefined') refreshRHSSidebar();
             }
         }, 'json');
@@ -474,15 +458,7 @@ parentSegment.find('.frm-upsert-review-plan-{{$label}}')
         showMask();
         $.post(form.attr('url'), form.serialize(), _data => {
             if(!hasResponseError(_data)) {
-                $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                refreshAffectedSegmentsByType('{{$label}}');
                 refreshDynamicStagPopup();
             }
         }).then(() => {
@@ -631,17 +607,7 @@ parentSegment.find('.toggle-relevance')
             }, _data => {
                 if (!hasResponseError(_data)) {
                     refreshDynamicStagPopup();
-                    $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                    // $('.visit-segment[data-segment-template-name="omega_objective_system"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_assessment_system"]').find('.refresh-segment').trigger('click');
-                    $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                    refreshAffectedSegmentsByType('{{$label}}');
                     if(typeof refreshRHSSidebar !== 'undefined') refreshRHSSidebar();
                 }
             }, 'json');
@@ -652,17 +618,7 @@ parentSegment.find('.toggle-relevance')
                 }, _data => {
                     if (!hasResponseError(_data)) {
                         refreshDynamicStagPopup();
-                        $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="omega_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="omega_plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="omega_subjective_system"]').find('.refresh-segment').trigger('click');
-                        // $('.visit-segment[data-segment-template-name="omega_objective_system"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="omega_assessment_system"]').find('.refresh-segment').trigger('click');
-                        $('.visit-segment[data-segment-template-name="omega_plan_system"]').find('.refresh-segment').trigger('click');
+                        refreshAffectedSegmentsByType('{{$label}}');
                         if(typeof refreshRHSSidebar !== 'undefined') refreshRHSSidebar();
                     }
                 }, 'json');
@@ -696,13 +652,7 @@ parentSegment.find('.tracker-input')
         }, _data => {
             if(!hasResponseError(_data)) {
                 refreshDynamicStagPopup();
-                $('.visit-segment[data-segment-template-name="intake_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="omega_plan_{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="{{$segment_part}}"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="subjective_general_v2"]').find('.refresh-segment').trigger('click');
-                $('.visit-segment[data-segment-template-name="plan_free_text_v2"]').find('.refresh-segment').trigger('click');
+                refreshAffectedSegmentsByType('{{$label}}');
             }
         }, 'json');
     });

+ 5 - 1
resources/views/app/practice-management/notes_filters.blade.php

@@ -22,6 +22,7 @@
 	.filter-container>div:not(:last-child) {
 		margin-right: 15px;
 	}
+
 	.select2-container {
 		width: 100% !important;
 	}
@@ -87,7 +88,7 @@
 			<select multiple class="form-control form-control-sm mr-2" name="patients[]" v-model="filters.patients">
 				<option value="">All Patients</option>
 				@foreach($allPatientsWithNotes as $notePatient)
-					<option value="{{ $notePatient->id }}">{{ $notePatient->displayName() }}</option>
+				<option value="{{ $notePatient->id }}">{{ $notePatient->displayName() }}</option>
 				@endforeach
 			</select>
 		</div>
@@ -99,6 +100,9 @@
 			<select class="form-control form-control-sm mr-2" name="status" v-model="filters.status">
 				<option value="">All Notes</option>
 				<option value="CANCELLED">Cancelled</option>
+				<option value="NOT_YET_SIGNED">Notes not yet signed</option>
+				<option value="NOT_YET_SIGNED_BUT_ALLY_SIGNED">Notes not yet signed (but ally signed)</option>
+				<option value="WITHOUT_BILLS">Without Bills</option>
 			</select>
 		</div>
 	</div>

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

@@ -297,7 +297,7 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 			@endif
 			<div class="card {{$trimLayout || $isVisitNote ? 'card m-0 border-0 rounded-0' : 'my-3'}}" id="patient-header">
 				<div id="patient-header-content">
-					<div class="px-2 @if($patient->client_engagement_status_category == 'DUMMY') alert-warning @endif py-1 hide-inside-ticket-popup">
+					<div class="@if($patient->client_engagement_status_category == 'DUMMY') alert-warning @endif hide-inside-ticket-popup">
 						@include('layouts.patient-header')
 					</div>
 				</div>
@@ -386,6 +386,30 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 		addMCInitializer('patient-add-note-popup', init, '#patient-header')
 	}).call(window);
 </script>
+<script>
+	(function() {
+		function init() {
+			let sbMenu = $('#sidebarMenu');
+			sbMenu
+					.off('scroll')
+					.on('scroll', function() {
+						localStorage.sidebarMenuScrollTop = $(this).scrollTop();
+					});
+			if(localStorage.sidebarMenuScrollTop) {
+				sbMenu.scrollTop(+localStorage.sidebarMenuScrollTop);
+				let sbMenuPos = sbMenu.offset(),
+						activeItem = sbMenu.find('.nav-item>.nav-link.active').first(),
+						activeItemPos = activeItem.offset();
+				if(activeItem.length) {
+					if(activeItemPos.top < sbMenuPos.top || (activeItemPos.top + activeItem.outerHeight(true)) > (sbMenuPos.top + sbMenu.outerHeight(true))) {
+						activeItem[0].scrollIntoView({behavior : "auto", block: "nearest"});
+					}
+				}
+			});
+		}
+		addMCInitializer('patient-add-note-popup', init, '#patient-header')
+	}).call(window);
+</script>
 <script>
 	(function() {
 		function init() {

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

@@ -77,6 +77,10 @@
     <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/TableDnD/1.0.5/jquery.tablednd.min.js"></script>
 
+    <script>
+        window.segmentRefreshConfig = {!! json_encode(config('stag.segmentRefreshConfig')) !!};
+    </script>
+
     @yield('head')
 </head>