浏览代码

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

Samson Mutunga 4 年之前
父节点
当前提交
69a45f5994

+ 10 - 0
app/Http/Controllers/PatientController.php

@@ -290,6 +290,16 @@ class PatientController extends Controller
         return view('app.patient.settings', compact('patient'));
     }
 
+    public function smsReminders(Request $request, Client $patient )
+    {
+        return view('app.patient.sms-reminders', compact('patient'));
+    }
+
+    public function measurementConfirmationNumbers(Request $request, Client $patient )
+    {
+        return view('app.patient.measurement-confirmation-numbers', compact('patient'));
+    }
+
     public function pros(Request $request, Client $patient )
     {
         return view('app.patient.pros', compact('patient'));

+ 12 - 0
app/Models/Client.php

@@ -492,4 +492,16 @@ class Client extends Model
         return $this->hasOne(AccountClient::class, 'client_id', 'id')->where('is_removed', false);
     }
 
+    public function smsReminders()
+    {
+        return $this->hasMany(SimpleSMSReminder::class, 'client_id', 'id')
+            ->orderBy('created_at', 'asc');
+    }
+
+    public function measurementConfirmationNumbers()
+    {
+        return $this->hasMany(MeasurementConfirmationNumber::class, 'client_id', 'id')
+            ->orderBy('created_at', 'asc');
+    }
+
 }

+ 10 - 0
app/Models/MeasurementConfirmationNumber.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class MeasurementConfirmationNumber extends Model
+{
+    protected $table = 'measurement_confirmation_number';
+}

+ 4 - 2
app/Models/Pro.php

@@ -292,7 +292,8 @@ class Pro extends Model
                     ->orWhereRaw('id IN (SELECT client_id FROM client_pro_access WHERE is_active AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT client_id FROM appointment WHERE status NOT IN (\'CANCELLED\', \'ABANDONED\') AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT mcp_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)')
-                    ->orWhereRaw('id IN (SELECT manager_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)');
+                    ->orWhereRaw('id IN (SELECT manager_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)')
+                    ->orWhereRaw('id IN (SELECT client_id FROM note WHERE ally_pro_id = ? AND is_cancelled = FALSE)', [$proID]);;
             });
         }
         return $query;
@@ -314,7 +315,8 @@ class Pro extends Model
                     ->orWhereRaw('id IN (SELECT client_id FROM client_pro_access WHERE is_active AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT client_id FROM appointment WHERE status NOT IN (\'CANCELLED\', \'ABANDONED\') AND pro_id = ?)', [$proID])
                     ->orWhereRaw('id IN (SELECT mcp_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)')
-                    ->orWhereRaw('id IN (SELECT manager_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)');
+                    ->orWhereRaw('id IN (SELECT manager_pro_id FROM client_program WHERE client_id = client.id AND is_active = TRUE)')
+                    ->orWhereRaw('id IN (SELECT client_id FROM note WHERE ally_pro_id = ? AND is_cancelled = FALSE)', [$proID]);
             })->count();
         return !!$canAccess;
     }

+ 11 - 0
app/Models/SimpleSMSReminder.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class SimpleSMSReminder extends Model
+{
+    protected $table = 'simple_sms_reminder';
+
+}

+ 4 - 0
public/css/style.css

@@ -1652,4 +1652,8 @@ th.only-screen, td.only-screen {
 .pro-dashboard-inline-calendar>.ui-datepicker-inline {
     width: 100%;
     border: 0 !important;
+}
+#simpleSMSReminderComponent input[type="time"] {
+    max-width: 90px;
+    min-width: unset !important;
 }

+ 9 - 0
public/js/mc.js

@@ -169,6 +169,15 @@ function onFastLoaded(_data, _href, _history) {
                     $(window).scrollTop(0);
                 }
                 window.top.currentMcUrl = window.top.location.href;
