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

SDC : Answer being vanished for Quantity type item after packRepeatedGroups #2013

Closed
khyativyasargus opened this issue May 23, 2023 · 11 comments
Labels
P1 High priority issue type:bug Something isn't working

Comments

@khyativyasargus
Copy link
Contributor

Describe the bug
For nested item of group type with enable expression, in some case, answer is getting vanished for the item after packRepeatedGroups method while processing QR

Component
SDC library

To Reproduce
Steps to reproduce the behavior:

  1. On Master branch apply the patch signs_complete_patch.txt
  2. Run the app, Go to new questionnaire (+ icon n patient list)
  3. Answer is not being rendered for the Respiratory rate
  4. Undo the patch changes and apply this patch: signs_questionnaire_patch_mvp.txt
    list)
  5. Now Re-run the app and again open the questionnaire, Interestingly it's working fine with MVP signs_questionnaire_patch_mvp.txt for the same item

Expected behavior
Respiratory rate item answer should be rendered if it's given in QR, while debugging through SDC methods , we found that answer object for Respiratory Rate item is being vanished after packRepeatedGroups method with the Patch signs_complete_patch.txt

Screenshots
Answer no being rendered for Respiratory rate
image

Answer being rendered for Respiratory rate as standalone item
image

Smartphone (please complete the following information):

  • Device: Pixel4 emulator

Additional context
After applying patch: Questionnaire is at file: assets/new-patient-registration-paginated.json & QuestionnaireResponse is on line: 83(AddPatientFragment.kt)

@jingtang10 @santosh-pingle

@santosh-pingle
Copy link
Collaborator

@khyativyasargus

Could you please remove any unnecessary characters from both the patch and attach separate questionnaire and questionnaire response files for the observed and not observed issues.

@santosh-pingle santosh-pingle added type:bug Something isn't working P1 High priority issue labels May 24, 2023
@santosh-pingle
Copy link
Collaborator

@khyativyasargus

Could you please remove any unnecessary characters from both the patch and attach separate questionnaire and questionnaire response files for the observed and not observed issues.

@khyativyasargus
any updates on it? thanks!

@ppanchal-argus
Copy link

@khyativyasargus
Could you please remove any unnecessary characters from both the patch and attach separate questionnaire and questionnaire response files for the observed and not observed issues.

@khyativyasargus any updates on it? thanks!

Thanks @santosh-pingle . Apologies for the delay. Here are the Questionnaires & QR (QR is same for both questionnaires)
The only difference in both questionnaires is of enableWhenExpression
signs_not_showing_respiratory_rate_questionnaire.txt
signs_not_showing_respiratory_rate_questionnaire_response.txt
signs_showing_respiratory_rate_questionnaire.txt

Patches:
not_working_signs.txt
working_signs.txt

@santosh-pingle
Copy link
Collaborator

@khyativyasargus

The description mentioned that it should work for one questionnaire.json file, but I am not seeing the quantity value in either case. Can you please confirm?

@ppanchal-argus
Copy link

@santosh-pingle Can you try applying the working_signs patch directly? Ideally it should show this screen. Let me know if it's still not showing up.

image

@santosh-pingle
Copy link
Collaborator

yes, issue is observed on signs_not_showing_respiratory_rate_questionnaire.json.

@santosh-pingle
Copy link
Collaborator

@khyativyasargus @ppanchal-argus
https://hl7.org/fhir/extensions/StructureDefinition-questionnaire-unit.html
This is for use on items of type integer and decimal

@santosh-pingle
Copy link
Collaborator

@khyativyasargus
Is the calculatedExpression extension truly necessary in signs_not_showing_respiratory_rate_questionnaire.json?

{
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "iif(%resource.repeat(item).where(linkId='Respiratory Rate profile').answer.first().exists(), %resource.repeat(item).where(linkId='Respiratory Rate profile').answer.first().value,{})"
              }
            }
          ],
          "linkId": "EmCare.B22.DE01",
...

@santosh-pingle
Copy link
Collaborator

@khyativyasargus @ppanchal-argus

The questionnaire item in questionnaire.json has a calculated expression that returns an empty answer. This empty answer is then updated to the existing answer, which is why the text field shows nothing.

@delcroip
Copy link
Collaborator

delcroip commented Jun 8, 2023

I don't Think so

I will remove it.

Br

@khyativyasargus
Copy link
Contributor Author

@khyativyasargus @ppanchal-argus

The questionnaire item in questionnaire.json has a calculated expression that returns an empty answer. This empty answer is then updated to the existing answer, which is why the text field shows nothing.

Thanks @santosh-pingle for looking up the cause. Really helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority issue type:bug Something isn't working
Projects
Status: Complete
Development

No branches or pull requests

4 participants