= 1 rok temu
rodzic
commit
a224ea647d
18 zmienionych plików z 72 dodań i 54 usunięć
  1. 3 2
      config/stag.php
  2. 4 1
      js-dev/mc.js
  3. 1 1
      resources/views/app/patient/module-specific-summary-renderers/data-dump.blade.php
  4. 8 5
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_general/subjective.blade.php
  5. 2 2
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_nutrition/subjective.blade.php
  6. 2 2
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_physical_activity/subjective.blade.php
  7. 2 2
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_sleep/subjective.blade.php
  8. 2 2
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_social_relationships/subjective.blade.php
  9. 2 2
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_stress/subjective.blade.php
  10. 2 2
      resources/views/app/patient/module-specific-summary-renderers/lifestyle_substance_use/subjective.blade.php
  11. 2 2
      resources/views/app/patient/modules/lifestyle_general/edit.blade.php
  12. 18 18
      resources/views/app/patient/modules/weight_loss_intake/edit.blade.php
  13. 0 1
      resources/views/app/patient/note/dashboard.blade.php
  14. 3 3
      resources/views/app/patient/note/note-segment-list-rhs.blade.php
  15. 4 4
      resources/views/app/patient/note/note-segment-list.blade.php
  16. 1 1
      resources/views/app/patient/note/segment-slim.blade.php
  17. 8 2
      resources/views/app/patient/segment-templates/lifestyle_general/edit.blade.php
  18. 8 2
      resources/views/app/patient/segment-templates/lifestyle_general/summary.blade.php

+ 3 - 2
config/stag.php

@@ -1,4 +1,4 @@
-<?php 
+<?php
 
 return [
     'authUrl' => env('AUTH_URL'),
@@ -72,9 +72,10 @@ return [
             'history_social/edit' => ['omega_history_social'],
             'history_surgical/edit' => ['omega_history_surgical'],
             'weight_loss_intake/edit' => ['omega_subjective_system', 'omega_plan_system'],
+            'lifestyle_general/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'],
         ],
     ]
-];
+];

+ 4 - 1
js-dev/mc.js

@@ -652,7 +652,10 @@ window.saveVisitForm = function(_trigger, _silent = false, _close = false, _done
                 '/api/visitPoint/addTopLevelBulkPreExisting'
             ];
             if(parentPopup.length && eps.indexOf(form.attr('url')) !== -1) {
+                console.log("Here 1")
                 refreshAffectedSegmentsByPopupKey(parentPopup.attr('stag-popup-key'));
+            }else{
+                console.log("Here 2")
             }
             if(typeof window.refreshRHSSidebar !== 'undefined') {
                 window.refreshRHSSidebar();
@@ -753,4 +756,4 @@ window.markEventAsConsumed = function(_e) {
     if(_e && _e.originalEvent) {
         _e.originalEvent.stagCosumed = true;
     }
-};
+};

+ 1 - 1
resources/views/app/patient/module-specific-summary-renderers/data-dump.blade.php

@@ -13,4 +13,4 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         }
     }
 }
-?>
+?>

+ 8 - 5
resources/views/app/patient/module-specific-summary-renderers/lifestyle_general/subjective.blade.php

@@ -1,4 +1,6 @@
+
 @if($points && count($points))
+
     <div class="d-flex border-bottom">
         <a class="mr-2 min-width-110px "
            open-in-stag-popup
@@ -9,15 +11,16 @@
             Lifestyle General
         </a>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
-                <?php $j = 0; foreach ($points as $point): $j++; ?>
+            <table class="table table-bordered table-xs mb-0">
+                <?php for( $j = 0; $j < count($points); $j++): ?>
+                    <?php $point = $points[$j]; ?>
                     <tr>
                         <td>
-                            @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
+                           @include('app.patient.module-specific-summary-renderers.data-dump', compact('point'))
                         </td>
                     </tr>
-                <?php endforeach; ?>
+                <?php endfor; ?>
             </table>
         </div>
     </div>
-@endif
+@endif

+ 2 - 2
resources/views/app/patient/module-specific-summary-renderers/lifestyle_nutrition/subjective.blade.php

@@ -9,7 +9,7 @@
             Lifestyle Nutrition
         </a>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
