It has been suggested that I abandon HapiWorkerContext and use instead the more generic or agnostic code below. Yes, I would like that very much:
FhirContext context = FhirContext.forR5();FHIRPath is a very useful thing, but I have to say that I have not been easily able to use it. I wonder if it's because I tend to do things that are radically different from how HAPI FHIR is used (and therefore what inspires most of the documented examples)?
Googling for strings like "fhirpath examples" and "fhirpathengine examples" is pretty fruitless in terms of being able to see just how others code to FHIRPath. Few or none of them are performing operations that I am performing.
I ingest medical documents, HL7 v2, HL7 v3, HL7 v4, X12, mere transcripts, etc. I ingest these to extract data into a proprietary search engine. I only rarely generate (v3 and v4 only) documents from data in our server. Mostly, my customers write queries against the data that I ingest. (And they're not especially aware that I got it in FHIR, CCD, a pipe message, etc.)
May I gently suggest that a page covering exactly how to use FHIRPath be added to the HAPI FHIR documentation?
Here's a working example of me using the more agnostic approach to FHIRPath:

But, I could not get from the working example above (that begins way up high in the document) to content down lower without resorting to HapiWorkerContext, which I found in the set of FHIRPath examples in the Documentation section of the HAPI FHIR website. What do I really want to do? Use FHIRPath to ferret out, at any depth, some construct I'm looking for. I don't know very closely at what depth I will have to descend. I would also like to know, as a FHIRPath, where what I'm looking for was found.

My work probably appears very torturesome, but it's the best I could do and still have it work out. (And it only works in 5.1.0, not with 5.2.0.)
Here is my (fake) FHIR document:

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/a5e47a95-9c81-488c-bdea-7bfeb7982505n%40googlegroups.com.