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

Helper function to match the correct pair of qItem and qrItem #2618

Closed
FikriMilano opened this issue Jul 15, 2024 · 4 comments · Fixed by #2624
Closed

Helper function to match the correct pair of qItem and qrItem #2618

FikriMilano opened this issue Jul 15, 2024 · 4 comments · Fixed by #2624
Labels
effort:small Small effort - 2 days P2 Medium priority issue

Comments

@FikriMilano
Copy link
Collaborator

val qrItem = questionnaireResponse.allItems.find { qrItem -> qrItem.linkId == qItem.linkId }

this can get quite complicated in the world of nested items and nested repeated groups because link ids no longer uniquely identify a questionnaire item or a questionnaire response item...

i've been meaning to write a helper function that traverses the two trees in parallel and match the pairs.. maybe it's time for me to do that..

Originally posted by @jingtang10 in #2522 (comment)

@jingtang10
Copy link
Collaborator

i'll take this

@aditya-07 aditya-07 added effort:small Small effort - 2 days P2 Medium priority issue labels Jul 22, 2024
@github-project-automation github-project-automation bot moved this from New to Complete in Android FHIR SDK Jul 29, 2024
@allan-on
Copy link
Contributor

Hello @jingtang10 @FikriMilano I think the changes introduced here through the associated PR are backwards-incompatible.
This requirement fails where
a. The questionnaire items nested under the repeated group are not represented as answer components in the questionnaire response and
b. The number of questionnaire items isn't equal to the number of questionnaire response items because for instance, a questionnaire item didn't have an answer because it was optional or it was hidden by an enableWhen expression

@FikriMilano
Copy link
Collaborator Author

@allan-on could you create a separate ticket for that new issue? we can have the discussion over there

@jingtang10
Copy link
Collaborator

Hello @jingtang10 @FikriMilano I think the changes introduced here through the associated PR are backwards-incompatible. This requirement fails where a. The questionnaire items nested under the repeated group are not represented as answer components in the questionnaire response and b. The number of questionnaire items isn't equal to the number of questionnaire response items because for instance, a questionnaire item didn't have an answer because it was optional or it was hidden by an enableWhen expression

See https://build.fhir.org/questionnaireresponse.html#link.

My understanding of the spec is that the questionnaire response really should be structurally consistent with the questionnaire. Hidden questions are just hidden, they should still be there. Same thing with questions that are not answered or not answered yet.

Please share your questionnaire and questionnaire response and we can have a look what exactly is the problem here. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Small effort - 2 days P2 Medium priority issue
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

4 participants