Stream: hapi
Topic: HAPI FHIR Error 500 on questionnaire/-response
peter stroessler (Oct 05 2021 at 09:37):
Hi all! On http://hapi.fhir.org/baseR4/QuestionnaireResponse?questionnaire=2535024&_pretty=true, I always get an error 500. What could be the reason? Such requests on public hapifhir worked already but not anymore. thank you for any help to solve this.
Simone Heckmann (Oct 05 2021 at 10:48):
I suppose it's because QuestionnaireResponse.questionnaire is of type canonical. It references Questionnaire.url instead of Questionnaire.id.
peter stroessler (Oct 05 2021 at 13:30):
2569991 is a vaid qestionnaire id for example. In the questoinnaire resource I can read for id on hapi fhir and get a 200 ok response...well the url is not updated to the actual website and points to an old url but this worked before without change. https://hapi.fhir.org/baseR4/QuestionnaireResponse?questionnaire=2569991&_pretty=true&_count=250 500 (Server Error)
Simone Heckmann (Oct 05 2021 at 15:21):
Is it possible that "this worked before" refers to STU3? Because the type of QuestionnaireResponse.questionnaire has been changed from Reference to canonical between STU3 and R4.
However I am not 100% certain how a search parameter of type reference on an element of type canonical is supposed to behave.
I would expect it to match against Questionnaire.url not Questionnaire.id, but it might be both...
The spec says:
The interpretation of a reference parameter is either:
[parameter]=[id] the logical [id] of a resource using a local reference (i.e. a relative reference)
[parameter]=[type]/[id] the logical [id] of a resource of a specified type using a local reference (i.e. a relative reference), for when the reference can point to different types of resources (e.g. Observation.subject)
[parameter]=[url] where the [url] is an absolute URL - a reference to a resource by its absolute location, or by it's canonical URL
I read that "either" as "if it's a canonical url it will only match against the url, not the id.
Simone Heckmann (Oct 05 2021 at 15:21):
Source: https://hl7.org/fhir/search.html#reference
peter stroessler (Oct 06 2021 at 12:05):
Simone Heckmann said:
Is it possible that "this worked before" refers to STU3? Because the type of QuestionnaireResponse.questionnaire has been changed from Reference to canonical between STU3 and R4.
However I am not 100% certain how a search parameter of type reference on an element of type canonical is supposed to behave.
I would expect it to match against Questionnaire.url not Questionnaire.id, but it might be both...The spec says:
The interpretation of a reference parameter is either:
[parameter]=[id] the logical [id] of a resource using a local reference (i.e. a relative reference)
[parameter]=[type]/[id] the logical [id] of a resource of a specified type using a local reference (i.e. a relative reference), for when the reference can point to different types of resources (e.g. Observation.subject)
[parameter]=[url] where the [url] is an absolute URL - a reference to a resource by its absolute location, or by it's canonical URLI read that "either" as "if it's a canonical url it will only match against the url, not the id.
No it refers to R4. Refers to Monday 3 p.m. same request url I guess, even I changed major things, not sure...Right now I get gateway timeout from the public hapi fhir, now for about 3 days. I made a workaround with dummy data for the 'statsistics' page for the presentation, so I'm fine. Unfortunately the test server from uni isn't running anymore (referenced url, whose Id I don't know before the resource is created. I think need to update the entry after creation?), I got it running locally but will not afford a webspace just for presetation purpose (background info). Thank you for the help & reply.
Last updated: Apr 12 2022 at 19:14 UTC