Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$extract disregards definitions in Questionnaire when applying definition based extraction #482

Open
simoneOnFhir opened this issue Jun 20, 2024 · 1 comment

Comments

@simoneOnFhir
Copy link

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

@simoneOnFhir
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant