瀏覽代碼

next_fu summary UI

Vijayakrishnan 4 年之前
父節點
當前提交
47b8ec8e1b

+ 23 - 21
resources/views/app/patient/canvas-sections/next_fu/form.blade.php

@@ -1,9 +1,15 @@
 <?php
 /** @var \App\Models\Pro $sectionPro */
 /** @var \App\Models\Pro $pro */
+/** @var \App\Models\Note $note */
 
 if(!@$sectionPro) {
-    $sectionPro = $pro;
+    if(@$note) {
+        $sectionPro = $note->hcpPro;
+    }
+    else {
+        $sectionPro = $pro; // should never get here
+    }
 }
 
 if(!$contentData) $contentData = [];
@@ -38,32 +44,30 @@ $formID = rand(0, 100000);
 
     <input type="hidden" name="data" value="{{json_encode($contentData)}}">
 
-    <div class="border p-3 my-3 bg-aliceblue">
-
-        <p class="font-weight-bold mb-0">
-            <label class="m-0 d-flex align-items-center">
-                <span class="mr-2">Follow-up Appointment</span>
-                <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['next_fu']['active']">
-            </label>
-        </p>
-
-        <label v-if="data['{{$sectionPro->uid}}']['next_fu']['active']" class="mt-3 d-flex align-items-center">
-            <span class="mr-2">Follow Up Date</span>
-            <input type="date" v-model="data['{{$sectionPro->uid}}']['next_fu']['date']">
-            <a v-if="data['{{$sectionPro->uid}}']['next_fu']['active'] && !!data['{{$sectionPro->uid}}']['next_fu']['date']" native target="_blank" href="{{route('patients.view.calendar', ['patient' => $patient])}}" class="ml-3">
-                <i class="fa fa-calendar-alt"></i>
-                Patient Calendar
-            </a>
+    <p class="font-weight-bold">
+        <label class="m-0 d-flex align-items-center">
+            <span class="mr-2">Follow-up Appointment</span>
+            <input type="checkbox" v-model="data['{{$sectionPro->uid}}']['next_fu']['active']">
         </label>
+    </p>
+
+    <label v-if="data['{{$sectionPro->uid}}']['next_fu']['active']" class="d-flex align-items-center">
+        <span class="mr-2">Follow Up Date</span>
+        <input type="date" v-model="data['{{$sectionPro->uid}}']['next_fu']['date']">
+        <a v-if="data['{{$sectionPro->uid}}']['next_fu']['active'] && !!data['{{$sectionPro->uid}}']['next_fu']['date']" native target="_blank" href="{{route('patients.view.calendar', ['patient' => $patient])}}" class="ml-3">
+            <i class="fa fa-calendar-alt"></i>
+            Patient Calendar
+        </a>
+    </label>
 
-        <div v-if="data['{{$sectionPro->uid}}']['next_fu']['active']" class="mt-3">
+    <div v-if="data['{{$sectionPro->uid}}']['next_fu']['active']" class="">
         <div class="mb-2">
             <span class="font-weight-bold">Next CC</span>
             <a href="#" class="ml-3"
                v-on:click.prevent="addNextCCItem()"
             >+ Add</a>
         </div>
-        <table class="table table-sm table-bordered mb-0 table-edit-sheet">
+        <table class="table table-sm table-bordered table-edit-sheet">
             <thead>
             <tr class="bg-light">
                 <th class="px-2 text-secondary border-bottom-0 width-30px text-center">#</th>
@@ -111,8 +115,6 @@ $formID = rand(0, 100000);
         </table>
     </div>
 
-    </div>
-
 </div>
 <script>
     (function() {

+ 48 - 29
resources/views/app/patient/canvas-sections/next_fu/summary.php

@@ -1,5 +1,18 @@
 <?php
 
+/** @var \App\Models\Pro $sectionPro */
+/** @var \App\Models\Pro $pro */
+/** @var \App\Models\Note $note */
+
+if(!@$sectionPro) {
+    if(@$note) {
+        $sectionPro = $note->hcpPro;
+    }
+    else {
+        $sectionPro = $pro; // should never get here
+    }
+}
+
 $contentData = false;
 if ($patient->canvas_data) {
     $canvasData = json_decode($patient->canvas_data, true);
@@ -14,37 +27,43 @@ if($contentData === false || !isset($contentData[$sectionPro->uid])) {
     <?php
 }
 else {
-    print_r($contentData[$sectionPro->uid]);
-    // echo "Hello";
-}
-
-/*
-if(count($contentData['items'])) {
-    for ($i = 0; $i < count($contentData['items']); $i++) {
-        $item = $contentData['items'][$i];
-?>
+    if(!$contentData[$sectionPro->uid]['next_fu']['active']) {
+        ?>
+        <div class="text-secondary">No follow-up scheduled</div>
+        <?php
+    }
+    else {
+        ?>
+        <label class="d-flex align-items-center">
+            <span class="mr-2">Date:</span>
+            <b><?= $contentData[$sectionPro->uid]['next_fu']['date'] ?></b>
+        </label>
         <div class="mb-2">
-            <div class="">
-                <?php if(isset($item["title"]) && !empty($item["title"])): ?>
-                    <b><?= $item["title"] ?></b>
-                <?php endif; ?>
-                <?= !!$item["strength"] ? '/&nbsp;' . $item["strength"] : '' ?>
-                <?= !!$item["frequency"] ? '/&nbsp;' . $item["frequency"] : '' ?>
-            </div>
-            <?php
-            $detailPlain = isset($item["detail"]) ? $item["detail"] : '';
-            $detailPlain = trim(strip_tags($detailPlain));
-            if(!empty($detailPlain)):
-            ?>
-                <div class="text-secondary"><?= $detailPlain ?></div>
-            <?php endif; ?>
+            <span class="font-weight-bold">Next CC</span>
         </div>
-<?php
+        <table class="table table-sm table-bordered table-edit-sheet">
+            <thead>
+            <tr class="bg-light">
+                <th class="px-2 text-secondary border-bottom-0 width-30px text-center">#</th>
+                <th class="px-2 text-secondary border-bottom-0">Category</th>
+                <th class="px-2 text-secondary border-bottom-0">Title</th>
+                <th class="px-2 text-secondary border-bottom-0">ICD</th>
+                <th class="px-2 text-secondary border-bottom-0 w-35">Memo</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php foreach($contentData[$sectionPro->uid]['next_cc']['list'] as $i => $line): ?>
+                <tr>
+                    <td class="bg-white px-2 py-1 text-center text-sm font-weight-bold"><?= ++$i ?></td>
+                    <td class="bg-white px-2 py-1"><?= ucwords($line['category']) ?></td>
+                    <td class="bg-white px-2 py-1"><?= $line['name'] ?></td>
+                    <td class="bg-white px-2 py-1"><?= @$line['icd'] ?></td>
+                    <td class="bg-white px-2 py-1"><?= @$line['memo'] ?></td>
+                </tr>
+            <?php endforeach; ?>
+            </tbody>
+        </table>
+        <?php
     }
 }
-else {
-    ?>
-    <div class="text-secondary">Nothing here yet!</div>
-    <?php
-}*/
 ?>