@props([ 'title' => 'Test Form', 'subtitle' => '', 'record' => null, 'testResult' => null, 'test' => '', 'isReadOnly' => false, ]) @php // Get patient data from health record $expectantMother = $record->mother->expectantMother ?? null; $fullName = $expectantMother->mother_full_name ?? $record->mother->name ?? 'N/A'; $icNumber = $expectantMother->ic_number ?? 'N/A'; // Get CURRENT color code from expectant mother $colorCode = $expectantMother->current_color_code ?? $expectantMother->color_code ?? 'white'; $colorCodeDisplay = ucfirst($colorCode); $badgeColors = [ 'red' => 'bg-red-100 text-red-700 border-red-200', 'yellow' => 'bg-yellow-100 text-yellow-700 border-yellow-200', 'green' => 'bg-green-100 text-green-700 border-green-200', 'white' => 'bg-white border-gray-300 text-gray-700', ]; $colorCodeClass = $badgeColors[$colorCode] ?? $badgeColors['white']; // Get existing test data if editing $testData = $testResult ? $testResult->test_data : []; @endphp @if(!$isReadOnly) {{-- Nurse View: Use Nurse Layout --}} @extends('layouts.nurse') @section('content')
{{ $subtitle }}
@endifPatient Name
{{ $fullName }}
IC Number
{{ $icNumber }}
Color Code
{{ $colorCodeDisplay }}You are viewing this test in read-only mode. Editing is disabled to maintain data integrity.