Electronic Health Records System for Community-Based Charity Healthcare

This project focused on developing a secure, AI-enabled Electronic Health Records (EHR) platform designed for a non-profit health institute serving low-income and remote communities. The system streamlines patient registration, medical history tracking, and health risk detection, enabling doctors, nurses, and volunteers to deliver faster, more accurate care. Built with strong privacy safeguards and optimized for low-resource environments, the platform empowers healthcare teams to maintain comprehensive records, improve continuity of care, and extend essential medical services to those who need them most.

Overview

 My Role

I led the complete design and development of the EHR system as a Machine Learning and Full-Stack Engineer. My responsibilities included:

  • Gathering requirements from medical and administrative staff.
  • Designing a secure, user-friendly data collection interface for both desktop and mobile.
  • Implementing AI modules for automated health risk detection from patient records.
  • Building a REST API for real-time access to encrypted medical data.
  • Configuring database encryption and role-based access controls to meet privacy standards.
  • Deploying the system in a containerized environment to ensure scalability and reliability.
  • Training healthcare staff and volunteers on system use and basic troubleshooting.

Collaborators

This project was delivered in close collaboration with:
• Charity Health Institute Management – defined priorities based on operational needs and patient care goals.
• Medical Staff (Doctors & Nurses) – provided input on required data fields, workflows, and reporting formats.
• IT Volunteers – supported testing, deployment, and ongoing technical maintenance.
• Health Data Analyst – advised on key metrics and reporting dashboards.

Duration Time

Total Duration: 3 months
• 2025 (3 months): Initial web-based version with core EHR functionality and basic reporting.

Client

A community-focused charity healthcare institute committed to improving access to essential medical services for underserved populations.

Completed Date

Completed: Final version delivered in Augest 2025.

Briefing

The EHR system was created to replace inefficient paper-based workflows and scattered Excel records, which often led to incomplete patient histories and delays in care. The new platform enables instant patient record creation, secure updates, and data sharing between medical staff, while an AI-powered analysis engine flags potential risks (e.g., high blood pressure, elevated BMI). The solution was built to operate reliably even in low-bandwidth environments, ensuring consistent care delivery in both urban clinics and remote outreach settings.

Outcomes

The implementation of the new system reduced patient registration and record update time by over 60%, enabling doctors to access a patient’s complete history in under five seconds. Built-in validation checks improved the accuracy of records, while AI-generated alerts increased the early detection of chronic conditions. Data security was also significantly strengthened through end-to-end encryption and role-based permissions, ensuring patient information remains protected at all times.

Problem Statements – The 4 Ws

As a Machine Learning Engineer, I applied the “4 Ws – Problem Statements” framework to clearly define and communicate the core challenge driving this project. This approach helped structure the technical and ethical scope of our work, ensuring the development of a solution that was both clinically relevant and technically feasible within a real-time, privacy-conscious context.

Who is affected?

Doctors, nurses, and administrative staff at the charity healthcare institute, as well as the patients they serve, particularly those in low-income or rural communities.

What is the problem?

Paper-based and spreadsheet-driven records are prone to errors, loss, and slow retrieval, making it difficult to provide timely, accurate, and continuous patient care.

Where does the problem occur?

At the main charity clinic and during mobile health outreach missions where patient information must be captured quickly and reliably.

Why is it important?

Accurate and accessible medical records are critical for diagnosis, treatment planning, and continuity of care. Without them, patients risk delayed treatment, repeated diagnostic tests, and missed opportunities for early intervention.

Reflection

“Before this system, I had to flip through stacks of paper files to find a patient’s history. Now, with a few clicks, I can see their entire medical journey. This has transformed how we care for our community.”

Senior Nurse, Charity Health Institute

Working on this project was both technically challenging and rewarding. Developing an EHR platform for a non-profit meant working with limited budgets, minimal infrastructure, and users with varying digital skills. I focused on creating a secure, scalable system that worked reliably despite unreliable internet, outdated hardware, and multi-role staff. The interface was designed to be simple, responsive, and support offline use to keep care uninterrupted. Seeing it in action during outreach, where patient histories could be updated instantly in remote villages, was a powerful reminder of technology’s real impact on people’s lives.

Process

From a systems engineering perspective, this project was far more than just building a patient database. It was about delivering an end-to-end, secure, and accessible health information system that could work in both modern clinics and resource-limited outreach settings. I followed the Double Diamond framework, adapting each phase to the realities of EHR development in a charity healthcare environment:

Steps

Please choose the following steps to discover the steps of the project.

This phase was dedicated to understanding the operational realities and user needs of the charity health institute. I conducted interviews with doctors, nurses, and administrative staff, and observed patient registration workflows both in the clinic and during mobile outreach programs. I also assessed the technical environment, including intermittent internet connections and outdated hardware, to ensure the system could perform under all conditions.

Key output:
A prioritized list of essential features, target performance benchmarks, and compliance requirements for handling sensitive medical data.

Based on the insights from the discovery phase, I worked with stakeholders to finalize the feature set and technical specifications. We defined strict security protocols, role-based access control levels, and a minimal but effective set of AI-assisted health risk detection metrics. We also mapped the user journeys for doctors, nurses, and administrative staff to ensure intuitive navigation and minimal training time.

