Data
Reset or wipe the server
Clean up practice data, from one tag to the whole database.
Pick the smallest tool that does the job.
Remove one drill's data#
If you tagged your resources (see $meta-add), use a conditional delete on the tag:
for t in Observation Encounter Patient; do
curl -s -X DELETE "$FHIR/$t?_tag=https://fhirdrill.dev/tags|drill-3" -o /dev/null -w "$t %{http_code}\n"
doneDelete the resources that hold references (Observations, Encounters) before the ones they point at (Patients).
Expunge everything (keep the server running)#
This removes every resource and every version. The database schema stays, and HAPI keeps running.
curl -s -X POST "http://localhost:8080/fhir/\$expunge" -H "Content-Type: application/fhir+json" \
-d '{"resourceType":"Parameters","parameter":[{"name":"expungeEverything","valueBoolean":true}]}'No undo
The lab has no backups. Once expungeEverything has run, the data is gone until you load it again from Synthea.
Start from an empty database#
The heavy-handed option, for when the database itself seems broken:
cd ~/fhir-lab/hapi
docker compose down -v # -v deletes the hapi_pgdata volume
docker compose up -d
docker compose logs -f hapi # wait for "Started Application"Then load the data again.