{{-- Obstetrics & Gynaecology profile, injected into ClinicCore's patient/
     appointment screens via the SpecialtyDriverRegistry. Receives $patient. --}}
@php
    $ob = \Modules\GynaecologyClinic\Entities\ObgynPatientProfile::where('clc_patient_id', $patient->id)->first();
@endphp
@if($ob && ($ob->gpal() || $ob->lmp_date || $ob->is_pregnant || $ob->menopause))
<div class="detail-row" style="display:block;">
    <span class="dk" style="display:block;margin-bottom:6px;"><i class="fas fa-venus fa-fw"></i> OB-Gyn Profile</span>

    @if($ob->gpal())
        <div style="margin-bottom:4px;"><span class="label label-default" style="font-size:11px;">{{ $ob->gpal() }}</span></div>
    @endif

    @if($ob->is_pregnant && $ob->gestationalAge())
        <div style="padding:6px 8px;background:#fdf2f8;border:1px solid #fbcfe8;border-radius:6px;margin-bottom:6px;">
            <div style="font-size:11px;color:#9d174d;font-weight:700;"><i class="fas fa-baby-carriage"></i> Pregnant</div>
            <div style="font-size:12px;"><strong>GA {{ $ob->gestationalAge() }}</strong>
                @if($ob->edd())<span style="color:#64748b;"> · EDD {{ $ob->edd()->format('d-m-Y') }}</span>@endif
            </div>
        </div>
    @elseif($ob->edd() && !$ob->menopause)
        <div class="detail-row"><span class="dk">LMP</span><span class="dv">{{ $ob->lmp_date->format('d-m-Y') }}</span></div>
    @endif

    @if($ob->cycle_length_days)
        <div class="detail-row"><span class="dk">Cycle</span><span class="dv">{{ $ob->cycle_length_days }} d · {{ $ob->cycle_regular ? 'regular' : 'irregular' }}</span></div>
    @endif
    @if($ob->contraception)
        <div class="detail-row"><span class="dk">Contraception</span><span class="dv">{{ $ob->contraception }}</span></div>
    @endif
    @if($ob->menopause)
        <span class="label label-warning" style="font-size:10px;">Menopause</span>
    @endif
    @if($ob->notes)
        <div style="font-size:11px;color:#475569;margin-top:4px;">{{ $ob->notes }}</div>
    @endif
</div>
@endif
