Skip to content

Eliminate redundant getFhirClientForR4() calls in location pagination#130

Merged
dubdabasoduba merged 2 commits into
fix_location_fetchingfrom
copilot/sub-pr-129
Nov 12, 2025
Merged

Eliminate redundant getFhirClientForR4() calls in location pagination#130
dubdabasoduba merged 2 commits into
fix_location_fetchingfrom
copilot/sub-pr-129

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 12, 2025

Addresses #129 (comment)

Description

The collectAllLocations method called getFhirClientForR4() three times per pagination iteration: once for instanceof check, once for cast, and once for loadPage(). Stored result in local variable to eliminate redundant calls.

Before:

if (getFhirClientForR4() instanceof GenericClient) {
    Utils.cleanUpBundlePaginationNextLinkServerBaseUrl(
            (GenericClient) getFhirClientForR4(), currentPage);
}

try {
    currentPage = getFhirClientForR4().loadPage().next(currentPage).execute();
}

After:

IGenericClient fhirClient = getFhirClientForR4();
if (fhirClient instanceof GenericClient) {
    Utils.cleanUpBundlePaginationNextLinkServerBaseUrl(
            (GenericClient) fhirClient, currentPage);
}

try {
    currentPage = fhirClient.loadPage().next(currentPage).execute();
}

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.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…t calls

Co-authored-by: dubdabasoduba <4817531+dubdabasoduba@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 12, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • central.sonatype.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/fhir-gateway-extension/fhir-gateway-extension org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/fhir-gateway-extension/fhir-gateway-extension/plugins org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/fhir-gateway-extension/fhir-gateway-extension org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true -Dspotless.check.skip=true -s /home/REDACTED/work/fhir-gateway-extension/.codeql-scratch/dbs/java/working/settings.xml com.github.ferstl:depgraph-maven-plugin:4.0.3-CodeQL:graph -B -DclasspathScopes=compile -DoutputDirectory=/home/REDACTED/work/fhir-gateway-extension/.codeql-scratch/dbs/java/working/java-standalone-dependency-graph5508499779638860552/${project.groupId}/${project.artifactId} -DgraphFormat=json -Dmaven.ext.class.path=/opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/java/tools/java-buildless-maven-plugin.jar (dns block)
  • jfrog-prod-use1-shared-virginia-main.s3.amazonaws.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/fhir-gateway-extension/fhir-gateway-extension org.codehaus.plexus.classworlds.launcher.Launcher clean compile -DskipTests (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Dfile.encoding=UTF-8 -Xms256M -Xss8M -Djdk.util.zip.disableZip64ExtraFieldValidation=true -Dsun.misc.unsafe.memory.access=allow --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED -Xmx14581m -classpath /opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/java/tools/semmle-extractor-java.jar:/opt/hostedtoolcache/CodeQL/2.23.3/x64/codeql/java/tools/lombok-javac-extend.jar com.semmle.extractor.java.JavaExtractor --jdk-version 17 --javac-args @@@/home/REDACTED/work/fhir-gateway-extension/.codeql-scratch/dbs/java/log/ext/javac.args (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on _syncLocations hierarchy fetch Eliminate redundant getFhirClientForR4() calls in location pagination Nov 12, 2025
Copilot AI requested a review from dubdabasoduba November 12, 2025 08:48
@dubdabasoduba dubdabasoduba marked this pull request as ready for review November 12, 2025 09:07
@dubdabasoduba dubdabasoduba merged commit 1a05e06 into fix_location_fetching Nov 12, 2025
@dubdabasoduba dubdabasoduba deleted the copilot/sub-pr-129 branch November 12, 2025 09:07
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.

2 participants