How kingdev4522/clinic works
City Multi-Specialty Clinic is a monolithic C CLI for staff and patient workflows. Users authenticate into role-specific portals; clinical visits move through intake, doctor evaluation, lab work, and billing, while pharmacy sales and patient history are also supported. The README describes a flat-file database engine, credential encryption, audit logging, and exported prescriptions, lab reports, and invoices. The excerpts confirm database loading, audit writes, password handling, and document generation; other portal and routing links reflect documented capabilities, not inspected call sites.
Main entry points: clinic.c Authentication and RBAC · visits_db.txt Visit Ledger · audit_log.txt Audit Log · patient_db.txt Account Files
Components 23
Access and Portals
- Main Gateway
clinic.c - Authentication and RBAC
clinic.c - Admin Portal
clinic.c - Employee Portal
clinic.c - Doctor Portal
clinic.c - Lab Portal
clinic.c - Patient Portal
clinic.c
Clinical Workflow
- Patient Intake
clinic.c - Clinical Evaluation
clinic.c - Visit Routing
clinic.c - Lab Diagnostics
clinic.c - Billing and Discharge
clinic.c - Pharmacy Sales
clinic.c - Patient History
clinic.c
Records and Persistence
- Flat-File Engine
clinic.c - Account Files
patient_db.txt - Visit Ledger
visits_db.txt - Pharmacy Ledger
pharmacy_db.txt
Security and Outputs
- Credential Encryption
clinic.c - Audit Log
audit_log.txt - Clinical Documents
clinic.c - Exported Reports
Other components
- CLI User
Connections 35
- CLI User → Main Gateway: uses
- Main Gateway → Flat-File Engine: loads data
- Main Gateway → Authentication and RBAC: dispatches
- Authentication and RBAC → Credential Encryption: encrypts credentials
- Authentication and RBAC → Account Files: checks accounts
- Authentication and RBAC → Admin Portal: opens portal
- Authentication and RBAC → Employee Portal: opens portal
- Authentication and RBAC → Doctor Portal: opens portal
- Authentication and RBAC → Lab Portal: opens portal
- Authentication and RBAC → Patient Portal: opens portal
- Admin Portal → Account Files: manages accounts
- Employee Portal → Patient Intake: registers patients
- Employee Portal → Billing and Discharge: processes checkout
- Employee Portal → Pharmacy Sales: records sales
- Doctor Portal → Clinical Evaluation: evaluates visits
- Doctor Portal → Visit Routing: routes visits
- Lab Portal → Lab Diagnostics: processes tests
- Lab Diagnostics → Visit Routing: returns for billing
- Patient Intake → Visit Routing: sets visit state
- Visit Routing → Visit Ledger: updates status
- Billing and Discharge → Visit Ledger: records checkout
- Pharmacy Sales → Pharmacy Ledger: records sales
- Patient Portal → Patient History: views records
- Patient History → Visit Ledger: reads history
- Flat-File Engine → Account Files: reads and writes
- Flat-File Engine → Visit Ledger: reads and writes
- Flat-File Engine → Pharmacy Ledger: reads and writes
- Admin Portal → Audit Log: logs actions
- Employee Portal → Audit Log: logs actions
- Doctor Portal → Audit Log: logs actions
- Lab Portal → Audit Log: logs actions
- Clinical Documents → Exported Reports: writes reports
- Doctor Portal → Clinical Documents: exports prescriptions
- Lab Diagnostics → Clinical Documents: exports lab reports
- Billing and Discharge → Clinical Documents: exports invoices