+            <table class="table table-bordered table-xs mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
@@ -20,4 +20,4 @@
             </table>
         </div>
     </div>
-@endif
+@endif

+ 2 - 2
resources/views/app/patient/module-specific-summary-renderers/lifestyle_physical_activity/subjective.blade.php

@@ -12,7 +12,7 @@
             Lifestyle Physical Activity
         </span>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
+            <table class="table table-bordered table-xs  mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
@@ -23,4 +23,4 @@
             </table>
         </div>
     </div>
-@endif
+@endif

+ 2 - 2
resources/views/app/patient/module-specific-summary-renderers/lifestyle_sleep/subjective.blade.php

@@ -12,7 +12,7 @@
             Lifestyle Sleep
         </span>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
+            <table class="table table-bordered table-xs  mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
@@ -23,4 +23,4 @@
             </table>
         </div>
     </div>
-@endif
+@endif

+ 2 - 2
resources/views/app/patient/module-specific-summary-renderers/lifestyle_social_relationships/subjective.blade.php

@@ -12,7 +12,7 @@
             Lifestyle Social
         </span>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
+            <table class="table table-bordered table-xs  mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
@@ -23,4 +23,4 @@
             </table>
         </div>
     </div>
-@endif
+@endif

+ 2 - 2
resources/views/app/patient/module-specific-summary-renderers/lifestyle_stress/subjective.blade.php

@@ -12,7 +12,7 @@
             Lifestyle Stress
         </span>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
+            <table class="table table-bordered table-xs  mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
@@ -23,4 +23,4 @@
             </table>
         </div>
     </div>
-@endif
+@endif

+ 2 - 2
resources/views/app/patient/module-specific-summary-renderers/lifestyle_substance_use/subjective.blade.php

@@ -12,7 +12,7 @@
             Lifestyle Substances
         </span>
         <div class="flex-grow-1">
-            <table class="table table-bordered table-xs table-cage mb-0">
+            <table class="table table-bordered table-xs  mb-0">
                 <?php $j = 0; foreach ($points as $point): $j++; ?>
                     <tr>
                         <td>
@@ -23,4 +23,4 @@
             </table>
         </div>
     </div>
-@endif
+@endif

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

@@ -418,7 +418,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         handler: function(val, oldVal) {
                             let parent = $('#edit-univ_sub_lifestyle_general-container').closest('form');
                             parent.find('[name="data"]').val(JSON.stringify(this.data));
-
+                            console.log('Autosaving lifestyle on change');
                             // autosave on change
                             autoSaveSegment(parent.find('[submit]').first());
                         },
@@ -460,4 +460,4 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         addMCInitializer('edit-univ_sub_lifestyle_general-container-{{$note->id}}', init, '#edit-univ_sub_lifestyle_general-container');
 
     })();
-</script>
+</script>

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

