@extends('hms.layout') @section('title','Review historical document') @section('content')

{{ $doc->name }}

{{ $patient->first_name }} {{ $patient->last_name }} · {{ $patient->patient_number }} · {{ str_replace('_',' ',$doc->status) }}

Search this patient’s historyDownload original for comparison
@if($doc->extraction_note)
{{ $doc->extraction_note }}
@endif @if(in_array($doc->status,['queued','extracting'],true))

Extraction is pending. Refresh this page after the queue worker processes the document. Manual transcription is available to a physician.

@endif

Extracted source text (unreviewed)

{{ $text?:'No extracted text available yet.' }}
@if($canReview)

Save a reviewed historical entry

Check OCR errors, dates, units, negation and patient identity against the original. Save separate sections under their appropriate categories. Missing dates should remain blank.

@csrf
@endif
@if($doc->status==='needs_transcription' && in_array(\App\Models\Hms\Membership::where('organization_id',$doc->organization_id)->where('user_id',auth()->id())->value('role'),['physician','nurse'],true))
@csrf
@endif

Reviewed sections and corrections

@forelse($entries as $entry)

{{ $entry->title }} · {{ $entry->category }} · {{ $entry->occurred_on??'Date unknown' }} @if($entry->supersedes_id) · Corrected historical entry @endif
{{ $entry->content }}

@empty

No reviewed sections saved yet.

@endforelse
@endsection