About the project
A clinic needs to know who a patient is, what they are allergic to, what they take and what the last doctor found, at the moment the patient sits down. aaafiya keeps each patient's record with a record number, and their allergies, long-term conditions, medicines, operations and family history as separate entries rather than a block of text. Reports, letters and photos are filed on the record as PDFs and images, kept on the clinic's own server or in S3 or MinIO storage. Before a new patient is registered it checks for someone with the same name and date of birth, phone or email.
Who sees a record is decided per doctor: the patient's own doctor, a colleague the record is shared with until a chosen day, or the front desk, which sees everyone. Every time a record is opened, that is written to the activity log, so searching the log for a record number shows who has looked at it.
Each doctor's working hours and days off become bookable slots. The front desk books any free time and patients book a free slot themselves. When two people take the same slot at once, the second is told it has gone. Patients get emails when a booking is made, moved or cancelled, and a reminder the day before by email and text message, through Twilio or any SMS gateway. On the day, checking in gives the patient a token, walk-ins join the same queue, the doctor calls the next patient in, and a screen in the waiting area shows only the token numbers. Follow-up dates written in notes become a list of who is due back and has not booked yet.
The doctor writes a note per visit: the complaint, the examination with vitals and BMI, the diagnosis and plan, a prescription and, when needed, a medical certificate. A note can be edited until the end of the day it was written. After that it can only be amended, and each amendment is dated and signed. A summary written for the patient appears in their own record, and the prescription and certificate print as PDFs. Lab orders take tests from the clinic's catalogue. A typed result is flagged High, Low or Normal against the test's range, and the lab's own report can be filed against the order and shared with the patient.
Billing raises an invoice per visit from a price list, with discounts and an insurer and claim number. Payments and refunds are each a numbered receipt, and invoices and receipts print as PDFs. Reports cover takings by payment method, outstanding balances by age, revenue by doctor, services sold and each doctor's appointments, with no-show rates, as CSV and PDF.
The AI reads and drafts; the doctor decides. It reads a lab's PDF into the results form and a hospital letter into the medical history. It keeps an entry only when the document says it, shows the line each entry came from, and leaves out what is already on the record. It also explains a period's figures on the dashboard and answers questions from the user manual. Before a document goes to the AI, the patient's name, record number and contact details are taken out of it. It runs on Tech5AI, Tech5A's self-hosted Ollama service, by default, or on Gemini, OpenAI or Claude. A backup provider answers when the first cannot be reached, each feature can use its own model, and there are daily limits and a spending budget. Every AI call appears in the activity log with its keys hidden, and a set of test cases is kept for every feature that reads documents.
Patients register themselves and see their own record: what the clinic has shared, their visits, appointments, bills and lab results. They can add allergies, medicines and documents, which stay marked as theirs until a doctor confirms them. Permissions are set per person across every part of the app. Doctors, staff and administrators can be made to sign in with a code from an authenticator app, and sign-in with Google, Facebook or Apple can be switched on.
One ASP.NET Core 10 API and SQL Server database serve three apps: a Vue 3 web app with light and dark themes, a native Android app in Kotlin and Jetpack Compose, and a native iPhone app in SwiftUI. It runs in Docker behind Caddy on Linux, or on Windows with IIS. A setup wizard guides the first start, and the user manual and technical guides come as PDFs.