Key output:
A detailed functional specification, security plan, and user interface wireframes aligned with privacy regulations.

I designed and implemented the system’s backend in Flask with a MySQL database schema, while the frontend was built in Streamlit to provide staff with a simple, form-based interface. AI modules powered by Scikit-learn and TensorFlow were integrated for health risk alerts, alongside specialized components for identity extraction (BERT), Q&A processing (Hugging Face), and sentiment analysis. The workflow also included cardiovascular risk detection, facial emotion recognition, and automated document generation (Docx → PDF → Email). To ensure reliability in field conditions, I added an offline-sync module so data could be captured without internet access and automatically updated once connectivity was restored.

Key output:
A working, internally tested EHR platform with AI-driven risk alerts, multilingual support, and real-time workflow integration.

The system was deployed on a Kubernetes-based cloud environment to ensure scalability and reliability. I conducted on-site and remote training sessions for healthcare staff and volunteers, created quick-reference guides, and established a feedback channel for ongoing improvements. The deployment included a soft-launch phase in one clinic before full rollout to all service points.

Key output:
A fully operational, secure, and AI-enabled EHR platform serving both in-clinic and outreach healthcare programs.

Technical Architecture and Workflow

The EHR system was designed as a modular, secure platform optimized for reliable data capture, AI-assisted analysis, and seamless operation in both clinic and outreach environments. Below is an overview of its core components and how they interact.

Client Side

• Data Entry Interface: Web-based application built with Streamlit for multilingual, form-based patient registration and updates.
• Field Validation: Real-time checks to prevent incomplete or invalid entries.

Network Layer

• HTTPS Communication: All data transfers are encrypted in transit using TLS.
• REST API: Flask-based endpoints handle patient data submission, retrieval, and updates.
• Authentication Layer: JWT-based role authentication (doctor, nurse, admin) controls access to records and actions.

Backend (Server Side)

• Record Processing Module: Validates and formats incoming data before storage.
• AI Risk Detection Engine: TensorFlow and Scikit-learn models flag potential health risks based on vitals and other key patient data.
• Database Layer: MySQL with encrypted tables for sensitive fields and a full audit log for all changes.
• Report Generation Service: Creates PDF summaries of visits and alerts, stored with the patient record and available for secure download.
• Notification Service: Sends AI alerts and summary reports to authorized staff via email or dashboard notifications.
• Monitoring & Logging: System health checks, user activity tracking, and data access auditing.

Deployment

• Containerized with Docker for portability.
• Reverse proxy with Nginx for load handling and HTTPS termination.
• Deployed on Kubernetes with automated backups and scalable pods.
• Designed for integration with laboratory systems or external health analytics platforms via secure REST endpoints.

Challenges & Solutions

A project of this scope came with several technical and ethical challenges. Here’s how I addressed them:

Limited VPS resources (CPU-only)

Running LLM prompts and TensorFlow inference on a standard VPS led to contention and latency spikes.

Solution:

Right-sized Kubernetes manifests with explicit CPU/RAM requests & limits, tuned concurrency, and added readiness/liveness probes to keep services responsive. On the ML side, I lightened models (TFLite/ONNX conversion, FP16/INT8 quantization, pruning/distillation, batch size = 1) and optimized the pipeline with caching and async I/O. Where appropriate, heavy LLM steps were offloaded to hosted APIs.

Outcome:

Stable real-time performance within tight VPS budgets, without sacrificing key functionality.

DEMO

“EHR Portfolio Demo – Hosam Zolfonoon Portfolio”

This video presents an AI-enabled EHR system from Hosam Zolfonoon’s portfolio, designed for charity clinics and outreach programs. It features a Streamlit interface with Flask and MySQL for quick patient registration and monitoring. AI modules built with Scikit-learn, TensorFlow, and Hugging Face power health alerts and automated reporting, with offline-sync for low-connectivity areas. To request access to a live test demo, please get in touch via: contact@hosamzolfonoon.pt.

Conclusion

The development of this Electronic Health Records system marked a significant step forward for the charity health institute’s ability to provide fast, accurate, and continuous care. By replacing fragmented paper records with a secure, AI-enabled platform, the clinic now delivers more timely diagnoses, better follow-up, and improved patient outcomes in the clinic and in remote outreach programs. Beyond the technology, the project’s real impact lies in empowering healthcare workers with the tools they need to serve their communities more effectively. The system’s offline-first design, multilingual interface, and built-in risk alerts ensure it remains practical in challenging environments while adhering to strict privacy standards. With a solid foundation in place, the platform is ready for future enhancements, including lab result integration, patient self-check-in, and expanded analytics. This EHR system demonstrates how thoughtful, human-centered engineering can strengthen healthcare delivery where it’s needed most.

Let’s Connect

Are you working on a project that bridges machine learning, real-time systems, or digital health?
Whether you’re building something innovative, looking for a technical collaborator, or just want to exchange ideas, I’d love to hear from you.
Feel free to reach out for a chat about projects, collaborations, or research.
Email me at: contact@hosamzolfonoon.pt
Let’s build technology that truly makes a difference.