Household Size
{{ $healthProfile['household_size'] }}
Chronic Cases
{{ $healthProfile['chronic_diseases_count'] }}
Pregnancies
{{ $healthProfile['pregnancy_status_count'] }}
Seniors (60+)
{{ $healthProfile['elderly_residents_count'] }}
SECTION 2: FAMILY COMPOSITION
Add Member
| Name |
Sex |
Age |
Relationship |
Occupation |
Dispensarización |
Action |
@forelse ($family->patients as $patient)
{{ $patient->name }}
NRC: {{ $patient->national_id ?? 'N/A' }}
|
{{ ucfirst($patient->gender) }} |
{{ $patient->date_of_birth->age }} yrs {{ $patient->date_of_birth->format('Y-m-d') }} |
{{ ucfirst($patient->relationship_to_head ?? 'Member') }} |
{{ $patient->occupation ?? 'N/A' }} |
@if ($patient->is_pregnant)
Pregnant
@endif
@if($patient->dispensary_group)
@php
$dispColors = ['Group I' => 'bg-success', 'Group II' => 'bg-info', 'Group III' => 'bg-danger', 'Group IV' => 'bg-purple'];
$dColor = $dispColors[$patient->dispensary_group] ?? 'bg-secondary';
@endphp
{{ $patient->dispensary_group }}
@endif
@if($patient->dispensary_chronic_conditions)
{{ $patient->dispensary_chronic_conditions }}
@endif
|
EHR
|
@empty
| No family members registered yet. |
@endforelse
SECTION 3: FAMILY STRUCTURE
Family Type: {{ $family->family_type ?? 'N/A' }}
Family Life Cycle Stage: {{ $family->family_lifecycle_stage ?? 'N/A' }}
SECTION 4: SOCIOECONOMIC CONDITIONS
House Type: {{ $family->house_type ?? 'N/A' }}
Ownership: {{ $family->house_ownership ?? 'N/A' }}
Water Source: {{ $family->water_source ?? 'N/A' }} ({{ $family->water_distance ?? 'N/A' }})
Sanitation: {{ $family->toilet_facility ?? 'N/A' }} ({{ $family->waste_disposal ?? 'N/A' }})
Electricity Access: {{ $family->electricity_access ?? 'N/A' }}
FAMILY LIVING CONDITIONS EVALUATIONS (Model 54-50)
| Date |
Housing |
Crowding |
Equipment |
Income |
Functioning |
Health Status |
Interventions |
@forelse ($family->evaluations as $eval)
| {{ $eval->evaluation_date->format('Y-m-d') }} |
{{ ucfirst($eval->housing_condition) }}
|
{{ ucfirst($eval->crowding_index) }}
@if($eval->bedroom_count) {{ $eval->bedroom_count }} beds@endif
|
{{ ucfirst($eval->basic_equipment) }}
|
{{ ucfirst(str_replace('_', ' ', $eval->income_satisfaction)) }} |
{{ ucfirst(str_replace('_', ' ', $eval->family_functioning)) }}
|
@if($eval->health_evaluation_status === 'healthy') Healthy @else Problems @endif
|
@forelse($eval->intervention_type ?? [] as $intv)
{{ ucfirst($intv) }}
@empty
None
@endforelse
|
@empty
| No evaluations logged yet. |
@endforelse
SECTION 6: FAMILY HEREDITARY DISEASES
Conditions present in family:
@forelse($family->family_diseases ?? [] as $fd)
{{ $fd }}
@empty
None recorded
@endforelse
Diseases Details:
{{ $family->family_diseases_details ?? 'N/A' }}
SECTION 8: BEHAVIOURAL ASSESSMENT
Alcohol Consumption: {{ $family->family_alcohol_use ?? 'N/A' }}
Physical Activity: {{ $family->family_physical_activity ?? 'N/A' }}
Common Family Foods:
@forelse($family->family_common_foods ?? [] as $food)
{{ $food }}
@empty
None specified
@endforelse
@if(!empty($family->family_diet_frequency))
Intake Frequencies:
@foreach($family->family_diet_frequency as $k => $v)
{{ ucfirst(str_replace('_', ' ', $k)) }}: {{ $v }}
@endforeach
@endif
SECTION 9: MENTAL HEALTH & SOCIAL WELLBEING
Stressors / Mental Risks:
@forelse($family->mental_social_risks ?? [] as $ms)
{{ $ms }}
@empty
None logged
@endforelse
Social Support Systems:
@forelse($family->social_support_systems ?? [] as $ss)
{{ $ss }}
@empty
None logged
@endforelse
SECTION 10: HEALTH SITUATION ANALYSIS (ASIS)
Determinants Affecting Family Health:
@forelse($family->asis_determinants ?? [] as $det)
{{ $det }}
@empty
No determinants flagged
@endforelse
Identified Health Problems:
@forelse($family->asis_health_problems ?? [] as $p)
@if($p) - {{ $p }}
@endif
@empty
No health problems specified
@endforelse
Ranked Priority Problems & Interventions
| Priority Problem |
Risk Level |
Intervention Required |
@forelse($family->asis_priority_problems ?? [] as $pr)
| {{ $pr['problem'] ?? 'N/A' }} |
@php
$rColors = ['High' => 'bg-danger', 'Medium' => 'bg-warning', 'Low' => 'bg-success'];
$rColor = $rColors[$pr['risk_level'] ?? ''] ?? 'bg-secondary';
@endphp
{{ $pr['risk_level'] ?? 'N/A' }}
|
{{ $pr['intervention'] ?? 'N/A' }} |
@empty
| No priority problems logged |
@endforelse
SECTION 11: FAMILY CARE PLAN
Preventive Care Actions:
@forelse($family->care_plan_preventive_actions ?? [] as $pa)
{{ $pa }}
@empty
None specified
@endforelse
Community Interventions:
@forelse($family->care_plan_community_interventions ?? [] as $ci)
{{ $ci }}
@empty
None specified
@endforelse
Clinical Follow-up Actions Plan
| Family Member |
Condition / Objective |
Follow-up Date |
Responsible Healthcare Worker |
@forelse($family->care_plan_clinical_followups ?? [] as $fl)
@if(is_array($fl))
| {{ is_array($fl['member'] ?? null) ? implode(', ', $fl['member']) : ($fl['member'] ?? 'N/A') }} |
{{ is_array($fl['condition'] ?? null) ? implode(', ', $fl['condition']) : ($fl['condition'] ?? 'N/A') }} |
{{ is_array($fl['date'] ?? null) ? implode(', ', $fl['date']) : ($fl['date'] ?? 'N/A') }} |
{{ is_array($fl['worker'] ?? null) ? implode(', ', $fl['worker']) : ($fl['worker'] ?? 'N/A') }} |
@else
{{ is_array($fl) ? implode(', ', $fl) : $fl }} |
@endif
@empty
| No clinical follow-ups logged |
@endforelse
SECTION 13: HOME VISIT HISTORY
Schedule Visit
| Scheduled Date |
Practitioner |
Status |
Completed At |
Purpose / Notes |
Action |
@forelse ($family->homeVisits as $visit)
| {{ $visit->scheduled_at->format('Y-m-d H:i') }} |
{{ $visit->doctor->user->name }} |
@if($visit->status === 'completed')
Completed
@elseif($visit->status === 'missed')
Missed
@else
Scheduled
@endif
|
{{ $visit->completed_at ? $visit->completed_at->format('Y-m-d H:i') : 'N/A' }} |
{{ Str::limit($visit->notes, 40) ?? 'N/A' }} |
Details
|
@empty
| No visits scheduled or completed yet. |
@endforelse
ATTACHMENTS & SUPPORTING DOCUMENTS
| Document |
Description |
Size |
Uploaded By |
Uploaded At |
Action |
@forelse ($family->attachments as $attachment)
|
@php
$ext = pathinfo($attachment->file_name, PATHINFO_EXTENSION);
$icon = match(strtolower($ext)) {
'pdf' => 'bi-file-pdf-fill text-danger',
'jpg', 'jpeg', 'png', 'gif', 'webp' => 'bi-file-image-fill text-success',
'doc', 'docx' => 'bi-file-word-fill text-primary',
'xls', 'xlsx' => 'bi-file-excel-fill text-success',
default => 'bi-file-earmark-fill text-secondary'
};
@endphp
{{ $attachment->file_name }}
|
{{ $attachment->description ?? 'N/A' }} |
{{ number_format($attachment->file_size / 1024, 1) }} KB |
{{ $attachment->uploader->name }} |
{{ $attachment->created_at->format('Y-m-d H:i') }} |
|
@empty
| No documents uploaded yet. |
@endforelse
FAMILY TREE VISUALIZATION
@php
$head = $family->patients->first(function($p) use ($family) {
$rel = strtolower($p->relationship_to_head ?? '');
return $rel === 'self' || $rel === 'head' || strtolower($p->name) === strtolower($family->head_name ?? '');
});
if (!$head) {
$head = $family->patients->first();
}
$spouse = null;
if ($head) {
$spouse = $family->patients->first(function($p) use ($head) {
$rel = strtolower($p->relationship_to_head ?? '');
return ($rel === 'spouse' || $rel === 'wife' || $rel === 'husband') && $p->id !== $head->id;
});
}
$children = $family->patients->filter(function($p) use ($head, $spouse) {
$rel = strtolower($p->relationship_to_head ?? '');
$isChildRel = ($rel === 'child' || $rel === 'son' || $rel === 'daughter' || $rel === 'stepchild');
$notHeadOrSpouse = (!$head || $p->id !== $head->id) && (!$spouse || $p->id !== $spouse->id);
return $isChildRel && $notHeadOrSpouse;
});
$others = $family->patients->filter(function($p) use ($head, $spouse, $children) {
if ($head && $p->id === $head->id) return false;
if ($spouse && $p->id === $spouse->id) return false;
if ($children->contains('id', $p->id)) return false;
return true;
});
@endphp
@if ($head)
@php
$isDeceased = ($head->removal_reason === 'deceased');
$avatarBg = $head->gender === 'female' ? 'bg-danger-subtle text-danger' : 'bg-info-subtle text-info';
$initials = strtoupper(substr($head->first_name ?? $head->name, 0, 1) . substr($head->first_surname ?? '', 0, 1));
@endphp
@if ($head->avatar_path)
 }})