+
+                let activeLeftNavLink = $('#sidebarMenu .nav-item>.nav-link.active').first();
+                if(activeLeftNavLink.length) {
+                    activeLeftNavLink[0].scrollIntoView({
+                        behavior: "smooth",
+                        block: "nearest",
+                        inline: "nearest"
+                    });
+                }
             }, 50);
         }
         else {

+ 106 - 0
resources/views/app/patient/measurement-confirmation-numbers.blade.php

@@ -0,0 +1,106 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+
+    <div id="simpleSMSReminderComponent">
+        <div class="pt-2 d-flex align-items-start">
+            <h6 class="my-0 text-secondary d-flex align-items-center w-100">
+                <span class="font-weight-bold text-secondary">Measurement Confirmation Numbers</span>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe>
+                    <a start show class="py-0 mb-3">Add</a>
+                    <form url="/api/measurementConfirmationNumber/create" class="mcp-theme-1">
+                        <input type="hidden" name="clientUid" value="{{$patient->uid}}">
+                        <div class="mb-3">
+                            <label class="text-sm text-secondary mb-1">SMS Number</label>
+                            <input type="text" name="smsNumber" class="form-control form-control-sm">
+                        </div>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">
+                                <input type="hidden" name="shouldIncludeClientName" value="0">
+                                <input type="checkbox" onchange="$(this).prev().val(this.checked ? 1 : 0)">
+                                Include Client Name
+                            </label>
+                        </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>
+            </h6>
+        </div>
+
+        <table class="table table-sm table-bordered mb-0 mt-2 notes-list">
+            <thead>
+            <tr class="bg-light">
+                <th class="px-2 text-secondary border-bottom-0">#</th>
+                <th class="px-2 text-secondary border-bottom-0">SMS Number</th>
+                <th class="px-2 text-secondary border-bottom-0">Include Client Name</th>
+                <th class="px-2 text-secondary border-bottom-0">Actions</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php $index = 0; ?>
+            @foreach ($patient->measurementConfirmationNumbers as $measurementConfirmationNumber)
+                <?php $index++; ?>
+                <tr class="{{$measurementConfirmationNumber->is_active ? '' : 'bg-light text-secondary'}}">
+                    <td class="px-2">{{$index}}</td>
+                    <td class="px-2">{{$measurementConfirmationNumber->sms_number}}</td>
+                    <td class="px-2">{{$measurementConfirmationNumber->should_include_client_name ? 'Yes' : 'No'}}</td>
+                    <td class="px-2">
+                        <div class="d-flex align-items-center">
+                            <div moe relative="">
+                                <a start show class="py-0 mb-3">Edit</a>
+                                <form url="/api/measurementConfirmationNumber/update" class="mcp-theme-1" right="">
+                                    <input type="hidden" name="uid" value="{{$measurementConfirmationNumber->uid}}">
+                                    <div class="mb-3">
+                                        <label class="text-sm text-secondary mb-1">SMS Number</label>
+                                        <input type="text" name="smsNumber" class="form-control form-control-sm" value="{{$measurementConfirmationNumber->sms_number}}">
+                                    </div>
+                                    <div class="mb-2">
+                                        <label class="text-sm text-secondary mb-1">
+                                            <input type="hidden" name="shouldIncludeClientName" value="{{$measurementConfirmationNumber->should_include_client_name ? '1' : '0'}}">
+                                            <input type="checkbox" {{$measurementConfirmationNumber->should_include_client_name ? 'checked' : ''}} onchange="$(this).prev().val(this.checked ? 1 : 0)">
+                                            Include Client Name
+                                        </label>
+                                    </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>
+                            @if($measurementConfirmationNumber->is_active)
+                                <div moe relative="" class="ml-2">
+                                    <a start show class="py-0 mb-3">Deactivate</a>
+                                    <form url="/api/measurementConfirmationNumber/deactivate" class="mcp-theme-1" right="">
+                                        <input type="hidden" name="uid" value="{{$measurementConfirmationNumber->uid}}">
+                                        <p>Deactivate this measurement confirmation number?</p>
+                                        <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>
+                            @else
+                                <div moe relative="" class="ml-2">
+                                    <a start show class="py-0 mb-3">Reactivate</a>
+                                    <form url="/api/measurementConfirmationNumber/reactivate" class="mcp-theme-1" right="">
+                                        <input type="hidden" name="uid" value="{{$measurementConfirmationNumber->uid}}">
+                                        <p>Reactivate this measurement confirmation number?</p>
+                                        <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>
+                            @endif
+                        </div>
+                    </td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+@endsection

+ 1 - 1
resources/views/app/patient/note/_create-claim.blade.php

@@ -189,7 +189,7 @@
                     return false;
                 }
 
