瀏覽代碼

Updated sca sleep study questionnaire

Samson Mutunga 1 年之前
父節點
當前提交
dbf5f53186

+ 77 - 71
resources/views/app/patient/segment-templates/sca_sleep_study_questionnaire/summary.blade.php

@@ -7,76 +7,78 @@ $endPoint = 'upsertNoteSingleton';
 
 $point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, $category, $sessionKey, true);
 $formFields = [
-    'name' => 'name',
-    'phone' => 'Telephone',
-    'email_address' => 'email_address',
-    'address' => 'address',
-    'height' => 'Height (inches)',
-    'weight' => 'Weight (lbs)',
-    'hst_before' => 'Have you ever had a sleep study test before?',
-    'yes_treatment' => 'When and what was your diagnosis and prescribed treatment?',
-    'allergies_medication' => 'allergies_medication',
-    'allergies_food' => 'allergies_food',
-    'social_history' => 'social_history',
-    'years_smoked' => 'years_smoked',
-    'packs_per_day' => 'packs_per_day',
-    'cigarettes_per_day' => 'cigarettes_per_day',
-    'drinks_per_day' => 'Alcohol drinks_per_day',
-    'drinks_per_week' => 'Alcohol drinks_per_week',
-    'drinks_per_month' => 'Alcohol drinks_per_month',
-    'current_medications' => 'Current Medications: Name, Dose & Frequency',
-    'current_supplements' => 'current_supplements',
-    'past_surgeries' => 'Past Surgeries (type and date)',
-    'acid_reflux' => 'acid_reflux',
-    'anxiety' => 'anxiety',
-    'bruxism' => 'bruxism',
-    'cognitive_difficulties' => 'cognitive_difficulties',
-    'depression' => 'depression',
-    'diabetes' => 'diabetes',
-    'fatigue' => 'fatigue',
-    'fatigue_time' => 'fatigue_time',
-    'headaches' => 'headaches',
-    'heart_disease' => 'heart_disease',
-    'high_cholesterol' => 'high_cholesterol',
-    'hypertension' => 'hypertension',
-    'hypothyroidism' => 'hypothyroidism',
-    'insomnia' => 'insomnia',
-    'irritable_bowel_disorder' => 'irritable_bowel_disorder',
-    'jaw_pain' => 'jaw_pain',
-    'memory_concerns' => 'memory_concerns',
-    'restless_leg_syndrome' => 'restless_leg_syndrome',
-    'sexual_dysfunction' => 'sexual_dysfunction',
-    'weight_gain' => 'weight_gain',
-    'weight_gain_amount' => 'weight_gain_amount',
-    'sitting_reading' => 'sitting_reading',
-    'watching_tv' => 'watching_tv',
-    'sitting_inactive_public' => 'sitting_inactive_public',
-    'car_passenger' => 'As a passenger in a car for an hour without a break',
-    'after_lunch' => 'Sitting quietly after lunch without drinking alcohol',
-    'lying_down' => 'Lying down to rest in the afternoon when circumstances permit',
-    'sitting_talking' => 'Sitting and talking to someone',
-    'car_traffic' => 'In a car, while stopped for a few minutes in traffic',
-    'total_epworth' => 'total_epworth score',
-    'snore' => 'Do you snore?',
-    'snore_loud' => 'Is your snoring loud?',
-    'snore_in_every_body_position' => 'Do you snore in every body position?',
-    'pauses_gaps' => 'Is your snoring interrupted by pauses, gasps or choking?',
-    'sleeping_position' => 'Do you sleep on your back, side, stomach?',
-    'sleep_not_refreshing' => 'Do you feel your sleep is not refreshing?',
-    'freq_times_wakeup' => 'freq_times_wakeup',
-    'memory_rate' => 'How would you rate your memory?',
-    'trouble_falling_asleep' => 'Do you have trouble falling asleep?',
-    'duration_sleep' => 'How long does it take you to fall asleep?',
-    'wake_during_night' => 'How often do you wake up during the night?',
-    'anxious_bother' => 'Are you bothered by feeling down, anxious?',
-    'anxiety_attack' => 'anxiety_attack',
-    'weekday_bedtime' => 'weekday_bedtime',
-    'weekday_wakeup' => 'weekday_wakeup',
-    'weekends_bedtime' => 'weekends_bedtime',
-    'weekends_wakeup' => 'weekends_wakeup',
+    'name' => [ 'label' => 'name'],
+    'phone' => [ 'label' => 'Telephone'],
+    'email_address' => [ 'label' => 'email_address'],
+    'address' => [ 'label' => 'address'],
+    'height' => [ 'label' => 'Height (inches)'],
+    'weight' => [ 'label' => 'Weight (lbs)'],
+    'hst_before' => [ 'label' => 'Have you ever had a sleep study test before?'],
+    'yes_treatment' => [ 'label' => 'When and what was your diagnosis and prescribed treatment?'],
+    'allergies_medication' => [ 'label' => 'allergies_medication'],
+    'allergies_food' => [ 'label' => 'allergies_food'],
+    'social_history' => [ 'label' => 'social_history'],
+    'years_smoked' => [ 'label' => 'years_smoked'],
+    'packs_per_day' => [ 'label' => 'packs_per_day'],
+    'cigarettes_per_day' => [ 'label' => 'cigarettes_per_day'],
+    'drinks_per_day' => [ 'label' => 'Alcohol drinks_per_day'],
+    'drinks_per_week' => [ 'label' => 'Alcohol drinks_per_week'],
+    'drinks_per_month' => [ 'label' => 'Alcohol drinks_per_month'],
+    'current_medications' => [ 'label' => 'Current Medications: Name, Dose & Frequency'],
+    'current_supplements' => [ 'label' => 'current_supplements'],
+    'past_surgeries' => [ 'label' => 'Past Surgeries (type and date)'],
+    'acid_reflux' => [ 'label' => 'acid_reflux', 'checkbox' => true],
+    'anxiety' => [ 'label' => 'anxiety', 'checkbox' => true],
+    'bruxism' => [ 'label' => 'bruxism', 'checkbox' => true],
+    'cognitive_difficulties' => [ 'label' => 'cognitive_difficulties', 'checkbox' => true],
+    'depression' => [ 'label' => 'depression', 'checkbox' => true],
+    'diabetes' => [ 'label' => 'diabetes', 'checkbox' => true],
+    'fatigue' => [ 'label' => 'fatigue', 'checkbox' => true],
+    'fatigue_time' => [ 'label' => 'fatigue_time'],
+    'headaches' => [ 'label' => 'headaches', 'checkbox' => true],
+    'heart_disease' => [ 'label' => 'heart_disease', 'checkbox' => true],
+    'high_cholesterol' => [ 'label' => 'high_cholesterol', 'checkbox' => true],
+    'hypertension' => [ 'label' => 'hypertension', 'checkbox' => true],
+    'hypothyroidism' => [ 'label' => 'hypothyroidism', 'checkbox' => true],
+    'insomnia' => [ 'label' => 'insomnia', 'checkbox' => true],
+    'irritable_bowel_disorder' => [ 'label' => 'irritable_bowel_disorder', 'checkbox' => true],
+    'jaw_pain' => [ 'label' => 'jaw_pain', 'checkbox' => true],
+    'memory_concerns' => [ 'label' => 'memory_concerns', 'checkbox' => true],
+    'restless_leg_syndrome' => [ 'label' => 'restless_leg_syndrome', 'checkbox' => true],
+    'sexual_dysfunction' => [ 'label' => 'sexual_dysfunction', 'checkbox' => true],
+    'weight_gain' => [ 'label' => 'weight_gain', 'checkbox' => true],
+    'weight_gain_amount' => [ 'label' => 'weight_gain_amount'],
+    'sitting_reading' => [ 'label' => 'sitting_reading'],
+    'watching_tv' => [ 'label' => 'watching_tv'],
+    'sitting_inactive_public' => [ 'label' => 'sitting_inactive_public'],
+    'car_passenger' => [ 'label' => 'As a passenger in a car for an hour without a break'],
+    'after_lunch' => [ 'label' => 'Sitting quietly after lunch without drinking alcohol'],
+    'lying_down' => [ 'label' => 'Lying down to rest in the afternoon when circumstances permit'],
+    'sitting_talking' => [ 'label' => 'Sitting and talking to someone'],
+    'car_traffic' => [ 'label' => 'In a car, while stopped for a few minutes in traffic'],
+    'total_epworth' => [ 'label' => 'total_epworth score'],
+    'snore' => [ 'label' => 'Do you snore?'],
+    'snore_loud' => [ 'label' => 'Is your snoring loud?'],
+    'snore_in_every_body_position' => [ 'label' => 'Do you snore in every body position?'],
+    'pauses_gaps' => [ 'label' => 'Is your snoring interrupted by pauses, gasps or choking?'],
+    'sleeping_position' => [ 'label' => 'Do you sleep on your back, side, stomach?'],
+    'sleep_not_refreshing' => [ 'label' => 'Do you feel your sleep is not refreshing?'],
+    'freq_times_wakeup' => [ 'label' => 'freq_times_wakeup'],
+    'memory_rate' => [ 'label' => 'How would you rate your memory?'],
+    'trouble_falling_asleep' => [ 'label' => 'Do you have trouble falling asleep?'],
+    'duration_sleep' => [ 'label' => 'How long does it take you to fall asleep?'],
+    'wake_during_night' => [ 'label' => 'How often do you wake up during the night?'],
+    'anxious_bother' => [ 'label' => 'Are you bothered by feeling down, anxious?'],
+    'anxiety_attack' => [ 'label' => 'anxiety_attack'],
+    'weekday_bedtime' => [ 'label' => 'weekday_bedtime'],
+    'weekday_wakeup' => [ 'label' => 'weekday_wakeup'],
+    'weekends_bedtime' => [ 'label' => 'weekends_bedtime'],
+    'weekends_wakeup' => [ 'label' => 'weekends_wakeup'],
 ];
 $contentData = [
-    "name" => null,
+    'name' => $point->client->displayName(),
+    'phone' => $point->client->cell_number,
+    'email_address' => $point->client->email_address,
 ];
 if (!!@$point->data) {
     $contentData = $point->data;
@@ -85,13 +87,17 @@ if (!!@$point->data) {
 
 <table class="table table-sm table-bordered mb-2">
     <tbody>
-    @foreach($formFields as $key=>$label)
+    @foreach($formFields as $key=>$detail)
     <tr>
         <td class="pl-1 align-middle bg-light width-250px">
-            <div class="mb-1">{{ toHumanReadable($label) }}</div>
+            <div class="mb-1">{{ toHumanReadable($detail['label']) }}</div>
         </td>
         <td class="font-weight-bold">
-            {{ @$contentData[$key] }}
+            @if(@$detail['checkbox'])
+                {{ @$contentData[$key] ? 'Yes': '---' }}
+            @else
+                {{ @$contentData[$key] }}
+            @endif
         </td>
     </tr>
     @endforeach