https://github.com/samply/test-data-loader
Load fake data to a FHIR store.
https://github.com/samply/test-data-loader
Last synced: 3 months ago
JSON representation
Load fake data to a FHIR store.
- Host: GitHub
- URL: https://github.com/samply/test-data-loader
- Owner: samply
- License: apache-2.0
- Created: 2023-01-04T16:14:59.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T08:52:56.000Z (3 months ago)
- Last Synced: 2025-02-17T09:32:29.055Z (3 months ago)
- Language: Shell
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Test data loader
A Docker image that generates test data and loads it into a FHIR store.
The data is generated by [bbmri-fhir-gen](https://github.com/samply/bbmri-fhir-gen), according to the [BBMRI/GBA FHIR profile](https://samply.github.io/bbmri-fhir-ig/overview.html).
The following FHIR resource types will be present in the generated data:
- Patient
- Observation
- Condition
- Specimen
- Organization (for collection and site)The user can control the naumber of patients generated. The remaining resources are created in proportion to the number of patients.
## Quickstart
The supplied `docker-compose.yml` file can be used for trying things out. It contains a FHIR store (Blaze) and the test data loader. Start it like this:
```
docker-compose up
```Wait for the test data to finish loading (a couple of minutes). Then try this (in a different console):
```
curl http://localhost:8080/fhir/Patient
```This should return a list of patients known to the store (all 2000 of them).
## Configuration
The test data loader is configured using environment variables:
| Variable | Description | Default |
|-------------------------------------------|--------------------------------------------------------------------------------------------------------------------|----------------------------------|
| `FHIR_STORE_URL` | HTTP Address of the FHIR store | http://store:8080/fhir |
| `PATIENT_COUNT` | Number of patients to be generated. | 100 |
| `START_DELAY` | Time in seconds before starting upload. | 0 |
| `USE_BRIDGEHEAD_AUTH` | Use Bridgehead-specific authorization credentials to access Blaze. | false |
| `KEEP_ALIVE` | Keep the script alive once it has done its work. | false |
| `WAIT_FOR_BLAZE` | Wait until blaze is ready before starting upload. | false |You can use the START_DELAY variable if you want to wait for something (typically Blaze) to start before running the data load.
If you set USE_BRIDGEHEAD_AUTH to true, then the script will look in /etc/bridgehead, to see if there is a file called ccp.local.conf or similar, and try to extract the authorization credentials for Blaze from there.
If you set KEEP_ALIVE to true, the script will never terminate. This can be useful if you are working in a Bridgehead environemnt, where terminating containers cause the Bridgehead to shut down.
If you set WAIT_FOR_BLAZE to true, the script will poll blaze every second and only start the upload when it is ready.
## Building
```
docker build -t samply/test-data-loader . --no-cache
```## License
Copyright 2023 The Samply Community
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.