Explorar el Código

erx - drug - new field / med - "instructions" - default to plan if available

Vijayakrishnan hace 3 años
padre
commit
cee2951c46
Se han modificado 1 ficheros con 14 adiciones y 4 borrados
  1. 14 4
      resources/views/app/patient/prescriptions/list.blade.php

+ 14 - 4
resources/views/app/patient/prescriptions/list.blade.php

@@ -212,9 +212,15 @@
                     </tr>
                     <tr v-for="drug in existingDrugs" v-if="notAlreadyAdded(drug.data.name)">
                         <td class="">@{{ drug.data.name }}</td>
-                        <td class="width-150px bg-white py-0 pr-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.instructions"></td>
-                        <td class="width-70px bg-white py-0 pr-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.dispense"></td>
-                        <td class="width-70px bg-white py-0 pl-0"><input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.refills"></td>
+                        <td class="width-150px bg-white py-0 px-0">
+                            <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.instructions">
+                        </td>
+                        <td class="width-70px bg-white py-0 px-0">
+                            <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.dispense">
+                        </td>
+                        <td class="width-70px bg-white py-0 pl-0">
+                            <input type="text" class="form-control form-control-sm min-width-unset rounded-0 border-0 shadow-none" v-model="drug.data.refills">
+                        </td>
                         <td class="text-right">
                             <a href="#" v-on:click.prevent="addExistingDrugToERx(drug.uid)" class="text-nowrap">Add to eRx</a>
                         </td>
@@ -410,6 +416,10 @@ GROUP BY erx_category");
             if ($point->data) {
                 $point->data = json_decode($point->data);
             }
+            if($point->lastChildPlan && $point->lastChildPlan->data) {
+                $parsedPlan = json_decode($point->lastChildPlan->data);
+                $point->instructions = trim(strip_tags($parsedPlan->value));
+            }
         }
 
         ?>
@@ -1149,7 +1159,7 @@ GROUP BY erx_category");
                             medication: existing.data.name,
                             dispense: existing.data.dispense,
                             refills: existing.data.refills,
-                            instructions: existing.data.instructions,
+                            instructions: existing.instructions,
                         });
                         this.currentPrescription.clinical_detail_json.items = JSON.parse(JSON.stringify(this.currentPrescription.clinical_detail_json.items));
                         let temp = this.currentPrescription;