|
@@ -3,9 +3,10 @@
|
|
|
<table class="table table-sm table-bordered mt-2 mb-0">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th class="px-1 text-nowrap"><b>Date & Time</b></th>
|
|
|
+ <th class="px-1 text-nowrap"><b>Date</b></th>
|
|
|
<th class="px-1"><b>Measurement</b></th>
|
|
|
<th class="px-1"><b>Type</b></th>
|
|
|
+ <th class="px-1"><b>Time</b></th>
|
|
|
<th class="px-1"><b>Interaction</b></th>
|
|
|
<th class="px-4 w-100"><b>Comments</b></th>
|
|
|
</tr>
|
|
@@ -14,106 +15,244 @@
|
|
|
@php
|
|
|
$measurementsInCareMonth = $patient->measurementsInCareMonth($careMonth);
|
|
|
$plottableMeasurements = [];
|
|
|
+
|
|
|
+ $printableMeasurements = [];
|
|
|
+
|
|
|
+ foreach($measurementsInCareMonth as $measurement){
|
|
|
+ if($measurementType && stripos($measurement->label, $measurementType) === false ){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!empty($measurement->label) && !in_array($measurement->label, ['SBP', 'DBP']) && !$measurement->is_cellular_zero){
|
|
|
+
|
|
|
+ $date = friendly_date($measurement->effective_date, true, 'EASTERN');
|
|
|
+ if(!isset($printableMeasurements[$date])){
|
|
|
+ $printableMeasurements[$date] = [
|
|
|
+ 'measurements' => [],
|
|
|
+ 'times' => [],
|
|
|
+ 'types' => [],
|
|
|
+ 'interaction' => '',
|
|
|
+ 'notes' => []
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ $value = null;
|
|
|
+ $type = null;
|
|
|
+ $time = null;
|
|
|
+
|
|
|
+ if ($measurement->ts){
|
|
|
+ $timestampInSec = floor($measurement->ts / 1000);
|
|
|
+ $time = friendly_date_time_short_with_tz_from_timestamp($timestampInSec, 'EASTERN');
|
|
|
+ }else{
|
|
|
+ $time = friendly_date_time_short_with_tz($measurement->effective_date, true, 'EASTERN');
|
|
|
+ }
|
|
|
+
|
|
|
+ $time = friendly_time($time);
|
|
|
+
|
|
|
+ if ($measurement->is_cellular_zero){
|
|
|
+ $value = '<i class="font-size-11 fa fa-rss"></i>';
|
|
|
+ }elseif($measurement->label === 'BP'){
|
|
|
+ $value = $measurement->sbp_mm_hg. '/'.$measurement->dbp_mm_hg .'mmHg';
|
|
|
+ $type = 'BP';
|
|
|
+ }elseif($measurement->label === 'Wt. (lbs.)'){
|
|
|
+ $value = round(floatval($measurement->numeric_value), 2). 'lbs';
|
|
|
+ $type = 'Weight';
|
|
|
+ }else {
|
|
|
+ $value = $measurement->value;
|
|
|
+ }
|
|
|
+
|
|
|
+ $printableMeasurements[$date]['values'][] = $value;
|
|
|
+ $printableMeasurements[$date]['types'][] = $type;
|
|
|
+ $printableMeasurements[$date]['times'][] = $time;
|
|
|
+
|
|
|
+ $notes = [];
|
|
|
+ foreach($careMonth->entries as $entry){
|
|
|
+ if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date)){
|
|
|
+ $note = [];
|
|
|
+ $note['content'] = $entry->content_text;
|
|
|
+ $note['duration'] = $entry->time_in_seconds/60;
|
|
|
+ $note['timestamp'] = friendly_date_time($entry->created_at);
|
|
|
+ if($entry->pro){
|
|
|
+ if($entry->pro->is_hcp){
|
|
|
+ $note['author'] = $entry->pro->displayName();
|
|
|
+ }else{
|
|
|
+ $note['author'] = 'Medical Staff';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $notes[] = $note;
|
|
|
+ }
|
|
|
+
|
|
|
+ $printableMeasurements[$date]['notes'] = $notes;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ $interaction = null;
|
|
|
+ //$found = false;
|
|
|
+ foreach($careMonth->entries as $entry){
|
|
|
+ if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date) && $entry->did_pro_interact_with_client_about_rm ){
|
|
|
+ if(str_contains($entry->content_text, 'text')){
|
|
|
+ $interaction = 'Text';
|
|
|
+ }else{
|
|
|
+ $interaction = 'Audio call';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $printableMeasurements[$date]['interaction'] = $interaction;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@endphp
|
|
|
- @foreach ($measurementsInCareMonth as $measurement)
|
|
|
- @if($measurementType && stripos($measurement->label, $measurementType) === false )
|
|
|
- @continue
|
|
|
- @endif
|
|
|
- @if (!empty($measurement->label) && !in_array($measurement->label, ['SBP', 'DBP']) && !$measurement->is_cellular_zero)
|
|
|
- <tr>
|
|
|
- <td class="px-2 text-nowrap">
|
|
|
- @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-1 text-nowrap">
|
|
|
+
|
|
|
+
|
|
|
+ @foreach ($printableMeasurements as $date => $measurement)
|
|
|
+ <tr>
|
|
|
+ <td class="px-2 text-nowrap">
|
|
|
+ {{$date}}
|
|
|
+ EST
|
|
|
+ </td>
|
|
|
+ <td class="px-1 text-nowrap">
|
|
|
+ @foreach($measurement['values'] as $value)
|
|
|
<div class="text-nowrap">
|
|
|
- @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
|
|
|
- {{ $measurement->value }}
|
|
|
- @endif
|
|
|
+ {{$value}}
|
|
|
</div>
|
|
|
- </td>
|
|
|
- <td class="px-1 text-nowrap">{{ $measurement->label }}</td>
|
|
|
- <td class="text-nowrap">
|
|
|
- <div class="">
|
|
|
- @php $found = false; @endphp
|
|
|
- @foreach($careMonth->entries as $entry)
|
|
|
- @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date) && $entry->did_pro_interact_with_client_about_rm && !$found)
|
|
|
- @php $found = true; @endphp
|
|
|
- @if(str_contains($entry->content_text, 'text'))
|
|
|
- Text
|
|
|
- @else
|
|
|
- Audio call
|
|
|
- @endif
|
|
|
- @endif
|
|
|
- @endforeach
|
|
|
+ @endforeach
|
|
|
+ </td>
|
|
|
+ <td class="px-1 text-nowrap">
|
|
|
+ @foreach($measurement['types'] as $type)
|
|
|
+ <div class="text-nowrap">
|
|
|
+ {{$type}}
|
|
|
</div>
|
|
|
- </td>
|
|
|
- {{-- <td colspan="px-2">--}}
|
|
|
- {{-- <?php--}}
|
|
|
- {{-- $stamps = ['has_been_stamped_by_mcp', 'has_been_stamped_by_non_hcp', 'has_been_stamped_by_rme', 'has_been_stamped_by_rmm'];--}}
|
|
|
- {{-- $isStamped = false;--}}
|
|
|
- {{-- foreach ($stamps as $stamp) {--}}
|
|
|
- {{-- if ($measurement->{$stamp}) {--}}
|
|
|
- {{-- $isStamped = true;--}}
|
|
|
- {{-- }--}}
|
|
|
- {{-- }--}}
|
|
|
- {{-- ?>--}}
|
|
|
- {{-- @if ($isStamped)--}}
|
|
|
- {{-- ✓--}}
|
|
|
- {{-- @endif--}}
|
|
|
- {{-- </td>--}}
|
|
|
- @php $rowSpan = 0 @endphp
|
|
|
- @foreach($careMonth->entries() as $entry)
|
|
|
- @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date))
|
|
|
- @php $rowSpan = $rowSpan + 1; @endphp
|
|
|
- @endif
|
|
|
@endforeach
|
|
|
- <td class="px-4">
|
|
|
- <div class="">
|
|
|
- @foreach($careMonth->entries as $entry)
|
|
|
- @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date))
|
|
|
- <div class="d-flex align-items-start">
|
|
|
- <span class="mr-2">{{$entry->time_in_seconds/60}}m: </span>
|
|
|
- <div>{!! $entry->content_text !!}</div>
|
|
|
- </div>
|
|
|
- <div class="d-flex justify-content-end ">
|
|
|
- <div class="mr-1">
|
|
|
- <b>
|
|
|
- @if($entry->pro)
|
|
|
- @if($entry->pro->is_hcp)
|
|
|
- {{$entry->pro->displayName()}}
|
|
|
- @else
|
|
|
- Medical Staff
|
|
|
- @endif
|
|
|
- @endif
|
|
|
- </b>
|
|
|
- </div>
|
|
|
- <div>{{friendly_date_time($entry->created_at)}}</div>
|
|
|
- </div>
|
|
|
- @endif
|
|
|
- @endforeach
|
|
|
+ </td>
|
|
|
+ <td class="px-1 text-nowrap">
|
|
|
+ @foreach($measurement['times'] as $time)
|
|
|
+ <div class="text-nowrap">
|
|
|
+ {{$time}}
|
|
|
</div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- @endif
|
|
|
- @endforeach
|
|
|
- @if (!$patient->measurements || !count($patient->measurements) === 0)
|
|
|
- <tr>
|
|
|
- <td class="text-secondary p-0 border-0">
|
|
|
- No items to show
|
|
|
+ @endforeach
|
|
|
+ </td>
|
|
|
+ <td class="text-nowrap">
|
|
|
+ <div class="">
|
|
|
+ {{$measurement['interaction']}}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td class="px-4">
|
|
|
+ <div class="">
|
|
|
+ @foreach($measurement['notes'] as $note)
|
|
|
+
|
|
|
+ <div class="d-flex align-items-start">
|
|
|
+ <span class="mr-2">{{$note['duration']}}m: </span>
|
|
|
+ <div>{!! $note['content'] !!}</div>
|
|
|
+ </div>
|
|
|
+ <div class="d-flex justify-content-end ">
|
|
|
+ <div class="mr-1">
|
|
|
+ <b>
|
|
|
+ {{$note['author']}}
|
|
|
+ </b>
|
|
|
+ </div>
|
|
|
+ <div>{{$note['timestamp']}}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ @endforeach
|
|
|
+ </div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- @endif
|
|
|
+ @endforeach
|
|
|
+
|
|
|
+
|
|
|
+{{-- @foreach ($measurementsInCareMonth as $measurement)--}}
|
|
|
+{{-- @if($measurementType && stripos($measurement->label, $measurementType) === false )--}}
|
|
|
+{{-- @continue--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- @if (!empty($measurement->label) && !in_array($measurement->label, ['SBP', 'DBP']) && !$measurement->is_cellular_zero)--}}
|
|
|
+{{-- <tr>--}}
|
|
|
+{{-- <td class="px-2 text-nowrap">--}}
|
|
|
+{{-- @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-1 text-nowrap">--}}
|
|
|
+{{-- <div class="text-nowrap">--}}
|
|
|
+{{-- @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--}}
|
|
|
+{{-- {{ $measurement->value }}--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- </div>--}}
|
|
|
+{{-- </td>--}}
|
|
|
+{{-- <td class="px-1 text-nowrap">{{ $measurement->label }}</td>--}}
|
|
|
+{{-- <td class="text-nowrap">--}}
|
|
|
+{{-- <div class="">--}}
|
|
|
+{{-- @php $found = false; @endphp--}}
|
|
|
+{{-- @foreach($careMonth->entries as $entry)--}}
|
|
|
+{{-- @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date) && $entry->did_pro_interact_with_client_about_rm && !$found)--}}
|
|
|
+{{-- @php $found = true; @endphp--}}
|
|
|
+{{-- @if(str_contains($entry->content_text, 'text'))--}}
|
|
|
+{{-- Text--}}
|
|
|
+{{-- @else--}}
|
|
|
+{{-- Audio call--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- @endforeach--}}
|
|
|
+{{-- </div>--}}
|
|
|
+{{-- </td>--}}
|
|
|
+{{-- --}}{{-- <td colspan="px-2">--}}
|
|
|
+{{-- --}}{{-- <?php--}}
|
|
|
+{{-- --}}{{-- $stamps = ['has_been_stamped_by_mcp', 'has_been_stamped_by_non_hcp', 'has_been_stamped_by_rme', 'has_been_stamped_by_rmm'];--}}
|
|
|
+{{-- --}}{{-- $isStamped = false;--}}
|
|
|
+{{-- --}}{{-- foreach ($stamps as $stamp) {--}}
|
|
|
+{{-- --}}{{-- if ($measurement->{$stamp}) {--}}
|
|
|
+{{-- --}}{{-- $isStamped = true;--}}
|
|
|
+{{-- --}}{{-- }--}}
|
|
|
+{{-- --}}{{-- }--}}
|
|
|
+{{-- --}}{{-- ?>--}}
|
|
|
+{{-- --}}{{-- @if ($isStamped)--}}
|
|
|
+{{-- --}}{{-- ✓--}}
|
|
|
+{{-- --}}{{-- @endif--}}
|
|
|
+{{-- --}}{{-- </td>--}}
|
|
|
+
|
|
|
+{{-- <td class="px-4">--}}
|
|
|
+{{-- <div class="">--}}
|
|
|
+{{-- @foreach($careMonth->entries as $entry)--}}
|
|
|
+{{-- @if(friendly_date($entry->effective_date) == friendly_date($measurement->effective_date))--}}
|
|
|
+{{-- <div class="d-flex align-items-start">--}}
|
|
|
+{{-- <span class="mr-2">{{$entry->time_in_seconds/60}}m: </span>--}}
|
|
|
+{{-- <div>{!! $entry->content_text !!}</div>--}}
|
|
|
+{{-- </div>--}}
|
|
|
+{{-- <div class="d-flex justify-content-end ">--}}
|
|
|
+{{-- <div class="mr-1">--}}
|
|
|
+{{-- <b>--}}
|
|
|
+{{-- @if($entry->pro)--}}
|
|
|
+{{-- @if($entry->pro->is_hcp)--}}
|
|
|
+{{-- {{$entry->pro->displayName()}}--}}
|
|
|
+{{-- @else--}}
|
|
|
+{{-- Medical Staff--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- </b>--}}
|
|
|
+{{-- </div>--}}
|
|
|
+{{-- <div>{{friendly_date_time($entry->created_at)}}</div>--}}
|
|
|
+{{-- </div>--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- @endforeach--}}
|
|
|
+{{-- </div>--}}
|
|
|
+{{-- </td>--}}
|
|
|
+{{-- </tr>--}}
|
|
|
+{{-- @endif--}}
|
|
|
+{{-- @endforeach--}}
|
|
|
+{{-- @if (!$patient->measurements || !count($patient->measurements) === 0)--}}
|
|
|
+{{-- <tr>--}}
|
|
|
+{{-- <td class="text-secondary p-0 border-0">--}}
|
|
|
+{{-- No items to show--}}
|
|
|
+{{-- </td>--}}
|
|
|
+{{-- </tr>--}}
|
|
|
+{{-- @endif--}}
|
|
|
</tbody>
|
|
|
</table>
|