@else
{{ $initials ?: '?' }}
@endif
Age: {{ $head->date_of_birth->age }} yrs ({{ ucfirst($head->gender) }})
@if ($head->dispensary_group)
{{ $head->dispensary_group }}
@endif
@if ($isDeceased)
Deceased
@endif
@else
No Head Registered
@endif
@if ($spouse)
@php
$isDeceased = ($spouse->removal_reason === 'deceased');
$avatarBg = $spouse->gender === 'female' ? 'bg-danger-subtle text-danger' : 'bg-info-subtle text-info';
$initials = strtoupper(substr($spouse->first_name ?? $spouse->name, 0, 1) . substr($spouse->first_surname ?? '', 0, 1));
@endphp
@if ($spouse->avatar_path)
 }})
@else
{{ $initials ?: '?' }}
@endif
Age: {{ $spouse->date_of_birth->age }} yrs ({{ ucfirst($spouse->gender) }})
@if ($spouse->dispensary_group)
{{ $spouse->dispensary_group }}
@endif
@if ($isDeceased)
Deceased
@endif
@endif
@if ($children->isNotEmpty())
@foreach ($children as $child)
@php
$isDeceased = ($child->removal_reason === 'deceased');
$avatarBg = $child->gender === 'female' ? 'bg-danger-subtle text-danger' : 'bg-info-subtle text-info';
$initials = strtoupper(substr($child->first_name ?? $child->name, 0, 1) . substr($child->first_surname ?? '', 0, 1));
@endphp
@if ($child->avatar_path)
 }})
