Skip to content

Add MVP dashboard API for MePRAM#1

Merged
Aberdur merged 5 commits into
BU-ISCIII:developfrom
Aberdur:develop
May 21, 2026
Merged

Add MVP dashboard API for MePRAM#1
Aberdur merged 5 commits into
BU-ISCIII:developfrom
Aberdur:develop

Conversation

@Aberdur
Copy link
Copy Markdown
Collaborator

@Aberdur Aberdur commented May 20, 2026

PR Description

Adds the first MePRAM API MVP, implemented as a read-only Django/DRF service over the aggregated PostgreSQL dashboard schema generated from OMOP data.

The project structure follows the PathoCore API layout where practical:

  • conf/ for settings, URLs, WSGI and requirements
  • core/api/services/ for query/service logic
  • core/api/v1/ for serializers, views and routes
  • Docker test stack with PostgreSQL + API
  • OpenAPI/Swagger via drf-spectacular

Scope

This API exposes aggregated dashboard data from dashboard.sql:

  • cohort summaries
  • OMOP domains
  • concepts
  • concept facts
  • numeric measurements
  • categorical measurements
  • age, sex and age+sex stratifications

Main Endpoints

  • GET /v1/health
  • GET /v1/metadata
  • GET /v1/capabilities
  • GET /v1/cohort/summary
  • GET /v1/domains
  • GET /v1/domains/{domain_id}/concepts
  • GET /v1/concepts
  • GET /v1/concepts/{concept_id}
  • GET /v1/concepts/{concept_id}/detail
  • GET /v1/facts/concepts
  • GET /v1/measurements/numeric
  • GET /v1/measurements/categorical

@Aberdur Aberdur self-assigned this May 20, 2026
Comment thread core/api/services/cohort.py Outdated
"total_patients": _total_patients(),
"by_age": db.fetch_all(
"""
SELECT age_group, COUNT(*)::integer AS patients
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these queries don’t follow the Django ORM definition. It might be worth considering creating a models.py that matches the current DB definition. This could help with future migrations when the DB design gets updated.

Comment thread CHANGELOG.md
@Aberdur Aberdur merged commit f36c7ba into BU-ISCIII:develop May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants