@extends("layout") @section("content")
{{trans('messages.test-details')}} @if($test->isCompleted() && $test->specimen->isAccepted())
@if(Auth::user()->can('edit_test_results')) {{trans('messages.edit-test-results')}} @endif @if(Auth::user()->can('verify_test_results') && Auth::user()->id != $test->tested_by) {{trans('messages.verify')}} @endif
@endif @if($test->isCompleted() || $test->isVerified()) @endif

{{ Lang::choice('messages.test-type',1) }} {{ $test->testType->name }}

{{trans('messages.visit-number')}} {{$test->visit->id }}

{{trans('messages.date-ordered')}} {{ $test->isExternal()?$test->external()->request_date:$test->time_created }}

{{trans('messages.lab-receipt-date')}} {{$test->time_created}}

{{trans('messages.test-status')}} {{trans('messages.'.$test->testStatus->name)}}

{{trans('messages.physician')}} {{$test->requested_by or trans('messages.unknown') }}

@if($test->testType->name = 'HIV' || $test->testType->name = 'H.I.V' )

{{trans('messages.purpose')}} {{$test->purpose or trans('messages.unknown') }}

@endif

{{trans('messages.request-origin')}} @if($test->specimen->isReferred() && $test->specimen->referral->status == Referral::REFERRED_IN) {{ trans("messages.in") }} @else {{ $test->visit->visit_type }} @endif

{{trans('messages.registered-by')}} {{$test->createdBy->name }}

@if($test->isCompleted())

{{trans('messages.tested-by')}} {{$test->testedBy->name}}

@endif @if($test->isVerified())

{{trans('messages.verified-by')}} {{$test->verifiedBy->name}}

@endif @if((!$test->specimen->isRejected()) && ($test->isCompleted() || $test->isVerified()))

{{trans('messages.turnaround-time')}} {{$test->getFormattedTurnaroundTime()}}

@endif

{{trans("messages.patient-details")}}

{{trans("messages.patient-number")}}

{{$test->visit->patient->patient_number}}

{{ Lang::choice('messages.name',1) }}

{{$test->visit->patient->name}}

{{trans("messages.age")}}

{{$test->visit->patient->getAge()}}

{{trans("messages.gender")}}

{{$test->visit->patient->gender==0?trans("messages.male"):trans("messages.female")}}

{{trans("messages.specimen-details")}}

Specimen Type

{{$test->specimen->specimenType->name }}

{{trans('messages.specimen-number')}}

{{$test->getSpecimenId() }}

{{trans('messages.specimen-status')}}

{{trans('messages.'.$test->specimen->specimenStatus->name) }}
@if($test->specimen->isRejected())

{{trans('messages.rejection-reason-title')}}

{{$test->specimen->rejectionReason->reason or trans('messages.pending') }}

{{trans('messages.reject-explained-to')}}

{{$test->specimen->reject_explained_to or trans('messages.pending') }}
@endif @if($test->specimen->isReferred())

{{trans("messages.specimen-referred-label")}}

@if($test->specimen->referral->status == Referral::REFERRED_IN) {{ trans("messages.in") }} @elseif($test->specimen->referral->status == Referral::REFERRED_OUT) {{ trans("messages.out") }} @endif

{{Lang::choice("messages.facility", 1)}}

{{$test->specimen->referral->facility->name }}

@if($test->specimen->referral->status == Referral::REFERRED_IN) {{ trans("messages.originating-from") }} @elseif($test->specimen->referral->status == Referral::REFERRED_OUT) {{ trans("messages.intended-reciepient") }} @endif

{{$test->specimen->referral->person }}

{{trans("messages.contacts")}}

{{$test->specimen->referral->contacts }}

@if($test->specimen->referral->status == Referral::REFERRED_IN) {{ trans("messages.recieved-by") }} @elseif($test->specimen->referral->status == Referral::REFERRED_OUT) {{ trans("messages.referred-by") }} @endif

{{ $test->specimen->referral->user->name }}
@endif

{{trans("messages.test-results")}}

@foreach($test->testResults as $result)

{{ Measure::find($result->measure_id)->name }}

{{$result->result}}
{{ Measure::getRange($test->visit->patient, $result->measure_id) }} {{ Measure::find($result->measure_id)->unit }}
@endforeach

{{trans('messages.test-remarks')}}

{{$test->interpretation}}
@if(count($test->testType->organisms)>0)

{{trans("messages.culture-worksheet")}}

{{trans("messages.culture-work-up")}}

@if(($observations = $test->culture) != null) @foreach($observations as $observation) @endforeach @else @endif
{{ trans('messages.date')}} {{ trans('messages.tech-initials')}} {{ trans('messages.observations-and-work-up')}}
{{ $observation->created_at }} {{ User::find($observation->user_id)->name }} {{ $observation->observation }}
{{ trans('messages.no-data-found') }}

{{trans("messages.susceptibility-test-results")}}

@if(count($test->susceptibility)>0) @foreach($test->testType->organisms as $organism)
@foreach($organism->drugs as $drug) @if($drugSusceptibility = Susceptibility::getDrugSusceptibility($test->id, $organism->id, $drug->id)) @if($drugSusceptibility->interpretation) @endif @endif @endforeach
{{ $organism->name }}
{{ Lang::choice('messages.drug',1) }} {{ trans('messages.zone-size')}} {{ trans('messages.interp')}}
{{ $drug->name }} {{ $drugSusceptibility->zone!=null?$drugSusceptibility->zone:'' }} {{ $drugSusceptibility->interpretation!=null?$drugSusceptibility->interpretation:'' }}
@endforeach @endif
@endif
@stop