powerbi-openehr-aql¶
A native Power BI custom data connector for openEHR Archetype Query Language (AQL).
Run AQL against an openEHR Clinical Data Repository directly from Power BI Desktop. Pagination, Reference-Model flattening, and Power BI Service refresh through the on-premises gateway are handled for you.
Pre-release
v0.1.0 is in active development against EHRbase 2.x. The source plan tracks the full roadmap. Expect breaking changes until v1.0.0.
How it fits together¶
flowchart LR
A["Power BI Desktop<br/>or Service"] -->|Get Data → openEHR| B["OpenEHR.pq<br/>(section document)"]
B --> C["Aql.pqm<br/>HTTP + auth"]
B --> D["Paging.pqm<br/>lag-one"]
B --> E["Schema.pqm<br/>RM flatten"]
B --> F["Navigation.pqm<br/>nav-table"]
C -->|POST /query/aql| G[("openEHR CDR<br/>EHRbase 2.x")]
D --> C
E --> C
F --> C
60-second install¶
- Download the signed
OpenEHR.pqx(anddev-cert.cer) from the latest GitHub Release. - Import
dev-cert.cerinto Windows trust stores once — see Self-signed cert install. - Drop
OpenEHR.pqxinto%USERPROFILE%\Documents\Power BI Desktop\Custom Connectors\. - Restart Power BI Desktop → Get Data → Other → openEHR (Beta).
Why this connector¶
- Native AQL, not a SQL bridge. Queries go straight to
/query/aql, so archetype-bound semantics are preserved. - RM-aware flattening.
DV_QUANTITY,DV_CODED_TEXT,DV_DATE_TIME,DV_IDENTIFIER, and similar shapes become scalar columns. - Lag-one pagination. Large result sets stream rather than failing on hard limits.
- Service-safe.
TestConnectionis implemented;Web.Contentsbase URLs are static;ExcludedFromCacheKey = {"Authorization"}keeps rotating tokens from poisoning the cache. - Zero PHI in logs. No row-level
Diagnostics.Trace; no query bodies atInformation.
Where to go next¶
- Analyst — End-user install, then the Blood-pressure cookbook.
- Gateway admin — Gateway admin install.
- Developer / integrator — Functions, Options, Error codes.
- Auth setup — Basic, OAuth PKCE, Entra ID.
- Something broken — Troubleshooting.