@extends('layouts.nurse') @section('title', 'View Health Record') @section('content')

Health Record Details

Visit #{{ $record->visit_number }} - {{ $record->formatted_visit_date }}

@php $statusColors = [ 'draft' => 'bg-yellow-100 text-yellow-800', 'completed' => 'bg-green-100 text-green-800', 'reviewed' => 'bg-blue-100 text-blue-800', ]; @endphp {{ ucfirst($record->status) }} @if($record->status === 'draft') @can('update', $record) Edit @endcan @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if(in_array($record->status, ['completed', 'reviewed']))

This record is {{ $record->status }} and cannot be edited.

Completed records are locked to maintain data integrity.

@endif

Patient Information

Patient Name

{{ $record->mother->expectantMother->mother_full_name }}

IC Number

{{ $record->mother->expectantMother->ic_number }}

Color Code

@php $colorCode = $record->mother->expectantMother->current_color_code ?? 'white'; $badgeColors = [ 'red' => 'bg-red-100 text-red-800 border-red-200', 'yellow' => 'bg-yellow-100 text-yellow-800 border-yellow-200', 'green' => 'bg-green-100 text-green-800 border-green-200', 'white' => 'bg-gray-100 text-gray-800 border-gray-200', ]; @endphp {{ ucfirst($colorCode) }}

Visit Information

Visit Date

{{ $record->formatted_visit_date }}

Visit Number

Visit #{{ $record->visit_number }}

Gestational Week

{{ $record->gestational_week ? $record->gestational_week . ' weeks' : 'Not recorded' }}

@if($record->general_notes)

General Notes

{{ $record->general_notes }}

@endif @if($record->nurse_remarks)

Nurse Remarks

{{ $record->nurse_remarks }}

@endif

Tests Performed

{{ $record->testResults->count() }} test(s)
@if($record->testResults->count() > 0)
@foreach($record->testResults as $testResult)

{{ $testResult->test_type_label }}

Performed by: {{ $testResult->performedByNurse->name }}

Date: {{ $testResult->performed_at->format('M j, Y g:i A') }}

View Details
@endforeach
@else

No tests have been performed yet

@endif

Record Information

Recorded By

{{ $record->recordedByNurse->name }}

{{ $record->created_at->format('M j, Y g:i A') }}

@if($record->updatedByNurse)

Last Updated By

{{ $record->updatedByNurse->name }}

{{ $record->updated_at->format('M j, Y g:i A') }}

@endif @if($record->appointment)

Linked Appointment

{{ $record->appointment->date?->format('M j, Y') ?? 'N/A' }}

{{ $record->appointment->slot_label ?? 'N/A' }}

@endif

Clinic

{{ $record->appointment?->clinic?->name ?? $record->expectantMother?->clinic?->name ?? $record->nurse?->clinic?->name ?? 'N/A' }}

Back to Appointments
@can('update', $record) @if($record->status === 'draft') Edit Record @endif @endcan @if($record->status === 'completed' && auth()->user()->role === 'head_nurse') @endif
@endsection