FHIR Chat · Search with _include · hapi

Stream: hapi

Topic: Search with _include


view this post on Zulip Gordon Wilkinson (Feb 28 2022 at 17:10):

I am using JPA starter to handle FHIR CRUD and search requests.
My problem is that search requests with _include and _revinclude parameters do not return the resources referenced by EnrollmentRequest in the request response Bundle.

For reference there are 2 EnrollmentRequest resources in my test FHIR db.

My search request is;

      .search()
      .forResource(classOf[EnrollmentRequest])
      .include(new Include("EnrollmentRequest:*", true))
      .revInclude(new Include("Provenance:target"))
      .returnBundle(classOf[Bundle])
      .execute() ```

The expected search parameters are generated;    ?_include%3Aiterate=EnrollmentRequest%3A*&_revinclude=Provenance%3Atarget
          "link" : [
            {
              "relation" : "self",
              "url" : "http://fhir-server:8011/fhir/f5f48a7b-c1ce-40e6-88e7-bf9c13785b07/EnrollmentRequest?_include%3Aiterate=EnrollmentRequest%3A*&_revinclude=Provenance%3Atarget"
            }
          ],


SearchBuilder logs indicate that the referenced resources (1 patient, 1 coverage, 2 coverage) for each of the 2 EnrollmentRequest stored in the FHIR db.
022-02-28 16:52:04.966 [http-nio-8080-exec-10] INFO  c.u.f.j.search.builder.SearchBuilder [SearchBuilder.java:966] Loaded 2 _revincludes in 1 rounds and 11 ms for search 93515fa3-3754-4e2f-88e9-8b9b854fe9b0
2022-02-28 16:52:04.983 [http-nio-8080-exec-10] INFO  c.u.f.j.search.builder.SearchBuilder [SearchBuilder.java:966] Loaded 8 _includes in 3 rounds and 17 ms for search 93515fa3-3754-4e2f-88e9-8b9b854fe9b0

2022-02-28 16:52:05.303 [http-nio-8080-exec-10] INFO  fhirtest.access [LoggingInterceptor.java:175] Path[/fhir] Source[] Operation[search-type  EnrollmentRequest] UA[HAPI-FHIR/5.5.1 (FHIR Client; FHIR 4.0.1/R4; apache)] Params[?_include%3Aiterate=EnrollmentRequest%3A*&_revinclude=Provenance%3Atarget] ResponseEncoding[JSON] Operation[search-type  EnrollmentRequest] UA[HAPI-FHIR/5.5.1 (FHIR Client; FHIR 4.0.1/R4; apache)] Params[?_include%3Aiterate=EnrollmentRequest%3A*&_revinclude=Provenance%3Atarget] ResponseEncoding[JSON]

Finally when I curl  <base>/<partition>/EnrollmentRequest/_search?_include=EnrollmentRequest%3A*&_revinclude=Provenance%3Atarget
the response does includes the expected  referenced resources(Patient, Coverage, Organization resources).

Any direction appreciated.

view this post on Zulip Notification Bot (Mar 18 2022 at 00:55):

Gordon Wilkinson has marked this topic as unresolved.


Last updated: Apr 12 2022 at 19:14 UTC