Use this https://github.com/giacomos/qifparse combined with https://github.com/quentinsf/icsv2ledger to automatically generate journal entried in ledger-cli format which can be used by hledger directly.
You can also fork and modify it to generate hledger format files directly.