Reputation: 199
I was wondering what kind of concurrency models do folks do to process inbound hl7 messages (adt,...) and persist them in a normalized data model (relational or no-sql).
I am struggling with the thought of sequential message processing (mapping to a nosql db) and multi-threading when transforming/processing them from the (java, .net, whatever):
example: if I process messages received and transformed by clover leaf (transformed to be compliant with an internal web/rest api expected payload), and set to an internal web/rest api server (multi threaded java web app) then i can't guarantee I am parsing the messages sequentially due to threading.
if I process messages sequentially then mapping will be slow...
Upvotes: 3
Views: 1141
Reputation: 431
If the sending application is using MLLP then you might not have any choice but to do sequential processing. Most MLLP clients will wait for an accept acknowledgment before sending the next message.
For many healthcare use cases the sequence does matter. For example if the sending application is producing ORU^R01 messages then it could send preliminary results first and then final results later. If you are presenting that data to users you wouldn't want to allow the preliminary results to overwrite the final results just because your application happened to process the messages out of order.
A normalized data model and a NoSQL persistence layer is generally a contradiction in terms.
Upvotes: 1
Reputation: 3586
Whether you can process the messages asynchronously depends on the characteristics of the messages, and your processing logic. Consider this sequence:
If you process the last message before the second last one, what happens? will you treat it as an error because you have a new episode on a merged patient?
This is why there is no simple answer to the question. It depends
Upvotes: 4