-
Notifications
You must be signed in to change notification settings - Fork 32
FHIR objectmapper upadation in generate ABHA #81
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
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
41a4bc0
Modified tnxId keyword to txnId
55e4881
Abha-address search API changes
08f485f
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty f3445cb
added validation for multiple phraddress
cb328f1
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty f967118
Abha-address search response changes
8430a37
Save facility id variable change chnages
246bf2a
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
68a81b3
Added check to avoid multiple save of single care-context
65e3751
Merge branch 'develop' into develop
helenKaryamsetty 44df923
removed unused variables
e329b5c
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
9c3b51f
Updated public key certificate API
82f88e6
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty 114cfff
Integrated Abha session v3 APIs and Profile login user verify APIs
e67eca9
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty cc1b252
committed coderabitai suggested
cf66e78
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
c38d099
Revert "jwt implementation changes (#53)"
da3053d
data Sync for FLW API changes
c28dccb
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty 38dd846
Reapply "jwt implementation changes (#53)"
d9201ff
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
43d6b48
changed variable type default value as false
86a06f5
addition of isNewAbha in getHealthIdDetails API
c75dfdd
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty 4cbaf06
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
9f0372c
Revert "jwt implementation changes (#53)"
ebff8ad
verify abha issue with mobile number
ba89acc
Reapply "jwt implementation changes (#53)"
8661760
lombok version changes
f19e6ba
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
3e2c7b2
API to fetch beneficiary ID linked with HealthID
b90abec
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
d77f370
modified sending benIds
6681955
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty 925dad3
getServices API upgrade to V3
0a4881e
Updated environment files
cd8db5b
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
355e7f2
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-APβ¦
00e28eb
fix(bug): fhir bundle creation scheduler calling for every 5mins
helenKaryamsetty 35733f9
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty fa6ef69
fix(bug): changed to objectmapper to gson malformed error
4576776
resolved merge conflicts
35bd3f8
fix(bug): bymistake removed comment
helenKaryamsetty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
Potential incorrect usage of Jackson ObjectMapper
If
requestis a JSON string (as the method signature suggests),convertValueis not the appropriate method. TheconvertValuemethod is for converting between different Java object types, not for deserializing JSON strings.If
requestis a JSON string, usereadValueinstead:π Committable suggestion
π€ Prompt for AI Agents
π οΈ Refactor suggestion
Missing exception handling for Jackson deserialization
The code doesn't handle potential exceptions that could be thrown by Jackson during deserialization (like
JsonProcessingException). This could lead to unexpected runtime errors.Add explicit exception handling for Jackson-specific exceptions:
π€ Prompt for AI Agents
π‘ Verification agent
π§© Analysis chain
Inconsistent JSON processing approaches within the same class
The code has been modified to use Jackson's ObjectMapper for deserialization instead of Gson, but the rest of the class still uses Gson for other JSON operations (lines 98, 114, 125, etc.). This creates an inconsistent approach to JSON handling within the same class.
Consider standardizing on either Jackson or Gson throughout the class for consistency and maintainability. If Jackson is preferred, replace all Gson usage:
Also, verify that
requestis already a parsed object and not a JSON string. If it's a JSON string, usereadValueinstead:π Script executed:
Length of output: 3145
Standardize on Jackson and correct JSON parsing of
requestThe
generateOTP(String request)parameter is a raw JSON string, soobjectMapper.convertValue(request, SendOTPForCard.class)will not parse it. UsereadValueinstead, and eliminate mixed use of Gson in this class:β’ In src/main/java/com/wipro/fhir/service/ndhm/GenerateHealthID_CardServiceImpl.java:
β Replace at lines 82β83:
diff - ObjectMapper objectMapper = new ObjectMapper(); - SendOTPForCard obj = objectMapper.convertValue(request, SendOTPForCard.class); + ObjectMapper objectMapper = new ObjectMapper(); + SendOTPForCard obj = objectMapper.readValue(request, SendOTPForCard.class);β’ Replace all remaining
new Gson().toJson(...)calls (e.g. lines 98, 114, 125) with:β’ Remove or refactor any
new Gson().fromJson(...)toobjectMapper.readValue(...).This will ensure a single, consistent JSON-handling library (Jackson) and correctly parse incoming JSON strings.
π Committable suggestion
π€ Prompt for AI Agents