|
@@ -1,12 +1,68 @@
|
|
|
<?php
|
|
|
+$commonFields = [
|
|
|
+ [
|
|
|
+ ":::Aneurysm repair|Appendectomy|Back surgery|Bariatric surgery/gastric bypass|Bilateral tubal ligation|Breast resection/mastectomy|CABG|Carotid endarterectomy/stent|Carpal tunnel release surgery",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ ":::Cataract/lens surgery|Cesarean section|Cholecystectomy/bile duct surgery|Dilation and curettage|Hemorrhoid surgery|Hip arthroplasty|Hip replacement|Hysterectomy|Inguinal hernia repair",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ ":::Knee arthroplasty|LASIK|Laminectomy|Nasal surgery|PTCA/PCI|Pacemaker/defibrillator|Prostate surgery|Prostatectomy|Rotator cuff surgery",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ ":::Sinus surgery|Skin cancer excision|Spinal fusion|TAH-BSO|TURP|Tonsillectomy/Adenoidectomy|Vasectomy",
|
|
|
+ ]
|
|
|
+];
|
|
|
+
|
|
|
+$customFields = [
|
|
|
+ [
|
|
|
+ ":::Bladder surgery/repair posts|Cardiac catheterization|Cardiac Stent Placement",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ ":::IVC filter/stent|Knee Replacement|Lumpectomy",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ ":::Multiple heart stents|Oral surgery|Rt elbow ulnar repair",
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ ":::Rt Nephrectomy|Thyroidectomy|Valve replacement with stent",
|
|
|
+ ]
|
|
|
+];
|
|
|
+
|
|
|
$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($commonFields); $i++) {
|
|
|
+ for($j = 0; $j < count($commonFields[$i]); $j++) {
|
|
|
+ $parts = explode(":::", $commonFields[$i][$j]);
|
|
|
+ $head = 'common';
|
|
|
+ if(!empty($parts[0])) $head = $parts[0];
|
|
|
+ $values = explode("|", $parts[1]);
|
|
|
+ for($k = 0; $k < count($values); $k++) {
|
|
|
+ $fName = $head . '_' . sanitize_field_name($values[$k]);
|
|
|
+ if(!isset($contentData[$fName])) {
|
|
|
+ $contentData[$fName] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+for ($i = 0; $i < count($customFields); $i++) {
|
|
|
+ for($j = 0; $j < count($customFields[$i]); $j++) {
|
|
|
+ $parts = explode(":::", $customFields[$i][$j]);
|
|
|
+ $head = 'custom';
|
|
|
+ if(!empty($parts[0])) $head = $parts[0];
|
|
|
+ $values = explode("|", $parts[1]);
|
|
|
+ for($k = 0; $k < count($values); $k++) {
|
|
|
+ $fName = $head . '_' . sanitize_field_name($values[$k]);
|
|
|
+ if(!isset($contentData[$fName])) {
|
|
|
+ $contentData[$fName] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
$formID = rand(0, 100000);
|
|
|
?>
|
|
@@ -17,9 +73,78 @@ $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="font-weight-bold mb-2">Common Surgeries</div>
|
|
|
+
|
|
|
+ <div class="row">
|
|
|
+ @for ($i = 0; $i < count($commonFields); $i++)
|
|
|
+ <div class="col-md-3">
|
|
|
+ @for($j = 0; $j < count($commonFields[$i]); $j++)
|
|
|
+ <?php
|
|
|
+ $parts = explode(":::", $commonFields[$i][$j]);
|
|
|
+ $head = 'common';
|
|
|
+ if(!empty($parts[0])) $head = $parts[0];
|
|
|
+ $values = explode("|", $parts[1]);
|
|
|
+ ?>
|
|
|
+ <div class="mb-3">
|
|
|
+ @if($head !== 'common')
|
|
|
+ <div class="font-weight-bold mb-2">{{ $head }}</div>
|
|
|
+ @endif
|
|
|
+ @for($k = 0; $k < count($values); $k++)
|
|
|
+ <?php
|
|
|
+ $fName = $head . '_' . sanitize_field_name($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="font-weight-bold mb-2">Custom Items</div>
|
|
|
+
|
|
|
+ <div class="row">
|
|
|
+ @for ($i = 0; $i < count($customFields); $i++)
|
|
|
+ <div class="col-md-3">
|
|
|
+ @for($j = 0; $j < count($customFields[$i]); $j++)
|
|
|
+ <?php
|
|
|
+ $parts = explode(":::", $customFields[$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 . '_' . sanitize_field_name($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>
|