Make patient file locations customizable
Currently, PulseEngine::InitializeEngine()
on the C++ side assumes that patient files are located under a patients
directory. If the file location does not include /patients
somewhere in it, then it gets prepended.
In my case, my Java application is passing the absolute path to the patient file (which is in a custom location), so it looks like this:
C:/path/to/patient.json
Since this doesn't have /patients
in it, it gets mangled to this:
./patients/C:/path/to/patient.json
Which doesn't work, so the engine initialization fails. Additionally, it was hard to figure out what had happened because while there are many error checks that print a message when something goes wrong, this one does not, so all I see is:
PulseEngine::115::Unable to initialize engine
PulseEngine::154::Engine has died
It seems like this part of the code could get the best of both worlds -- try to load the specified location as-is, and if that doesn't work, try pre-pending ./patients/
. And an error message saying what it tried and failed to load would be nice, too :)