Browse Source

ERx PDF - support multiple line items

Vijayakrishnan 4 years ago
parent
commit
e1bf661818

+ 1 - 1
public/css/style.css

@@ -1442,7 +1442,7 @@ button.note-templates-trigger-assessment {
     display: none;
 }
 #send-fax-pdf-preview {
-    max-height: 400px;
+    max-height: 350px;
     overflow: auto;
     box-shadow: 0 0 2px #ccc;
 }

+ 2 - 2
resources/views/app/patient/tickets/ticket_send_fax_form.blade.php

@@ -5,14 +5,14 @@
             <a href="#" class="ml-auto text-secondary"
                 onclick="return closeStagPopup()"><i class="fa fa-times"></i></a>
         </h3>
-        <div class="mb-2">
+        <div class="mb-3">
             <p class="text-secondary text-sm mb-2 text-center">Document Preview</p>
             <div id="send-fax-pdf-preview">
 
             </div>
         </div>
         <div class="form-group mb-2">
-            <label class="text-sm text-secondary mb-1">Fax Number</label>
+            <label class="font-weight-bold mb-1">Fax Number</label>
             <input type="text" v-model="faxNumber" class="form-control">
         </div>
         <div class="d-flex align-items-center justify-content-center mt-3">

+ 32 - 2
resources/views/app/ticket/pdf-preview.blade.php

@@ -35,11 +35,11 @@
             <p style="margin: 0.5rem 0;">{!! $addressParts !!}</p>
         </div>
     </section>
+    <?php $rxData = json_decode($ticket->data); ?>
     <hr style="margin: 1rem 0;">
     <section>
-        <?php $rxData = json_decode($ticket->data); ?>
         <p style="margin: 0.5rem 0;">
-        <b>{{ $rxData->medication }} {{ $rxData->strength }}
+        1. <b>{{ $rxData->medication }} {{ $rxData->strength }}
         @if($rxData->route)
             - {{ $rxData->route }}
         @endif
@@ -60,6 +60,36 @@
             @endif
         </div>
     </section>
+    <?php
+    $additionalItems = @$rxData->items && count($rxData->items) ? $rxData->items : [];
+    $itemNum = 2;
+    ?>
+    @foreach($additionalItems as $item)
+        <hr style="margin: 1rem 0;">
+        <section>
+            <p style="margin: 0.5rem 0;">
+                {{$itemNum++}}. <b>{{ $item->medication }} {{ $item->strength }}
+                    @if($item->route)
+                        - {{ $item->route }}
+                    @endif
+                </b>
+            </p>
+            <div style="padding-left: 1rem;">
+                @if($item->frequency)
+                    <p style="margin: 0.5rem 0;">Frequency: {{ $item->frequency }}</p>
+                @endif
+                @if($item->dispense)
+                    <p style="margin: 0.5rem 0;">Dispense: {{ $item->dispense }}</p>
+                @endif
+                @if($item->refills)
+                    <p style="margin: 0.5rem 0;">Refills: {{ $item->refills }}</p>
+                @endif
+                @if($item->purpose)
+                    <p style="margin: 0.5rem 0;">Purpose: <b>{{ $item->purpose }}</b></p>
+                @endif
+            </div>
+        </section>
+    @endforeach
     <hr style="margin: 1rem 0;">
     <p><b>Pharmacy Information</b>:</p>
     <div style="padding-left: 1rem;">