kind-lab/mimic-fhir

Catch failed bundles and write out to file

Closed this issue · 3 comments

When sending bundles to HAPI FHIR catch any failed bundles and write out to file. These can then be rerun later.

To Do

  • Catch failed bundles
  • Output list of failed resources/bundles
    • Output resources or bundle? I guess I need to output the patient associated with the resources
    • Output error message too
  • Find way to rerun failed bundles
    • Need a way to create bundle from a list of resources file

Failed bundles are caught and written out to a log file. The log file identifies the issue and stores the bundle resource ids. To rerun the bundle a new function was added to pull an error file in and rerun the resource ids.

The limitation right now is that all error bundles are output to the same file (I distinguish depending on day). The reason I did it by day is that we don't want each individual bundle making an error file, but more a batch of them. Explore this when running more and not just tests

A very typical pattern is to have the log file named after the day of the week, or the day of the month, so that it will naturally be recycled each week/month.

Updated to write out to a day of week log, so written over after that.