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 crash: org.hl7.fhir.exceptions.FHIRException: Type mismatch #1633

Closed
jingtang10 opened this issue Sep 27, 2022 · 1 comment · Fixed by #1634
Closed

SDC crash: org.hl7.fhir.exceptions.FHIRException: Type mismatch #1633

jingtang10 opened this issue Sep 27, 2022 · 1 comment · Fixed by #1634
Assignees
Labels
effort:xsmall Extra small effort - 1 day P1 High priority issue type:bug Something isn't working

Comments

@jingtang10
Copy link
Collaborator

Describe the bug

org.hl7.fhir.exceptions.FHIRException: Type mismatch: the type IntegerType was expected, but org.hl7.fhir.r4.model.Coding was encountered

Component
SDC library

To Reproduce
Use this questionnaire:


                    {
                      "resourceType": "Questionnaire",
                      "id": "registration.ideal.q",
                      "title": "Registration Ideal Questionnaire",
                      "status": "draft",
                      "item": [
                        {
                          "extension": [
                            {
                              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
                              "valueCodeableConcept": {
                                "coding": [
                                  {
                                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                                    "code": "drop-down"
                                  }
                                ]
                              }
                            }
                          ],
                          "linkId": "089df4c1-6aa7-4d89-8098-b94ef9e573ce",
                          "text": "Provide An Estimated Age Or Estimated Date Of Birth",
                          "type": "choice",
                          "required": false,
                          "answerOption": [
                            {
                              "valueCoding": {
                                "id": "09c64bf3-0858-43fe-b8a7-4bf8fd308ebf",
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-age",
                                "display": "Estimated Age"
                              }
                            },
                            {
                              "valueCoding": {
                                "id": "20f8138c-03c9-4319-94f1-9d20070823f5",
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-weeks",
                                "display": "Estimated Weeks"
                              }
                            },
                            {
                              "valueCoding": {
                                "id": "b3b80370-4e3a-454d-96c6-57016245fdbf",
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-dob",
                                "display": "Estimated DOB"
                              }
                            }
                          ]
                        },
                        {
                          "linkId": "c717e9d5-830c-44f9-ec10-4e41529e8b2a",
                          "text": "Estimated Age",
                          "type": "integer",
                          "enableWhen": [
                            {
                              "question": "089df4c1-6aa7-4d89-8098-b94ef9e573ce",
                              "operator": "=",
                              "answerCoding": {
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-age"
                              }
                            }
                          ],
                          "enableBehavior": "all",
                          "required": false
                        },
                        {
                          "linkId": "f75368ac-d5ef-44ef-db67-f33e256a893f",
                          "text": "Estimated Weeks",
                          "type": "integer",
                          "enableWhen": [
                            {
                              "question": "089df4c1-6aa7-4d89-8098-b94ef9e573ce",
                              "operator": "=",
                              "answerCoding": {
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-weeks"
                              }
                            }
                          ],
                          "enableBehavior": "all",
                          "required": false
                        },
                        {
                          "linkId": "ec499555-f62d-4e3b-f682-dea68e09999f",
                          "text": "Estimated Date Of Birth",
                          "type": "date",
                          "enableWhen": [
                            {
                              "question": "089df4c1-6aa7-4d89-8098-b94ef9e573ce",
                              "operator": "=",
                              "answerCoding": {
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-dob"
                              }
                            }
                          ],
                          "enableBehavior": "all"
                        },
                        {
                          "linkId": "00b267bb-6d8a-41da-e1ff-921fa276b88b",
                          "text": "Sex",
                          "type": "choice",
                          "required": false,
                          "answerOption": [
                            {
                              "valueCoding": {
                                "id": "5dd9310f-a1fd-4640-8e9c-3adaf9d43489",
                                "system": "urn:uuid:6f48566a-4fdc-44a4-8893-0dd818911797",
                                "code": "female",
                                "display": "Female"
                              }
                            },
                            {
                              "valueCoding": {
                                "id": "58934e68-c4b5-4349-914a-c3b8a0c9d286",
                                "system": "urn:uuid:6f48566a-4fdc-44a4-8893-0dd818911797",
                                "code": "male",
                                "display": "Male"
                              }
                            },
                            {
                              "valueCoding": {
                                "id": "0827b1ba-5728-49a7-fc3e-59c1c4684175",
                                "system": "urn:uuid:6f48566a-4fdc-44a4-8893-0dd818911797",
                                "code": "not-specified",
                                "display": "Not Specified"
                              }
                            }
                          ]
                        }
                      ]
                    }

and this response:

                    {
                      "resourceType": "QuestionnaireResponse",
                      "item": [
                        {
                          "linkId": "089df4c1-6aa7-4d89-8098-b94ef9e573ce",
                          "text": "Provide An Estimated Age Or Estimated Date Of Birth",
                          "answer": [
                            {
                              "valueCoding": {
                                "id": "09c64bf3-0858-43fe-b8a7-4bf8fd308ebf",
                                "system": "urn:uuid:728a3a4c-93b7-4c98-8f57-227c6cb60d07",
                                "code": "estimated-age",
                                "display": "Estimated Age"
                              }
                            }
                          ]
                        },
                        {
                          "linkId": "c717e9d5-830c-44f9-ec10-4e41529e8b2a",
                          "text": "Estimated Age",
                          "answer": [
                            {
                              "valueInteger": 1
                            }
                          ]
                        },
                        {
                          "linkId": "00b267bb-6d8a-41da-e1ff-921fa276b88b",
                          "text": "Sex",
                          "answer": [
                            {
                              "valueCoding": {
                                "id": "5dd9310f-a1fd-4640-8e9c-3adaf9d43489",
                                "system": "urn:uuid:6f48566a-4fdc-44a4-8893-0dd818911797",
                                "code": "female",
                                "display": "Female"
                              }
                            }
                          ]
                        }
                      ]
                    }

And then change the answer of the first question

Expected behavior
No crash

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: Pixel 6
  • Android version: Any
  • Build number: Any
  • Version Any

Additional context
This is caused by an issue in the logic to copy answers from questionnaire response provided to the questionnaire fragment

Would you like to work on the issue?
Yes

@jingtang10 jingtang10 added the type:bug Something isn't working label Sep 27, 2022
@jingtang10 jingtang10 self-assigned this Sep 27, 2022
@jingtang10 jingtang10 added P1 High priority issue effort:xsmall Extra small effort - 1 day labels Sep 27, 2022
@jingtang10
Copy link
Collaborator Author

This issue was originally raised by Parth Panchal from Argusoft.

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

Successfully merging a pull request may close this issue.

2 participants