@else
{{ $initials ?: '?' }}
@endif
{{ $child->name }}
{{ ucfirst($child->relationship_to_head ?? 'Child') }}
Age: {{ $child->date_of_birth->age }} yrs ({{ ucfirst($child->gender) }})
@if ($child->dispensary_group)
{{ $child->dispensary_group }}
@endif
@if ($isDeceased)
Deceased
@endif
@if ($child->father_name || $child->mother_name)
@if ($child->father_name)
F: {{ $child->father_name }}
@if ($child->father_alive === false)
@else
@endif
@endif
@if ($child->mother_name)
M: {{ $child->mother_name }}
@if ($child->mother_alive === false)
@else
@endif
@endif
@endif
@endforeach
@endif
@if ($others->isNotEmpty())
OTHER HOUSEHOLD MEMBERS
@foreach ($others as $other)
@php
$isDeceased = ($other->removal_reason === 'deceased');
$avatarBg = $other->gender === 'female' ? 'bg-danger-subtle text-danger' : 'bg-info-subtle text-info';
$initials = strtoupper(substr($other->first_name ?? $other->name, 0, 1) . substr($other->first_surname ?? '', 0, 1));
@endphp
@if ($other->avatar_path)
 }})
@else
{{ $initials ?: '?' }}
@endif
{{ $other->name }}
{{ ucfirst($other->relationship_to_head ?? 'Member') }}
Age: {{ $other->date_of_birth->age }} yrs ({{ ucfirst($other->gender) }})
@if ($other->dispensary_group)
{{ $other->dispensary_group }}
@endif
@if ($isDeceased)
Deceased
@endif
@endforeach
@endif