-                $.post('/api/claim/create', {
+                $.post('/api/claim/createForNote', {
                     noteUid: '{{$note->uid}}',
                     data: JSON.stringify(this.payload)
                 }, function(_data) {

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

@@ -161,23 +161,25 @@
             </div>
 
 
-            @if($performer->pro->pro_type == 'ADMIN')
+            @if($performer->pro->pro_type == 'ADMIN' || ($note->allyPro && $note->allyPro->uid === $performer->pro->uid))
                 <span class="px-2 border-right d-flex">
                     @if($note->allyPro)
                         <span class="mr-2"><span class="text-secondary">NA:</span>  {{$note->allyPro->name_first}} {{$note->allyPro->name_last}}</span>
-                        <span class="d-inline-block" moe>
-                            <a class="text-danger" href="" show start>
-                                <i class="fa fa-times"></i>
-                            </a>
-                            <form url="/api/note/removeNa">
-                                <input type="hidden" name="uid" value="{{$note->uid}}">
-                                <p>Remove NA?</p>
-                                <div class="mb-0">
-                                    <button class="btn btn-success btn-sm" submit>Submit</button>
-                                    <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                </div>
-                            </form>
-                        </span>
+                        @if($performer->pro->pro_type == 'ADMIN')
+                            <span class="d-inline-block" moe>
+                                <a class="text-danger" href="" show start>
+                                    <i class="fa fa-times"></i>
+                                </a>
+                                <form url="/api/note/removeNa">
+                                    <input type="hidden" name="uid" value="{{$note->uid}}">
+                                    <p>Remove NA?</p>
+                                    <div class="mb-0">
+                                        <button class="btn btn-success btn-sm" submit>Submit</button>
+                                        <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                                    </div>
+                                </form>
+                            </span>
+                        @endif
                     @else
                         <span class="mr-2"><span class="text-secondary">NA:</span> - </span>
                         <span class="d-block" moe>

+ 248 - 0
resources/views/app/patient/sms-reminders.blade.php

@@ -0,0 +1,248 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+
+    <div id="simpleSMSReminderComponent">
+        <div class="pt-2 d-flex align-items-start">
+            <h6 class="my-0 text-secondary d-flex align-items-center w-100">
+                <span class="font-weight-bold text-secondary">SMS Reminders</span>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe>
+                    <a start show class="py-0 mb-3">Add</a>
+                    <form url="/api/simpleSmsReminder/create" class="mcp-theme-1">
+                        <input type="hidden" name="clientUid" value="{{$patient->uid}}">
+                        <div class="row mb-2">
+                            <div class="col-5 pr-0">
+                                <label class="text-sm text-secondary mb-1">To Number</label>
+                                <input type="text" name="smsNumber" class="form-control form-control-sm">
+                            </div>
+                        </div>
+                        <div class="row mb-2">
+                            <div class="col-12">
+                                <label class="text-sm text-secondary mb-1">Message</label>
+                                <textarea name="message" class="form-control form-control-sm"></textarea>
+                            </div>
+                        </div>
+                        <div class="row mb-2">
+                            <div class="col-12">
+                                <label class="text-sm text-secondary mb-1">Schedule</label>
+                                <table class="table table-sm table-bordered mb-0">
+                                    <thead>
+                                    <tr class="bg-light">
+                                        <th class="border-bottom-0 text-center">Sun</th>
+                                        <th class="border-bottom-0 text-center">Mon</th>
+                                        <th class="border-bottom-0 text-center">Tue</th>
+                                        <th class="border-bottom-0 text-center">Wed</th>
+                                        <th class="border-bottom-0 text-center">Thu</th>
+                                        <th class="border-bottom-0 text-center">Fri</th>
+                                        <th class="border-bottom-0 text-center">Sat</th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+                                    <tr>
+                                        <td class="text-center"><input type="checkbox" data-day="sun"></td>
+                                        <td class="text-center"><input type="checkbox" data-day="mon"></td>
+                                        <td class="text-center"><input type="checkbox" data-day="tue"></td>
+                                        <td class="text-center"><input type="checkbox" data-day="wed"></td>
+                                        <td class="text-center"><input type="checkbox" data-day="thu"></td>
+                                        <td class="text-center"><input type="checkbox" data-day="fri"></td>
+                                        <td class="text-center"><input type="checkbox" data-day="sat"></td>
+                                    </tr>
+                                    <tr>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="sun" name="timeOfDaySunday" readonly></td>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="mon" name="timeOfDayMonday" readonly></td>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="tue" name="timeOfDayTuesday" readonly></td>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="wed" name="timeOfDayWednesday" readonly></td>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="thu" name="timeOfDayThursday" readonly></td>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="fri" name="timeOfDayFriday" readonly></td>
+                                        <td><input type="time" class="form-control form-control-sm" data-day="sat" name="timeOfDaySaturday" readonly></td>
+                                    </tr>
+                                    </tbody>
+                                </table>
+                            </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>
+            </h6>
+        </div>
+
+        <table class="table table-sm table-bordered mb-0 mt-2 notes-list">
+            <thead>
+            <tr class="bg-light">
+                <th class="px-2 text-secondary border-bottom-0">#</th>
+                <th class="px-2 text-secondary border-bottom-0">To Number</th>
+                <th class="px-2 text-secondary border-bottom-0">Message</th>
+                <th class="px-2 text-secondary border-bottom-0">Schedule</th>
+                <th class="px-2 text-secondary border-bottom-0">Actions</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php $index = 0; ?>
+            @foreach ($patient->smsReminders as $smsReminder)
+                <?php $index++; ?>
+                <tr class="{{$smsReminder->is_active ? '' : 'bg-light text-secondary'}}">
+                    <td class="px-2">{{$index}}</td>
+                    <td class="px-2">{{$smsReminder->sms_number}}</td>
+                    <td class="px-2">{{$smsReminder->message}}</td>
+                    <td class="px-2">
+                        @if($smsReminder->time_of_day_sunday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Sun:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_sunday)}}</b>
+                            </div>
+                        @endif
+                        @if($smsReminder->time_of_day_monday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Mon:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_monday)}}</b>
+                            </div>
+                        @endif
+                        @if($smsReminder->time_of_day_tuesday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Tue:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_tuesday)}}</b>
+                            </div>
+                        @endif
+                        @if($smsReminder->time_of_day_wednesday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Wed:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_wednesday)}}</b>
+                            </div>
+                        @endif
+                        @if($smsReminder->time_of_day_thursday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Thu:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_thursday)}}</b>
+                            </div>
+                        @endif
+                        @if($smsReminder->time_of_day_friday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Fri:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_friday)}}</b>
+                            </div>
+                        @endif
+                        @if($smsReminder->time_of_day_saturday)
+                            <div>
+                                <span class="text-secondary width-40px d-inline-block">Sat:</span>
+                                <b>{{friendly_time($smsReminder->time_of_day_saturday)}}</b>
+                            </div>
+                        @endif
+                    </td>
+                    <td class="px-2">
+                        <div class="d-flex align-items-center">
+                            <div moe relative="">
+                                <a start show class="py-0 mb-3">Edit</a>
+                                <form url="/api/simpleSmsReminder/update" class="mcp-theme-1" right="">
+                                    <input type="hidden" name="uid" value="{{$smsReminder->uid}}">
+                                    <div class="row mb-2">
+                                        <div class="col-5 pr-0">
+                                            <label class="text-sm text-secondary mb-1">To Number</label>
+                                            <input type="text" name="smsNumber" class="form-control form-control-sm" value="{{$smsReminder->sms_number}}">
+                                        </div>
+                                    </div>
+                                    <div class="row mb-2">
+                                        <div class="col-12">
+                                            <label class="text-sm text-secondary mb-1">Message</label>
+                                            <textarea name="message" class="form-control form-control-sm">{{$smsReminder->message}}</textarea>
+                                        </div>
+                                    </div>
+                                    <div class="row mb-2">
+                                        <div class="col-12">
+                                            <label class="text-sm text-secondary mb-1">Schedule</label>
+                                            <table class="table table-sm table-bordered mb-0">
+                                                <thead>
+                                                <tr class="bg-light">
+                                                    <th class="border-bottom-0 text-center">Sun</th>
+                                                    <th class="border-bottom-0 text-center">Mon</th>
+                                                    <th class="border-bottom-0 text-center">Tue</th>
+                                                    <th class="border-bottom-0 text-center">Wed</th>
+                                                    <th class="border-bottom-0 text-center">Thu</th>
+                                                    <th class="border-bottom-0 text-center">Fri</th>
+                                                    <th class="border-bottom-0 text-center">Sat</th>
+                                                </tr>
+                                                </thead>
+                                                <tbody>
+                                                <tr>
+                                                    <td class="text-center"><input type="checkbox" data-day="sun" {{$smsReminder->time_of_day_sunday ? 'checked' : ''}}></td>
+                                                    <td class="text-center"><input type="checkbox" data-day="mon" {{$smsReminder->time_of_day_monday ? 'checked' : ''}}></td>
+                                                    <td class="text-center"><input type="checkbox" data-day="tue" {{$smsReminder->time_of_day_tuesday ? 'checked' : ''}}></td>
+                                                    <td class="text-center"><input type="checkbox" data-day="wed" {{$smsReminder->time_of_day_wednesday ? 'checked' : ''}}></td>
+                                                    <td class="text-center"><input type="checkbox" data-day="thu" {{$smsReminder->time_of_day_thursday ? 'checked' : ''}}></td>
+                                                    <td class="text-center"><input type="checkbox" data-day="fri" {{$smsReminder->time_of_day_friday ? 'checked' : ''}}></td>
+                                                    <td class="text-center"><input type="checkbox" data-day="sat" {{$smsReminder->time_of_day_saturday ? 'checked' : ''}}></td>
+                                                </tr>
+                                                <tr>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="sun" name="timeOfDaySunday" {{$smsReminder->time_of_day_sunday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_sunday ? substr($smsReminder->time_of_day_sunday, 0, 5) : ''}}"></td>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="mon" name="timeOfDayMonday" {{$smsReminder->time_of_day_monday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_monday ? substr($smsReminder->time_of_day_monday, 0, 5) : ''}}"></td>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="tue" name="timeOfDayTuesday" {{$smsReminder->time_of_day_tuesday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_tuesday ? substr($smsReminder->time_of_day_tuesday, 0, 5) : ''}}"></td>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="wed" name="timeOfDayWednesday" {{$smsReminder->time_of_day_wednesday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_wednesday ? substr($smsReminder->time_of_day_wednesday, 0, 5) : ''}}"></td>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="thu" name="timeOfDayThursday" {{$smsReminder->time_of_day_thursday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_thursday ? substr($smsReminder->time_of_day_thursday, 0, 5) : ''}}"></td>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="fri" name="timeOfDayFriday" {{$smsReminder->time_of_day_friday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_friday ? substr($smsReminder->time_of_day_friday, 0, 5) : ''}}"></td>
+                                                    <td><input type="time" class="form-control form-control-sm" data-day="sat" name="timeOfDaySaturday" {{$smsReminder->time_of_day_saturday ? '' : 'readonly'}} value="{{$smsReminder->time_of_day_saturday ? substr($smsReminder->time_of_day_saturday, 0, 5) : ''}}"></td>
+                                                </tr>
+                                                </tbody>
+                                            </table>
+                                        </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>
+                            @if($smsReminder->is_active)
+                                <div moe relative="" class="ml-2">
+                                    <a start show class="py-0 mb-3">Deactivate</a>
+                                    <form url="/api/simpleSmsReminder/deactivate" class="mcp-theme-1" right="">
+                                        <input type="hidden" name="uid" value="{{$smsReminder->uid}}">
+                                        <p>Deactivate this SMS reminder?</p>
+                                        <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>
+                            @else
+                                <div moe relative="" class="ml-2">
+                                    <a start show class="py-0 mb-3">Reactivate</a>
+                                    <form url="/api/simpleSmsReminder/reactivate" class="mcp-theme-1" right="">
+                                        <input type="hidden" name="uid" value="{{$smsReminder->uid}}">
+                                        <p>Reactivate this SMS reminder?</p>
+                                        <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>
+                            @endif
+                        </div>
+                    </td>
+                </tr>
+            @endforeach
+            </tbody>
+        </table>
+    </div>
+
+    <script>
+        (function () {
+            function init() {
+                $('input[type="checkbox"][data-day]').change(function() {
+                    let input = $(this).closest('form')
+                        .find('input[type="time"][data-day="' + $(this).attr('data-day') + '"]');
+                    input.prop('readonly', !this.checked);
+                    if(this.checked) {
+                        input.focus();
+                    }
+                    else {
+                        input.val('');
+                    }
+                });
+            }
+            addMCInitializer('simpleSMSReminderComponent', init, '#simpleSMSReminderComponent');
+        }).call(window);
+    </script>
+@endsection

