Definition based extraction works only if the definitions are present in the QuestionnaireResponse
I can put absolute nonsense into Questionnaire.item.definition, or nothing, but the extraction results remain the same. Even if I remove QuestionnaireResponse.questionnaire or point it to an nonexisting URL, extraction will be performed without error, if the definitions are present in the QuestionnaireResponse.
If I remove all definitions from QuestionanireResponse, I get "HAPI-0389: Failed to call access method: java.lang.NullPointerException: Cannot invoke \"String.contains(java.lang.CharSequence)\" because \"definition\" is null", regardless of whether definitions are present in the referenced Questionnaire or not.
If I remove the reference to the questionnaire or reference a non-existing questionnaire, and no definitions are present in the QuestionnaireResponse, I get "HAPI-0389: Failed to call access method: java.lang.IllegalArgumentException: Unable to retrieve Questionnaire code map for Observation based extraction"
To me it looks like Observation based extraction relies on the annotations in Questionnaire but Definition based Extraction relies on the annotations in QuestionnaireResponse.
IMO $extract should always use the annotations from Questionnaire as first line and only use definitions from QuestionnaireResponse as a fallback, if no Questionnaire is referenced or the referenced Questionnaire cannot be found (AND produce a warning in the latter case).
Definition based extraction works only if the definitions are present in the QuestionnaireResponse
I can put absolute nonsense into Questionnaire.item.definition, or nothing, but the extraction results remain the same. Even if I remove QuestionnaireResponse.questionnaire or point it to an nonexisting URL, extraction will be performed without error, if the definitions are present in the QuestionnaireResponse.
If I remove all definitions from QuestionanireResponse, I get "HAPI-0389: Failed to call access method: java.lang.NullPointerException: Cannot invoke \"String.contains(java.lang.CharSequence)\" because \"definition\" is null", regardless of whether definitions are present in the referenced Questionnaire or not.
If I remove the reference to the questionnaire or reference a non-existing questionnaire, and no definitions are present in the QuestionnaireResponse, I get "HAPI-0389: Failed to call access method: java.lang.IllegalArgumentException: Unable to retrieve Questionnaire code map for Observation based extraction"
To me it looks like Observation based extraction relies on the annotations in Questionnaire but Definition based Extraction relies on the annotations in QuestionnaireResponse.
IMO $extract should always use the annotations from Questionnaire as first line and only use definitions from QuestionnaireResponse as a fallback, if no Questionnaire is referenced or the referenced Questionnaire cannot be found (AND produce a warning in the latter case).
see also: https://chat.fhir.org/#narrow/stream/179167-hapi/topic/SDC-Extraction.20capabilities.20in.20HAPI.20Starter