Unfortunately, the majority of FHIR Questionnaire engines don’t respect the extraction part. They interrupt form life cycle one QuestionnaireResponse is generated. Indeed extraction step is complex, but the advantage of fully extracted data is huge.
You can’t build analytics on top of QuestionnaireResponse. In a nutshell, it is just a key-value storage where keys are driven by questionnaire and form layout. As a result, Questionnaire change may cause QustionnaireResponse structure change. So you can’t query data in the same way even for one questionnaire. Things become even more complex when you need to build analytics on top of multiple questionnaires.
While questionnaires may address the same data (vitals, measures, conditions information) each questionnaire may ask it in its own way. On the FHIR level, the data is perfectly structured as Conditions and Observations. In this way, it is much easier to analyze the data.
FHIR mapping was never an easy topic. Our approach for the mapping evolved over time.
The first tool we used was
JUTE. It is a powerful engine that provides a nice experience in creating mappers. The data DSL nature is a big advantage. You can create an FHIR resource and just replace some values with JUTE expressions/directives. Please have a look at this
mapper. It is pretty easy to understand what is going on here.
Unfortunately, JUTE provides its own syntax and approach for path expressions, while it is more convenient to use FHIRPath when you query data from FHIR Resources especially if you are querying QuestionnaireResponse. JUTE provides API to add any function inside the engine, so we embedded FHIRPath function. As a result, almost all JUTE expressions call FHIRPath function:
jute.yaml It looks like an overhead, so we replaced the JUTE path engine with FHIRPath and made it FHIRPath native.
Finally, data DSL should be LLM-friendly and there should be an easy way to generate a mapper based on the text description. ChatGPT works pretty well with JSON and FHIRPath. So, you can just copy and paste the specification into ChatGPT and try to generate mappers.
As a result, we got the following
specifications.
Here you can check the video that demonstrates how you can generate mappers automatically via OpenAI.