+ 8 - 0
resources/views/app/patients.blade.php

@@ -55,6 +55,7 @@
                     <th class="border-0">PCP</th>
                     {{--<th class="border-0">RMM</th>--}}
                     <th class="border-0">Appointments</th>
+                    <th class="border-0">Account</th>
                 </tr>
                 </thead>
                 <tbody>
@@ -180,6 +181,13 @@
                                 </tbody>
                             </table>
                         </td>
+                        <td>
+                            @if($patient->accountClient)
+                                <span class="font-weight-bold text-info"><i class="fa fa-check"></i></span>
+                            @else
+                                <span class="text-secondary">-</span>
+                            @endif
+                        </td>
                     </tr>
                 @endforeach
                 </tbody>

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

@@ -157,6 +157,14 @@
                             <a class="nav-link {{ strpos($routeName, 'patients.view.settings') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.settings', ['patient' => $patient]) }}">Settings</a>
                         </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.sms-reminders') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.sms-reminders', ['patient' => $patient]) }}">SMS Reminders</a>
+                        </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.measurement-confirmation-numbers') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.measurement-confirmation-numbers', ['patient' => $patient]) }}">Meas. Conf. Numbers</a>
+                        </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.pros') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.pros', ['patient' => $patient]) }}">Pros</a>

