|
@@ -0,0 +1,204 @@
|
|
|
|
+<div class="note-rhs-sidebar screen-only" id="note-rhs-sidebar">
|
|
|
|
+
|
|
|
|
+ <?php
|
|
|
|
+ $cmStartDate = date('Y-m-01', strtotime($note->effective_dateest));
|
|
|
|
+ $careMonth = \App\Models\CareMonth::where('client_id', $patient->id)->where('start_date', $cmStartDate)->first();
|
|
|
|
+ ?>
|
|
|
|
+ <div id="recent-measurements"
|
|
|
|
+ class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold">
|
|
|
|
+ Recent Measurements
|
|
|
|
+ </div>
|
|
|
|
+ <?php
|
|
|
|
+ $date = date('Y-m-d');
|
|
|
|
+ $end = strtotime($date);
|
|
|
|
+ $start = date_sub(date_create($date), date_interval_create_from_date_string("12 days"))->getTimestamp();
|
|
|
|
+ $start *= 1000;
|
|
|
|
+ $end *= 1000;
|
|
|
|
+ $recentMeasurements = \App\Models\Measurement
|
|
|
|
+ ::where('client_id', $patient->id)
|
|
|
|
+ ->whereRaw("(is_removed IS NULL OR is_removed = FALSE)")
|
|
|
|
+ ->whereNotNull('ts')
|
|
|
|
+ ->whereRaw("(is_cellular_zero IS NULL OR is_cellular_zero = FALSE)")
|
|
|
|
+ ->whereRaw("(label = 'BP' OR label = 'Wt. (lbs.)')")
|
|
|
|
+ ->where('ts', '>=', $start)
|
|
|
|
+ ->where('ts', '<=', $end)
|
|
|
|
+ ->orderBy('ts', 'desc')
|
|
|
|
+ ->skip(0)
|
|
|
|
+ ->take(10)
|
|
|
|
+ ->get();
|
|
|
|
+ ?>
|
|
|
|
+ @if($recentMeasurements && count($recentMeasurements))
|
|
|
|
+ <div class="pt-2">
|
|
|
|
+ @foreach($recentMeasurements as $m)
|
|
|
|
+ @if($m->label === 'BP')
|
|
|
|
+ <div class="text-sm text-nowrap">BP: {{round($m->sbp_mm_hg)}}/{{round($m->dbp_mm_hg)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
|
|
|
|
+ @elseif($m->label === 'Wt. (lbs.)')
|
|
|
|
+ <div class="text-sm text-nowrap">Wt: {{round($m->value, 1)}} ({{date('m/d/Y', $m->ts/1000)}})</div>
|
|
|
|
+ @endif
|
|
|
|
+ @endforeach
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <?php
|
|
|
|
+ $allergies = \App\Models\Point::getPointsOfCategory($patient, "ALLERGY");
|
|
|
|
+ $medications = \App\Models\Point::getPointsOfCategory($patient, "MEDICATION");
|
|
|
|
+ $supplements = \App\Models\Point::getPointsOfCategory($patient, "SUPPLEMENT");
|
|
|
|
+ $problems = \App\Models\Point::getPointsOfCategory($patient, "PROBLEM");
|
|
|
|
+ $goals = \App\Models\Point::getPointsOfCategory($patient, "GOAL");
|
|
|
|
+ $prescriptions = $patient->prescriptionsCreatedInNote($note);
|
|
|
|
+ $tracker = \App\Models\Point::getGlobalSingletonOfCategory($patient, 'NO_KNOWN_TRACKER');
|
|
|
|
+ ?>
|
|
|
|
+ <div id="active-allergies"
|
|
|
|
+ class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold mb-2">
|
|
|
|
+ Allergies
|
|
|
|
+ <i class="fa fa-bolt text-primary ml-1"></i>
|
|
|
|
+ </div>
|
|
|
|
+ @if($tracker && @($tracker->data->no_known_drug_allergies))
|
|
|
|
+ <div class="text-secondary mb-2"><span>No Known Drug Allergies</span></div>
|
|
|
|
+ @endif
|
|
|
|
+ @if($tracker && @($tracker->data->no_known_allergies_of_any_type))
|
|
|
|
+ <div class="text-secondary mb-2"><span>No Known Allergies of Any Type</span></div>
|
|
|
|
+ @endif
|
|
|
|
+ @if(!$tracker || !@($tracker->data->no_known_allergies_of_any_type))
|
|
|
|
+ @if($allergies && count($allergies))
|
|
|
|
+ @foreach($allergies as $allergy)
|
|
|
|
+ <?php $rel = $allergy->relevanceToNote($note); ?>
|
|
|
|
+ <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
|
|
|
|
+ <span class="mr-1">•</span>
|
|
|
|
+ <span>{{$allergy->data->name}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ @endforeach
|
|
|
|
+ @else
|
|
|
|
+ <span class="px-1 text-secondary">-</span>
|
|
|
|
+ @endif
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ <div id="active-medications"
|
|
|
|
+ class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold mb-2">
|
|
|
|
+ Medications
|
|
|
|
+ <i class="fa fa-bolt text-primary ml-1"></i>
|
|
|
|
+ </div>
|
|
|
|
+ @if($tracker && @($tracker->data->no_known_medications))
|
|
|
|
+ <div class="text-secondary mb-2"><span>-</span></div>
|
|
|
|
+ @endif
|
|
|
|
+ @if(!$tracker || !@($tracker->data->no_known_medications))
|
|
|
|
+ @if($medications && count($medications))
|
|
|
|
+ @foreach($medications as $medication)
|
|
|
|
+ <?php $rel = $medication->relevanceToNote($note); ?>
|
|
|
|
+ <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
|
|
|
|
+ <span class="mr-1">•</span>
|
|
|
|
+ <span>{{$medication->data->name}}
|
|
|
|
+ <?php
|
|
|
|
+ if($medication->lastChildReview) {
|
|
|
|
+ $review = json_decode($medication->lastChildReview->data);
|
|
|
|
+ if(isset($review->value) && isset($review->experience)) {
|
|
|
|
+ ?>
|
|
|
|
+ <span class="text-dark text-sm ml-1">({{$review->value}})</span>
|
|
|
|
+ <?php
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ @endforeach
|
|
|
|
+ @else
|
|
|
|
+ <span class="px-1 text-secondary">-</span>
|
|
|
|
+ @endif
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ <div id="active-problems"
|
|
|
|
+ class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold mb-2">
|
|
|
|
+ Problems
|
|
|
|
+ <i class="fa fa-bolt text-primary ml-1"></i>
|
|
|
|
+ </div>
|
|
|
|
+ @if($problems && count($problems))
|
|
|
|
+ <div class="dx-items">
|
|
|
|
+ @foreach($problems as $problem)
|
|
|
|
+ <?php $rel = $problem->relevanceToNote($note); ?>
|
|
|
|
+ <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
|
|
|
|
+ <span class="mr-1">•</span>
|
|
|
|
+ <span class="dx-data font-underline c-pointer on-hover-aliceblue">
|
|
|
|
+ <span class="dx-data-description">{{$problem->data->name}}</span>
|
|
|
|
+ <span class="dx-data-code">{{$problem->data->icd}}</span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ @endforeach
|
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
|
+ <button class="btn btn-sm btn-primary mt-2 dx-add-all text-sm">Apply</button>
|
|
|
|
+ <button class="btn btn-sm btn-primary mt-2 dx-add-all text-sm ml-2" save>Apply & Save</button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ @else
|
|
|
|
+ <span class="px-1 text-secondary">-</span>
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ <div id="active-goals"
|
|
|
|
+ class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold mb-2">
|
|
|
|
+ Goals
|
|
|
|
+ <i class="fa fa-bolt text-primary ml-1"></i>
|
|
|
|
+ </div>
|
|
|
|
+ @if($goals && count($goals))
|
|
|
|
+ @foreach($goals as $goal)
|
|
|
|
+ <?php $rel = $goal->relevanceToNote($note); ?>
|
|
|
|
+ <div class="d-inline-flex align-items-baseline px-1 {{$rel ? 'bg-warning-mellow' : ''}}">
|
|
|
|
+ <span class="mr-1">•</span>
|
|
|
|
+ <span>{{$goal->data->goal}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ @endforeach
|
|
|
|
+ @else
|
|
|
|
+ <span class="px-1 text-secondary">-</span>
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+ <div id="active-careteam"
|
|
|
|
+ class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold">
|
|
|
|
+ Care Team
|
|
|
|
+ <i class="fa fa-external-link-alt text-primary ml-1"></i>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div id="note-prescriptions" class="p-2 border-bottom ">
|
|
|
|
+ <div class="font-weight-bold">
|
|
|
|
+ ERx & Orders
|
|
|
|
+ </div>
|
|
|
|
+ @if($prescriptions && count($prescriptions))
|
|
|
|
+ @foreach($prescriptions as $prescription)
|
|
|
|
+ <div class="d-flex align-items-baseline px-1 pt-2">
|
|
|
|
+ <span class="mr-2 text-secondary text-sm font-weight-bold">{{$prescription->erx_category}}</span>
|
|
|
|
+ <?php $parsed = json_decode($prescription->clinical_detail_json) ?>
|
|
|
|
+ <span class="flex-grow-1">
|
|
|
|
+ <?php
|
|
|
|
+ switch($prescription->erx_category) {
|
|
|
|
+ case 'DRUG':
|
|
|
|
+ if(@$parsed && @$parsed->items) {
|
|
|
|
+ foreach ($parsed->items as $item) {
|
|
|
|
+ echo '<div>' . $item->medication . '</div>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case 'LAB':
|
|
|
|
+ case 'IMAGING':
|
|
|
|
+ if(@$parsed && @$parsed->items) {
|
|
|
|
+ foreach ($parsed->items as $item) {
|
|
|
|
+ if(@$item->tests) {
|
|
|
|
+ foreach ($item->tests as $test) {
|
|
|
|
+ echo '<div>' . $test->desc . '</div>';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ @endforeach
|
|
|
|
+ @endif
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+</div>
|