ValueSet Manager Application
- Make sure that Docker desktop is running.
- In root directory, run:
docker-compose up
- Load data to FHIR server (wait 30 sec/1min after you've run your
docker-compose upbefore doing this for the server to be ready)bin/load-data.sh
IMPORTANT- notes about data:
The load-data program includes several conveniences that you will need to do manually if using Postman or cURL. It:
- Loads many different static resources aside from demodata (SearchParameters, RCKMS Conditions, Endpoint resources, etc.)
- Loads a special, manually-curated Parameters resource to the server, and inserts your
FHIR_SERVERconstant into theappAuthoritativeUrlbefore loading. This is necessary because:
- The current eRSD has a known bug where it structures the
compose.includeitems in the groupers incorrectly (fixed in that parameters resource).- The data cannot currently be loaded via a plain POST to the server. It needs to be
POSTto<FHIR server endpoint>/$eRSD-v2-import, which adds necessary VSM-related metadata, such as profiles, usage contexts, etc. Theload-dataprogram does this- The
appAuthoritativeUrlis your public fhir server URL on that environment. This is used in order to be able to generate the proper authoritativeSource extensions on resources that should be managed by VSM. Not having this will break the data.Remember that for Dev and QA deployments, you will need to load data with an authorization header. To do this via the
load-dataprogram, you can just set your AUTH_TOKEN const near the top of the file
-
After you start up the dockerized services and load the data, wait a few minutes before running next steps
./keycloak/configure -
The configure file initializes some of the settings in Keycloak, adding a realm, admin role, etc.
-
At this point, you should be able to run the app using the username johndoe and password password (if you didn't change the default values)
Keep in mind, to run the app, you will need a VSAC api username and key. You must sign up with them to receive this.
-
If you don't have it already, copy .env.local.example to .env.local within
/vsm-appcp vsm-app/.env.local.example vsm-app/.env.local -
You must also run the following script to generate keys for the app BEFORE starting the application
node generateKeyPair.js -
You must also copy the Keycloak client secret into your .env.local 'KEYCLOAK_SECRET' variable.
Log in to keycloak -> Select aphl realm -> Select Clients -> Select server_auth -> Select Credentials -> Copy the client secret
-
Next run the following command to install the necessary dependencies for the Next.js app
cd vsm-app && npm install -
Finally to launch the the Next.js app run the following command:
npm run dev
To see the app UI, navigate to http://localhost:3000/
You will need to use the non_admin_username and non_admin_password that you defined in the ./keycloak/configure file to log in.
- The Docker setup includes a Postgres volume that will persist even if you stop + kill containers.
- To clear everything out, run:
bin/docker-cleanup - Note that this command will also delete anything related to your local CQF (HAPI) server for this project (and anything you have for other projects)
- If you want to clear out the HAPI data only, run:
./bin/clear-data.sh
By default this will point to the local instance of the HAPI FHIR JPA server running at http://localhost:8082/fhir, but you can override this by passing in a different URL as the first argument.
Use ./mvnw clean install to generate and cache a local version of your clinical-reasoning build
- Ensure that the pom.xml file has the right
clinical-reasoningversion variable:
<clinical-reasoning.version>3.12.0-SNAPSHOT</clinical-reasoning.version>
or similar matching the version in your clinical-reasoning pom.xml file.
- Use
./mvnw clean installto generate and cache a local version of yourhapi-fhir-jpa-server-starterbuild containing theclinical-reasoningdependency - Use
docker build -t hapi-fhir-docker-image-tag-whatever .to generate a docker image ofhapi-fhir-jpa-server-starterwhich you can use in the next part
- Update your
docker-composefile as follows:
hapi-fhir-jpa-server-starter:
image: hapi-fhir-docker-image-tag-whatever
- Run
docker compose upto start up your dev instance which will use the development build ofclinical-reasoning