+ 2 - 0
routes/web.php

@@ -182,6 +182,8 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('sections', 'PatientController@sections')->name('sections');
             Route::get('handouts', 'PatientController@handouts')->name('handouts');
             Route::get('settings', 'PatientController@settings')->name('settings');
+            Route::get('sms-reminders', 'PatientController@smsReminders')->name('sms-reminders');
+            Route::get('measurement-confirmation-numbers', 'PatientController@measurementConfirmationNumbers')->name('measurement-confirmation-numbers');
             Route::get('pros', 'PatientController@pros')->name('pros');
             Route::get('account', 'PatientController@account')->name('account');
             Route::get('care-checklist', 'PatientController@careChecklist')->name('care-checklist');

+ 12 - 12
spec/todo-march-29-2021.txt

@@ -1,28 +1,28 @@
 
 	@Josh...
-		1) rm_reasons | [{'icd': ..., 'description': ...}...]
-		2) /api/client/updateRmReasons
+		1)DONE: rm_reasons | [{'icd': ..., 'description': ...}...]
+		2)DONE: /api/client/updateRmReasons
 		3) DEV ENDPOINT::
 			-- make sure each has ICDs on it. @Josh/Sal [dev endpoint... I10, E77.9, etc...
-		4) ALTER TABLE care_month ADD COLUMN rm_reasons TEXT (same as client)
-		5) /api/careMonth/updateRmReasons
-		6) ALTER TABLE care_month ADD COLUMN number_of_days_with_remote_measurements INTEGER;
-		7) maintain this field each time there is a measurement.
-		8) dev endpoint to backfill data.
+		4)DONE: ALTER TABLE care_month ADD COLUMN rm_reasons TEXT (same as client)
+		5)DONE: /api/careMonth/updateRmReasons
+		6)DONE: ALTER TABLE care_month ADD COLUMN number_of_days_with_remote_measurements INTEGER;
+		7)DONE: maintain this field each time there is a measurement.
+		8)DONE:** dev endpoint to backfill data.
 
