AQL support for an array of ehr_id

Hi,

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.

regards

Hi Dileep - this is supported by THinkEhr…

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’}

Dear Ian,

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.

regards

It seems to work on Ethercis for this

{
“executedAQL”: “SELECT e/ehr_id/value FROM EHR e WHERE e/ehr_id/value matches { ‘cd8abecd-9925-4313-86af-93aab4930eae’ , ‘3a579ae0-0cbe-425b-9ac9-f15b83750481’ }”,
“resultSet”: [
{
“ehr_id/value”: “3a579ae0-0cbe-425b-9ac9-f15b83750481”
},
{
“ehr_id/value”: “cd8abecd-9925-4313-86af-93aab4930eae”
}
]
}

Certainly should be legal AQL .
Ian

Dear Ian,

Thanks for the pointer, I will check it out

regards

The matches statement is part of Aql specification

thanks

regards