Переглянути джерело

CCM agreement - reasons UI (wip)

Vijayakrishnan 3 роки тому
батько
коміт
aba58c34c1
1 змінених файлів з 110 додано та 0 видалено
  1. 110 0
      resources/views/app/patient/note/ccm-agreement.blade.php

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

@@ -11,6 +11,112 @@
 
     <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>
 
+    <?php $patient = $note->client; ?>
+
+    <div class="border rounded p-3 mb-3 max-width-500px">
+        <p><b>CCM Reasons @if(!$patient->cmReasons || count($patient->cmReasons) < 2)(2 reasons required)@else <i class="fa fa-check text-success ml-1"></i> @endif</b></p>
+        <div class="min-width-300px">
+            @if(!$patient->cmReasons || !count($patient->cmReasons))
+                <span class="text-secondary d-block mb-2">None</span>
+            @else
+                <div>
+                    @foreach($patient->cmReasons as $reason)
+                        <div class="border-bottom pb-1 mb-1 d-flex align-items-start bg-white">
+                            <b class="min-width-70px">{{$reason->code}}</b>
+                            <span class="max-width-200px mr-3">{{$reason->description}}</span>
+                            <div moe relative class="ml-auto">
+                                <a start show><i class="fa fa-pencil-alt"></i></a>
+                                <form url="/api/clientCmRmReason/updateBasic" class="mcp-theme-1" right>
+                                    <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 moe relative class="ml-2">
+                                <a start show><i class="fa fa-trash-alt text-danger on-hover-opaque"></i></a>
+                                <form url="/api/clientCmRmReason/remove" class="mcp-theme-1" right>
+                                    <input type="hidden" name="uid" value="{{$reason->uid}}">
+                                    <p>Remove this CM reason?</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>
+                        </div>
+                    @endforeach
+                </div>
+            @endif
+            @if(!$patient->cmReasons || count($patient->cmReasons) < 2)
+                <div class="d-flex align-items-baseline">
+                    <div moe>
+                        <a start show>+ Add From Dx</a>
+                        <form url="/api/clientCmRmReason/create" class="mcp-theme-1">
+                            <input type="hidden" name="clientUid" value="{{$patient->uid}}">
+                            <input type="hidden" name="cmOrRm" value="CM">
+                            <input type="hidden" name="code" value="">
+                            <input type="hidden" name="description" value="">
+                            <div class="mb-2">
+                                <label class="text-sm mb-1 text-secondary">Reason *</label>
+                                <select type="text" class="form-control form-control-sm problem-select" name="problem" required>
+                                    <?php $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM"); ?>
+                                    <option value="">-- select --</option>
+                                    @foreach($problems as $problem)
+                                        @if(!!@($problem->data->icd))
+                                            <option value="{{$problem->uid}}" data-icd="{{$problem->data->icd}}" data-name="{{$problem->data->name}}">{{$problem->data->icd}} - {{$problem->data->name}}</option>
+                                        @endif
+                                    @endforeach
+                                </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>
+                    <span class="mx-2 text-secondary text-sm">|</span>
+                    <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="CM">
+                            <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>
+            @endif
+        </div>
+    </div>
+
     <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">
@@ -37,6 +143,10 @@
             parentForm.find('.btn-ccm-agreement-submit')
                 .off('click')
                 .on('click', function() {
+                    @if(!$patient->cmReasons || count($patient->cmReasons) < 2)
+                    toastr.error('2 reasons are required for CCM');
+                    return false;
+                    @endif
                     let form = parentForm.find('#ccm-agreement-form')[0];
                     if(!form.checkValidity()) {
                         form.reportValidity();