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

Internationalization for Questionnaire AnswerOptions #927

Merged
merged 18 commits into from
Feb 9, 2022

Conversation

ndegwamartin
Copy link
Collaborator

@ndegwamartin ndegwamartin commented Nov 17, 2021

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #929

Description
Add Multi language translations support for Questionnaire Answer Options via FHIR Extensions
.

Alternative(s) considered
Alternatives for Multi language support are CodeSystems and ValueSets via Designations. See #929 for context.

Type
Choose one: (Feature)

Screenshots (if applicable)

                    "answerOption": [
                        {
                            "valueCoding": {
                                "system": "https://hl7.org/fhir/administrative-gender",
                                "code": "female",
                                "display": "Female",
                                "_display": {
                                    "extension": [
                                        {
                                            "url": "https://hl7.org/fhir/StructureDefinition/translation",
                                            "extension": [
                                                {
                                                    "url": "lang",
                                                    "valueCode": "sw-KE"
                                                },
                                                {
                                                    "url": "content",
                                                    "valueString": "Mwanamke"
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        },

Checklist

  • I have read and acknowledged the Code of conduct
  • I have read How to Contribute
  • I have read the Developer's guide
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally
  • I have built and run the reference app(s) to verify my change fixes the issue and/or does not break the reference app(s)

@codecov
Copy link

codecov bot commented Nov 17, 2021

Codecov Report

Merging #927 (5f29e43) into master (44c65ce) will decrease coverage by 0.00%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #927      +/-   ##
============================================
- Coverage     84.52%   84.51%   -0.01%     
  Complexity      608      608              
============================================
  Files           134      134              
  Lines         10279    10276       -3     
  Branches        756      756              
============================================
- Hits           8688     8685       -3     
  Misses         1215     1215              
  Partials        376      376              
Impacted Files Coverage Δ
...hir/datacapture/MoreQuestionnaireItemComponents.kt 90.19% <ø> (-0.55%) ⬇️
...ogle/android/fhir/datacapture/MoreAnswerOptions.kt 85.71% <83.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a11d8ed...5f29e43. Read the comment docs.

@ndegwamartin ndegwamartin force-pushed the mn/i18n-answer-options branch 2 times, most recently from 1bf6c71 to 6f914a6 Compare November 18, 2021 13:19
Copy link
Collaborator

@santosh-pingle santosh-pingle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments.

@ndegwamartin
Copy link
Collaborator Author

@santosh-pingle made the updates based on your feedback, please have a look

@jingtang10 jingtang10 self-assigned this Dec 1, 2021
Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comment I made in the linked issue #929 (comment)

According to the example I found here: https://build.fhir.org/ig/HL7/fhir-ips/StructureDefinition-Coding-uv-ips.html it seems the translation extension is on the display (which is a string) rather than the Coding itself (display is a field inside Coding).

If that's the case, then all we need to do is to reuse the extension function

fun StringType.getLocalizedText

which is in this file: MoreQuestionnaireItemComponents.kt

I would suggest moving that function to the common module if that's the path we decide to go down.

* Add translations support for Questionnaire Answer Options via Extensions
* Implement internationalisation for Display elements using extensions
* Refactor/move getLocalizedText method to shared common module
@Tarun-Bhardwaj
Copy link

@ndegwamartin , though you have committed changes 3 days back, the status still shows 'Changes requested'. Is there an ETA by when the remaining changes can be committed?

Copy link
Collaborator

@jingtang10 jingtang10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1037 has been released today.

looks good. just have to update the dependency.

buildSrc/src/main/kotlin/Dependencies.kt Outdated Show resolved Hide resolved
buildSrc/src/main/kotlin/Dependencies.kt Outdated Show resolved Hide resolved
@ndegwamartin
Copy link
Collaborator Author

@Tarun-Bhardwaj The PR was awaiting the Alpha 02 Release of the FHIR Common Library which is now ready. I've updated the PR

@ndegwamartin ndegwamartin merged commit b549fe4 into master Feb 9, 2022
@ndegwamartin ndegwamartin deleted the mn/i18n-answer-options branch February 9, 2022 09:27
ktarasenko pushed a commit that referenced this pull request Feb 16, 2022
Internationalization for Questionnaire AnswerOptions
* Add translations support for Questionnaire Answer Options via Extensions 
* Refactor/move getLocalizedText method to shared common module
* Migrate Android FHIR Common Library version

Co-authored-by: Jing Tang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Internationalisation for the Questionnaire answerOption item using Translation Extensions
4 participants