@@ -79,7 +79,7 @@ $contentData = [
     "family_history_other" => [],
     "family_history_other_text" => "",
     "family_history_alcoholism" => "",
-    "fhdos" => "",    
+    "fhdos" => "",
     "age_periods_started" => "",
     "age_periods_ended" => "",
     "periods_frequency" => "",
@@ -322,8 +322,8 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 								<div class="form-check form-check-inline">
 									<input class="form-check-input" type="checkbox" v-model="data.previous_weight_loss_programs" id="pwl-ornish_diet" value="ornish_diet">
 									<label class="form-check-label" for="pwl-ornish_diet">Ornish diet</label>
-								</div>							
-								
+								</div>
+
 								<div class="d-flex flex-grow-1 align-items-end">
 									<div class="form-check form-check-inline mr-3">
 										<input class="form-check-input" type="checkbox" v-model="data.previous_weight_loss_programs" id="pwl-other"
@@ -406,8 +406,8 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 								<div class="form-check form-check-inline">
 									<input class="form-check-input" type="checkbox" v-model="data.weight_loss_medication" id="wlm-contrave" value="contrave">
 									<label class="form-check-label" for="wlm-contrave">Contrave</label>
-								</div>				
-								
+								</div>
+
 								<div class="d-flex flex-grow-1 align-items-end">
 									<div class="form-check form-check-inline mr-3">
 										<input class="form-check-input" type="checkbox" v-model="data.weight_loss_medication" id="wlm-other"
@@ -456,7 +456,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 									<input type="text" class="form-control inline" style="width:50px" v-model="data.breakfast_hour">
 									<label>:</label>
 								</div>
-								<div class="d-flex mr-3">									
+								<div class="d-flex mr-3">
 									<input type="text" class="form-control inline" style="width:50px" v-model="data.breakfast_min">
 									<label>a.m</label>
 								</div>
@@ -531,7 +531,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 								<div class="form-check form-check-inline">
 									<input class="form-check-input" type="checkbox" v-model="data.food_triggers" id="ft-eating_out" value="eating_out">
 									<label class="form-check-label" for="ft-eating_out">Eating out</label>
-								</div>								
+								</div>
 								<div class="d-flex flex-grow-1 align-items-end">
 									<div class="form-check form-check-inline mr-3">
 										<input class="form-check-input" type="checkbox" v-model="data.food_triggers" id="ft-other"
@@ -574,7 +574,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 								<div class="form-check form-check-inline">
 									<input class="form-check-input" type="checkbox" v-model="data.food_cravings" id="fc-largr_portions" value="largr_portions">
 									<label class="form-check-label" for="fc-largr_portions">Large portions</label>
-								</div>								
+								</div>
 								<div class="d-flex flex-grow-1 align-items-end">
 									<div class="form-check form-check-inline mr-3">
 										<input class="form-check-input" type="checkbox" v-model="data.food_cravings" id="fc-other"
@@ -613,10 +613,10 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 									<input type="text" class="form-control inline" style="width:50px" v-model="data.medical_history_mins">
 									<label>minutes</label>
 								</div>
-								<div class="d-flex mr-3 flex-grow-1">	
-									<label>Number of times per week:</label>								
+								<div class="d-flex mr-3 flex-grow-1">
+									<label>Number of times per week:</label>
 									<input type="text" class="form-control inline flex-grow-1" v-model="data.medical_history_no_of_times_per_week">
-									
+
 								</div>
 							</div>
 						</div>
@@ -629,8 +629,8 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 								<div class="d-flex mr-3">
 									<input type="text" class="form-control inline" v-model="data.sleeping_hours_per_night">
 								</div>
-								<div class="d-flex mr-3 flex-grow-1">	
-									<label>Do you feel rested in the morning?</label>								
+								<div class="d-flex mr-3 flex-grow-1">
+									<label>Do you feel rested in the morning?</label>
 									<input type="text" class="form-control inline flex-grow-1" v-model="data.feels_rested_in_morning">
 								</div>
 							</div>
@@ -825,12 +825,12 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 								<div class="form-check form-check-inline">
 									<input class="form-check-input" type="checkbox" v-model="data.women_only" id="wo-abnormal_menstruation" value="abnormal_menstruation">
 									<label class="form-check-label" for="wo-abnormal_menstruation">Abnormal/excessive menstruation</label>
-								</div>					
+								</div>
 								<div class="form-check form-check-inline">
 									<input class="form-check-input" type="checkbox" v-model="data.women_only" id="wo-facial_hair" value="facial_hair">
 									<label class="form-check-label" for="wo-facial_hair"> Facial hair</label>
-								</div>	
-								
+								</div>
+
 							</div>
 						</div>
 					</div>
@@ -889,7 +889,7 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         handler: function(val, oldVal) {
                             let parent = $('#edit-weight_loss_intake-container').closest('form');
                             parent.find('[name="data"]').val(JSON.stringify(this.data));
-
+                            console.log('Autosaving weightloss on change');
                             // autosave on change
                             autoSaveSegment(parent.find('[submit]').first());
                         },
@@ -924,4 +924,4 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
         addMCInitializer('edit-weight_loss_intake-container-{{$note->id}}', init, '#edit-weight_loss_intake-container');
 
     })();
-</script>
+</script>

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

@@ -145,7 +145,6 @@ use App\Models\Handout;
             @endif
         </h6>
     </div>
-
     <div class="card mb-0 {{ $note->is_cancelled ? 'cancelled-item' : '' }} border-0 rounded-0">
         <div class="card-header d-flex align-items-start px-3 py-2 border-bottom rounded-0" id="note-card-header">
             <div class="pr-3">

