0

Bundle response = client.search() .forResource("Observation")
.where(....) .returnBundle(Bundle.class) .execute();

Searched a whole while and still can not get the answer. I am using hapi fhir http://hapifhir.io/, and using Java.

cautree
  • 35
  • 7

1 Answers1

0

Unless you figured it out already, you need to add the class in the forRsource():

Bundle response = client.search() .forResource(Observation.class)
.where(....) .returnBundle(Bundle.class) .execute();

And if you have more than 10 Entries, you should have a look at https://github.com/jamesagnew/hapi-fhir/blob/master/examples/src/main/java/example/BundleFetcher.java which reads all the pages in the Bundle and adds it to your Bundle object!

K. K.
  • 136
  • 7