@extends('layouts.app') @push('styles') @endpush @section('content')

MAM+NAP · ART Follow-Up

@php $hasPtConfig = $hasPtConfig ?? false; $isExisting = $hasPtConfig; $patientInfo = $data ?? []; $napId = $napId ?? ($patientInfo['NAP_ID'] ?? null); $formatDisplayDate = function ($value) { if (blank($value)) { return ''; } try { if ($value instanceof \Carbon\CarbonInterface) { return $value->format('d-m-Y'); } return \Illuminate\Support\Carbon::parse($value)->format('d-m-Y'); } catch (\Throwable $e) { return is_string($value) ? $value : ''; } }; $patientDob = $formatDisplayDate($patientInfo['Date Of Birth'] ?? ($patientInfo['Date of Birth'] ?? ($patientInfo['Dob'] ?? null))); $autoAddressParts = array_filter([ $patientInfo['Quarter'] ?? null, $patientInfo['Township'] ?? null, $patientInfo['Region'] ?? null, ]); $autoAddress = implode(', ', $autoAddressParts); $regDate = $formatDisplayDate($patientInfo['Reg Date'] ?? null); $visits = $visits ?? collect(); $v = $lastVisit; $patientAge = old('age', $patientInfo['Agey'] ?? $patientInfo['Age'] ?? $patientInfo['age'] ?? optional($lastVisit)->age); $patientAgeMonths = old('age_months', $patientInfo['Agem'] ?? null); if (!$patientAge && $patientDob) { try { $dobCarbon = \Illuminate\Support\Carbon::parse($patientDob); $patientAge = $dobCarbon->age; $patientAgeMonths = $dobCarbon->diffInMonths(now()) % 12; } catch (\Throwable $e) { $patientAge = null; } } elseif ($patientAge && !$patientAgeMonths && $patientDob) { try { $patientAgeMonths = \Illuminate\Support\Carbon::parse($patientDob)->diffInMonths(now()) % 12; } catch (\Throwable $e) { $patientAgeMonths = null; } } @endphp
Pending Queue
Loading pending queue…
@if(session('success'))
{{ session('success') }}
@endif @if(session('info_new_patient'))
{{ session('info_new_patient') }}
@endif @if(session('info'))
{{ session('info') }}
@endif @if($errors->any() && !session('suppress_errors'))
Invalid data, please check fields:
    @foreach($errors->all() as $message)
  • {{ $message }}
  • @endforeach
@endif
@if(session('highlight_pid')) @endif @if(session('highlight_inner_id')) @endif
@csrf {{-- hidden base ids --}}
{{-- TAB 1 --}}
Patient Demographics
@if($pid && !$hasPtConfig)
This patient was loaded from another database. Click Save Patient to store the demographics in MAM_NAP · PtConfigs before recording visits.
@endif
@error('patient_name')
{{ $message }}
@enderror
@error('pid')
{{ $message }}
@enderror
@error('nap_id')
{{ $message }}
@enderror
@error('fuchia_id')
{{ $message }}
@enderror
date
@error('reg_date')
{{ $message }}
@enderror
@error('age')
{{ $message }}
@enderror
@error('age_months')
{{ $message }}
@enderror
date
@error('patient_dob')
{{ $message }}
@enderror
@php $oldGender = old('patient_gender'); $selectedGender = ($oldGender !== null && $oldGender !== '') ? trim($oldGender) : trim($patientInfo['Gender'] ?? ''); $selectedCompare = strtolower($selectedGender); $selectedReason = old('reason_of_ref', optional($v)->reason_of_ref); @endphp @error('patient_gender')
{{ $message }}
@enderror
@php $receptionTownships = [ 'Insein','MingalarDon','Hmawbi','Hlegu','Taikkyi','Htantabin','Shwepyithar','Hlaingtharya', 'Thingangyun','Yankin','South Okkalapa','North Okkalapa','Thaketa','Dawbon','Tamwe','Pazundaung', 'Botahtaung','Dagon Myothit (South)','Dagon Myothit (North)','Dagon Myothit (East)', 'Dagon Myothit (Seikkan)','Mingalartaungnyunt','Thanlyin','Kyauktan','Thongwa','Kayan','Twantay', 'Kawhmu','Kungyangon','Dala','Seikgyikanaungto','Cocokyun','Kyauktada','Pabedan','Lanmadaw', 'Latha','Ahlone','Kyeemyindaing','Sanchaung','Hlaing','Kamaryut','Mayangone','Dagon','Bahan','Seikkan' ]; $selectedTownship = trim(old('patient_township', $patientInfo['Township'] ?? '')); @endphp @php if ($selectedTownship && !in_array($selectedTownship, $receptionTownships, true)) { array_unshift($receptionTownships, $selectedTownship); } @endphp @error('patient_township')
{{ $message }}
@enderror @error('patient_gender')
{{ $message }}
@enderror @error('patient_township')
{{ $message }}
@enderror
@php $mainRiskOptions = ['HS','MSM','SW','IDU','Blood Transfusion','Mother to child','Unknown']; $selectedRisk = old('patient_main_risk'); if ($selectedRisk === null || $selectedRisk === '') { $selectedRisk = trim($patientInfo['Main Risk'] ?? ''); } $selectedRisk = trim((string)$selectedRisk); @endphp @error('patient_main_risk')
{{ $message }}
@enderror
date
date
art_regime_changed) ? 'checked' : '' }} >
@php $selectedStatus = old('patient_status', optional($v)->patient_status); @endphp
{{-- row --}}
{{-- TAB 2 --}}
@php $serviceOptions = [ ['name' => 'fp_service', 'label' => 'Family Planning Service Provided'], ['name' => 'sti_service', 'label' => 'STI Treatment Provided'], ['name' => 'counseling_service', 'label' => 'Counseling Service'], ['name' => 'hepc_tx', 'label' => 'HepC Tx'], ]; $oiOptions = [ ['name' => 'oi_tb', 'label' => 'TB'], ['name' => 'oi_mac', 'label' => 'MAC'], ['name' => 'oi_crypto', 'label' => 'Crypto'], ['name' => 'oi_cmv', 'label' => 'CMV'], ['name' => 'oi_pcp', 'label' => 'PCP'], ['name' => 'oi_toxo', 'label' => 'Toxo'], ['name' => 'oi_penic', 'label' => 'Penic'], ['name' => 'oi_pml', 'label' => 'PML'], ['name' => 'oi_other', 'label' => 'Other'], ]; @endphp
Services Provided
@foreach($serviceOptions as $option) @endforeach
Current OIs
@foreach($oiOptions as $option) @endforeach

