FHIR Chat · revinclude asRecursive · hapi

Stream: hapi

Topic: revinclude asRecursive


view this post on Zulip Jenny Meinsma (Jan 31 2017 at 14:02):

I am trying to "translate" the following query to hapi:

/EpisodeOfCare?patient=someId&_revinclude=Encounter:episodeofcare&_revinclude:recurse=Observation:encounter

I would expect it to be

client.search()
      .forResource(classOf[EpisodeOfCare])
      .where(EpisodeOfCare.PATIENT.hasId(patientId))
      .revInclude(Encounter.INCLUDE_EPISODEOFCARE)
      .revInclude(Observation.INCLUDE_ENCOUNTER.asRecursive())

Unfortunately the asRecursive does not seem to do anything, it doesn't add ":recurse" to the query string. Is there something I am missing?

view this post on Zulip James Agnew (Feb 07 2017 at 03:08):

@Jenny Meinsma Hmm, it appears you're right, HAPI isn't properly including the :recurse qualifier for revincludes.

I'm going to check in a fix shortly.

That said, I'm not sure what recurse would mean in the context of your example.. Observation.encounter doesn't point to EpisodeOfCare, so you couldn't do a revinclude like that AFAIK.

view this post on Zulip Jenny Meinsma (Feb 07 2017 at 11:20):

@James Agnew , thank you.
We want to search for EpisodeOfCare for a patient and maybe include encounters and observations. Because an observation has encounters and an encounter has episodeofcares we can search those at once with reverse include. For this search we have tested the query-url above which seems to work.

view this post on Zulip James Agnew (Feb 07 2017 at 11:37):

@Jenny Meinsma Interesting... I don't suppose you have a sample link against one of the public servers that shows this type of search working? I don't think this would work on HAPI's server, I'd like to try and replicate it.

view this post on Zulip Jenny Meinsma (Feb 07 2017 at 12:23):

@James Agnew
http://fhirtest.uhn.ca/baseDstu3//EpisodeOfCare?patient=zd8&_revinclude=Encounter:episodeofcare&_revinclude:recurse=Observation:encounter


Last updated: Apr 12 2022 at 19:14 UTC