I am not sure if this has been asked before. I am asking again since I could not find an answer
Does AQL support an array of EHRs? In AQL specs i can see examples to query any a single EHR and across all EHRs in the system. If I want to limit my query to a set of EHRs is it possible using AQL?
Use case - As part of a dynamic consent management framework, we keep a dynamic mapping of EHRs to organizations. This is kept updated based on patient consent. So at any time a query is run by an organization, it should be limited to the EHRs that it has consent at that point of time.
SELECT
e/ehr_id/value, a/data[at0001]/events[at0006]/time,
a/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value,
a/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value – diastolic
FROM EHR e CONTAINS OBSERVATION a[openEHR-EHR-OBSERVATION.blood_pressure.v1]
WHERE e/ehr_id/value MATCHES { ‘e241715b-3ca7-435e-a474-718579aadaa2’, ‘0e7ac1d6-2dc6-40ec-8259-ac9f9a9727d1’, ‘ed74f788-4bd6-4e47-ab98-211643cc4b0c’}
Thanks. Is this part of the AQL spec or a feature that THinkEhr has implemented?
Given the emerging importance of patient consent, given the GDPR and similar rules coming our across the world (DISHA in India), this may become a basic requirement in any EHR systems of the future. A static mapping of an EHR to the creator organization, as is normal in provider centric systems, may not be good enough.