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

MAM_NAP · ART Care

@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 : ''; } }; $parseDisplayDate = function ($value) { if (blank($value)) { return null; } if ($value instanceof \Carbon\CarbonInterface) { return $value; } $raw = trim((string) $value); try { if (preg_match('/^\d{1,2}[\/-]\d{1,2}[\/-]\d{4}$/', $raw)) { $normalized = str_replace('/', '-', $raw); return \Illuminate\Support\Carbon::createFromFormat('d-m-Y', $normalized); } return \Illuminate\Support\Carbon::parse($raw); } catch (\Throwable $e) { return null; } }; $patientDob = $formatDisplayDate($patientInfo['Date Of Birth'] ?? ($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(); $visitTotal = method_exists($visits, 'total') ? $visits->total() : $visits->count(); $visitPageCount = $visits->count(); $visitHasPages = method_exists($visits, 'hasPages') ? $visits->hasPages() : false; $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 = $parseDisplayDate($patientDob); if ($dobCarbon === null) { throw new \RuntimeException('Invalid DOB'); } $patientAge = $dobCarbon->age; $patientAgeMonths = $dobCarbon->diffInMonths(now()) % 12; } catch (\Throwable $e) { $patientAge = null; } } elseif ($patientAge && !$patientAgeMonths && $patientDob) { try { $dobCarbon = $parseDisplayDate($patientDob); if ($dobCarbon === null) { throw new \RuntimeException('Invalid DOB'); } $patientAgeMonths = $dobCarbon->diffInMonths(now()) % 12; } catch (\Throwable $e) { $patientAgeMonths = null; } } $clinicOptions = $clinicOptions ?? []; $selectedClinicId = $selectedClinicId ?? ($patientInfo['Clinic_ID'] ?? null); @endphp
Use this Inner ID when correcting PID, NAP ID, or Fuchia ID.
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 @php $duplicateMatches = session('duplicate_matches', []); $duplicateIdentifier = session('duplicate_identifier'); $hasDuplicateMatches = !empty($duplicateMatches); @endphp
@foreach($duplicateMatches as $match) @php $clinicName = $clinicOptions[$match['clinic_id'] ?? ''] ?? ($match['clinic_id'] ?? '—'); @endphp @endforeach
Inner ID NAP ID PID Fuchia ID Name Clinic Action
{{ $match['id'] ?? '—' }} {{ $match['nap_id'] ?? '—' }} {{ $match['pid'] ?? '—' }} {{ $match['fuchia_id'] ?? '—' }} {{ $match['name'] ?? '—' }} {{ $clinicName }} Load
@csrf {{-- hidden base ids --}}
{{-- TAB 1 --}}
Patient Demographics
@if($pid && !$hasPtConfig && ($patientInfo['DB_Location'] ?? null))
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('clinic_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' => 'prevention_commodities_provided', 'label' => 'Prevention Commodities 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
STI Services
@php $stiPatientTypes = ['non-KP', 'MSM', 'TGW', 'FSW', 'PWID']; $stiVisitTypes = ['3months', '6months', '12months']; $yesNoOptions = ['Yes', 'No']; $rprOptions = [ 'Neat', '1:2', '1:4', '1:8', '1:16', '1:32', '1:64', '1:128', '1:256', '1:512', '1:1024', 'More than 1024' ]; $stiPatientValue = old('sti_patient_type', optional($v)->sti_patient_type); $stiVisitValue = old('sti_visit_type', optional($v)->sti_visit_type); $stiComplaintValue = old('sti_complaint', optional($v)->sti_complaint); $stiRdtValue = old('sti_syphilis_rdt_result', optional($v)->sti_syphilis_rdt_result); $stiRprValue = old('sti_syphilis_rpr_result', optional($v)->sti_syphilis_rpr_result); $stiRprQualValue = old('sti_syphilis_rpr_qual', optional($v)->sti_syphilis_rpr_qual); $stiGcCtValue = old('sti_presumptive_gc_ct_rx', optional($v)->sti_presumptive_gc_ct_rx); $stiSyphRxValue = old('sti_syphilis_rx', optional($v)->sti_syphilis_rx); @endphp

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', '12 : NCD', ]; $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.
{{ $visitTotal }} visits
@if(($pid || $napId) && $visitTotal)
@forelse($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, 'fp_condom' => (bool)$visit->fp_condom, 'fp_oc_pills' => (bool)$visit->fp_oc_pills, 'fp_depo' => (bool)$visit->fp_depo, 'prevention_commodities_provided' => (bool)$visit->prevention_commodities_provided, 'prevention_condom' => (bool)$visit->prevention_condom, 'prevention_ns' => (bool)$visit->prevention_ns, 'sti_patient_type' => $visit->sti_patient_type, 'sti_visit_type' => $visit->sti_visit_type, 'sti_complaint' => $visit->sti_complaint, 'sti_syphilis_rdt_result' => $visit->sti_syphilis_rdt_result, 'sti_syphilis_rpr_result' => $visit->sti_syphilis_rpr_result, 'sti_syphilis_rpr_qual' => $visit->sti_syphilis_rpr_qual, 'sti_presumptive_gc_ct_rx' => $visit->sti_presumptive_gc_ct_rx, 'sti_syphilis_rx' => $visit->sti_syphilis_rx, '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 @empty @endforelse
Visit Date Visit ID ART Regime VL Result Actions
{{ $formatDisplayDate($visit->visit_date) }} {{ $visit->visit_id }} {{ $visit->art_regime ?? '—' }} {{ $visit->vl_result ?? '—' }}
No visits on this page.
@if($visitHasPages)
{{ $visits->links() }}
@endif @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: Clinic_ID, Inner ID, Pid, NAP_ID, Fuchia_ID, Name, Gender, Date_of_Birth, Phone, Township, Address, Main_Risk, Notes, Reg_Date.

Follow-up Visits Import
Download template

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

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