How to implement custom query result to be returned in FHIR bundle

Primary tabs

I have to implement a custom query result to be returned using the FHIR Bundle Resource.

I am a novice and not well versed in InterSystems yet so please excuse mistakes due to ignorance.

I have to take the query result and return in a bundle to achieve this I need to: 

  1. build the pages for the bundle from the query result according to the number of records per page configured or specified in the url
  2. store these query results using a state id
  3. when next page is request return records for the next page or according to the page number requested

Please, does anybody know how to achieve each of the steps above? How do I store the query results against a state id? 

How do I add these page results to the bundle so that the links reflect the correct pages(self, next, etc.)?

Your help shall be appreciated.

Replies

Hi

I have an example of exactly what you are trying to do. It makes use of the IRIS 2019.1 9or later) FHIR Bundle resource, it handles stateid, paging and so on. I have a meeting I have to attend online very shortly and then I will put the code  together and update this thread.

Nigel

Thank you Nigel,

In the meantime  I was able to locate an example in the FHIR code itself where they implemented the search on the repository.