|
@@ -93,7 +93,7 @@
|
|
|
</a>
|
|
|
<div>
|
|
|
<div>
|
|
|
- <span class="text-dark font-weight-bold">Care Month</span> for <span class="text-dark font-weight-bold">{{friendly_month($careMonth->start_date)}}</span>
|
|
|
+ <span class="text-dark font-weight-bold font-size-14">Care Month</span> for <span class="text-dark font-weight-bold">{{friendly_month($careMonth->start_date)}}</span>
|
|
|
</div>
|
|
|
{{--@if(!$careMonth->is_tm_this_month)
|
|
|
<div moe class="mt-2">
|
|
@@ -341,83 +341,71 @@
|
|
|
</div>
|
|
|
@endif
|
|
|
</div>
|
|
|
+ <div class="row mb-3 d-none">
|
|
|
+ <div class="col-9">
|
|
|
+ <div id="caremonth-measurements-calendar">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-3">Stats</div>
|
|
|
+ </div>
|
|
|
<table class="table table-striped table-sm table-bordered mt-2 mb-0">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th class="px-2 text-secondary">Created</th>
|
|
|
+ <th class="px-2 text-secondary">Effective Date</th>
|
|
|
<th class="px-2 text-secondary w-25">Category</th>
|
|
|
<th class="px-2 text-secondary w-25">Value</th>
|
|
|
- <th class="px-2 text-secondary">Status</th>
|
|
|
- <th class="px-2 text-secondary">Memo</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- @php $measurementsInCareMonth = $patient->measurementsInCareMonth($careMonth); @endphp
|
|
|
+ @php
|
|
|
+ $measurementsInCareMonth = $patient->measurementsInCareMonth($careMonth);
|
|
|
+ $plottableMeasurements = [];
|
|
|
+ @endphp
|
|
|
@foreach($measurementsInCareMonth as $measurement)
|
|
|
- @if(1 || !empty($measurement->label) && !in_array($measurement->label, $vitalLabels))
|
|
|
+ @if(!empty($measurement->label) && !in_array($measurement->label, ["SBP", "DBP"]) && !$measurement->is_cellular_zero)
|
|
|
<tr>
|
|
|
- <td class="px-2">{{ friendly_date_time($measurement->created_at) }}</td>
|
|
|
+ <td class="px-2">
|
|
|
+ @if($measurement->ts)
|
|
|
+ <?php $timestampInSec = floor($measurement->ts/1000); ?>
|
|
|
+ {{ friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN') }}
|
|
|
+ @else
|
|
|
+ {{ friendly_date_time_short_with_tz($measurement->effective_date, true, 'EASTERN') }}
|
|
|
+ @endif
|
|
|
+ EST
|
|
|
+ </td>
|
|
|
<td class="px-2">{{ $measurement->label }}</td>
|
|
|
<td class="px-2">
|
|
|
- @if(empty($measurement->client_bdt_measurement_id))
|
|
|
- {{ $measurement->value }}
|
|
|
+ @if($measurement->is_cellular_zero)
|
|
|
+ <i class="font-size-11 fa fa-rss"></i>
|
|
|
+ @elseif($measurement->label === 'BP')
|
|
|
+ {{ $measurement->sbp_mm_hg }}/{{ $measurement->dbp_mm_hg }} mmHg
|
|
|
+ @elseif($measurement->label === 'Wt. (lbs.)')
|
|
|
+ {{ round(floatval($measurement->numeric_value), 2) }} lbs
|
|
|
@else
|
|
|
- @if($measurement->label === 'BP')
|
|
|
- {{ $measurement->clientBDTMeasurement->measurement->systolic_bp_in_mm_hg }}/{{ $measurement->clientBDTMeasurement->measurement->diastolic_bp_in_mm_hg }} mmHg
|
|
|
- @elseif($measurement->label === 'SBP')
|
|
|
- {{ $measurement->clientBDTMeasurement->measurement->systolic_bp_in_mm_hg }} mmHg
|
|
|
- @elseif($measurement->label === 'DBP')
|
|
|
- {{ $measurement->clientBDTMeasurement->measurement->diastolic_bp_in_mm_hg }} mmHg
|
|
|
- @elseif($measurement->label === 'Wt. (lbs.)')
|
|
|
- {{ $measurement->clientBDTMeasurement->measurement->weight_in_pounds }} lbs
|
|
|
- @endif
|
|
|
+ {{ $measurement->value }}
|
|
|
@endif
|
|
|
</td>
|
|
|
- <td></td>
|
|
|
- <td></td>
|
|
|
-
|
|
|
- {{--<td class="text-black p-0 border-0">
|
|
|
- <div class="d-flex align-items-center">
|
|
|
- <div moe relative class="mr-2">
|
|
|
- <a class="on-hover-opaque" start show title="Delete">
|
|
|
- <i class="font-size-11 fa fa-trash-alt text-danger"></i>
|
|
|
- </a>
|
|
|
- <form url="/api/measurement/remove">
|
|
|
- <input type="hidden" name="uid" value="{{ $measurement->uid }}">
|
|
|
- <p class="small min-width-200px">Are you sure you want to delete this entry?</p>
|
|
|
- <div class="d-flex align-items-center">
|
|
|
- <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
|
|
|
- <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- <div moe class="mr-2">
|
|
|
- <a class="on-hover-opaque" start show title="Update">
|
|
|
- <i class="font-size-11 fa fa-edit text-primary"></i>
|
|
|
- </a>
|
|
|
- <form url="/api/measurement/create">
|
|
|
- <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
|
|
|
- <div class="mb-2">
|
|
|
- <input type="text" class="form-control form-control-sm" name="label" value="{{ $measurement->label }}" placeholder="Type">
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <input autofocus type="text" class="form-control form-control-sm" name="value" value="{{ $measurement->value }}" placeholder="Value">
|
|
|
- </div>
|
|
|
- <div class="mb-2">
|
|
|
- <input type="date" class="form-control form-control-sm" name="effectiveDate" max="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}">
|
|
|
- </div>
|
|
|
- <div class="d-flex align-items-center">
|
|
|
- <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
|
|
|
- <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- <span>{{ $measurement->label }}:</span>
|
|
|
- <span class="font-weight-bold ml-1">{{ $measurement->value }}</span>
|
|
|
- <span class="font-weight-normal text-secondary ml-2 text-sm">(as on {{ friendly_date_time($measurement->effective_date, false) }})</span>
|
|
|
- </div>
|
|
|
- </td>--}}
|
|
|
</tr>
|
|
|
+
|
|
|
+ <?php
|
|
|
+ if ($measurement->ts) {
|
|
|
+ $timestampInSec = floor($measurement->ts / 1000);
|
|
|
+ $measurement->start = postgres_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN');
|
|
|
+ } else {
|
|
|
+ $measurement->start = postgres_date_time_short_with_tz($measurement->effective_date, true, 'EASTERN');
|
|
|
+ }
|
|
|
+ $measurement->title = '';
|
|
|
+ if ($measurement->label === 'BP') {
|
|
|
+ $measurement->title .= 'BP ' . $measurement->sbp_mm_hg . '/' . $measurement->dbp_mm_hg . ' mmHg';
|
|
|
+ } elseif ($measurement->label === 'Wt. (lbs.)') {
|
|
|
+ $measurement->title .= 'Weight ' . round(floatval($measurement->numeric_value), 2) . ' lbs';
|
|
|
+ } else {
|
|
|
+ $measurement->title .= $measurement->value;
|
|
|
+ }
|
|
|
+ $plottableMeasurements[] = $measurement;
|
|
|
+ ?>
|
|
|
+
|
|
|
@endif
|
|
|
@endforeach
|
|
|
@if(!$patient->measurements || !count($patient->measurements) === 0)
|
|
@@ -1285,6 +1273,8 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
+ <link href='/fullcalendar-5.3.2/lib/main.css' rel='stylesheet' />
|
|
|
+ <script src='/fullcalendar-5.3.2/lib/main.js'></script>
|
|
|
<script>
|
|
|
(function() {
|
|
|
function init() {
|
|
@@ -1326,7 +1316,42 @@
|
|
|
.attr('data-editor-id', editorID)
|
|
|
.attr('with-shortcuts', 1);
|
|
|
|
|
|
- })
|
|
|
+ });
|
|
|
+
|
|
|
+ // init calendar view
|
|
|
+ @if(count($plottableMeasurements))
|
|
|
+ $('#caremonth-measurements-calendar').closest('.d-none').removeClass('d-none');
|
|
|
+ let measurementsCalendar = new FullCalendar.Calendar($('#caremonth-measurements-calendar')[0], {
|
|
|
+ headerToolbar: false,
|
|
|
+ initialView: 'dayGridMonth',
|
|
|
+ initialDate: '{{ date('Y-m-d', strtotime($careMonth->created_at)) }}',
|
|
|
+ navLinks: false,
|
|
|
+ dayMaxEvents: false,
|
|
|
+ slotMinTime: '00:00',
|
|
|
+ slotMaxTime: '23:59',
|
|
|
+ scrollTime: '06:00:00',
|
|
|
+ slotDuration: '00:15:00',
|
|
|
+ events: function(info, successCallback, failureCallback) {
|
|
|
+ successCallback({!! json_encode($plottableMeasurements) !!});
|
|
|
+ },
|
|
|
+ eventClassNames: function(arg) {
|
|
|
+ let classes = [];
|
|
|
+ if (arg.event.extendedProps.label === 'Wt. (lbs.)') {
|
|
|
+ classes.push('m-weight');
|
|
|
+ }
|
|
|
+ if (arg.event.extendedProps.label === 'BP') {
|
|
|
+ classes.push('m-bp');
|
|
|
+ }
|
|
|
+ return classes;
|
|
|
+ },
|
|
|
+ eventClick: function(info) {
|
|
|
+ // self.selectedEvent = info.event;
|
|
|
+ // self.showEditAppointmentModal();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ measurementsCalendar.render();
|
|
|
+
|
|
|
+ @endif
|
|
|
}
|
|
|
|
|
|
addMCInitializer('care-month-dashboard', init, '#care-month-container');
|