Samson Mutunga 2 rokov pred
rodič
commit
00c32f4b42

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

@@ -330,13 +330,24 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
                         $.each(fields, function(i, field) {
                             var value = parseInt($(field).val());
                             value = isNaN(value) ? 0 : value;
-							console.log({value});
                             score = score + value;
                         });
                         self.data.Score = score;
+						$('#scoreValue').text(self.data.Score);
 						self.$forceUpdate();
                         self.autoSaveForm();
                     },
+					clearScore: function(){
+						var self = this;
+                        var fields = self.form.find('[score-input]');
+                        $.each(fields, function(i, field) {
+                            $(field).val(0)
+                        });
+                        self.data.Score = 0;
+						$('#scoreValue').text(self.data.Score);
+						self.$forceUpdate();
+                        self.autoSaveForm();
+					},
                     initOnSelectChange: function() {
                         var self = this;
                         self.form.find('select').on('change', function() {
@@ -351,7 +362,6 @@ if ($point->lastChildReview && $point->lastChildReview->data) {
 					}
 					this.initSelect2();
 					this.initOnSelectChange();
-					console.log('1: DATA: ', this.data);
 				}
 			});
 

+ 3 - 3
resources/views/app/patient/modules/sleep_study_intake/partials/epworth_sleepiness_study.blade.php

@@ -78,9 +78,9 @@
                     <input type="hidden" data-name="Score" name="Score" v-model="data.Score">
                     <span id="scoreValue">@{{ data.Score }}</span>
                 </div>
-                <div class="d-none">
-                    <span class="mr-1 text-primary c-pointer">Calculate</span>
-                    <span class="text-danger c-pointer">Clear</span>
+                <div class="">
+                    <span class="mr-1 text-primary c-pointer" @click="calculateScore">Calculate</span>
+                    <span class="text-danger c-pointer" @click="clearScore">Clear</span>
                 </div>
             </div>
         </div>

+ 107 - 107
resources/views/app/patient/modules/sleep_study_intake/partials/obstructive_sleep_apnea.blade.php

