Error with making filter for linelistrecord/fetch

I want to leverage the C3.ai COVID-19 Data Lake to look for line list records where the patient has a chronic disease. I’m using linelistrecord/fetch . How do I construct the correct filter for this?

The POST request body that I tried was

{"spec" : {"filter" : "chronicDisease"}}

But I got the following error:

"ERROR: argument of AND must be type boolean, not type character varying".

You’d want to use {"spec" : {"filter" : "exists(chronicDisease)"}} .

As the error says, it needs to evaluate to a boolean. Other options that also work:

  • "length(chronicDisease) > 0"
  • "chronicDisease != ''"