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

Gateway ext. enhancements | Search by REL Sync strategy performance optimizations #79

Merged
merged 10 commits into from
Aug 22, 2024

Conversation

ndegwamartin
Copy link
Collaborator

@ndegwamartin ndegwamartin commented Aug 16, 2024

IMPORTANT: Where possible all PRs must be linked to a Github issue

Resolves #78

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for
    bug fixes
  • I have added documentation for any new feature(s) and configuration
    option(s) on the README.md
  • I have run mvn spotless:check to check my code follows the project's
    style guide
  • I have run mvn clean test jacoco:report to confirm the coverage report
    was generated at plugins/target/site/jacoco/index.html
  • I ran mvn clean package right before creating this pull request.

- Remove duplicate parameters
- Chunk search by REL sync location request parameters
- Out of bound exception on REL requests
- Fix REL resource GET by id request
- Return correct bundle SELF LINK url
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 33.02752% with 73 lines in your changes missing coverage. Please review.

Project coverage is 44.30%. Comparing base (712d495) to head (9889c86).
Report is 14 commits behind head on main.

Files Patch % Lines
...ister/fhir/gateway/plugins/SyncAccessDecision.java 22.36% 56 Missing and 3 partials ⚠️
.../fhir/gateway/plugins/PermissionAccessChecker.java 0.00% 6 Missing ⚠️
...teway/plugins/LocationHierarchyEndpointHelper.java 76.47% 4 Missing ⚠️
...way/plugins/PractitionerDetailsEndpointHelper.java 60.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #79      +/-   ##
============================================
- Coverage     45.01%   44.30%   -0.72%     
- Complexity      130      135       +5     
============================================
  Files            16       16              
  Lines          1213     1316     +103     
  Branches        146      156      +10     
============================================
+ Hits            546      583      +37     
- Misses          600      667      +67     
+ Partials         67       66       -1     

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

- Remove this since doesn't work on current server versions
@ndegwamartin ndegwamartin marked this pull request as ready for review August 21, 2024 12:20
Comment on lines +84 to +89
return locationIds.parallelStream()
.map(
locationId ->
getLocationHierarchy(
locationId, preFetchAdminLevels, postFetchAdminLevels))
.collect(Collectors.toList());
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@@ -108,7 +108,7 @@ private Bundle getAttributedPractitionerDetailsByPractitioner(Practitioner pract

List<LocationHierarchy> locationHierarchies =
getLocationsHierarchy(supervisorCareTeamOrganizationLocationIds);
List<String> attributedLocationsList = getAttributedLocations(locationHierarchies);
Set<String> attributedLocationsList = getAttributedLocations(locationHierarchies);
Copy link
Member

Choose a reason for hiding this comment

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

I like the use of sets here.

private final List<String> roles;
private IgnoredResourcesConfig config;
private final String keycloakUUID;
private final Gson gson = new Gson();
private FhirContext fhirR4Context;
private final IParser fhirR4JsonParser;
private IGenericClient fhirR4Client;
private static final int REL_LOCATION_CHUNKSIZE = 20;
Copy link
Member

Choose a reason for hiding this comment

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

Is this configurable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No it isn't and I don't think it should be at the moment since this is where the Large URI Exception stems from. We want it to be the least highest possible value.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense

fhirR4Client.getFhirContext().getRestfulClientFactory().setConnectionRequestTimeout(300000);
fhirR4Client.getFhirContext().getRestfulClientFactory().setSocketTimeout(300000);

int subListSize = 100;
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to move this to the Constants?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool let me move it to the inner Constants class at the bottom. Should be internal to the class and also should not be re-configured so as not to impact the proxy to FHIR server communication (Based on tests we did with SRE this was the optimal pagination value for server resources deployed for ESM MG Preview)

We could however make it configurable but with a caveat on how it could impact stability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update done. We can introduce configurability at some point.

@ndegwamartin ndegwamartin enabled auto-merge August 22, 2024 07:31
@ndegwamartin ndegwamartin merged commit cd9e528 into main Aug 22, 2024
1 check passed
@ndegwamartin ndegwamartin deleted the gateway-enhancements branch August 22, 2024 14:59
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.

Add Support for HTTP POST Requests in RequestMutation
3 participants