@php
$redTextConditions = [
'Normal Posture Gait' => 'no',
'Mental Status' => 'Lethargic',
'JAUNDICE' => 'yes',
'ANEMIA' => 'yes',
'CLUBBING' => 'yes',
'CYANOSIS' => 'yes',
'Skin' => ['Rash', 'Allergy', 'Lesion', 'Bruises'],
'Breath' => 'Bad Breath',
'Nails' => 'Dirty',
'lice/Nits' => 'yes',
'Hair/scalp' => 'Color-faded',
'Hair Problem' => ['Kinky', 'Brittle', 'Dry'],
'Scalp' => ['Scaly', 'Dry', 'Moist'],
'Hair/distribution' => ['Patchy', 'Receding', 'Receding_Hair_Line'],
'Normal_ocular_alignment' => 'no',
'Normal_eye_inspection' => 'no',
'Normal_color_vision' => 'no',
'Nystagmus' => 'yes',
'Normal_ears_shape_and_position' => 'no',
'Ear_examination' => ['Ear wax', 'Canal infection'],
'Conclusion_of_hearing_test_with_rinner_and_weber' => ['right_ear_conductive_hearing_loss', 'left_ear_conductive_hearing_loss','right_ear_sensorineural_hearing_loss','left_ear_sensorineural_hearing_loss'],
'External_nasal_examinaton' =>['Deformities', 'Swelling','Redness','Lesions','Nasal Discharge','Crusting'],
'nasal_patency_test' =>['Obstruction', 'DNS'],
'GUMS' =>['Infection', 'Bleed'],
'tonsils' =>'Tonsillitis',
'Normal_speech_development' =>'no',
'Any_neck_swelling' =>'yes',
'LYMPH NODE' =>'abnormal',
'WRITE CHEST EXAMINATION-NORMAL' =>'yes',
'Lung_auscultation' =>['Wheezing','Crackles'],
'Cardiac_auscultation' =>'Murmur',
'ABDOMEN' =>['Distention','Scar','Mass'],
'dental_caries' =>'yes',
'Abdominal_pain' =>'yes',
'Any_limitation_in_child_range_of_motion' =>'yes',
'Adams_forward_bend_test' =>'Positive',
'Any_foot_or_toe_abnormalities' =>['Flat Feet','Varus','Valgus','High Arch','Hammer Toe','Bunion'],
'Epi_immunization_card' =>'no',
'ANY KNOWN ALLERGY' =>'Yes',
'ANY URINARY PROBLEM' =>['Urinary frequency','Urinary urgency','Pain or discomfort during urination','Nocturnal enuresis'],
'RESTLESS OR OVERACTIVE' =>['PRETTY MUCH','VARY MUCH'],
'EXCITABLE, IMPULSIVE' =>['PRETTY MUCH','VARY MUCH'],
'DISTURBS OTHER CHILDREN' =>['PRETTY MUCH','VARY MUCH'],
'SHORT SPAN' =>['PRETTY MUCH','VARY MUCH'],
'INATTENTIVE, EASILY DISTRACTED' =>['PRETTY MUCH','VARY MUCH'],
'CRIES OFTEN AND EASILY' =>['PRETTY MUCH','VARY MUCH'],
'SPELLINGS' =>['PRETTY MUCH','VARY MUCH'],
'WRITES DATE ACCURATELY' =>['PRETTY MUCH','VARY MUCH'],
'DIRECTIONS SENSE' =>['PRETTY MUCH','VARY MUCH'],
'CRYING SPELLS' =>['PRETTY MUCH','VARY MUCH'],
];
@endphp
@foreach ($details as $key => $detail)
{{ htmlspecialchars($detail['heading']) }}
@php
$skipCount = 0;
@endphp
@foreach ($detail as $subKey => $value)
@if ($subKey !== 'heading')
@if ($skipCount > 0)
@php
$skipCount--;
@endphp
@continue
@endif
{{-- Conditional skipping for specific keys --}}
@if ($subKey === 'LYMPH NODE' && ($value === 'normal' || $value === 'Normal'))
@php
$skipCount = 2;
@endphp
@endif
@if ($subKey === 'Abdominal_pain' && ($value === 'no' || $value === 'No'))
@php
$skipCount = 1;
@endphp
@endif
@if ($subKey === 'Any_allergies' && ($value === 'no' || $value === 'No'))
@php
$skipCount = 1;
@endphp
@endif
@if ($subKey === 'ANY MENSTRUAL PROBLEM' && ($value === 'no' || $value === 'No'))
@php
$skipCount = 1;
@endphp
@endif
@if (isset($detail['heading']) && (!empty($subKey === 'Assessment')) || $detail['heading'] === 'Dietary Advice'||$detail['heading'] === 'Doctor Comment' || $detail['heading'] === 'Psychological Assessment')
{{-- If the heading is Nutritional Assessment, combine both values into one td --}}
|
{{ $value === null ? 'N/A' : mb_convert_case(mb_strtolower(rtrim(preg_replace('/\bYes\b.*/i', '', $value), " ,"), 'UTF-8'), MB_CASE_TITLE, 'UTF-8') }}
|
@else
{{-- Otherwise, show the default behavior --}}
| {{ str_replace('_', ' ', strtoupper($subKey)) }} |
{{ $value === null ? 'N/A' : mb_convert_case(mb_strtolower(rtrim($value, ','), 'UTF-8'), MB_CASE_TITLE, 'UTF-8') }}
|
@endif
@endif
@endforeach
@endforeach