URL semantic to retrieve a questionnaire response from another site

Hello everybody,

I have a use case where I retrieve a bundle of different objects (DocumentReference and QuestionnaireResponse). Each of those object has an organization: for DocumentReference, the organization is defined by the “author” attribute whereas it is defined by the attribute “owner” of the object Device set as “author” of the QuestionnaireResponse.

The problem here is I want to retrieve the information concerning just one of those object. For example, I want to retrieve a QuestionnaireResponse stored in organization “B”. So, in the semantic of the URL, how do I do?

  • Should I use the by-id URL type in which I create a custom GET parameter (Is that even allowed?)? Something like: http://myserver/QuestionnaireResponse/myId?site=mySiteId
  • Should I use the Bundle-way where the URL, generated by HAPI FHIR is something like:http://myserver/QuestionnaireResponse?author.organization=mySiteId&identifier=myId

Note that I already posted this message in the HAPI FHIR Google Group, too, if you are interested: https://groups.google.com/forum/#!topic/hapi-fhir/mnJqXktaTQU

The former is not legal FHIR. You can’t query inside an identified resource instance. The second approach will work, though only if the author is a Device. (That’s the only STU3 resource that’s allowed as a Questionnaire.author that has “organization” as a search criteria.)