@if($episode_has_grand_parent_episode)
@if(count($grand_parent_episode_investigation_results) > 0)
| {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }} |
@foreach($grand_parent_episode_investigation_results as $result)
@php
$investigation_ids_array = explode(',', $result->investigation_id);
// authentication of investigations
$per_investigation_array = explode(',', $result->per_investigation);
$comments = explode(",", $result->comment);
$results_values = explode(",", $result->value);
@endphp
@for($i = 0 ; $i < count($investigation_ids_array) ; $i++)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]);
@endphp
@if($investigation)
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@if($investigation->range_type == 1)
{{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $investigation->normal_ranges }}
@endif
|
{!! $per_investigation_array[$i] == 0 ? '{{ __("consultations.pending") }}' : $results_values[$i] !!}
|
{!! $per_investigation_array[$i] == 0 ? '{{ __("consultations.pending") }}' : ($comments[$i] ?? '') !!}
|
@endif
@endfor
| {{ __('consultations.authenticated_by') }} | {{ get_name($result->authenticated_by, 'id', 'first_name', 'users')}} {{ get_name($result->authenticated_by, 'id', 'last_name', 'users')}} |
@endforeach
|
@elseif(count($grand_parent_episode_ordered_investigations) > 0)
| {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }} |
@foreach($grand_parent_episode_ordered_investigations as $investigation)
@php $investigation_ids_array = explode(',', $investigation->investigation_id); @endphp
@for($i = 0 ; $i < count($investigation_ids_array) ; $i++)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]);
@endphp
@if($investigation)
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@if($investigation->range_type == 1)
{{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $investigation->normal_ranges }}
@endif
|
{{ __('consultations.pending') }} |
{{ $investigation->comments }}
|
@endif
@endfor
@endforeach
|
@endif
@endif
@if(count($parent_episode_investigation_results) > 0)
| {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }} |
@foreach($parent_episode_investigation_results as $result)
@php
$investigation_ids_array = explode(',', $result->investigation_id);
// authentication of investigations
$per_investigation_array = explode(',', $result->per_investigation);
$comments = explode(",", $result->comment);
$results_values = explode(",", $result->value);
@endphp
@for($i = 0 ; $i < count($investigation_ids_array) ; $i++)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]);
@endphp
@if($investigation)
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@if($investigation->range_type == 1)
{{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $investigation->normal_ranges }}
@endif
|
{!! $per_investigation_array[$i] == 0 ? '{{ __("consultations.pending") }}' : $results_values[$i] !!}
|
{!! $per_investigation_array[$i] == 0 ? '{{ __("consultations.pending") }}' : $comments[$i] !!}
|
@endif
@endfor
| {{ __('consultations.authenticated_by') }} | {{ get_name($result->authenticated_by, 'id', 'first_name', 'users')}} {{ get_name($result->authenticated_by, 'id', 'last_name', 'users')}} |
@endforeach
|
@elseif(count($parent_episode_ordered_investigations) > 0)
| {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }} |
@foreach($parent_episode_ordered_investigations as $investigation)
@php $investigation_ids_array = explode(',', $investigation->investigation_id); @endphp
@for($i = 0 ; $i < count($investigation_ids_array) ; $i++)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]);
@endphp
@if($investigation)
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@if($investigation->range_type == 1)
{{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $investigation->normal_ranges }}
@endif
|
{{ __('consultations.pending') }} |
{{ $investigation->comments }}
|
@endif
@endfor
@endforeach
|
@endif
@php $set_order_ids = []; @endphp
@if(count($investigation_results) > 0)
@if(check_if_episode_is_a_followup($episode->id))
| {{ __('consultations.investigation_for_review') }} ({{ streamline_date($episode->created_at)}}) |
@endif
@foreach($investigation_results as $result)
@php
$investigation_ids_array = explode(',', $result->investigation_id);
// authentication of investigations
$per_investigation_array = explode(',', $result->per_investigation);
$comments = explode(",", $result->comment);
$results_values = explode(",", $result->value);
$set_order_ids[] = $result->order_id;
@endphp
@for($i = 0 ; $i < count($investigation_ids_array) ; $i++)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]);
@endphp
@if($investigation)
@if($investigation->type == 1 && isset($results_values[$i]))
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $results_values[$i])->first();
if($specialised_results){
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
$variable_normal_range_array = explode(',', $specialised_results->normal_ranges);
}
@endphp
@if($specialised_results)
@for($x = 0; $x < count($variable_id_array); $x++)
| {{ get_name($variable_id_array[$x], 'id', 'name', 'investigation_specialised_variables') }} |
{{ $variable_value_array[$x] }} |
@if(get_name($variable_id_array[$x], 'id', 'range_type', 'investigation_specialised_variables') == 1)
{{ get_dynamic_normal_range_specialized($variable_id_array[$x], get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ get_name($variable_id_array[$x], 'id', 'normal_ranges', 'investigation_specialised_variables') }}
@endif
|
@if(get_name(get_name($variable_id_array[$x], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name(get_name($variable_id_array[$x], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') }}
@endif
|
{{ $variable_comment_array[$x] }} |
@endfor
@endif
@elseif($investigation->slug == 'echo' && $results_values[$i] == "")
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
View Results
|
@else
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@if($per_investigation_array[$i] == 0)
{{ __("consultations.pending") }}
@else
{!! isset($results_values[$i]) ? nl2br(e($results_values[$i])) : "" !!}
@endif
|
@if($investigation->range_type == 1)
{{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $investigation->normal_ranges }}
@endif
|
{{ get_name(get_name($investigation->id, 'id', 'units', 'investigations'),'id', 'name', 'unit_of_measure') }}
|
{!! $per_investigation_array[$i] == 0 ? '{{ __("consultations.pending") }}' : $comments[$i] !!}
|
@endif
@endif
@endfor
| {{ __('consultations.authenticated_by') }} | {{ get_name($result->authenticated_by, 'id', 'first_name', 'users')}} {{ get_name($result->authenticated_by, 'id', 'last_name', 'users')}} |
@endforeach
@endif
@if(count($ordered_investigations) > 0)
@if(check_if_episode_is_a_followup($episode->id))
| {{ __('consultations.investigation_for_review') }} ({{ streamline_date($episode->created_at)}}) |
@endif
@foreach($ordered_investigations as $investigation)
@php
$investigation_ids_array = explode(',', $investigation->investigation_id);
if (in_array($investigation->id, $set_order_ids)) {
continue;
}
@endphp
@for($i = 0 ; $i < count($investigation_ids_array) ; $i++)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]);
@endphp
@if($investigation)
@if($investigation->slug == 'echo')
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
@if(($cardio_echo))
View results
@else
Pending
@endif
|
@else
|
@if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
{{ $investigation->name }}
@else
{{ $investigation->name }}
@endif
|
{{ __('consultations.pending') }} |
@if($investigation->range_type == 1)
{{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $investigation->normal_ranges }}
@endif
|
|
{{ $investigation->comments }}
|
@endif
@endif
@endfor
@endforeach
@endif
@if(!(count($ordered_investigations) > 0 || count($investigation_results) > 0))
{{ __('consultations.investigation_not_ordered') }} {{ check_if_episode_is_a_followup($episode->id) ? __('consultations.during_current_review') : '' }}. |
@endif