简体   繁体   中英

sequencial or concurrent hl7 message processing

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...

Whether you can process the messages asynchronously depends on the characteristics of the messages, and your processing logic. Consider this sequence:

  1. you get a registration for a new patient
  2. you get an episode listed against the patient
  3. you get a merge message merging the new patient with a different patient

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM