Cannot query all compositions of an EHR only with identifier "c"

Hey Folks!

I usually used Select c from EHR [ehr_id/value='02bb7f40-df72-491e-b44e-ca004b2a5932'] Contains Composition c to get an overview over the compositions of an EHR. However, this now gives me

{
  "error": "Bad Request",
  "message": "Could not process query/stored-query, reason: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0"
}

Strangely, when using c/name instead of c, like Select c/name from EHR [ehr_id/value='02bb7f40-df72-491e-b44e-ca004b2a5932'] Contains Composition c, i get a result:

{
  "q": "Select c/name from EHR  [ehr_id/value='02bb7f40-df72-491e-b44e-ca004b2a5932'] Contains Composition c",
  "columns": [
    {
      "path": "/name",
      "name": "#0"
    }
  ],
  "rows": [
    [
      {
        "_type": "DV_TEXT",
        "value": "GECCO_Personendaten"
      }
    ],
  ]
}

Is this normal behavior? I’m pretty sure that the first statement should also work :confused:

Please specify which CDR are you using, The AQL, by the current openEHR specs, should work. It might be a bug of your specific CDR, and would be reported as such to the developers.

Yes, according to the documentation this should be a valid query. I tried to pull the latest image of ehrbase yesterday and tried to re-run my docker container. EHRBase version is now 0.22.0-SNAPSHOT, Spring Boot 2.5.12 and PostgreSQL 13.4. However, I believe that there is some process ongoing, as I cannot access the server. The log shows me

2022-05-16 13:29:29.508 INFO [] 9 — [ main] org.ehrbase.application.EhrBase : The following 1 profile is active: “docker”
2022-05-16 13:29:31.616 INFO [] 9 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-05-16 13:29:31.627 INFO [] 9 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-05-16 13:29:31.628 INFO [] 9 — [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.60]
2022-05-16 13:29:31.723 INFO [] 9 — [ main] o.a.c.c.C.[.[localhost].[/ehrbase] : Initializing Spring embedded WebApplicationContext
2022-05-16 13:29:31.723 INFO [] 9 — [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2162 ms

2022-05-16 13:29:32.180  INFO [] 9 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2022-05-16 13:29:32.306  INFO [] 9 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2022-05-16 13:29:32.331  INFO [] 9 --- [           main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 8.4.4 by Redgate
2022-05-16 13:29:32.332  INFO [] 9 --- [           main] o.f.c.i.database.base.BaseDatabaseType   : Database: jdbc:postgresql://ehrdb:5432/ehrbase (PostgreSQL 13.4)
2022-05-16 13:29:32.376  INFO [] 9 --- [           main] o.f.c.i.c.SqlScriptCallbackFactory       : Executing SQL callback: beforeValidate -
2022-05-16 13:29:32.490  INFO [] 9 --- [           main] o.f.core.internal.command.DbValidate     : Successfully validated 72 migrations (execution time 00:00.094s)
2022-05-16 13:29:32.506  INFO [] 9 --- [           main] o.f.c.i.c.SqlScriptCallbackFactory       : Executing SQL callback: beforeMigrate -
2022-05-16 13:29:32.516  INFO [] 9 --- [           main] o.f.core.internal.command.DbMigrate      : Current version of schema "ehr": 70
2022-05-16 13:29:32.523  INFO [] 9 --- [           main] o.f.core.internal.command.DbMigrate      : Migrating schema "ehr" to version "71 - merge duplicate users"

. This was 18h ago - still nothing :confused: I also created a topic on this:
After pulling latest image, Migrating Schema EHR takes long - openEHR - I would appreciate it if you have any idea whats going on here.

1 Like

Hi @mc1995,

would be great if you can open a ticket for this one in GitHub. Then I will ask my colleagues to take a look and try to reproduce! Thx

3 Likes

Done:) thanks for helping

Facing the same issue. Can anyone please help in resolving that