浏览代码

RPM/CCM setup agreement popups

Vijayakrishnan 3 年之前
父节点
当前提交
0acb2e1099

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

@@ -33,6 +33,10 @@ use Illuminate\Support\Facades\Http;
 class HomeController extends Controller
 {
 
+    public function nop() {
+        return json_encode(["success" => true]);
+    }
+
     public function confirmSmsAuthToken(Request $request)
     {
         return view('app/confirm_sms_auth_token');

+ 8 - 0
app/Http/Controllers/NoteController.php

@@ -398,6 +398,14 @@ class NoteController extends Controller
         return view('app.patient.supplements-reconcile', compact('patient', 'note'));
     }
 
+    public function ccmAgreement(Request $request, Note $note) {
+        return view('app.patient.note.ccm-agreement', compact('note'));
+    }
+
+    public function rpmAgreement(Request $request, Note $note) {
+        return view('app.patient.note.rpm-agreement', compact('note'));
+    }
+
     // TODO move to utility
     private function callJava($request, $endPoint, $data, $guestAccessCode = null)
     {

+ 59 - 0
resources/views/app/patient/note/ccm-agreement.blade.php

@@ -0,0 +1,59 @@
+<div class="mt-3 p-3 border-top" id="ccm-agreement-{{$note->id}}">
+    <p class="mb-3">Dear Patient,</p>
+
+    <p class="mb-3">You are eligible for a new Medicare program that enables us to provide you with a round-the clock service to oversee your chronic conditions and improve your overall wellness.</p>
+
+    <p class="mb-3">Chronic conditions are ongoing medical problems like diabetes, high blood pressure, dementia, heart disease, depression, osteoporosis, and many others. These conditions must be managed effectively in partnership between the healthcare team and patient to maintain the best possible overall health and wellness.</p>
+
+    <p class="mb-3">CCM involves a combination of face-to-face and non-face-to-face services to ensure that each patient’s healthcare needs are met. The non-face-to-face component of CCM involves the creation of a patient-centered plan of care, medication monitoring, management of care transitions, electronic care coordination and exchange of health information with other health care providers as necessary, while providing you or your caregiver 24/7 access to your care team.</p>
+
+    <p class="mb-3">Each month, after we provide you with a minimum of 20 minutes of non-face-to-face services, we will bill your insurer(s). Either you or your supplementary insurer may be responsible for any patient responsibility.</p>
+
+    <p class="mb-3">You may stop this service at any time, for any reason. If you choose to stop the service we will provide it only through the last day of the calendar month of your decision.</p>
+
+    <form action="/nop" method="post" id="ccm-agreement-form">
+        <label class="d-flex align-items-center">
+            <input type="checkbox" name="ccm-agreement" required class="mr-2">
+            <span>I agree to participate in the Chronic Care Management program.</span>
+        </label>
+    </form>
+
+    <hr class="m-neg-3">
+
+    <div class="d-flex align-items-center justify-content-center">
+        <button class="btn btn-primary btn-sm font-weight-bold px-3 btn-ccm-agreement-submit">Submit</button>
+        <button class="ml-3 btn btn-default border btn-sm px-3" onclick="return closeStagPopup()">Close</button>
+    </div>
+
+</div>
+
+<script>
+    (function() {
+
+        function init() {
+
+            let parentForm = $('#ccm-agreement-{{$note->id}}');
+
+            parentForm.find('.btn-ccm-agreement-submit')
+                .off('click')
+                .on('click', function() {
+                    let form = parentForm.find('#ccm-agreement-form')[0];
+                    if(!form.checkValidity()) {
+                        form.reportValidity();
+                        return false;
+                    }
+                    showMask();
+                    $.post('/api/note/markCmSetupPerformedAsMcp', {uid: '{{$note->uid}}'}, _data => {
+                        hideMask();
+                        if(!hasResponseError(_data)) {
+                            closeStagPopup();
+                            fastReload();
+                        }
+                    }, 'json');
+                });
+        }
+
+        addMCInitializer('ccm-agreement-{{$note->id}}', init, '#ccm-agreement-{{$note->id}}')
+
+    }).call(window);
+</script>

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

@@ -594,17 +594,15 @@
                                     <b>Not Enrolled</b>
                                 </span>
                                 @if($patient->mcp_pro_id === $pro->id)
-                                    <div moe class="ml-3">
-                                        <a href="" show start>Mark as enrolled</a>
-                                        <form url="/api/note/markCmSetupPerformedAsMcp">
-                                            <input type="hidden" name="uid" value="{{$note->uid}}">
-                                            <p>Mark as enrolled into CCM?</p>
-                                            <div class="mb-0">
-                                                <button class="btn btn-primary btn-sm" submit>Submit</button>
-                                                <button class="btn btn-default border btn-sm" cancel>Cancel</button>
-                                            </div>
-                                        </form>
-                                    </div>
+                                    <a native target="_blank"
+                                       class="screen-only ml-3"
+                                       open-in-stag-popup
+                                       popup-style="medium"
+                                       mc-initer="ccm-agreement-{{$note->id}}"
+                                       title="Consent To Chronic Care Management Services"
+                                       href="/note/ccm-agreement/{{$note->uid}}?popupmode=1">
+                                        Mark as enrolled
+                                    </a>
                                 @endif
                             @endif
                         </div>
@@ -717,7 +715,7 @@
                     <div class="d-flex align-items-center mb-3">
                         <p class="font-weight-bold text-secondary m-0 font-size-14">RM Setup</p>
                     </div>
-                    @include('app.patient.partials.rm-setup')
+                    @include('app.patient.note.rm-setup')
                 </div>
 
                 <div class="p-3 border-bottom screen-only" data-non-segment-section="Vitals Settings">

+ 383 - 0
resources/views/app/patient/note/rm-setup.blade.php

@@ -0,0 +1,383 @@
+<div class="row">
+    <div class="col-6">
+        @if($pro->pro_type === 'ADMIN')
+            <div class="d-flex align-items-baseline mb-3">
+                <span class="width-200px">Is Eligible for RM?</span>
+                <div class="ml-3">
+                    <div class="d-inline-flex align-items-start">
+                        <b>{{ ucwords($patient->is_eligible_for_rm ? $patient->is_eligible_for_rm : '-') }}</b>
+                        <div moe class="ml-2">
+                            <a start show><i class="fa fa-edit"></i></a>
+                            <form url="/api/client/updateRmEligibility" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Is Eligible?</label>
+                                    <select name="isEligibleForRm"
+                                            class="form-control form-control-sm"
+                                            onchange="toggleDisabledAsNeeded(this, 'NO', 'not-eligible-for-rm')">
+                                        <option value="">-- Select Status --</option>
+                                        <option value="YES" {{ $patient->is_eligible_for_rm === 'YES' ? 'selected' : '' }}>YES</option>
+                                        <option value="NO" {{ $patient->is_eligible_for_rm === 'NO' ? 'selected' : '' }}>NO</option>
+                                        <option value="UNKNOWN" {{ $patient->is_eligible_for_rm === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
+                                    </select>
+                                </div>
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Why not eligible category</label>
+                                    <input type="text" class="not-eligible-for-rm form-control form-control-sm"
+                                           {{$patient->is_eligible_for_rm === 'NO' ? '' : 'disabled' }}
+                                           name="whyNotEligibleForRmCategory" value="{{$patient->why_not_eligible_for_rm_category}}">
+                                </div>
+                                <div class="mb-2">
+                                    <label class="text-sm mb-1 text-secondary">Why not eligible memo</label>
+                                    <input type="text" class="not-eligible-for-rm form-control form-control-sm"
+                                           {{$patient->is_eligible_for_rm === 'NO' ? '' : 'disabled' }}
+                                           name="whyNotEligibleForRmMemo" value="{{$patient->why_not_eligible_for_rm_memo}}">
+                                </div>
+                                <div>
+                                    <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    </div>
+                    @if($patient->is_eligible_for_rm === 'NO')
+                        <div class="mt-1">
+                            <span>{{$patient->why_not_eligible_for_rm_category ?: '-'}}</span>
+                            /
+                            <span class="text-secondary">{{$patient->why_not_eligible_for_rm_memo ?: '-'}}</span>
+                        </div>
+                    @endif
+                </div>
+            </div>
+        @endif
+
+        <div class="d-flex align-items-baseline mb-3">
+            <span class="width-200px">RM Enrollment Status:</span>
+            <div class="ml-3">
+                <div class="d-inline-flex align-items-start">
+                    <b>{{ ucwords($patient->is_enrolled_in_rm ? $patient->is_enrolled_in_rm : '-') }}</b>
+                    @if($patient->is_enrolled_in_rm === 'YES')
+                        <div moe wide class="ml-2">
+                            <a start show>Toggle</a>
+                            <form url="/api/client/setIsEnrolledInRmToFalse" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                <h2 class="alert alert-warning"><i class="fa fa-warning"></i> RPM Enrollment Cancellation</h2>
+                                <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
+                        <a native target="_blank"
+                           class="screen-only ml-2"
+                           open-in-stag-popup
+                           popup-style="medium"
+                           mc-initer="rpm-agreement-{{$note->id}}"
+                           title="Leadership Health Remote Patient Monitoring Consent Form"
+                           href="/note/rpm-agreement/{{$note->uid}}?popupmode=1">
+                            Mark as enrolled
+                        </a>
+                    @endif
+                </div>
+            </div>
+        </div>
+
+        <div class="d-flex align-items-baseline mb-3">
+            <span class="width-200px">RM Reasons:</span>
+            <div class="ml-3">
+                @if(!$patient->rmReasons || !count($patient->rmReasons))
+                    <span class="text-secondary">None</span>
+                @else
+                    <div>
+                        @foreach($patient->rmReasons as $reason)
+                            <div class="border-bottom pb-1 mb-1 d-flex align-items-start">
+                                <b class="width-90px">{{$reason->code}}</b>
+                                <span class="width-200px mr-3">{{$reason->description}}</span>
+                                <div moe>
+                                    <a start show>Edit</a>
+                                    <form url="/api/clientCmRmReason/updateBasic" class="mcp-theme-1">
+                                        <input type="hidden" name="uid" value="{{$reason->uid}}">
+                                        <div class="mb-2">
+                                            <label class="text-sm mb-1 text-secondary">Code *</label>
+                                            <input type="text" class="form-control form-control-sm"
+                                                   icd-autocomplete-code
+                                                   name="code" value="{{$reason->code}}" required>
+                                        </div>
+                                        <div class="mb-2">
+                                            <label class="text-sm mb-1 text-secondary">Description</label>
+                                            <input type="text" class="form-control form-control-sm"
+                                                   icd-autocomplete-description
+                                                   name="description" value="{{$reason->description}}">
+                                        </div>
+                                        <div>
+                                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                        </div>
+                                    </form>
+                                </div>
+                            </div>
+                        @endforeach
+                    </div>
+                @endif
+                <div>
+                    <div moe>
+                        <a start show>+ Add</a>
+                        <form url="/api/clientCmRmReason/create" class="mcp-theme-1">
+                            <input type="hidden" name="clientUid" value="{{$patient->uid}}">
+                            <input type="hidden" name="cmOrRm" value="RM">
+                            <div class="mb-2">
+                                <label class="text-sm mb-1 text-secondary">Code *</label>
+                                <input type="text" class="form-control form-control-sm"
+                                       icd-autocomplete-code
+                                       name="code" value="" required>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm mb-1 text-secondary">Description</label>
+                                <input type="text" class="form-control form-control-sm"
+                                       icd-autocomplete-description
+                                       name="description" value="">
+                            </div>
+                            <div>
+                                <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        @if($pro->pro_type === 'ADMIN')
+            <div class="d-flex align-items-baseline mb-3">
+                <span class="width-200px">RME Pro:</span>
+                <div class="ml-3">
+                    <div class="d-inline-flex align-items-start">
+                        <b>{{ $patient->rme ? $patient->rme->displayName() : '-' }}</b>
+                        <div moe class="ml-2">
+                            <a start show><i class="fa fa-edit"></i></a>
+                            <form url="/api/client/putRmePro" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                <div class="mb-2">
+                                    <label class="text-secondary text-sm">RME Pro</label>
+                                    <select provider-search data-pro-uid="{{ @$patient->rme->uid }}" name="rmeProUid" class="form-control form-control-sm">
+                                        <option value=""> --select--</option>
+                                    </select>
+                                </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($patient->rme)
+                            <div moe class="ml-2">
+                                <a start show><i class="fa fa-trash-alt text-danger on-hover-opaque"></i></a>
+                                <form url="/api/client/removeRmePro" class="mcp-theme-1">
+                                    <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                    <p>Remove RME Pro?</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>
+                </div>
+            </div>
+            <div class="d-flex align-items-baseline mb-3">
+                <span class="width-200px">RMM Pro:</span>
+                <div class="ml-3">
+                    <div class="d-inline-flex align-items-start">
+                        <b>{{ $patient->rmm ? $patient->rmm->displayName() : '-' }}</b>
+                        <div moe class="ml-2">
+                            <a start show><i class="fa fa-edit"></i></a>
+                            <form url="/api/client/putRmmPro" class="mcp-theme-1">
+                                <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                <div class="mb-2">
+                                    <label class="text-secondary text-sm">RMM Pro</label>
+                                    <select provider-search data-pro-uid="{{ @$patient->rmm->uid }}" name="rmmProUid" class="form-control form-control-sm">
+                                        <option value=""> --select--</option>
+                                    </select>
+                                </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($patient->rmm)
+                            <div moe class="ml-2">
+                                <a start show><i class="fa fa-trash-alt text-danger on-hover-opaque"></i></a>
+                                <form url="/api/client/removeRmmPro" class="mcp-theme-1">
+                                    <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                    <p>Remove RMM Pro?</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>
+                </div>
+            </div>
+        @endif
+    </div>
+    <div class="col-6 border-left">
+        <?php
+        $bpDevice = null;
+        $weightScale = null;
+        if(count($patient->devices)) {
+            foreach($patient->devices as $device) {
+                if(!$bpDevice && $device->device->category === 'BP') {
+                    $bpDevice = $device;
+                }
+                elseif(!$weightScale && $device->device->category === 'WEIGHT') {
+                    $weightScale = $device;
+                }
+                if($bpDevice && $weightScale) break;
+            }
+        }
+        $bpMeasurements = [];
+        if($bpDevice) {
+            $bpMeasurements["first"] = \App\Models\Measurement
+                ::where('imei', $bpDevice->device->imei)
+                ->where('client_id', $patient->id)
+                ->where('is_cellular_zero', false)
+                ->orderBy('ts')
+                ->first();
+            $bpMeasurements["last"] = \App\Models\Measurement
+                ::where('imei', $bpDevice->device->imei)
+                ->where('client_id', $patient->id)
+                ->where('is_cellular_zero', false)
+                ->orderBy('ts', 'DESC')
+                ->first();
+        }
+        $weightMeasurements = [];
+        if($weightScale) {
+            $weightMeasurements["first"] = \App\Models\Measurement
+                ::where('imei', $weightScale->device->imei)
+                ->where('client_id', $patient->id)
+                ->where('is_cellular_zero', false)
+                ->orderBy('ts')
+                ->first();
+            $weightMeasurements["last"] = \App\Models\Measurement
+                ::where('imei', $weightScale->device->imei)
+                ->where('client_id', $patient->id)
+                ->where('is_cellular_zero', false)
+                ->orderBy('ts', 'DESC')
+                ->first();
+        }
+        $careMonth = $patient->currentCareMonth();
+        ?>
+
+        @if($bpDevice)
+            <div class="mb-3">
+                <div class="d-flex align-items-baseline mb-2">
+                    <span class="width-200px font-weight-bold">Cellular BP Device</span>
+                    <b class="ml-3">Yes</b>
+                    <span class="ml-3 text-secondary">IMEI: {{$bpDevice->device->imei}}</span>
+                </div>
+                <div class="">
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">Arrived:</span>
+                        <span class="ml-3">Yes</span>*
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">First Measurement:</span>
+                        @if($bpMeasurements["first"])
+                            <span class="ml-3">{{ $bpMeasurements["first"]->sbp_mm_hg . '/' . $bpMeasurements["first"]->dbp_mm_hg . ' mmHg' }}</span>
+                            <span class="ml-3 text-secondary">{{date("Y-m-d", $bpMeasurements["first"]->ts/1000)}}</span>
+                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $bpMeasurements["first"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                        @else
+                            -
+                        @endif
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">Last Measurement:</span>
+                        @if($bpMeasurements["last"])
+                            <span class="ml-3">{{ $bpMeasurements["last"]->sbp_mm_hg . '/' . $bpMeasurements["last"]->dbp_mm_hg . ' mmHg' }}</span>
+                            <span class="ml-3 text-secondary">{{date("Y-m-d", $bpMeasurements["last"]->ts/1000)}}</span>
+                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $bpMeasurements["last"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                        @else
+                            -
+                        @endif
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">How often to measure:</span>
+                        <span class="ml-3"> -- </span>
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">SMS reminders:</span>
+                        <span class="ml-3"> -- </span>
+                    </div>
+                </div>
+            </div>
+        @else
+            <div class="d-flex align-items-baseline mb-3">
+                <span class="width-200px">Cellular BP Device</span>
+                <b class="ml-3">No</b>
+            </div>
+        @endif
+
+        @if($weightScale)
+            <div class="mb-3">
+                <div class="d-flex align-items-baseline mb-2">
+                    <span class="width-200px font-weight-bold">Cellular Weight Scale</span>
+                    <b class="ml-3">Yes</b>
+                    <span class="ml-3 text-secondary">IMEI: {{$weightScale->device->imei}}</span>
+                </div>
+                <div class="">
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">Arrived:</span>
+                        <span class="ml-3">Yes</span>*
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">First Measurement:</span>
+                        @if($weightMeasurements["first"])
+                            <span class="ml-3">{{ round($weightMeasurements["first"]->value, 2) . ' lbs' }}</span>
+                            <span class="ml-3 text-secondary">{{date("Y-m-d", $weightMeasurements["first"]->ts/1000)}}</span>
+                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $weightMeasurements["first"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                        @else
+                            -
+                        @endif
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">Last Measurement:</span>
+                        @if($weightMeasurements["last"])
+                            <span class="ml-3">{{ round($weightMeasurements["last"]->value, 2) . ' lbs' }}</span>
+                            <span class="ml-3 text-secondary">{{date("Y-m-d", $weightMeasurements["last"]->ts/1000)}}</span>
+                            <span class="ml-3">{{date_diff(date_create(date("Y-m-d", $weightMeasurements["last"]->ts/1000)), date_create('now'))->days}} days ago</span>
+                        @else
+                            -
+                        @endif
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">How often to measure:</span>
+                        <span class="ml-3"> -- </span>
+                    </div>
+                    <div class="d-flex align-items-baseline mb-1">
+                        <span class="width-200px pl-3">SMS reminders:</span>
+                        <span class="ml-3"> -- </span>
+                    </div>
+                </div>
+            </div>
+        @else
+            <div class="d-flex align-items-baseline mb-3">
+                <span class="width-200px">Cellular Weight Scale</span>
+                <b class="ml-3">No</b>
+            </div>
+        @endif
+
+        @if($careMonth && ($bpDevice || $weightScale))
+            <div class="d-flex align-items-baseline mb-1">
+                <span class="width-200px">Measurement days this month:</span>
+                <div class="ml-3">
+                    <b>{{$careMonth->number_of_days_with_remote_measurements}} days</b>
+                </div>
+            </div>
+        @endif
+    </div>
+</div>

+ 81 - 0
resources/views/app/patient/note/rpm-agreement.blade.php

@@ -0,0 +1,81 @@
+<div class="mt-3 p-3 border-top" id="rpm-agreement-{{$note->id}}">
+    <p class="mb-3">I understand that:</p>
+
+    <form action="/nop" method="post" id="rpm-agreement-form">
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-1" required></div>
+            <span>I am the only person who should be using the remote monitoring equipment as instructed. I will not use the equipment for reasons other than health monitoring.</span>
+        </label>
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-2" required></div>
+            <span>I will not tamper with the equipment. I understand that I am responsible for any fees associated with misuse of the equipment.</span>
+        </label>
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-3" required></div>
+            <span>I understand the equipment is only designed for the Wellness at Home program and not designed for, intended or permitted for use on the Internet.</span>
+        </label>
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-4" required></div>
+            <span>The equipment is meant to monitor symptoms and vitals only. It is NOT AN EMERGENCY RESPONSE unit. Call 911 for immediate medical emergencies.</span>
+        </label>
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-5" required></div>
+            <span>My data and medical information obtained from my participation in the RPM program may/may not be considered part of my patient record, but may be shared with other health care professionals to enhance my care and I authorize such professional disclosure. My data and information will be securely transmitted data and reviewed at the clinician’s discretion.</span>
+        </label>
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-6" required></div>
+            <span>I will comply with the RPM program clinical expectations and if I don’t, I may be removed from the RPM program and I will return the RPM equipment.</span>
+        </label>
+
+        <label class="d-flex align-items-baseline mb-3">
+            <div class="mr-2 align-self-stretch" style="padding-top: 2px;"><input type="checkbox" name="rpm-agreement-7" required></div>
+            <span>I have the right to withdraw my consent to participate in the RPM program and stop receiving RPM Services at any time by returning the equipment.</span>
+        </label>
+
+    </form>
+
+    <hr class="m-neg-3">
+
+    <div class="d-flex align-items-center justify-content-center">
+        <button class="btn btn-primary btn-sm font-weight-bold px-3 btn-rpm-agreement-submit">Submit</button>
+        <button class="ml-3 btn btn-default border btn-sm px-3" onclick="return closeStagPopup()">Close</button>
+    </div>
+
+</div>
+
+<script>
+    (function() {
+
+        function init() {
+
+            let parentForm = $('#rpm-agreement-{{$note->id}}');
+
+            parentForm.find('.btn-rpm-agreement-submit')
+                .off('click')
+                .on('click', function() {
+                    let form = parentForm.find('#rpm-agreement-form')[0];
+                    if(!form.checkValidity()) {
+                        form.reportValidity();
+                        return false;
+                    }
+                    showMask();
+                    $.post('/api/client/setIsEnrolledInRmToTrue', {uid: '{{$note->client->uid}}'}, _data => {
+                        hideMask();
+                        if(!hasResponseError(_data)) {
+                            closeStagPopup();
+                            fastReload();
+                        }
+                    }, 'json');
+                });
+        }
+
+        addMCInitializer('rpm-agreement-{{$note->id}}', init, '#rpm-agreement-{{$note->id}}')
+
+    }).call(window);
+</script>

+ 4 - 0
routes/web.php

@@ -456,6 +456,8 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/point/review-log/{point}', 'NoteController@reviewLog')->name('point-review-log');
     Route::get('/point/plan-log/{point}', 'NoteController@planLog')->name('point-plan-log');
     Route::get('/note/pdf/{note}', 'NoteController@downloadAsPdf')->name('note-pdf');
+    Route::get('/note/ccm-agreement/{note}', 'NoteController@ccmAgreement')->name('ccm-agreement');
+    Route::get('/note/rpm-agreement/{note}', 'NoteController@rpmAgreement')->name('rpm-agreement');
     Route::get('/segment-summary/{segment}', 'NoteController@segmentSummary')->name('segment-summary');
     Route::get('/note-segment-view/{patient}/{note}/{segment}/{segmentInternalName}/{view}', 'NoteController@noteSegmentView')->name('note-segment-view');
     Route::get('/chart-segment-view/{patient}/{segmentInternalName}/{view}', 'NoteController@chartSegmentView')->name('chart-segment-view');
@@ -588,3 +590,5 @@ Route::post("/process_form_submit", 'NoteController@processFormSubmit')->name('p
 Route::get("/get-default-section-data/{patientID}/{sectionTemplateID}", 'NoteController@getDefaultValueForSection')->name('get_default_section_data');
 
 Route::get("/get-segment-html/{segmentUid}/{sessionKey}", 'NoteController@getHtmlForSegment')->name('get_segment_html');
+
+Route::any("/nop", 'HomeController@nop')->name('nop');