LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
326 stars 157 forks source link

CQL: how to return subfield data from array? #4194

Open renom opened 1 year ago

renom commented 1 year ago

Describe the bug On the following request:

http://127.0.0.1:9080/fhir-server/api/v4/$cql?expression=[Observation] o return (o.code.coding c return c.code)&subject=Patient/example

I got the following error:

{
    "resourceType": "OperationOutcome",
    "id": "ac-12-0-6-8d388349-82af-4f17-8e77-a0d4c0eb5f79",
    "issue": [
        {
            "severity": "error",
            "code": "invalid",
            "details": {
                "text": "Only lists of resources are supported"
            }
        }
    ]
}

Environment LinuxForHealth FHIR Server 5.1.1

JohnTimm commented 1 year ago

Have you tried using this CQL syntax: https://cql.hl7.org/09-b-cqlreference.html#indexer-1