@@ -7,11 +7,11 @@ $questionnaire = [
                 'title' => 'Do you snore?',
                 'options' => [
                     [
-                        'value' => 'SnoreYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'SnoreNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ]
                 ]
@@ -20,15 +20,15 @@ $questionnaire = [
                 'title' => 'Your Snoring is...?',
                 'options' => [
                     [
-                        'value' => 'SofterSnoring',
+                        'value' => 'Softer than talking',
                         'label' => 'Softer than talking'
                     ],
                     [
-                        'value' => 'MidSnoring',
+                        'value' => 'As loud as talking',
                         'label' => 'As loud as talking'
                     ],
                     [
-                        'value' => 'LouderSnoring',
+                        'value' => 'Louder than talking',
                         'label' => 'Louder than talking'
                     ]
                 ]
@@ -37,15 +37,15 @@ $questionnaire = [
                 'title' => 'Your snoring occurs:',
                 'options' => [
                     [
-                        'value' => 'SnoringEveryNight',
+                        'value' => 'Every night',
                         'label' => 'Every night'
                     ],
                     [
-                        'value' => 'AFewTimesSnoring',
+                        'value' => 'A few times a week',
                         'label' => 'A few times a week'
                     ],
                     [
-                        'value' => 'OnceAWeekSnoring',
+                        'value' => 'Once a week or less',
                         'label' => 'Once a week or less'
                     ]
                 ]
@@ -54,15 +54,15 @@ $questionnaire = [
                 'title' => 'Do you snore in every body poisition?',
                 'options' => [
                     [
-                        'value' => 'yessnoreposition',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'NoSnorePosition',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                     [
-                        'value' => 'DontKnowSnorePosition',
+                        'value' => "I don't know",
                         'label' => "I don't know"
                     ]
                 ]
@@ -71,15 +71,15 @@ $questionnaire = [
                 'title' => 'Your snoring is also interrupted by pauses/choking?:',
                 'options' => [
                     [
-                        'value' => 'FrequentSnoring',
+                        'value' => 'Frequent',
                         'label' => 'Frequent'
                     ],
                     [
-                        'value' => 'OccasionalSnoring',
+                        'value' => 'Occasionally',
                         'label' => 'Occasionally'
                     ],
                     [
-                        'value' => 'NeverSnoring',
+                        'value' => 'Never',
                         'label' => "Never"
                     ]
                 ]
@@ -88,11 +88,11 @@ $questionnaire = [
                 'title' => 'Do you have, or ever had a bed partner?',
                 'options' => [
                     [
-                        'value' => 'PartnerYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'PartnerNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ]
                 ]
@@ -101,11 +101,11 @@ $questionnaire = [
                 'title' => 'Has your bed partner ever said that you have pauses in your breathing or stop breathing during sleep?:',
                 'options' => [
                     [
-                        'value' => 'PartnerSaysYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'PartnerSaysNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ]
                 ]
@@ -114,19 +114,19 @@ $questionnaire = [
                 'title' => 'Do you feel that in some way your sleep is not refreshing or restful?',
                 'options' => [
                     [
-                        'value' => 'UnrestfulEveryday',
+                        'value' => 'Nearly every day',
                         'label' => 'Nearly every day'
                     ],
                     [
-                        'value' => 'OnceAWeekUnrestful',
+                        'value' => 'Once or twice a week',
                         'label' => 'Once or twice a week'
                     ],
                     [
-                        'value' => '3to4Unrestful',
+                        'value' => '3 to 4 times a week',
                         'label' => '3 to 4 times a week'
                     ],
                     [
-                        'value' => 'HardlyUnrestful',
+                        'value' => 'Hardly ever',
                         'label' => 'Hardly ever'
                     ],
 
@@ -136,19 +136,19 @@ $questionnaire = [
                 'title' => 'Do you feel fatigued, exhausted, tired, or not up to par?',
                 'options' => [
                     [
-                        'value' => 'ExhaustedEveryDay',
+                        'value' => 'Nearly every day',
                         'label' => 'Nearly every day'
                     ],
                     [
-                        'value' => 'ExhaustedOnceAWeek',
+                        'value' => 'Once or twice a week',
                         'label' => 'Once or twice a week'
                     ],
                     [
-                        'value' => '3To4TimesExhausted',
+                        'value' => '3 to 4 times a week',
                         'label' => '3 to 4 times a week'
                     ],
                     [
-                        'value' => 'HardlyEverExhausted',
+                        'value' => 'Hardly ever',
                         'label' => 'Hardly ever'
                     ],
 
@@ -158,11 +158,11 @@ $questionnaire = [
                 'title' => 'Do you frequently wake up with morning headaches?',
                 'options' => [
                     [
-                        'value' => 'HeadacheYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'HeadachesNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
 
@@ -172,19 +172,19 @@ $questionnaire = [
                 'title' => 'How would you rate your memory?',
                 'options' => [
                     [
-                        'value' => 'ExMemory',
+                        'value' => 'Excellent',
                         'label' => 'Excellent'
                     ],
                     [
-                        'value' => 'PoorMemory',
+                        'value' => 'Fair',
                         'label' => 'Fair'
                     ],
                     [
-                        'value' => 'GoodMemory',
+                        'value' => 'Good',
                         'label' => 'Good'
                     ],
                     [
-                        'value' => 'HeadacheNo',
+                        'value' => 'Poor',
                         'label' => 'Poor'
                     ],
 
@@ -194,23 +194,23 @@ $questionnaire = [
                 'title' => 'How would you rate your sex life?',
                 'options' => [
                     [
-                        'value' => 'ExSexLife',
+                        'value' => 'Excellent',
                         'label' => 'Excellent'
                     ],
                     [
-                        'value' => 'FairSexLife',
+                        'value' => 'Fair',
                         'label' => 'Fair'
                     ],
                     [
-                        'value' => 'GoodSexLife',
+                        'value' => 'Good',
                         'label' => 'Good'
                     ],
                     [
-                        'value' => 'PoorSexLife',
+                        'value' => 'Poor',
                         'label' => 'Poor'
                     ],
                     [
-                        'value' => 'NASexLife',
+                        'value' => 'NA',
                         'label' => 'NA'
                     ],
 
@@ -225,11 +225,11 @@ $questionnaire = [
                 'title' => 'Do you experience creeping/crawling feeling and urge to move your legs?',
                 'options' => [
                     [
-                        'value' => 'MoveLegsYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'MoveLegsNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
 
@@ -239,15 +239,15 @@ $questionnaire = [
                 'title' => 'Do these sensations and urge to move your legs occur during periods of rest or inactivity, and are relieved by movement?',
                 'options' => [
                     [
-                        'value' => 'legsmoveyes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'legsmoveNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                     [
-                        'value' => 'legsmoveNA',
+                        'value' => 'NA',
                         'label' => 'NA'
                     ],
 
@@ -257,15 +257,15 @@ $questionnaire = [
                 'title' => 'Do the sensations and urge to move bother you more in the evening and at night, rather than during the day?',
                 'options' => [
                     [
-                        'value' => 'sensationyes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'sensationno',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                     [
-                        'value' => 'sensationna',
+                        'value' => 'NA',
                         'label' => 'NA'
                     ],
 
@@ -275,15 +275,15 @@ $questionnaire = [
                 'title' => 'Does your bed partner tell you that you jerk your legs/arms when you are asleep?',
                 'options' => [
                     [
-                        'value' => 'jerklegsYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'jerklegsno',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                     [
-                        'value' => 'kerklegsNA',
+                        'value' => 'NA',
                         'label' => 'NA'
                     ],
 
@@ -298,11 +298,11 @@ $questionnaire = [
                 'title' => 'Have you ever experience sudden body weakness brought on by laughter, surprise, or fear?',
                 'options' => [
                     [
-                        'value' => 'BodyMovementYes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'BodyMovementNo',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                 ]
@@ -311,11 +311,11 @@ $questionnaire = [
                 'title' => 'Have you ever experienced seeing or hearing things that was not real when you were falling asleep or had just awakened?',
                 'options' => [
                     [
-                        'value' => 'hearingthingsyes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'hearingthingsno',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                 ]
@@ -324,11 +324,11 @@ $questionnaire = [
                 'title' => 'Have you ever felt as if you were awake but could not move (sleep paralysis)?',
                 'options' => [
                     [
-                        'value' => 'sleepparalysisyes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'sleepparalysisno',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                 ]
@@ -342,19 +342,19 @@ $questionnaire = [
                 'title' => 'Do you have trouble initiating and/or maintaining sleep?',
                 'options' => [
                     [
-                        'value' => 'NearlyEveryDayTrouble',
+                        'value' => 'Nearly every day',
                         'label' => 'Nearly every day'
                     ],
                     [
-                        'value' => 'OnceorTwice',
+                        'value' => 'Once or twice a week',
                         'label' => 'Once or twice a week'
                     ],
                     [
-                        'value' => '3to4TimesWeeksTrouble',
+                        'value' => '3 to 4 times a week',
                         'label' => '3 to 4 times a week'
                     ],
                     [
-                        'value' => 'HardEverTrouble',
+                        'value' => 'Hardly ever',
                         'label' => 'Hardly ever'
                     ],
                 ]
@@ -363,23 +363,23 @@ $questionnaire = [
                 'title' => 'How long does it take to fall asleep at night?',
                 'options' => [
                     [
-                        'value' => 'sleepinstantly',
+                        'value' => 'Fall asleep right away',
                         'label' => 'Fall asleep right away'
                     ],
                     [
-                        'value' => 'SleepInHalfHour',
+                        'value' => 'Half an hour',
                         'label' => 'Half an hour'
                     ],
                     [
-                        'value' => 'SleepIn1Hour',
+                        'value' => '1 hour',
                         'label' => '1 hour'
                     ],
                     [
-                        'value' => 'SleepIn2Hours',
+                        'value' => '2 hours',
                         'label' => '2 hours'
                     ],
                     [
-                        'value' => 'SleepIn3hours',
+                        'value' => '3 or more hours',
                         'label' => '3 or more hours'
                     ],
                 ]
@@ -398,19 +398,19 @@ $questionnaire = [
                 'title' => 'How long does it take to fall back asleep when you wake up in the middle of the night?',
                 'options' => [
                     [
-                        'value' => 'rightawaybacktosleep',
+                        'value' => 'Right away',
                         'label' => 'Right away'
                     ],
                     [
-                        'value' => 'halfanhours',
+                        'value' => 'Half an hour',
                         'label' => 'Half an hour'
                     ],
                     [
-                        'value' => 'halfhourbacaktosleep',
+                        'value' => '1 hour',
                         'label' => '1 hour'
                     ],
                     [
-                        'value' => '2hoursbacktosleep',
+                        'value' => '2 or more hours',
                         'label' => '2 or more hours'
                     ],
                 ]
@@ -419,11 +419,11 @@ $questionnaire = [
                 'title' => 'Do you wake up very early in the morning and find it hard to get back to sleep?',
                 'options' => [
                     [
-                        'value' => 'wakeupearlyyes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'wakeupearlyno',
+                        'value' => 'No',
                         'label' => 'No'
                     ],
                 ]
@@ -437,11 +437,11 @@ $questionnaire = [
                         'title' => 'Feeling down, depressed, or hopeless?',
                         'options' => [
                             [
-                                'value' => 'wakeupearlyy',
+                                'value' => 'Yes',
                                 'label' => 'Yes'
                             ],
                             [
-                                'value' => 'wakeupearlyn',
+                                'value' => 'No',
                                 'label' => 'No'
                             ],
                         ]
@@ -452,11 +452,11 @@ $questionnaire = [
                         'title' => 'By "nerves" or feeling anxious or on edge?',
                         'options' => [
                             [
-                                'value' => 'wakeupearlyyess',
+                                'value' => 'Yes',
                                 'label' => 'Yes'
                             ],
                             [
-                                'value' => 'wakeupearlynon',
+                                'value' => 'No',
                                 'label' => 'No'
                             ],
                         ]
@@ -467,11 +467,11 @@ $questionnaire = [
                         'title' => 'Had an anxiety attack (Suddenly feeling fear or panic)?',
                         'options' => [
                             [
-                                'value' => 'wakeupearlyyesss',
+                                'value' => 'Yes',
                                 'label' => 'Yes'
                             ],
                             [
-                                'value' => 'wakeupearlynonono',
+                                'value' => 'No',
                                 'label' => 'No'
                             ],
                         ]
@@ -487,19 +487,19 @@ $questionnaire = [
                 'title' => 'On the weekdays, what time do you go to bed?',
                 'options' => [
                     [
-                        'value' => 'badtime8to10',
+                        'value' => '8 to 10 pm',
                         'label' => '8 to 10 pm'
                     ],
                     [
-                        'value' => '10pmbedtime',
+                        'value' => '10 pm to midnight',
                         'label' => '10 pm to midnight'
                     ],
                     [
-                        'value' => 'midnightbedtime',
+                        'value' => 'Midnight to 2 am',
                         'label' => 'Midnight to 2 am'
                     ],
                     [
-                        'value' => '2to4bedtime',
+                        'value' => '2 to 4 am',
                         'label' => '2 to 4 am'
                     ],
 
@@ -509,19 +509,19 @@ $questionnaire = [
                 'title' => 'On the weekdays, what time do you get up in the morning?',
                 'options' => [
                     [
-                        'value' => 'weekday5to7',
+                        'value' => '5 to 7 a.m.',
                         'label' => '5 to 7 a.m.'
                     ],
                     [
-                        'value' => 'weekdays7to9am',
+                        'value' => '7 to 9 a.m.',
                         'label' => '7 to 9 a.m.'
                     ],
                     [
-                        'value' => 'weekdays9to11',
+                        'value' => '9 to 11 a.m.',
                         'label' => '9 to 11 a.m.'
                     ],
                     [
-                        'value' => 'weekdays11to1pm',
+                        'value' => '11 a.m to 1 p.m',
                         'label' => '11 a.m to 1 p.m'
                     ],
 
@@ -531,19 +531,19 @@ $questionnaire = [
                 'title' => 'On the weekends, what time do you go to bed?',
                 'options' => [
                     [
-                        'value' => '8to10pmweekendssleep',
+                        'value' => '8 to 10 p.m.',
                         'label' => '8 to 10 p.m.'
                     ],
                     [
-                        'value' => '10weekendssleep',
+                        'value' => '10 p.m. to Midnight',
                         'label' => '10 p.m. to Midnight'
                     ],
                     [
-                        'value' => 'midnightto2amsleep',
+                        'value' => 'midnight to 2 a.m.',
                         'label' => 'midnight to 2 a.m.'
                     ],
                     [
-                        'value' => '2to4amweekendsleep',
+                        'value' => '2 to 4 a.m.',
                         'label' => '2 to 4 a.m.'
                     ],
 
@@ -553,19 +553,19 @@ $questionnaire = [
                 'title' => 'On the weekends, what time do you get up in the morning?',
                 'options' => [
                     [
-                        'value' => '8to10pmweekendswakeup',
+                        'value' => '5 to 7 p.m.',
                         'label' => '5 to 7 p.m.'
                     ],
                     [
-                        'value' => '10weekendswakeup',
+                        'value' => '7 to 9 a.m.',
                         'label' => '7 to 9 a.m.'
                     ],
                     [
-                        'value' => 'midnightto2amwakeup',
+                        'value' => '9 to 11 a.m.',
                         'label' => '9 to 11 a.m.'
                     ],
                     [
-                        'value' => '2to4amweekendwakeup',
+                        'value' => '11 a.m. to 1 p.m.',
                         'label' => '11 a.m. to 1 p.m.'
                     ],
 
@@ -575,31 +575,31 @@ $questionnaire = [
                 'title' => 'What do you feel is your ideal amount of sleep per day?',
                 'options' => [
                     [
-                        'value' => 'hourofsleep1',
+                        'value' => '2-4 hours',
                         'label' => '2-4 hours'
                     ],
                     [
-                        'value' => 'hourofsleep5',
+                        'value' => '5 hours',
                         'label' => '5 hours'
                     ],
                     [
-                        'value' => 'hourofsleep6',
+                        'value' => '6 hours',
                         'label' => '6 hours'
                     ],
                     [
-                        'value' => 'hourofsleep7',
+                        'value' => '7 hours',
                         'label' => '7 hours'
                     ],
                     [
-                        'value' => 'hourofsleep8',
+                        'value' => '8 hours',
                         'label' => '8 hours'
                     ],
                     [
-                        'value' => 'hourofsleep9',
+                        'value' => '9 hours',
                         'label' => '9 hours'
                     ],
                     [
-                        'value' => 'hourofsleep10',
+                        'value' => '10 hours',
                         'label' => '10 hours'
                     ],
 
@@ -609,31 +609,31 @@ $questionnaire = [
                 'title' => 'Estimate the average number of hours of sleep you had per day during the last week.',
                 'options' => [
                     [
-                        'value' => 'averagesleep1',
+                        'value' => '2-4 hours',
                         'label' => '2-4 hours'
                     ],
                     [
-                        'value' => 'averagesleep5',
+                        'value' => '5 hours',
                         'label' => '5 hours'
                     ],
                     [
-                        'value' => 'averagesleep6',
+                        'value' => '6 hours',
                         'label' => '6 hours'
                     ],
                     [
-                        'value' => 'averagesleep7',
+                        'value' => '7 hours',
                         'label' => '7 hours'
                     ],
                     [
-                        'value' => 'averagesleep8',
+                        'value' => '8 hours',
                         'label' => '8 hours'
                     ],
                     [
-                        'value' => 'averagesleep9',
+                        'value' => '9 hours',
                         'label' => '9 hours'
                     ],
                     [
-                        'value' => 'averagesleep10',
+                        'value' => '10 hours',
                         'label' => '10 hours'
                     ],
 
@@ -643,11 +643,11 @@ $questionnaire = [
                 'title' => 'Estimate the average number of hours of sleep you had per day during the last week.Are you a shift worker?',
                 'options' => [
                     [
-                        'value' => 'shiftworkeryes',
+                        'value' => 'Yes',
                         'label' => 'Yes'
                     ],
                     [
-                        'value' => 'shiftworkerno',
+                        'value' => 'No',
                         'label' => 'No'
                     ],