Skip to content

Fix concept retrieval by parsing string ID to integer in Person Attribute Translator #567

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

icrc-jofrancisco
Copy link
Contributor

Description of what I changed

Updated concept retrieval to use the correct ConceptService.get(Integer id) method by explicitly parsing the string ID to an integer.
Previously, the code was passing a stringified numeric ID to ConceptService.get(String uuid), which led to null being returned in real scenarios because no UUID matched the numeric string. This change ensures we call the correct method overload for integer-based IDs.

Thanks,
CC: @ibacher @parthfloyd

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.

  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)

  • I ran mvn clean package right before creating this pull request and
    added all formatting changes to my commit.

  • All new and existing tests passed.

  • My pull request is based on the latest changes of the master branch.

@icrc-jofrancisco icrc-jofrancisco requested a review from ibacher June 18, 2025 09:15
@icrc-jofrancisco icrc-jofrancisco marked this pull request as draft June 18, 2025 09:27
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.46%. Comparing base (c7f2ec2) to head (a5e03d4).
Report is 57 commits behind head on master.

Files with missing lines Patch % Lines
...ranslators/impl/PersonAttributeTranslatorImpl.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #567      +/-   ##
============================================
+ Coverage     77.84%   78.46%   +0.61%     
+ Complexity     2683     2516     -167     
============================================
  Files           239      239              
  Lines          7452     7353      -99     
  Branches        901     1022     +121     
============================================
- Hits           5801     5769      -32     
+ Misses         1115      990     -125     
- Partials        536      594      +58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@icrc-jofrancisco icrc-jofrancisco marked this pull request as ready for review June 18, 2025 14:28
@icrc-jofrancisco icrc-jofrancisco requested a review from ibacher June 24, 2025 15:40
@gracepotma gracepotma requested a review from pmanko July 11, 2025 06:29
@gracepotma
Copy link

@pmanko since Ian is extremely swamped right now, could you kindly take a look at this PR?

Big-picture context here: ICRC is using Google Health's Android FHIR SDK to build a secure offline app for offline/community-based patient visits. To get it to exchange data with their O3 systems, they've been making improvements to the FHIR2 module, like this one. :) So this is based in field-level needs.

@ibacher ibacher changed the title Fix: Concept retrieval by parsing string ID to integer in Person Attribute Translator Fix concept retrieval by parsing string ID to integer in Person Attribute Translator Jul 11, 2025
@ibacher
Copy link
Member

ibacher commented Jul 11, 2025

@icrc-jofrancisco Could we add an integration test to cover this feature please?

parthfloyd and others added 2 commits July 13, 2025 23:12
…dd-test

(test) added concept type PersonAttribute to patient and person integration test
@icrc-jofrancisco
Copy link
Contributor Author

@icrc-jofrancisco Could we add an integration test to cover this feature please?

Hello @ibacher Can you check the latest tests added? Thanks

@gracepotma
Copy link

Followed up with Ian today - this is in his review queue, and he'll try to get to it Monday for you! Thank you for your patience and, as always, really appreciate your contributions ❤️ 💐 🙏

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

Successfully merging this pull request may close these issues.

4 participants