瀏覽代碼

For cm-eligible patient, enforce cm-enrollment before adding SOs

Vijayakrishnan 3 年之前
父節點
當前提交
577804717f
共有 1 個文件被更改,包括 72 次插入46 次删除
  1. 72 46
      resources/views/app/patient/supply-orders.blade.php

+ 72 - 46
resources/views/app/patient/supply-orders.blade.php

@@ -7,52 +7,78 @@
                 <span class="mx-2 text-secondary">|</span>
                 <div moe large>
                     <a start show href="#">Add</a>
-                    <form url="/api/supplyOrder/create" redir="/patients/view/{{ $patient->uid }}/supply-orders/[data]">
-                        <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
-                        <input type="hidden" name="noteUid" value="{{ request()->input('note-uid') }}">
-                        <label class="text-secondary font-weight-bold">Add Supply Order</label>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Product</label>
-                            <select name="productUid" class="form-control form-control-sm">
-                                <option value=""> --select--</option>
-                                @foreach($products as $product)
-                                    <option
-                                        value="{{$product->uid}}">{{$product->title}}</option>
-                                @endforeach
-                            </select>
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Address Line1</label>
-                            <input type="text" class="form-control form-control-sm" name="mailingAddressLine1" value="{{$patient->mailing_address_line1}}">
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Address Line2</label>
-                            <input type="text" class="form-control form-control-sm" name="mailingAddressLine2" value="{{$patient->mailing_address_line2}}">
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Address City</label>
-                            <input type="text" class="form-control form-control-sm" name="mailingAddressCity" value="{{$patient->mailing_address_city}}">
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Address State</label>
-                            <input type="text" class="form-control form-control-sm" name="mailingAddressState" value="{{$patient->mailing_address_state}}">
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Address Zip</label>
-                            <input type="text" class="form-control form-control-sm" name="mailingAddressZip" value="{{$patient->mailing_address_zip}}">
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Reason</label>
-                            <input type="text" class="form-control form-control-sm" name="reason">
-                        </div>
-                        <div class="mb-2">
-                            <label class="text-secondary text-sm">Client Understanding Memo</label>
-                            <input type="text" class="form-control form-control-sm" name="clientUnderstandingMemo">
-                        </div>
-                        <div class="d-flex align-items-center">
-                            <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
-                        </div>
-                    </form>
+                    @if(($patient->is_eligible_for_cm === 'YES' || ($patient->was_medicare_validation_successful && $patient->is_part_b_primary == 'YES')) && $patient->is_enrolled_in_cm !== 'YES')
+                        <form url="/api/client/setIsEnrolledInCmToTrue">
+                            <p class="font-weight-bold">You need to enroll this patient into CM before adding supply orders.</p>
+                            <input type="hidden" name="uid" value="{{ $patient->uid }}">
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">CM Enrollment Consent Method</label>
+                                <input type="text" class="form-control form-control-sm" name="cmEnrollmentConsentMethod">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">CM Enrollment Consent Method Memo</label>
+                                <input type="text" class="form-control form-control-sm" name="cmEnrollmentConsentMethodMemo">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">CM Reason 1</label>
+                                <input type="text" class="form-control form-control-sm" name="cmReason1">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">CM Reason 2</label>
+                                <input type="text" class="form-control form-control-sm" name="cmReason2">
+                            </div>
+                            <div class="d-flex align-items-center">
+                                <button class="btn btn-sm btn-primary mr-2" type="button" submit>Enroll</button>
+                            </div>
+                        </form>
+                    @else
+                        <form url="/api/supplyOrder/create" redir="/patients/view/{{ $patient->uid }}/supply-orders/[data]">
+                            <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                            <input type="hidden" name="noteUid" value="{{ request()->input('note-uid') }}">
+                            <label class="text-secondary font-weight-bold">Add Supply Order</label>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Product</label>
+                                <select name="productUid" class="form-control form-control-sm">
+                                    <option value=""> --select--</option>
+                                    @foreach($products as $product)
+                                        <option
+                                                value="{{$product->uid}}">{{$product->title}}</option>
+                                    @endforeach
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Address Line1</label>
+                                <input type="text" class="form-control form-control-sm" name="mailingAddressLine1" value="{{$patient->mailing_address_line1}}">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Address Line2</label>
+                                <input type="text" class="form-control form-control-sm" name="mailingAddressLine2" value="{{$patient->mailing_address_line2}}">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Address City</label>
+                                <input type="text" class="form-control form-control-sm" name="mailingAddressCity" value="{{$patient->mailing_address_city}}">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Address State</label>
+                                <input type="text" class="form-control form-control-sm" name="mailingAddressState" value="{{$patient->mailing_address_state}}">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Address Zip</label>
+                                <input type="text" class="form-control form-control-sm" name="mailingAddressZip" value="{{$patient->mailing_address_zip}}">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Reason</label>
+                                <input type="text" class="form-control form-control-sm" name="reason">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-secondary text-sm">Client Understanding Memo</label>
+                                <input type="text" class="form-control form-control-sm" name="clientUnderstandingMemo">
+                            </div>
+                            <div class="d-flex align-items-center">
+                                <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                            </div>
+                        </form>
+                    @endif
                 </div>
             @endif
             <select class="ml-auto max-width-300px form-control form-control-sm supply-orders-filter">