|
@@ -12,13 +12,23 @@ use \App\Models\Segment;
|
|
$interventions = Point::getPlanPointsOfCategory($patient, 'INTERVENTION', $note);
|
|
$interventions = Point::getPlanPointsOfCategory($patient, 'INTERVENTION', $note);
|
|
$intakeOrVisit = 'PLAN';
|
|
$intakeOrVisit = 'PLAN';
|
|
|
|
|
|
|
|
+$relevance = Point::where('added_in_segment_id', $segment->id)
|
|
|
|
+ ->where('category', 'INTERVENTIONS_RELEVANT_TO_NOTE')
|
|
|
|
+ ->orderBy('id', 'DESC')->first();
|
|
|
|
+if (!!@$relevance->data) {
|
|
|
|
+ $relevance = json_decode($relevance->data, true);
|
|
|
|
+}
|
|
|
|
+else {
|
|
|
|
+ $relevance = [];
|
|
|
|
+}
|
|
|
|
+
|
|
?>
|
|
?>
|
|
<div>
|
|
<div>
|
|
|
|
|
|
- <div class="d-flex mb-2">
|
|
|
|
- <table class="table table-sm table-bordered table-striped mb-0 bg-white">
|
|
|
|
|
|
+ <table class="table table-sm table-bordered table-striped mb-0 bg-white mb-2">
|
|
<thead>
|
|
<thead>
|
|
<tr class="">
|
|
<tr class="">
|
|
|
|
+ <th class="border-bottom-0 width-100px text-info">Relevant to<br>this visit</th>
|
|
<th class="border-bottom-0">Category</th>
|
|
<th class="border-bottom-0">Category</th>
|
|
<th class="border-bottom-0">Intervention</th>
|
|
<th class="border-bottom-0">Intervention</th>
|
|
<th class="border-bottom-0">Last Review</th>
|
|
<th class="border-bottom-0">Last Review</th>
|
|
@@ -30,6 +40,13 @@ $intakeOrVisit = 'PLAN';
|
|
<?php foreach($interventions as $intervention): ?>
|
|
<?php foreach($interventions as $intervention): ?>
|
|
<?php $point = $intervention; ?>
|
|
<?php $point = $intervention; ?>
|
|
<tr>
|
|
<tr>
|
|
|
|
+ <td>
|
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
|
+ <input type="checkbox" class="m-0 chk-relevance"
|
|
|
|
+ data-uid="{{$intervention->uid}}" {{in_array($intervention->uid, $relevance) ? 'checked' : ''}}>
|
|
|
|
+ <span> </span>
|
|
|
|
+ </div>
|
|
|
|
+ </td>
|
|
<td>
|
|
<td>
|
|
<?php if($previousCategory === $intervention->data->category): ?>
|
|
<?php if($previousCategory === $intervention->data->category): ?>
|
|
<span class="text-secondary"><?= $intervention->data->category ?></span>
|
|
<span class="text-secondary"><?= $intervention->data->category ?></span>
|
|
@@ -98,48 +115,90 @@ $intakeOrVisit = 'PLAN';
|
|
<?php $previousCategory = $intervention->data->category; ?>
|
|
<?php $previousCategory = $intervention->data->category; ?>
|
|
<?php endforeach; ?>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</table>
|
|
- </div>
|
|
|
|
|
|
|
|
- <div visit-moe class="mt-1">
|
|
|
|
- <a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add new intervention, added during this visit</a>
|
|
|
|
- <form url="/api/visitPoint/addTopLevelDuringVisit" class="mcp-theme-1">
|
|
|
|
- <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
|
- <input type="hidden" name="category" value="INTERVENTION">
|
|
|
|
- <input type="hidden" name="data">
|
|
|
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
|
+ <div visit-moe>
|
|
|
|
+ <form start show url="/api/visitPoint/upsertNoteSingleton" class="mcp-theme-1" id="<?= $segment->uid ?>-relevance-form">
|
|
|
|
+ <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
|
+ <input type="hidden" name="category" value="INTERVENTIONS_RELEVANT_TO_NOTE">
|
|
|
|
+ <input type="hidden" name="data">
|
|
|
|
+ <button submit class="btn btn-sm btn-info font-weight-bold">Save Relevance</button>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
|
|
+ <div visit-moe large class="ml-auto mt-1 max-width-500px">
|
|
|
|
+ <a href="#" start show class="btn btn-sm btn btn-outline-primary">+ Add new intervention, added during this visit</a>
|
|
|
|
+ <form url="/api/visitPoint/addTopLevelDuringVisit" class="mcp-theme-1" right>
|
|
|
|
+ <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
|
+ <input type="hidden" name="category" value="INTERVENTION">
|
|
|
|
+ <input type="hidden" name="data">
|
|
|
|
|
|
- <p class="mb-2"><b>Add Intervention (on intake)</b></p>
|
|
|
|
|
|
+ <p class="mb-2"><b>Add Intervention (on intake)</b></p>
|
|
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <label class="text-sm text-secondary mb-1">Name</label>
|
|
|
|
- <select type="text" data-name="category" class="form-control form-control-sm">
|
|
|
|
- <option value="">-- select --</option>
|
|
|
|
- <option value="Self-Monitoring">Self-Monitoring</option>
|
|
|
|
- <option value="Labs">Labs</option>
|
|
|
|
- <option value="Radiology / Imaging">Radiology / Imaging</option>
|
|
|
|
- <option value="Screenings">Screenings</option>
|
|
|
|
- <option value="Medication Rx">Medication Rx</option>
|
|
|
|
- <option value="Physical Therapy Rx">Physical Therapy Rx</option>
|
|
|
|
- <option value="Occupational Therapy Rx">Occupational Therapy Rx</option>
|
|
|
|
- <option value="Referral to Specialist / HCP">Referral to Specialist / HCP</option>
|
|
|
|
- <option value="Clinical Instructions / Other">Clinical Instructions / Other</option>
|
|
|
|
- <option value="SMS Reminders">SMS Reminders</option>
|
|
|
|
- <option value="Handouts / Education Provided">Handouts / Education Provided</option>
|
|
|
|
- </select>
|
|
|
|
- </div>
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <label class="text-sm text-secondary mb-1">Intervention</label>
|
|
|
|
- <input type="text" data-name="intervention" class="form-control form-control-sm">
|
|
|
|
- </div>
|
|
|
|
- <div class="mb-2">
|
|
|
|
- <label class="text-sm text-secondary mb-1">Description</label>
|
|
|
|
- <textarea type="text" data-name="description" class="form-control form-control-sm"></textarea>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Name</label>
|
|
|
|
+ <select type="text" data-name="category" class="form-control form-control-sm">
|
|
|
|
+ <option value="">-- select --</option>
|
|
|
|
+ <option value="Self-Monitoring">Self-Monitoring</option>
|
|
|
|
+ <option value="Labs">Labs</option>
|
|
|
|
+ <option value="Radiology / Imaging">Radiology / Imaging</option>
|
|
|
|
+ <option value="Screenings">Screenings</option>
|
|
|
|
+ <option value="Medication Rx">Medication Rx</option>
|
|
|
|
+ <option value="Physical Therapy Rx">Physical Therapy Rx</option>
|
|
|
|
+ <option value="Occupational Therapy Rx">Occupational Therapy Rx</option>
|
|
|
|
+ <option value="Referral to Specialist / HCP">Referral to Specialist / HCP</option>
|
|
|
|
+ <option value="Clinical Instructions / Other">Clinical Instructions / Other</option>
|
|
|
|
+ <option value="SMS Reminders">SMS Reminders</option>
|
|
|
|
+ <option value="Handouts / Education Provided">Handouts / Education Provided</option>
|
|
|
|
+ </select>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Intervention</label>
|
|
|
|
+ <input type="text" data-name="intervention" class="form-control form-control-sm">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mb-2">
|
|
|
|
+ <label class="text-sm text-secondary mb-1">Description</label>
|
|
|
|
+ <textarea type="text" data-name="description" class="form-control form-control-sm"></textarea>
|
|
|
|
+ </div>
|
|
|
|
|
|
- <div>
|
|
|
|
- <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
|
|
|
|
- <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
|
- </div>
|
|
|
|
- </form>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
|
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+<script>
|
|
|
|
+ window.segmentInitializers.<?= $segment->segmentTemplate->internal_name ?> = function () {
|
|
|
|
+ // any JS can come here
|
|
|
|
+ // will be run on page-load as well as whenever this segment is refreshed
|
|
|
|
+
|
|
|
|
+ let parentSegment = $('[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] ');
|
|
|
|
+
|
|
|
|
+ // relevance
|
|
|
|
+ $(document).off('change', '[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] .chk-relevance');
|
|
|
|
+ $(document).on('change', '[data-segment-template-name="<?= $segment->segmentTemplate->internal_name ?>"] .chk-relevance', function () {
|
|
|
|
+ let uids = $('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val();
|
|
|
|
+ if(!!uids) {
|
|
|
|
+ uids = JSON.parse(uids);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ uids = [];
|
|
|
|
+ }
|
|
|
|
+ let uid = $(this).attr('data-uid'), found = uids.indexOf(uid) > -1;
|
|
|
|
+ if(this.checked === found) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if(this.checked) {
|
|
|
|
+ uids.push(uid);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ uids = uids.filter(_x => _x !== uid);
|
|
|
|
+ }
|
|
|
|
+ $('#<?= $segment->uid ?>-relevance-form').find('[name="data"]').val(JSON.stringify(uids));
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ };
|
|
|
|
+</script>
|