|
@@ -1,13 +1,53 @@
|
|
|
<?php
|
|
|
+$fields = [
|
|
|
+ [
|
|
|
+ "Head:::Trauma",
|
|
|
+ "Eyes:::Blindness|Cataracts|Glaucoma|Wears glasses/contacts",
|
|
|
+ "Ears:::Hearing aids",
|
|
|
+ "Nose/Sinuses:::Allergic Rhinitis|Sinus infections",
|
|
|
+ "Mouth/Throat/Teeth:::Dentures",
|
|
|
+ "Cardiovascular:::Aneurysm|Angina|DVT|Dysrhythmia|HTN|Murmur|Myocardial infarction|Other heart disease",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "Respiratory:::Asthma|Bronchitis|COPD - Bronchitis/Emphysema|Pleuritis|Pneumonia",
|
|
|
+ "Gastrointestinal:::Cirrhosis|GERD|Gallbladder disease|Heartburn|Hemorrhoids|Hepatitis|Hiatal hernia|Jaundice|Ulcer",
|
|
|
+ "Genitourinary:::Hernia|Incontinence|Nephrolithiasis|Other kidney disease|STDs|UTI(s)",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "Musculoskeletal:::Arthritis|Gout|M/S injury",
|
|
|
+ "Skin:::Dermatitis|Mole(s)|Other skin condition(s)|Psoriasis",
|
|
|
+ "Neurological:::Epilepsy|Seizures|Severe headaches, migraines|Stroke|TIA",
|
|
|
+ "Psychiatric:::Bipolar disorder|Depression|Hallucinations, delusions|Suicidal ideation|Suicide attempts",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "Endocrine:::Goiter|Hyperlipidemia|Hypothyroidism|Thyroid disease|Thyroiditis|Type I DM|Type II DM",
|
|
|
+ "Heme/Onc:::Anemia|Cancer",
|
|
|
+ "Infectious:::HIV|STDs|Tuberculosis (dz)|Tuberculosis (exposure)",
|
|
|
+ ]
|
|
|
+];
|
|
|
+
|
|
|
$contentData = false;
|
|
|
if($section){
|
|
|
$contentData = json_decode($section->content_data, true);
|
|
|
}
|
|
|
-if(!$contentData || !isset($contentData['value'])) {
|
|
|
- $contentData = [
|
|
|
- 'value'=>''
|
|
|
- ];
|
|
|
+if(!$contentData) {
|
|
|
+ $contentData = [];
|
|
|
}
|
|
|
+for ($i = 0; $i < count($fields); $i++) {
|
|
|
+ for($j = 0; $j < count($fields[$i]); $j++) {
|
|
|
+ $parts = explode(":::", $fields[$i][$j]);
|
|
|
+ $head = 'custom';
|
|
|
+ if(!empty($parts[0])) $head = $parts[0];
|
|
|
+ $values = explode("|", $parts[1]);
|
|
|
+ for($k = 0; $k < count($values); $k++) {
|
|
|
+ $fName = $head . '_' . $values[$k];
|
|
|
+ if(!isset($contentData[$fName])) {
|
|
|
+ $contentData[$fName] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
$formID = rand(0, 100000);
|
|
|
?>
|
|
|
<form method="POST" action="/process_form_submit" onsubmit="return submitForm_NoteSection_{{ $formID }}(this);">
|
|
@@ -17,9 +57,45 @@ $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">
|
|
|
- <textarea rte type="text" class="form-control form-control-sm p-2" name="value" placeholder="Value"><?= $contentData['value'] ?></textarea>
|
|
|
+
|
|
|
+ <div class="row">
|
|
|
+ @for ($i = 0; $i < count($fields); $i++)
|
|
|
+ <div class="col-md-3">
|
|
|
+ @for($j = 0; $j < count($fields[$i]); $j++)
|
|
|
+ <?php
|
|
|
+ $parts = explode(":::", $fields[$i][$j]);
|
|
|
+ $head = 'custom';
|
|
|
+ if(!empty($parts[0])) $head = $parts[0];
|
|
|
+ $values = explode("|", $parts[1]);
|
|
|
+ ?>
|
|
|
+ <div class="mb-3">
|
|
|
+ @if($head !== 'custom')
|
|
|
+ <div class="font-weight-bold mb-2">{{ $head }}</div>
|
|
|
+ @endif
|
|
|
+ @for($k = 0; $k < count($values); $k++)
|
|
|
+ <?php
|
|
|
+ $fName = $head . '_' . $values[$k];
|
|
|
+ ?>
|
|
|
+ <label class="d-flex align-items-center mb-1">
|
|
|
+ <input type="checkbox" name="{{ $fName }}" {{ $contentData[$fName] ? 'checked' : '' }} class="m-0">
|
|
|
+ <span class="ml-2">{{ $values[$k] }}</span>
|
|
|
+ </label>
|
|
|
+ @endfor
|
|
|
+ </div>
|
|
|
+ @endfor
|
|
|
+ </div>
|
|
|
+ @endfor
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row mb-3">
|
|
|
+ <div class="col-12">
|
|
|
+ <textarea rte type="text" class="form-control form-control-sm p-2"
|
|
|
+ name="comments"
|
|
|
+ data-shortcuts="{{ $shortcuts }}"
|
|
|
+ placeholder="Value"><?= isset($contentData['comments']) ? $contentData['comments'] : '' ?></textarea>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
<div class="form-group m-0 d-flex">
|
|
|
<button class="btn btn-sm btn-primary mr-2">Submit</button>
|
|
|
<button class="btn btn-sm btn-default border" onclick="return cancelForm_NoteSection_{{ $formID }}(this)">Cancel</button>
|