Add MVP dashboard API for MePRAM#1
Merged
Merged
Conversation
Daniel-VM
reviewed
May 20, 2026
| "total_patients": _total_patients(), | ||
| "by_age": db.fetch_all( | ||
| """ | ||
| SELECT age_group, COUNT(*)::integer AS patients |
Member
There was a problem hiding this comment.
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.
Daniel-VM
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Adds the first MePRAM API MVP, implemented as a read-only Django/DRF service over the aggregated PostgreSQL
dashboardschema generated from OMOP data.The project structure follows the PathoCore API layout where practical:
conf/for settings, URLs, WSGI and requirementscore/api/services/for query/service logiccore/api/v1/for serializers, views and routesdrf-spectacularScope
This API exposes aggregated dashboard data from
dashboard.sql:Main Endpoints
GET /v1/healthGET /v1/metadataGET /v1/capabilitiesGET /v1/cohort/summaryGET /v1/domainsGET /v1/domains/{domain_id}/conceptsGET /v1/conceptsGET /v1/concepts/{concept_id}GET /v1/concepts/{concept_id}/detailGET /v1/facts/conceptsGET /v1/measurements/numericGET /v1/measurements/categorical