Bläddra i källkod

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

Samson Mutunga 3 år sedan
förälder
incheckning
a2cea5f634
1 ändrade filer med 47 tillägg och 36 borttagningar
  1. 47 36
      resources/views/app/patient/notes.blade.php

+ 47 - 36
resources/views/app/patient/notes.blade.php

@@ -221,44 +221,55 @@
                     <div class="d-flex align-items-center">
                         <a href="/patients/view/{{ $patient->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold">Open</a>
                         @if($note->new_or_fu_or_na !== 'NEW')
-                        <span class="px-2 text-secondary">|</span>
-                        <div moe>
-                            <a start show>Clone</a>
-                            <form url="/api/visit/clone" class="mcp-theme-1">
-                                <input type="hidden" name="visitToCloneUid" value="{{$note->uid}}">
-                                <div class="form-group">
-                                    <label for="" class="control-label">Effective Date</label>
-                                    <input type="date" name="effectiveDate" class="form-control input-sm">
-                                </div>
-                                <div class="form-group">
-                                    <label for="" class="control-label">New/Fu</label>
-                                    <select name="newOrFuOrNa" id="" class="form-control input-sm">
-                                        <option value="">--select--</option>
-                                        <option value="NEW">New</option>
-                                        <option value="FU">Fu</option>
-                                        <option value="NA">Na</option>
-                                    </select>
+                            @if(!$note->visit_template_id)
+                                <span class="px-2 text-secondary">|</span>
+                                <div class="d-flex align-items-center">
+                                    <a href="/patients/view/{{ $patient->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold">Open</a>
+                                    @if($note->new_or_fu_or_na !== 'NEW')
+                                    <span class="px-2 text-secondary">|</span>
+                                    <a href="#" class="text-primary trigger-clone" data-uid="{{$note->uid}}">Clone</a>
+                                    @endif
                                 </div>
+                            @else
+                                <span class="px-2 text-secondary">|</span>
+                                <div moe>
+                                    <a start show>Clone Visit</a>
+                                    <form url="/api/visit/clone" class="mcp-theme-1">
+                                        <input type="hidden" name="visitToCloneUid" value="{{$note->uid}}">
+                                        <div class="form-group">
+                                            <label for="" class="control-label">Effective Date</label>
+                                            <input type="date" name="effectiveDate" class="form-control input-sm">
+                                        </div>
+                                        <div class="form-group">
+                                            <label for="" class="control-label">New/Fu</label>
+                                            <select name="newOrFuOrNa" id="" class="form-control input-sm">
+                                                <option value="">--select--</option>
+                                                <option value="NEW">New</option>
+                                                <option value="FU">Fu</option>
+                                                <option value="NA">Na</option>
+                                            </select>
+                                        </div>
 
-                                <div class="form-group">
-                                    <label for="" class="control-label">Method</label>
-                                    <select name="noteContactMethod" id="" class="form-control input-sm">
-                                        <option value="">--select--</option>
-                                        <option value="VIDEO">Video</option>
-                                        <option value="AUDIO">Audio</option>
-                                        <option value="IN_CLINIC">In Clinic</option>
-                                        <option value="HOUSE_CALL">House Call</option>
-                                    </select>
-                                </div>
-                                <div class="form-group">
-                                    <label for="" class="control-label">Title</label>
-                                    <input type="text" name="title" class="form-control input-sm">
+                                        <div class="form-group">
+                                            <label for="" class="control-label">Method</label>
+                                            <select name="noteContactMethod" id="" class="form-control input-sm">
+                                                <option value="">--select--</option>
+                                                <option value="VIDEO">Video</option>
+                                                <option value="AUDIO">Audio</option>
+                                                <option value="IN_CLINIC">In Clinic</option>
+                                                <option value="HOUSE_CALL">House Call</option>
+                                            </select>
+                                        </div>
+                                        <div class="form-group">
+                                            <label for="" class="control-label">Title</label>
+                                            <input type="text" name="title" class="form-control input-sm">
+                                        </div>
+                                        <div class="form-group m-0">
+                                            <button submit class="btn btn-primary btn-sm">submit</button>
+                                        </div>
+                                    </form>
                                 </div>
-                                <div class="form-group m-0">
-                                    <button submit class="btn btn-primary btn-sm">submit</button>
-                                </div>
-                            </form>
-                        </div>
+                            @endif
                         @endif
                     </div>
                 </td>
@@ -294,7 +305,7 @@
                 $('.trigger-clone')
                     .off('click.clone')
                     .on('click.clone', function() {
-                        $.post('/api/visit/clone', {
+                        $.post('/api/note/clone', {
                             uid: $(this).attr('data-uid')
                         }, function(_data) {
                             if(_data) {