fhirsnake is a minimalistic FHIR server that serve yaml and json files as FHIR resources
The server reads all yaml and json files from resources directory.
Resources directory should have subdirectories with names equal resource types:
resources/
├── Patient/
│ ├── example.yaml
│ ├── john-doe.json
│ └── patient3.yaml
├── Questionnaire/
│ ├── questionnaire1.yaml
│ ├── questionnaire2.yaml
│ └── sudbir/
│ └── questionnaire3.yamlTo use environment variables in resources, you can use the syntax ${VAR_NAME}.
In the case of missing environment variable, the exception will be raised.
NOTE: The syntax $VAR without braces is not supported because it might be used in resources.
Important
All created and updated resources persist in runtime only. All changes are vanished after service restart
- read, create and update operations are supported
- search - limied support without any search params
GET /$indexoperation returns a map of all resources in format<resource_type>:<id>
- Organize resources in a directory
- Option A: Run a container
docker run -p 8002:8000 -v ./resources:/app/resources bedasoftware/fhirsnake
- Option B: Adjust source destination in
Dockerfile.resourcesif required 2.1. Build an image using the base imagedocker build -t fhirsnake-resources:latest -f Dockerfile.resources . docker run -p 8000:8000 fhirsnake-resources
- Export resources as .json (Bundle) or .ndjson or ndjson.gz
docker run -v ./resources:/app/resources -v ./output:/output bedasoftware/fhirsnake export --external-questionnaire-fce-fhir-converter-url=http://host.docker.internal:3000/to-fhir --output /output/seeds.ndjson.gz
- Watch resources for changes and send as PUT requests to external fhir server
docker run -v ./resources:/app/resources -v ./output:/output bedasoftware/fhirsnake watch --external-fhir-server-url http://host.docker.internal:8080 --external-fhir-server-header "Authorization: Token token" --external-questionnaire-fce-fhir-converter-url=http://host.docker.internal:3000/to-fhir
There's an image bedasoftware/questionnaire-fce-fhir-converter:latest available that provides /to-fhir endpoint that can be used along with --external-questionnaire-fce-fhir-converter-url args for watch and export commands.
Please, use Issues
ruff format
ruff check . --fixIssue new version - run semantic release locally
npx semantic-release --no-cipoetry build
poetry publish