You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This subproject hosts a HAPI FHIR server that is based on the [hapi-fhir-jpaserver-example](https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jpaserver-example).
2
+
3
+
This subproject hosts a HAPI FHIR server that is based on the now-deprecated [hapi-fhir-jpaserver-example](https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jpaserver-example). The new repo is found [here](https://github.com/hapifhir/hapi-fhir-jpaserver-starter).
3
4
4
5
## Running the server
5
-
1. Make sure `gradle` is installed on your machine. Gradle v8 or higher.
6
+
7
+
1. Make sure `gradle` is installed on your machine. Gradle v6.9 or higher.
6
8
2. Run `gradle bootRun`
7
9
3. In a separate terminal tab, run `gradle loadData` to load resources
8
10
@@ -11,33 +13,50 @@ This will start the server running on http://localhost:8080/test-ehr.
11
13
**If you've loaded resources before, and want a clean slate, delete the `target` and `build` folders from test-ehr if they exist.**
12
14
13
15
## Adding resources to the database
16
+
14
17
The FHIR server will persist FHIR resources between restarts. You can delete the folder `target` to clear all resources.
15
18
16
19
To load the data from the json files in fhirResourcesToLoad, run the following script:
17
-
`gradle loadData`
20
+
`gradle loadData`
18
21
19
-
>Note: 'gradle loadData' can only be run while the FHIR server is running and `use_oauth` is false in`src/main/resources/fhirServer.properties`
22
+
>Note: 'gradle loadData' can only be run while the FHIR server is running and `use_oauth` is false in `src/main/resources/fhirServer.properties`
20
23
21
24
## Using OAuth security features
22
-
The FHIR server is open by default, but this can be changed in the `fhirServer.properties` file.
23
25
24
-
First, change the `use_oauth` flag to `true` to turn on security. Then set the `client_id`, `client_secret`, and `oauth_token` fields.
26
+
The FHIR server is open by default, but this can be changed in the `fhirServer.properties` file.
25
27
26
-
If using Keycloak and following the [CRD](https://github.com/mcode/CRD) guide, the `client_id` and `oauth_token` fields can be left as default. The`client_secret` can be found with the following steps:
28
+
First, change the `use_oauth` flag to `true` to turn on security. Then set the `client_id`,`client_secret`, and `oauth_token` fields.
27
29
28
-
1) Open the keycloak admin console (http://localhost:8180/auth) and log in
29
-
2) Open the ClientFhirServer, then the `clients` tab, and click `app-token`.
30
-
3) Click on the `Credentials` tab, use the `regenerate secret` option if needed.
31
-
4) Copy the client secret into the properties file under `client_secret`
30
+
If using Keycloak and following the [REMS Admin](https://github.com/mcode/rems-admin) guide, the `client_id` and `oauth_token` fields can be left as default. The `client_secret` can be found with the following steps:
32
31
33
-
Finally, ensure that the [request generator](https://github.com/mcode/crd-request-generator) has the correct username and password in the `properties.json` file. If following the CRD guide, this will be one of the users created when setting up Keycloak.
32
+
1. Open the Keycloak admin console (http://localhost:8180/auth) and log in
33
+
2. Open the ClientFhirServer, then the `clients` tab, and click `app-token`.
34
+
3. Click on the `Credentials` tab, use the `regenerate secret` option if needed.
35
+
4. Copy the client secret into the properties file under `client_secret`
36
+
37
+
Finally, ensure that the [request generator](https://github.com/mcode/request-generator) has the correct username and password in the `properties.json` file. If following the REMS Admin guide, this will be one of the users created when setting up Keycloak.
34
38
35
39
## Server endpoints
36
-
|Relative URL|Endpoint Description|
37
-
|----|----|
38
-
|`/test-ehr/`|Base server endpoint|
39
-
|`/test-ehr/r4`|EHR FHIR Server endpoint (will not resolve in browser)|
|`/test-ehr/r4`| EHR FHIR Server endpoint (will not resolve in browser) |
40
45
41
46
## Version
47
+
42
48
Java v11 or higher is required to run this application.
43
-
49
+
50
+
## Run configurations
51
+
52
+
Run configurations to run, clean, and load data for the FHIR server can be used for the IntelliJ IDEA CE IDE. You can set breakpoints on the `Boot Run` configuration.
53
+
54
+
These were last used with IntelliJ IDEA 2021.2.2 (Community Edition) and Microsoft Edge DevTools.
55
+
56
+
### Steps:
57
+
58
+
1. Select "Boot Run" as a Run Configuration from the dropdown menu.
59
+
2. Put a breakpoint (red dot) on the desired line, e.g. line 43 of `test-ehr/src/main/java/org/hl7/davinci/ehrserver/interceptor/QuestionnaireResponseSearchParameterInterceptor.java`.
60
+
3. Click the debug icon (green bug) up top.
61
+
4. Go to http://localhost:3000 (where a locally run request-generator is served at) and try to select a patient. You may have to wait for bootRun to finish starting up if you see a "Network Request Failed Error". request-generator will ask test-ehr for QuestionnaireResponse resources (to get the list of in-progress forms).
62
+
5. request-generator will pause as the breakpoint at line 43 gets hit. Hit F12 to open up DevTools on http://localhost:3000. You will see the QuestionnaireResponse (and other FHIR resources) have yet to be received.
0 commit comments