Dmitrii Baranov · Feb 23

Easiest way to clean up a FHIR database?

Hi, what is the easiest way to clear all the tables which store FHIR data? The most straitforward approach is to get a list of tables using the information_schema.tables view, then execute dynamic SQL with the "delete from" clause, but perhaps some helper class has already been written for this purpose?

Product version: IRIS 2022.3
0 86
Discussion (2)1
Log in or sign up to continue

Great question. We routinely need to do this in our internal testing. To clean out your repo, use the following commands at the IRIS terminal:

Set strategy = ##class(HS.FHIRServer.API.InteractionsStrategy).GetStrategyForEndpoint(appKey)
Set options("deleteDataOnly") = 1
Do strategy.Delete(.options)

The FHIR Server config page should have your app key.

Good luck.

Great answer! And yes, I badly need that for testing!