Community Article
Community articles are authored by SitePoint Premium contributors. Content is screened before publication, and SitePoint reserves the right to moderate or remove articles that violate our guidelines. Views expressed are those of the authors and do not necessarily reflect those of SitePoint.
Beyond Digital Charts: How Developers Can Turn EHR Data into Actionable Healthcare Applications
SZShilei ZhangPublished inAI·Database·Databases·Data types·
August 12, 2026
The AI briefing for Developers
Stay up to date with AI tools, model releases, and developer workflows that matter.
Weekly. Free. One click to leave.
SitePoint Premium
Stay Relevant and Grow Your Career in Tech
- Premium Results
- Publish articles on SitePoint
- Daily curated jobs
- Learning Paths
- Discounts to dev tools
7 Day Free Trial. Cancel Anytime.
Introduction
Electronic health records have changed how healthcare organizations store patient information, but digitizing a medical chart is only the beginning.
An EHR may contain diagnoses, medications, laboratory results, procedures, appointments, allergies, and clinical observations. Yet much of that information remains locked inside individual workflows and is primarily used to document what has already happened.
The larger opportunity is to make that data usable.
Modern interoperability standards such as FHIR (Fast Healthcare Interoperability Redardized healthcare data through APIs. Once those records can be accessed programmatically, they can support applications for care-gap detection, patient engagement, clinical decision support, population health analytics, and other use cases
In this article, we’ll examine how EHR data flows through a modern healthcare application, retrieve simplified patient information through a FHIR-style REST API, and build a basic care-gap detection service in Python.
The goal isn’t to replace an EHR. It’s to show how developers can build useful applications around the data an EHR already contains.
From Medical Records to Structured Data
A traditional medical record contains information such as a patient’s diagnoses, medications, laboratory results, previous procedures, and physician notes.
Modern EHR platforms increasingly expose at least some of this information using standardized re
FHIR organizes healthcare information into re, Encounter, and Procedure
Instead of receiving an entire medical chart, an application can request the specific re
GET /fhir/Patient/12345A simplified response might look like this:
{
"resourceType": "Patient",
"id": "12345",
"gender": "female",
"birthDate": "1972-08-14"
}The same application could request clinical observations:
GET /fhir/Observation?patient=12345The response could contain laboratory measurements or other clinical observations.
{
"resourceType": "Observation",
"status": "final",
"code": {
"text": "Hemoglobin A1c"
},
"valueQuantity": {
"value": 7.4,
"unit": "%"
}
}The important architectural change is that the healthcare application doesn’t need to understand every EHR’s internal database structure. It communicates through an interoperability layer with a standardized representation of healthcare information.
A simplified architecture looks like this:
EHR
|
v
FHIR API
|
v
Application Backend
|
+----------------------+
| |
v v
Care-Gap Engine Analytics
| |
v v
Provider Portal Population DashboardThis separation creates opportunities to build specialized applications without rebuilding the underlying clinical record system.
Retrieving EHR Data with Python
A developer can interact with a FHIR REST endpoint in much the same way as other web APIs.
For illustration, consider the following Python request:
import requests
FHIR_BASE_URL = "https://example-health-system.com/fhir"
patient_id = "12345"
response = requests.get(
f"{FHIR_BASE_URL}/Patient/{patient_id}",
headers={
"Accept": "application/fhir+json",
"Authorization": "Bearer ACCESS_TOKEN"
},
timeout=10
)
response.raise_for_status()
patient = response.json()
print(patient)The endpoint and token above are placeholders. Production authentication depends on the EHR and implementation, and healthcare APIs should never be called by hard-coding real credentials into application
We can then extract the information our application actually needs.
patient_profile = {
"patient_id": patient.get("id"),
"gender": patient.get("gender"),
"birth_date": patient.get("birthDate")
}
print(patient_profile)This seems simple, but it establishes an important pattern:
retrieve → validate → transform → use
Developers shouldn’t assume that every expected field will exist.
A safer transformation might look like this:
def normalize_patient(resource):
if resource.get("resourceType") != "Patient":
raise ValueError("Expected Patient resource")
return {
"patient_id": resource.get("id"),
"gender": resource.get("gender", "unknown"),
"birth_date": resource.get("birthDate")
}Healthcare data is frequently incomplete. Defensive handling of optional and missing fields is therefore an important part of application design.
Combining Multiple FHIR Resources
A patient profile alone doesn’t tell us much about healthcare needs.
Suppose we want to build an application that identifies potential care gaps. We may need information from several re
def get_fhir_resource(resource, params=None):
response = requests.get(
f"{FHIR_BASE_URL}/{resource}",
params=params,
headers={
"Accept": "application/fhir+json",
"Authorization": "Bearer ACCESS_TOKEN"
},
timeout=10
)
response.raise_for_status()
return response.json()We can reuse the function to request different information.
conditions = get_fhir_resource(
"Condition",
{"patient": patient_id}
)
observations = get_fhir_resource(
"Observation",
{"patient": patient_id}
)
procedures = get_fhir_resource(
"Procedure",
{"patient": patient_id}
)Our application now has several views of the patient’s history.
Patient
|
+---- Conditions
|
+---- Observations
|
+---- ProceduresThat is where EHR interoperability becomes more useful than simply displaying an electronic chart.
The application can begin evaluating relationships between the data.
Building a Simple Care-Gap Engine
Consider a simplified example.
Suppose an application needs to determine whether a patient appears to have received a particular preventive service within a specified period.
First, we can normalize the procedure history.
from datetime import datetime
def extract_procedures(bundle):
procedures = []
for entry in bundle.get("entry", []):
resource = entry.get("resource", {})
if resource.get("resourceType") != "Procedure":
continue
procedures.append({
"code": resource.get("code", {}).get("text"),
"date": resource.get("performedDateTime")
})
return proceduresWe can then search for the service.
def has_recent_service(procedures, service_name, cutoff_date):
for procedure in procedures:
if procedure["code"] != service_name:
continue
if not procedure["date"]:
continue
service_date = datetime.fromisoformat(
procedure["date"].replace("Z", "+00:00")
)
if service_date >= cutoff_date:
return True
return FalseThe resulting business logic might look like this:
if has_recent_service(
procedure_history,
"Preventive Screening",
cutoff_date
):
status = "Completed"
else:
status = "Potential Care Gap"This is deliberately simplified. Real quality measures can have complicated eligibility, exclusion, coding, timing, and clinical requirements.
That’s an important distinction.
A production application shouldn’t translate a quality measure into a few arbitrary if statements and assume the result is clinically valid. Measure specifications and terminology should come from authoritativentation
Nevertheless, the example illustrates the underlying engineering pattern:
Clinical Data
|
v
Standardization
|
v
Rules Engine
|
v
Care-Gap Status
|
v
ActionTurning Detection into Action
Finding a potential care gap has limited value if nobody acts on it.
This is where EHR applications can connect analytics with workflow.
{
"patient_id": "12345",
"care_gap": "Preventive Screening",
"status": "Potential Care Gap",
"priority": "medium"
}That output could feed several applications.
A provider portal could show outstanding opportunities before an appointment. A care-management application could create an outreach queue. A patient application could provide an appropriate reminder. Population health teams could aggregate the results to understand where gaps are concentrated.
EHR
|
v
FHIR API
|
v
Data Processing
|
v
Care-Gap Engine
|
+--------+--------+
| | |
v v v
Provider Member Analytics
Portal App DashboardThe EHR remains the clinical information system. The surrounding applications make that information easier to use for specific workflows.
Using EHR Data for Population Health
The same concept can be extended from one patient to an entire population.
Suppose the application creates a normalized dataset containing:
Patient_ID
Age
Condition
Last_Visit
Care_Gap
Care_Gap_StatusPython can aggregate the results:
import pandas as pd
df = pd.read_csv("care_gap_results.csv")
summary = (
df.groupby("Care_Gap_Status")
.size()
.reset_index(name="Patients")
)
print(summary)A Tableau dashboard could then display the percentage of patients with identified gaps, trends over time, distribution by age group, differences across provider groups, and completion rates following outreach.
This is where EHR data becomes particularly valuable for healthcare analytics.
How many visits occurred last month?
organizations can begin asking:
Which patients may need attention next?
EHR Data and Health Plan Data Solve Different Problems
There is another important distinction for developers building healthcare applications.
EHR data and health plan data aren’t interchangeable.
An EHR provides detailed clinical information about care documented within connected provider systems. Health plan data provides a broader administrative view through eligibility, enrollment, claims, and other payer information.
Consider a patient who visits multiple providers.
One EHR may contain detailed laboratory results from one health system but have limited visibility into services delivered somewhere else. Claims data may show that another service occurred, but it may lack the clinical detail contained in the EHR.
Combining appropriately authorized
EHR Data
Clinical Detail
> Unified Healthcare View
/
/
Claims + Enrollment Data
Utilization and CoverageThis combination can support more sophisticated population health applications, but it also increases the importance of identity matching, data provenance, access controls, and governance.
Data Quality Is Still the Hard Part
APIs don’t automatically make healthcare data clean.
Developers should expect missing values, duplicate records, inconsistent terminology, delayed updates, conflicting
For example, a production pipeline should validate incoming re
def validate_observation(resource):
errors = []
if resource.get("resourceType") != "Observation":
errors.append("Invalid resource type")
if "status" not in resource:
errors.append("Missing status")
if "code" not in resource:
errors.append("Missing observation code")
return errorsInstead of silently accepting bad records, the application can log them for investigation.
errors = validate_observation(observation)
if errors:
logger.warning(
"Observation validation failed: %s",
errors
)This becomes especially important when downstream applications influence operational or clinical workflows.
Security and Privacy Can’t Be an Afterthought
Healthcare applications may process protected health information, so security needs to be part of the architecture from the beginning.
API credentials should be stored in secure secret-management systems rather than appropriate authorization, minimize the data they retrieve, and maintain audit trails for sensitive operations
Developers should also distinguish between being able to retrieve data and being authorized to use it for a particular purpose. Technical access alone doesn’t establish an appropriate healthcare use case.
For applications handling PHI, HIPAA requirements and organizational security policies may also affect hosting, logging, storage, vendor relationships, and data retention.
Where EHR Applications Go Next
Once reliable interoperability exists, increasingly sophisticated applications become possible.
Machine learning could help prioritize large care-management queues. Natural-language processing could help structure appropriate portions of clinical documentation. Predictive analytics could identify populations that may require additional support. Patient-facing applications could make medical information easier to understand and navigate.
But sophisticated AI shouldn’t be the starting point.
The foundation is much less glamorous:
Reliable Data
↓
Interoperability
↓
Validation
↓
Business / Clinical Logic
↓
Workflow Integration
↓
Analytics and AIWithout the first four layers, adding AI simply creates a more sophisticated way to process unreliable information.
Conclusion
Electronic health records have already solved one major healthcare problem: moving large amounts of clinical information from paper into digital systems.
The next challenge is making that information more useful.
FHIR APIs give developers a standardized way to connect applications with EHR data. From there, healthcare organizations can build care-gap engines, provider tools, population health dashboards, patient applications, and other services that transform clinical records into actionable workflows.
The most valuable EHR applications won’t necessarily be the ones with the most complicated algorithms. They’ll be the ones that reliably connect the right data with the right person at the right moment.
For developers, that means the future of EHR technology isn’t simply about building better digital charts.
It’s about building useful software around the data inside them.


