Enforce ordering between updating database and predicting per patient
The problem before is demonstrated below.
Suppose Patient A receives 2 tests:
- 11am
- 12pm
The prediction for Test 1 should only use the result from 11am. However, due to multi-threading, the ordering is no longer preserved. It is possible that the database gets updated with the result from 12pm before the feature construction for the 1st prediction is ready.
This merge request fixes this issue.
With 5 threads, we achieve the expected F3-score: the same as if we ran the program with a single thread.
1143 32 42657 209
0.8566289440155885