简体   繁体   English

顺序或并发hl7消息处理

[英]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). 我想知道人们会使用哪种并发模型来处理入站hl7消息(adt,...)并将其持久化在规范化的数据模型(关系或无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): 当从(java,.net等)转换/处理顺序消息处理(映射到nosql db)和多线程时,我很挣扎:

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. 示例:如果我处理三叶草叶接收和转换的消息(转换为与内部Web / REST API预期有效负载兼容),并设置为内部Web / REST API服务器(多线程Java Web应用程序),则我无法保证我是由于线程顺序解析消息。

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. 如果发送应用程序正在使用MLLP,那么您可能别无选择,只能进行顺序处理。 Most MLLP clients will wait for an accept acknowledgment before sending the next message. 大多数MLLP客户端将在发送下一条消息之前等待接受确认。

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. 例如,如果发送应用程序正在生成ORU ^ R01消息,则它可以先发送初步结果,然后再发送最终结果。 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. 就规范而言,标准化数据模型和NoSQL持久层通常是矛盾的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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