@extends('layouts.main') @section('content') @php $other_patients_info_data = !empty($patient->other_patients_info) ? json_decode($patient->other_patients_info) : ''; @endphp

{{ __('patients.view') }}

{{ __('patients.patient_number') }} {{ $patient->number }}
Code {{ getDNS1DBarcodePNG(sprintf("%04u", $patient->id)) }}

{{ sprintf("%04u", $patient->id) }}

{{ __('patients.full_names') }} {{ $patient->first_name }} {{ $patient->last_name }}
{{ __('patients.gender') }} {{ $patient->gender == 1 ? 'Male' : 'Female' }}
{{ __('patients.age') }} {{ get_patients_age($patient->date_of_birth) }}
@if (Auth::user()->can('print-patient-cards')) {{ __('patients.print_patient_card') }} @endif
{{ __('patients.phone') }} {{ $patient->phone }}
{{ __('patients.occupation') }} {{ get_name($patient->occupation_id, 'id', 'name', 'occupations') }}
{{ __('patients.insurance') }} {{ $patient->insurance_status == 1 ? __('patients.yes') : __('patients.no') }}
{{ __('patients.religion') }} {{ get_name($patient->religion_id, 'id', 'name', 'religions') }}
{{__('patients.next_of_kin')}} {{ $patient->next_of_kin }}
{{ __('patients.next_of_kin_relationship') }} {{ get_name($patient->next_of_kin_relationship, 'id', 'name', 'family_relations') }}
{{__('patients.phone_of_next_of_kin')}} {{ $patient->phone_of_next_of_kin }}
Country {{ $country->name ?? '' }}
@if (isset($other_patients_info_data->non_ugandan_national_id_no)) @else @endif @php $registration_fields = !empty($patient->registration_fields)? json_decode($patient->registration_fields, true):[]; @endphp @foreach ($registration_fields as $key => $registration_field) @php $keys = explode("_",$key) @endphp @if (!empty($keys[2])) @endif @endforeach
{{ __('patients.district') }} {{ get_name($patient->district_id, 'id', 'name', 'districts') }}
{{ __('patients.county') }} {{ get_name($patient->county_id, 'id', 'name', 'counties') }}
{{ __('patients.sub_county') }} {{ get_name($patient->subcounty_id, 'id', 'name', 'subcounties') }}
{{ __('patients.parish') }} {{ get_name($patient->parish_id, 'id', 'name', 'parishes') }}
{{ __('patients.village') }} {{ get_name($patient->village_id, 'id', 'name', 'villages') }}
Referred From {{ $patient->referred_from }}
Foreigner / Refugee @if(!empty($other_patients_info_data)) @if ($other_patients_info_data->non_ugandan_foreigner_or_refugee == 1) {{ __('patients.foreigner') }} @elseif ($other_patients_info_data->non_ugandan_foreigner_or_refugee == 2) {{ __('patients.refugee') }} @else @endif @else @endif
ID Number {{ $other_patients_info_data->non_ugandan_national_id_no ?? '' }}
National ID {{ $patient->national_id ?? '' }}
{{ get_name($keys[2], 'id', 'name', 'patient_registration_fields') }} {{ $registration_field }}
@if (mother_of_patient($patient->id)) @php $mother_id = mother_of_patient($patient->id); @endphp @endif @if (children_of_patient($patient->id)) @php $children_ids_array = children_of_patient($patient->id); @endphp @endif
{{ __('patients.last_patient_visit') }} : @if(!is_null($last_episode)) @php $diagnosis = null; $primary_diagnosis_id = get_name($last_episode->id, 'episode_id', 'primary_diagnosis', 'consultations'); if($primary_diagnosis_id != "N/A" && $primary_diagnosis_id != ""){ $diagnosis = \Streamline\Models\Diagnosis::withTrashed()->find($primary_diagnosis_id); } @endphp {{ __('patients.primary_diagnosis') }} : {{ !is_null($diagnosis) ? $diagnosis->name : '' }}
{{ __('patients.comments') }} : {{ get_name($last_episode->id, 'episode_id', 'comments', 'consultations') }}
@endif {{ __('patients.date') }} : {{ !is_null($last_episode) ? streamline_date($last_episode->created_at) : __('patients.no_visit_yet') }}
{{ __('patients.date_registered') }} : {{streamline_date($patient->created_at) }}
{{ __('patients.created_by') }} : {{ get_full_name($patient->created_by, "id", "first_name", "last_name", "users") }}
{{ __('patients.mother_name') }}: {{ get_full_name($mother_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($mother_id, "id", "number", "patients") }})
{{ __('patients.children') }}:
    @for ($i = 0; $i < count($children_ids_array); $i++)
  1. {{ get_full_name($children_ids_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($children_ids_array[$i], "id", "number", "patients") }})
  2. @endfor
{{ __('patients.select_patient_history') }}
@endsection