Importer Logging

GNUmed aims for decoupled importer vs GNUmed infrastructure, making both of them behave more like black boxes towards each other.

The minimum API for this arrangement is:
  1. results-related table(s)
  2. dem.message_inbox

In the event of failure, a message can be written into dem.message_inbox with a text file log copied into dem.message_inbox.data (data of type text) whereas success may normally not be desired to be messaged inside GNUmed (but should be configurable).

IMO an importer could well argue:

I just create a log and indicate failure and success (say, by exit code). Whatever happens with that log (archive all, message failure logs by whatever means to whomever) is quite within the duties of whoever called me (say, a wrapper script).

Separation of concerns will make complexity more manageable. One sane interface with the importer might be:

call: importer.py --hl7=<hl7 file>
      (importer knows where to read its config file from
       or else could allow for --conf=config file)

return:
   exit code:
      0: success
      1: transient error, useful to just try again
      2: permanent error, not useful to try again w/o prior intervention
   log file:
      /some/programmatically/knowable/path/with/fixed/filename/such/as/gm-ca_hl7-import.log

With that, other code wanting to use the importer can make do just fine.
Topic revision: 07 Nov 2011, JamesBusser
 
Download.png
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Powered by Olark