AushadhiAI: AI-Powered Prescription Analysis System
A technical deep dive into how we built a cloud-native system that transforms handwritten prescriptions into structured medication information

I am a student studying in Mumbai University, learning DevOps, looking for opportunities to learn more things by gaining experience at prestigious institutions
Introduction
AushadhiAI is an innovative solution that leverages artificial intelligence and Azure Computer Vision to decode doctors' handwritten prescriptions, making medication information accessible and understandable for patients. This technical deep dive explores the architecture, implementation details, and key features of the AushadhiAI system.
System Architecture
AushadhiAI employs a modern, scalable architecture that separates frontend and backend concerns while leveraging cloud services for advanced AI capabilities.
Key Components
- Frontend: HTML, CSS, and JavaScript providing a responsive user interface
- Backend API: FastAPI application providing RESTful endpoints for image analysis
- Azure Vision Service: Cloud-based OCR through Azure Computer Vision API
- Medication Service: Logic for identifying medications from extracted text
- Medication Database: JSON-based storage of medication information
Technical Implementation Details
Backend System
The backend is built with FastAPI, a modern, high-performance web framework for building APIs with Python. It provides several key endpoints:
Key Backend Components:
- app.py: Main FastAPI application that defines all endpoints
- services/azure_vision_service.py: Handles communication with Azure Computer Vision API
- services/ocr_service.py: Manages text extraction from images with fallback mechanisms
- services/med_service.py: Identifies medications from extracted text
- services/rxnorm_service.py: Integrates with RxNorm for standardized medication information
Prescription Analysis Process
The prescription analysis workflow involves several steps:
Frontend Implementation
The frontend provides an intuitive interface for users to upload and analyze prescriptions:
The interface includes:
- Upload Section: For prescription image upload
- Processing Visualization: Shows analysis progress
- Results Display: Presents identified medications and details
- Responsive Design: Works across desktop and mobile devices
Deployment Architecture
AushadhiAI is deployed using a modern cloud-based infrastructure:
Deployment Components:
- Frontend: Hosted on GitHub Pages (static hosting)
- Backend: Containerized with Docker and deployed on AWS Elastic Beanstalk
- CI/CD: Automated deployment using GitHub Actions
- Monitoring: AWS CloudWatch for performance and error tracking
System Features
1. Robust OCR Capabilities
The system uses Azure Computer Vision API for high-quality OCR, with a fallback mechanism for offline operation:
2. Medication Identification
The system identifies medications using a combination of techniques:
3. Error Handling and Resilience
The system is designed with robust error handling:
Performance Considerations
The most computationally intensive parts of the system are:
- OCR Processing: Handled by Azure Computer Vision to offload processing
- Medication Identification: Optimized with efficient text matching algorithms
- Image Preprocessing: Used to enhance OCR accuracy
Security Implementation
Key security considerations:
- CORS Configuration: Prevents unauthorized cross-origin requests
- Input Validation: Sanitizes and validates all user input
- API Key Management: Securely stores and manages Azure API keys
- Error Handling: Prevents information leakage in error responses
Future Enhancements
The system is designed for extensibility, with planned enhancements:
Conclusion
AushadhiAI represents a powerful application of AI technology to solve real-world healthcare challenges. By combining Azure Computer Vision's advanced OCR capabilities with custom medication identification algorithms, the system effectively bridges the gap between handwritten prescriptions and patient understanding.
The architecture balances performance, reliability, and user experience, with careful consideration given to fallback mechanisms that ensure the system remains functional even when cloud services are unavailable.
Through its modern deployment architecture and thoughtful technical implementation, AushadhiAI demonstrates how cloud-native applications can deliver meaningful solutions to everyday problems.