Follow-up & Referral
date
@php $referralReasons = [ '1.1 : Suspect OI or diagnosed OI or taking OI, treatment or other infections', '1.2 : Suspect of drug side effect or close monitoring of drug side effect', '1.3 : Clinically unstable patient: Other', '2 : Abnormal investigation results like Cr Cl < 50/ ALT >, 3 times ULN/ Hb% < 10mg%', '3 : Patient with last viral load > 1000 (for OI screening and EAC)', '4 : Mental health problem and/or drug use issues', '5 : PMTCT patients', '6 : For Hep C management', '7 : Monthly STI screening (For active FSW)', '8 : Breast cancer screening', '9 : Cervical cancer screening', '10 : Family planning service', '11 : Other support needed', ]; $selectedReason = old('reason_of_ref'); $selectedReason = old('reason_of_ref', optional($v)->reason_of_ref); @endphp
{{-- TAB 3 --}}
Viral Load Snapshot
Lab Summary
date
ml
{{-- Example: read-only labs via AJAX card (optional) --}}
{{-- TAB 4 --}}
Follow-up history
Select a visit to edit or delete.
{{ $visits->count() }} visits
@if(($pid || $napId) && $visits->count())
@foreach($visits as $visit) @php $visitPayload = [ 'visit_id' => $visit->visit_id, 'visit_date' => $formatDisplayDate($visit->visit_date), 'age' => $visit->age, 'sex' => $visit->sex, 'main_risk' => $visit->main_risk, 'art_started_date' => $formatDisplayDate($visit->art_started_date), 'art_regime' => $visit->art_regime, 'art_regime_changed' => (bool) $visit->art_regime_changed, 'patient_status' => $visit->patient_status, 'fp_service' => (bool)$visit->fp_service, 'sti_service' => (bool)$visit->sti_service, 'counseling_service' => (bool)$visit->counseling_service, 'hepc_tx' => (bool)$visit->hepc_tx, 'oi_tb' => (bool)$visit->oi_tb, 'oi_mac' => (bool)$visit->oi_mac, 'oi_crypto' => (bool)$visit->oi_crypto, 'oi_cmv' => (bool)$visit->oi_cmv, 'oi_pcp' => (bool)$visit->oi_pcp, 'oi_toxo' => (bool)$visit->oi_toxo, 'oi_penic' => (bool)$visit->oi_penic, 'oi_pml' => (bool)$visit->oi_pml, 'oi_other' => (bool)$visit->oi_other, 'oi_other_specify' => $visit->oi_other_specify, 'next_appointment_date' => $formatDisplayDate($visit->next_appointment_date), 'refer_to_mam' => (bool)$visit->refer_to_mam, 'reason_of_ref' => $visit->reason_of_ref, 'transfer_out_center' => $visit->transfer_out_center, 'vl_test_date' => $formatDisplayDate($visit->vl_test_date), 'vl_copies_ml' => $visit->vl_copies_ml, 'vl_result' => $visit->vl_result, 'remarks' => $visit->remarks, ]; @endphp @endforeach
Visit Date Visit ID ART Regime VL Result Actions
{{ $formatDisplayDate($visit->visit_date) }} {{ $visit->visit_id }} {{ $visit->art_regime ?? '—' }} {{ $visit->vl_result ?? '—' }}
@else
No visits recorded yet.
@endif
{{-- TAB 5 --}}
Export Follow-up data
@php $exportType = old('export_type', 'followup'); @endphp
date
date
NAP ID Appointment Date Unplan Visited Unplan Visited Date
Missed List: Chosen dates အတွင်းရှိ appointments များထံမှ appointment day နေ့တွင် visit မလာသည့် လူနာများကို ပြသပါသည်။ လူနာသည် appointment day မဟုတ်ပဲ different day တစ်နေ့မှာ လာခဲ့ပါက Unplan column တွင် TRUE ဟုပြပြီး၊ visit date ကိုလည်း ပြပေးပါသည်။
Appointment List: Chosen dates အတွင်းရှိ appointments များအားလုံးကို grid format ဖြင့် ပြသထားပါသည်။ Appointment day မဟုတ်ဘဲ ±7 days အတွင်း closest visit တစ်ခုရှိပါက ထို visit date ကို Unplan columns တွင် ပြသပေးပါသည်။
{{-- TAB 6 --}}
Import legacy Excel data
Upload Microsoft Excel files exported from legacy tools.
Patient (PtConfig) Import
Download template

Columns supported: PID, NAP ID, Fuchia ID, Name, Gender, Date of Birth, Phone, Township, Address, Main Risk.

@csrf
Follow-up Visits Import
Download template

Accepts exports generated from this page. Ensure PID and Visit Date columns are filled.

@csrf
{{-- tab-content --}}
@csrf
@foreach($visits as $visit)
@csrf
@endforeach @endsection @push('scripts') @endpush