Skip to content

Commit a3b606b

Browse files
authored
Merge pull request #65 from mcode/dev
Dev
2 parents 2a6f209 + 691be2d commit a3b606b

3 files changed

Lines changed: 37 additions & 34 deletions

File tree

.github/auto_assign.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# EHR FHIR Server
2-
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).
34

45
## 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.
68
2. Run `gradle bootRun`
79
3. In a separate terminal tab, run `gradle loadData` to load resources
810

@@ -11,33 +13,50 @@ This will start the server running on http://localhost:8080/test-ehr.
1113
**If you've loaded resources before, and want a clean slate, delete the `target` and `build` folders from test-ehr if they exist.**
1214

1315
## Adding resources to the database
16+
1417
The FHIR server will persist FHIR resources between restarts. You can delete the folder `target` to clear all resources.
1518

1619
To load the data from the json files in fhirResourcesToLoad, run the following script:
17-
`gradle loadData`
20+
`gradle loadData`
1821

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`
2023
2124
## Using OAuth security features
22-
The FHIR server is open by default, but this can be changed in the `fhirServer.properties` file.
2325

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.
2527

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.
2729

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:
3231

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.
3438

3539
## 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)|
40+
41+
| Relative URL | Endpoint Description |
42+
| -------------- | ------------------------------------------------------ |
43+
| `/test-ehr/` | Base server endpoint |
44+
| `/test-ehr/r4` | EHR FHIR Server endpoint (will not resolve in browser) |
4045

4146
## Version
47+
4248
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.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ task loadRequestBuilder() {
193193
void setup() {
194194
exec {
195195
workingDir 'src/main/webapp/'
196-
commandLine 'git','clone','--single-branch', '--branch','settings-change-hotfix','https://github.com/HL7-DaVinci/crd-request-generator.git','tempFolder'
196+
commandLine 'git','clone','--single-branch', '--branch','settings-change-hotfix','https://github.com/mcode/request-generator.git','tempFolder'
197197
}
198198
exec {
199199
workingDir 'src/main/webapp/tempFolder'

0 commit comments

Comments
 (0)