Querying an external HIS from Orthanc

Hi All,
Our HIS system is SQL based. I’d like to receive images in Orthanc, query the HIS for clinical trials information (such as Patient ID on the trial), anonymise the images and then insert the trials data back into the images. This is to satisfy anonymous image export for clinical trials evaluation. I am comfortable with all of the other functions except for the SQL query, where it doesn’t seem to be possible currently.
Is there a way to run SQL queries from the lua files? I have tried to recycle code from an Iguana interface engine (which is also lua based) but when I start Orthanc, it can’t understand db.connect when I initialise the connection. Iguana has a separate DB module, can/does Orthanc need the same thing?

Best Regards
Dave.

Hi Dave,

You should be able to access any lua modules you’ve installed at system level.

You’ll find some related info here: https://book.orthanc-server.com/users/lua.html#using-external-modules

HTH

Alain

Thanks very much Alain, that has helped out a lot.

Best Regards,
Dave.