-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add support for location lineage post processing #119
Conversation
cbb10e7
to
227b66e
Compare
Better target to requests to location endpoint
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #119 +/- ##
============================================
+ Coverage 62.96% 63.13% +0.17%
- Complexity 221 224 +3
============================================
Files 16 16
Lines 1477 1492 +15
Branches 168 173 +5
============================================
+ Hits 930 942 +12
- Misses 460 461 +1
- Partials 87 89 +2 ☔ View full report in Codecov by Sentry. |
plugins/src/main/java/org/smartregister/fhir/gateway/plugins/SyncAccessDecision.java
Outdated
Show resolved
Hide resolved
plugins/src/test/java/org/smartregister/fhir/gateway/plugins/SyncAccessDecisionTest.java
Outdated
Show resolved
Hide resolved
String locationId; | ||
if (StringUtils.isNotBlank(resultContent)) { | ||
IBaseResource parsedResource = this.fhirR4JsonParser.parseResource(resultContent); | ||
if (parsedResource instanceof Location) { | ||
return ((Location) parsedResource).getIdElement().getIdPart(); | ||
} | ||
} | ||
|
||
String[] pathParts = requestPath.split("/"); | ||
locationId = pathParts[pathParts.length - 1]; |
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.
If these two conditions are primarily for differentiating between a PUT and POST I'd recommend passing the request Method (PUT|POST) as a parameter and using an if else statement for more clarity
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.
They're not for differentiating the request method. They are there incase a request is made but the resource updated/created is not returned in the json or isn't a valid location resource. Done away with one condition though
Update test to handle this merge
IMPORTANT: Where possible all PRs must be linked to a Github issue
Resolves [link to issue]
Engineer Checklist
bug fixes
option(s) on the
README.md
mvn spotless:check
to check my code follows the project'sstyle guide
mvn clean test jacoco:report
to confirm the coverage reportwas generated at
plugins/target/site/jacoco/index.html
mvn clean package
right before creating this pull request.