Stream: questionnaire
Topic: Async Pattern for QuestionnaireResponse
Milton Mitjans (Feb 17 2022 at 02:02):
If there's a questionnaire where provides a 'score' part of a "health assessment" when the user response. And the score calculation takes a long time (might a ML model). Is there a reference or implementation guide we could use (for example: https://www.hl7.org/fhir/async.html), where the UI can poll for status of completion via a "status API"?
Josh Mandel (Feb 17 2022 at 03:01):
If you are modeling this using something like a /QuestionnaireResponse/123/$score
operation, you can look at the newly defined asynchronous interaction request -- see http://build.fhir.org/async-bundle.html
Josh Mandel (Feb 17 2022 at 03:01):
But if you are just expecting the resource to be updated to contain a score at some unknown point in the future, you might want to do something like create a subscription listening for updates on the resource itself.
David Winters (Feb 18 2022 at 14:25):
If you're using something like SurveyJS to implement your Questionnaire, it supports asynchronous operations like what you describe. I use SurveyJS in a SoF app that calculates a score based upon user input. I think it depends what you mean by a long time. For my application I use the asynchronous capability to hide latency that would otherwise freeze the app; from a user's perspective the calculation appears almost instantaneous. For a more complex calculation you would want to implement something in the UI to let the user know a calculated result is pending.
Last updated: Apr 12 2022 at 19:14 UTC