# Dokitab EMR

> Dokitab is a cloud-native, multi-tenant Electronic Medical Records (EMR) and Hospital Management System tailored for clinical operations, inpatient care, triage, inventory, HMO billing, and enterprise healthcare management in West Africa.

## Core Capabilities & Documentation

- [Full Architectural & Clinical Specification](/llms-full.txt): Dense technical specification covering database schemas, RLS tenant isolation, API endpoints, inpatient MAR, and Nigerian HMO claims processing.
- [Public OpenAPI Schema](https://api.dokitab.com/openapi.json): Full OpenAPI 3.0 specification for all public and hospital staff endpoints.
- [Clinical Sanctuary Web Admin](https://admin.dokitab.com): Desktop-first clinical workflow SPA for doctors, nurses, pharmacists, lab techs, and hospital administrators.
- [Patient Portal](https://portal.dokitab.com): Web portal for patient lab results, appointment scheduling, and invoice status tracking.

## Clinical & Administrative Modules

- [Inpatient & Bed Management](https://dokitab.com/docs/inpatient): Real-time ward occupancy, fluid balance (I/O) tracking, nursing handovers with JSONB snapshots, and Medication Administration Records (MAR).
- [Emergency Triage](https://dokitab.com/docs/triage): Rapid registration (<30s) for emergency admissions, 4-tier color-coded triage (RED/ORANGE/YELLOW/GREEN), re-triage logging, and identity merging.
- [Pharmacy & FEFO Inventory](https://dokitab.com/docs/inventory): First-Expiring, First-Out (FEFO) batch depletion, automated reorder thresholds, and clinical drug order dispensing queues.
- [HMO Claims & Billing](https://dokitab.com/docs/billing): Nigerian HMO tariff schedules, ICD-10 diagnosis scrubbing, timely filing rule engine, and Naira (₦) invoice generation.
- [Lab Investigations](https://dokitab.com/docs/investigations): Sample tracking, numeric panel entry (CBC, metabolic), result verification, and secure result attachment.

## Technical Architecture & Security

- **Backend**: Go (Gin GORM) running on PostgreSQL with Row-Level Security (RLS) tenant isolation.
- **Frontend**: React (TypeScript, Vite, TailwindCSS) with role-based access control (RBAC).
- **Mobile**: React Native (Expo, Redux Toolkit, Jest).
- **Security & Compliance**: Audit logging on all PHI access, JWT tenant context enforcement, client clock drift validation, and PostgreSQL RLS transaction wrappers.
