Răsfoiți Sursa

Fix allergies section

Vijayakrishnan Krishnan 4 ani în urmă
părinte
comite
4f51cf0127

+ 16 - 0
storage/sections/allergies/form.blade.php

@@ -17,6 +17,22 @@ $formID = rand(0, 100000);
     <input type="hidden" name="note_uid" value="<?= $note->uid?>">
     <input type="hidden" name="section_template_uid" value="<?= $sectionTemplate->uid ?>">
     <?php endif; ?>
+
+    <div class="form-group mb-2">
+        <label class="d-flex align-items-center">
+            <input type="checkbox" class="my-0 mr-2" name="no_known_allergies" <?= $contentData['no_known_allergies'] ? 'checked' : '' ?>>
+            <span>No known allergies</span>
+        </label>
+        <label class="d-flex align-items-center">
+            <input type="checkbox" class="my-0 mr-2" name="no_known_medication_allergies" <?= $contentData['no_known_medication_allergies'] ? 'checked' : '' ?>>
+            <span>No known medication allergies</span>
+        </label>
+        <label class="d-flex align-items-center">
+            <input type="checkbox" class="my-0 mr-2" name="allergy_reconciliation_performed" <?= $contentData['allergy_reconciliation_performed'] ? 'checked' : '' ?>>
+            <span>Allergy reconciliation performed</span>
+        </label>
+    </div>
+
     <div class="form-group mb-2">
         <textarea rte type="text" class="form-control form-control-sm p-2" name="value" placeholder="Value"><?= $contentData['value'] ?></textarea>
     </div>

+ 3 - 0
storage/sections/allergies/processor.php

@@ -1,4 +1,7 @@
 <?php
 $newContentData = [
+    'no_known_allergies' => $request->get('no_known_allergies'),
+    'no_known_medication_allergies' => $request->get('no_known_medication_allergies'),
+    'allergy_reconciliation_performed' => $request->get('allergy_reconciliation_performed'),
     'value' => $request->get('value')
 ];

+ 3 - 0
storage/sections/allergies/summary.php

@@ -1 +1,4 @@
+<div class="font-weight-bold"><?= isset($newContentData['no_known_allergies']) && !empty($newContentData['no_known_allergies']) ? 'No known allergies' : '' ?></div>
+<div class="font-weight-bold"><?= isset($newContentData['no_known_medication_allergies']) && !empty($newContentData['no_known_medication_allergies']) ? 'No known medication allergies' : '' ?></div>
+<div class="font-weight-bold"><?= isset($newContentData['allergy_reconciliation_performed']) && !empty($newContentData['allergy_reconciliation_performed']) ? 'Allergy reconciliation performed' : '' ?></div>
 <div><?= $newContentData['value']; ?></div>