+ 3 - 3
resources/views/app/patient/note/note-segment-list-rhs.blade.php

@@ -3,7 +3,7 @@
     $previousHeading = null;
     $previousSubHeading = null;
 
-    $suggestionModeOn = request()->get('suggestion_mode') == 'on' && $note->is_signed_by_hcp 
+    $suggestionModeOn = request()->get('suggestion_mode') == 'on' && $note->is_signed_by_hcp
 
     ?>
     @foreach($note->segmentsRight as $segment)
@@ -28,7 +28,7 @@
         <div>
 			@if($suggestionModeOn)
 				@include('app.patient.note.segment.suggestions_and_updates')
-			@else 
+			@else
 				@include('app.patient.note.segment')
 			@endif
 		</div>
@@ -39,4 +39,4 @@
     }
     ?>
 </div>
-@include('app.patient.note.segment_script-rhs')
+@include('app.patient.note.segment_script-rhs')

+ 4 - 4
resources/views/app/patient/note/note-segment-list.blade.php

@@ -1,6 +1,6 @@
-<?php  
-    $suggestionModeOn = request()->get('suggestion_mode') == 'on' && $note->is_signed_by_hcp 
-?> 
+<?php
+    $suggestionModeOn = request()->get('suggestion_mode') == 'on' && $note->is_signed_by_hcp
+?>
 <div class="segments-list" id="note-segments-list">
     <?php
     $previousHeading = null;
@@ -33,7 +33,7 @@
                     @include('app.patient.note.segment')
                 @endif
             </div>
-           
+
     @endforeach
     <?php
     if (!empty($previousHeading)) {

+ 1 - 1
resources/views/app/patient/note/segment-slim.blade.php

@@ -31,7 +31,7 @@ $isOmegaHistorySegment = strpos($iName, 'omega_history_') === 0;
                         @if($note->is_signed_by_hcp && $segment->accepted_suggestion_summary_html)
                             {!! $segment->accepted_suggestion_summary_html !!}
                         @else
-                            {!! $segment->summary_html !!}
+                           {!! $segment->summary_html !!}
                         @endif
                     </div>
 

+ 8 - 2
resources/views/app/patient/segment-templates/lifestyle_general/edit.blade.php

@@ -6,6 +6,10 @@ use App\Models\Point;
 /** @var Note $note */
 /** @var Point $point */
 
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
 $contentData = [
     "current_overall_health_level" => '',
     "sleep" => '',
@@ -25,7 +29,9 @@ $contentData = [
     "gain_other_description" => '',
 ];
 
-$point = Point::getGlobalSingletonOfCategory($patient, 'LIFESTYLE_GENERAL', true);
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'LIFESTYLE_GENERAL', $sessionKey, true);
+
+//$point = Point::getGlobalSingletonOfCategory($patient, 'LIFESTYLE_GENERAL', true);
 
 if ($point && @$point->data) {
     $contentData = $point->data;
@@ -34,7 +40,7 @@ if ($point && @$point->data) {
 <div class="p-3 mcp-theme-1">
 
     <div visit-moe close-on-save close-on-cancel class="d-block">
-        <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1">
+        <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1">
             <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
             <input type="hidden" name="category" value="LIFESTYLE_GENERAL">
             <input type="hidden" name="data">

+ 8 - 2
resources/views/app/patient/segment-templates/lifestyle_general/summary.blade.php

@@ -6,14 +6,20 @@ use App\Models\Note;
 /** @var Client $patient */
 /** @var Note $note */
 
-$point = Point::getGlobalSingletonOfCategory($patient, 'LIFESTYLE_GENERAL', false);
+if(!@$sessionKey) {
+    $sessionKey = request()->cookie('sessionKey');
+}
+
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'LIFESTYLE_GENERAL', $sessionKey, true);
+
+//$point = Point::getGlobalSingletonOfCategory($patient, 'LIFESTYLE_GENERAL', false);
 
 if ($point && @$point->data) {
     $contentData = $point->data;
 ?>
 
     <div id="v3_sleep_assessment_section" class="mt-3">
-
+        <h1>Summary is here</h1>
         <div class="row">
 
             <div class="col-md-12">