This fhir-client-example
project demonstrates very basic functionality
using the HAPI FHIR library to do a search for patients
against a FHIR server while using HAPI FHIR interceptors along with some
rudimentary error handling.
Maven and JDK 17.
- Build the Maven project:
mvn clean package
Once the project is built, it can be ran using the Exec Maven plugin
(exec
).
A FHIR base server URL (e.g., http://hapi.fhir.org/baseDstu2
or
http://localhost:8080/fhir-server-example/fhir
) must be provided as a
command line argument. Also (optionally), the logging level can be
changed from its default of INFO
via the
-Dorg.slf4j.simpleLogger.defaultLogLevel
property.
For example, to build the project and run it against a FHIR server with a
logging level of DEBUG
for this project's code, run the following:
mvn clean package exec:java -Dexec.args="http://hapi.fhir.org/baseDstu2" -Dorg.slf4j.simpleLogger.log.io.github.infiniteloop90=DEBUG
This FHIR Client Example is licensed under the terms of the MIT License.