-
Notifications
You must be signed in to change notification settings - Fork 33
Testing Your Local Environment Setup
Logan Mitchell edited this page Jul 10, 2023
·
9 revisions
Once you've got dependencies installed and the BFD repository downloaded as noted in Local Environment Setup for BFD Development, you may want to run a test to ensure everything is set up correctly. This guide will run you through loading data using the pipeline into your local BFD database, setting up a local BFD server, and then hitting the server to return data.
- To load one test beneficiary, with your database running, change directories into
apps/bfd-pipeline/bfd-pipeline-ccw-rif
and run:This will kick off the integration testmvn -Dits.db.url="jdbc:postgresql://localhost:5432/fhirdb" -Dits.db.username=bfd -Dits.db.password=InsecureLocalDev -Dit.test=RifLoaderIT#loadSampleA clean verify
loadSampleA
. After the job completes, you can verify that it ran properly with:docker exec bfd-db psql 'postgresql://bfd:InsecureLocalDev@localhost:5432/fhirdb' -c 'SELECT "bene_id" FROM "beneficiaries" LIMIT 1;'
- Run
export BFD_PORT=6500
. The actual port is not important, but without it thestart-server
script will pick a different one each time, which gets annoying later. This can be set in your shell profile but note that when running the integration tests through maven, the BFD_PORT needs to be unset from the environment. - Now it's time to start the server up. Change to
apps/bfd-server
and run:After it starts up, you can tail the logs withmvn -Dits.db.url="jdbc:postgresql://localhost:5432/fhirdb?user=bfd&password=InsecureLocalDev" --projects bfd-server-war package dependency:copy antrun:run org.codehaus.mojo:exec-maven-plugin:exec@server-start
tail -f bfd-server-war/target/server-work/server-console.log
- We're finally going to make a request. BFD requires that clients authenticate themselves with a certificate. Those certs live in the
apps/bfd-server/dev/ssl-stores
directory. We can curl the server using a cert with this command:wherecurl --silent --insecure --cert $BFD_PATH/apps/bfd-server/dev/ssl-stores/client-unsecured.pem "https://localhost:$BFD_PORT/v2/fhir/ExplanationOfBenefit/?patient=567834&_format=json"
$BFD_PATH
is that path to thebeneficiary-fhir-data
repo on your system. It may be helpful to have that set in your profile, too. To configure Postman, go toSettings -> Certificates -> Add certificate
and load inapps/bfd-server/dev/ssl-stores/client-trusted-keystore.pfx
under the PFX File option. The passphrase ischangeit
. UnderSettings -> General
you'll also want to turn off "SSL Certificate Verification." - Total success (probably)!. You have a working call. To stop the server run this from the
apps/bfd-server
directory:mvn -Dits.db.url="jdbc:postgresql://localhost:5432/fhirdb?user=bfd&password=InsecureLocalDev" --projects bfd-server-war package dependency:copy antrun:run org.codehaus.mojo:exec-maven-plugin:exec@server-stop
- Home
- For BFD Users
- Making Requests to BFD
- API Changelog
- Migrating to V2 FAQ
- Synthetic and Synthea Data
- BFD SAMHSA Filtering