-		9) ALTER TABLE care_month ADD COLUMN // all the stuff like on note... is_bill_closed, is_bill_marked_done, is_claims, etc. MAINTAIN SYMETTRY
+		9)DONE ALTER TABLE care_month ADD COLUMN // all the stuff like on note... is_bill_closed, is_bill_marked_done, is_claims, etc. MAINTAIN SYMETTRY
 
 		10) dev endpoint to auto-bill all months with 16+ measurements in them for RM20.
 
 	@Josh
 	- patient accounts... enable for existing patients!!!
-		background: we already have so many pts. they don't have accounts... 
+		background: we already have so many pts. they don't have accounts...
 			>>> have a straightforward way for HCP to push and link a chart to an email
 				->>> motivates them to sign up and complete an account that gets auto-linked.
 
 	@Josh
 	- text message replies, where do they go?
-		// TODO when you send an SMS to pt, add as an sms_number
+		//DONE:: TODO when you send an SMS to pt, add as an sms_number
 		// !!! enable to [+ Add SMS Number] directly on client
 	- TODO... make it so taht MCP has to mark reply texts as read...
 
@@ -32,7 +32,7 @@
 		-- when to send messages?
 		-- make sure 3 different numbers! (reminder, BP, weight)
 			-- 3 twilio numbers...
-			
+
 			scheduled_sms_reminder
 				client_id
 				sms_number
@@ -69,4 +69,4 @@
 	- presentation to hcp -> LMS
 	- presentation to non-hcp -> LMS
 
------------------------------------------------------------------------------
+-----------------------------------------------------------------------------