<div class="mt-2 mb-3" id="patient-dashboard-measurements">
    <div class="d-flex align-items-center mb-2 py-2 border-top border-bottom">
        <h6 class="my-0 font-weight-bold">Measurements</h6>
        <span class="mx-2 text-secondary">|</span>
        <a start show class="py-0 font-weight-normal"
           href="/patients/view/{{ $patient->uid }}/measurements">
            View All
        </a>
    </div>
    <table class="table table-sm border-0 m-0">
        <tbody>
        @foreach($patient->recentMeasurements as $measurement)
            @if(1 || !empty($measurement->label) && !in_array($measurement->label, $vitalLabels))
                @if(!in_array($measurement->label, ["SBP", "DBP"]))
                    @if(!empty($measurement->client_bdt_measurement_id))
                        @if($measurement->label === 'BP' && $measurement->dbp_mm_hg == 0)
                            <?php continue; ?>
                        @endif
                        @if($measurement->label === 'Wt. (lbs.)' && $measurement->value == 0)
                            <?php continue; ?>
                        @endif
                    @endif
                <tr>
                    <td class="text-black p-0 border-0">
                        <div class="d-flex align-items-center">
                            <span class="text-secondary">
                                {{ $measurement->label == 'Wt. (lbs.)' ? 'WT' : $measurement->label}}:
                            </span>
                            <span class="font-weight-normal ml-1">
                                @if($measurement->label == 'BP')
                                    {{ $measurement->sbp_mm_hg }} / {{ $measurement->dbp_mm_hg }} <span class="font-weight-normal d-inline-block text-secondary pl-2">Pulse:</span> {{ $measurement->value_pulse }} {{ $measurement->value_irregular === 0?'Irregular':'' }} {{ $measurement->value_irregular === 1?'Regular':'' }}
                                @elseif($measurement->label == 'Wt. (lbs.)')
                                    {{round($measurement->numeric_value, 1)}} lbs.
                                @elseif($measurement->numeric_value)
                                    {{round($measurement->numeric_value)}}
                                @else
                                    {{ $measurement->value }}
                                @endif
                            </span>
                            <span class="font-weight-normal text-secondary ml-2 text-sm">({{ $measurement->ts ? friendly_date_time_short_with_tz_from_timestamp_divide1000($measurement->ts, 'EASTERN') : friendly_date_time($measurement->effective_date, false) }})</span>
                        </div>
                    </td>
                </tr>
                @endif
            @endif
        @endforeach
        @if(!$patient->measurements || !count($patient->measurements))
            <tr>
                <td class="text-secondary p-0 border-0 pl-2">
                    No items to show
                </td>
            </tr>
        @endif
        </tbody>
    </table>
</div>
