Hi,
Running in the Better CDR, here is your AQL without the Where clause
{
"meta": {
"_type": "RESULTSET",
"_created": "2022-11-09T15:36:01.875Z",
"_executed_aql": " SELECT e/ehr_id/value as ehrid, c/uid/value as compid,\no/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0004]/value/value as Condition,\no/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0005]/value/value as Result\n\n FROM ehr e \n CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1] \n CONTAINS (observation o[openEHR-EHR-OBSERVATION.symptom_sign_screening.v0] )\n \n\n "
},
"q": " SELECT e/ehr_id/value as ehrid, c/uid/value as compid,\no/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0004]/value/value as Condition,\no/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0005]/value/value as Result\n\n FROM ehr e \n CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1] \n CONTAINS (observation o[openEHR-EHR-OBSERVATION.symptom_sign_screening.v0] )\n \n\n ",
"columns": [
{
"name": "ehrid",
"path": "/ehr_id/value"
},
{
"name": "compid",
"path": "/uid/value"
},
{
"name": "Condition",
"path": "/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0004]/value/value"
},
{
"name": "Result",
"path": "/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0005]/value/value"
}
],
"rows": [
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"a18341ee-f6a6-4098-988c-eec328d71cc7::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Depression",
"Yes"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"5a2be35f-6b36-402e-b332-e14e4e94162f::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Depression",
"No"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"5a2be35f-6b36-402e-b332-e14e4e94162f::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Anxiety",
"No"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"5a2be35f-6b36-402e-b332-e14e4e94162f::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Feeding/eating",
"Yes"
],
[
"a61459fe-c977-4720-9ffd-7f401e61dc7b",
"76ff5c2d-8710-408a-a583-24e73cc7c90c::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"a61459fe-c977-4720-9ffd-7f401e61dc7b",
"724b89e9-5a2b-424f-ad33-44d8e9935604::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"a61459fe-c977-4720-9ffd-7f401e61dc7b",
"cbf974c7-f5a6-467f-a720-ef840aca8b67::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"33664b0c-6c81-43fb-b72a-6abdb1b6524c::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Anosmia (loss of taste/smell)",
"Present"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"33664b0c-6c81-43fb-b72a-6abdb1b6524c::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Shortness of breath",
"Present"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"33664b0c-6c81-43fb-b72a-6abdb1b6524c::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"D.91 description",
"Present"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"33664b0c-6c81-43fb-b72a-6abdb1b6524c::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"F.85 description",
"Present"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"33664b0c-6c81-43fb-b72a-6abdb1b6524c::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Sore throat",
"Present"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"58e35672-e17a-44e4-90c1-682637cd8e23::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Fever",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"58e35672-e17a-44e4-90c1-682637cd8e23::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Diarrhea",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"9109e25f-6284-4d53-8ef9-f70b16496aa7::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Fever",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"9109e25f-6284-4d53-8ef9-f70b16496aa7::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Diarrhea",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"94c8955a-0f63-4d56-9da2-ef9fc1cd9566::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Fever",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"94c8955a-0f63-4d56-9da2-ef9fc1cd9566::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Diarrhea",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"4ea3fcdc-0dfe-45e8-b153-da3f7ebb1be5::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Fever",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"4ea3fcdc-0dfe-45e8-b153-da3f7ebb1be5::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Diarrhea",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"30ce80a7-51c8-4a91-b51a-13ac6e1c5b2d::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"2e4ee84c-1da8-4c58-b735-8b89b459b060::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"44d07bf6-4172-4fa2-93aa-790023a36a5f::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"a6f9c861-3483-41b3-b759-50d2f6461b35::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"0ce89e9d-5ee0-496e-a828-c406cde2a5d2::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"f2c1ebbf-c585-4514-94b2-df4c1ee57548::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Altered consciousness",
null
]
]
}
- With
WHERE o/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0004]/value/value = 'Depression'
"rows": [
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"a18341ee-f6a6-4098-988c-eec328d71cc7::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Depression",
"Yes"
],
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"5a2be35f-6b36-402e-b332-e14e4e94162f::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Depression",
"No"
]
]
- With
WHERE o/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0004]/value/value = 'Depression' and o/data[at0001]/events[at0002]/data[at0003]/items[at0022]/items[at0005]/value/value = 'Yes'
"rows": [
[
"3e674739-950c-4b8a-976b-5aef21c618c5",
"a18341ee-f6a6-4098-988c-eec328d71cc7::a81f47c6-a757-4e34-b644-3ccc62b4a01c::1",
"Depression",
"Yes"
]
]
So that looks correct to me?