简体   繁体   English

Biztalk 消息不可知的编排

[英]Biztalk message agnostic orchestration

After moving away from Biztalk since BT2006, we're looking at bringing it back into the organization.自从 BT2006 离开 Biztalk 之后,我们正在考虑将其带回组织。 One of the frustrations I had early on was when dealing wht HL7 and orchestrations, we needed to have a seperate orchestration for each ADT message type, even though the schema for each type is essentially the same, and each orchestration did exactly the same thing.我早期遇到的挫折之一是在处理 HL7 和编排时,我们需要为每种 ADT 消息类型进行单独的编排,即使每种类型的模式基本相同,并且每个编排都做完全相同的事情。 Moving forward into the world of BizTalk 2010, has anything improved here?进入 BizTalk 2010 世界,这里有什么改进吗? Is there a pattern I can utilize to use a single orchestration for all ADT types?是否有一种模式可以用来为所有 ADT 类型使用单一编排?

As I see it you have two possibilities here.如我所见,您在这里有两种可能性。

  1. Treat the message as anonymous.将消息视为匿名。 This means your message is "un-typed" (you declare it as a System.Xml.XmlDocument type).这意味着您的消息是“未键入的”(您将其声明为 System.Xml.XmlDocument 类型)。 Then your orchestration can interrogate the message to decide what type it is.然后您的编排可以询问消息以确定它是什么类型。
  2. Create an envelope message whose body can be all of your possible message types (using the xsd choice group selector).创建一个信封消息,其正文可以是所有可能的消息类型(使用 xsd 选择组选择器)。 Your orchestration then handles the envelope message type.然后您的业务流程处理信封消息类型。 With this approach you can declare the type contained in the body of the envelope by setting a value in the envelope header.使用这种方法,您可以通过在信封 header 中设置一个值来声明信封主体中包含的类型。

I would prefer the second one;我更喜欢第二个; while it is certainly more work (you need to wrap all your inbound messages in an envelope) it allows you to understand the what the message is by just looking at the envelope header. This means you can still route by message type if you need to.虽然它肯定需要更多工作(您需要将所有入站消息包装在一个信封中),但它允许您通过查看信封 header 来了解消息是什么。这意味着如果需要,您仍然可以按消息类型路由.

HL7 messaging in BizTalk has remained roughly unchanged since the 2006 release. BizTalk 中的 HL7 消息传递自 2006 年发布以来大致保持不变。 Because BizTalk defines a schema for each message and event type (eg ADT^A01, ADT^A03, ADT^A08) and not just for each message type (eg ADT, BAR, MDM), your mapping and orchestrations quickly become a mess.因为 BizTalk 为每个消息和事件类型(例如 ADT^A01、ADT^A03、ADT^A08)定义了一个架构,而不只是为每个消息类型(例如 ADT、BAR、MDM)定义了一个架构,您的映射和编排很快就会变得一团糟。

Here is what I have done in the past to get around this limitation:这是我过去为解决此限制所做的工作:

  1. Allow messages to come in untyped to the orchestration.允许消息以未类型化的方式进入编排。 That is set the MessageType = System.Xml.XmlDocument.即设置MessageType = System.Xml.XmlDocument。 I found that generally, I am only interested in parsing out or updating a few elements, so I would just write a helper library with a few generic linq statements to get to the data that I needed.我发现一般来说,我只对解析或更新一些元素感兴趣,所以我只需要编写一个带有一些通用 linq 语句的帮助程序库来获取我需要的数据。 This way, I could write a linq statement that gets to PID-3 (Patient Id Number) and I would be able to use it consistently over any message or event type because PID remains the same.这样,我可以编写一个 linq 语句来获取 PID-3(患者 ID 号),并且我可以在任何消息或事件类型上始终如一地使用它,因为 PID 保持不变。 Likewise, I would use the same technique to update the message as well.同样,我也会使用相同的技术来更新消息。 This technique does not work great if there are large structural differences in the fields that you are looking to update or if you are looking to read/update a large amount of data.如果您要更新的字段存在很大的结构差异,或者如果您要读取/更新大量数据,则此技术效果不佳。
  2. Create master/canonical HL7 message type schemas.创建主/规范 HL7 消息类型架构。 This takes a bit more work, but depending on how many message types you are looking to process, this can really pay off and is more consistent with how healthcare organizations think of their HL7 interfaces.这需要做更多的工作,但取决于您要处理的消息类型的数量,这确实可以带来回报,并且更符合医疗保健组织对其 HL7 接口的看法。 In order to do this, you would need to define a new schema for a message type and include all possible segments for this message.为此,您需要为消息类型定义一个新模式并包括该消息的所有可能段。 So, instead of having multiple ADT types defined, you would roll all the possible variations for A01, A03, A04, etc. under one master schema.因此,不是定义多个 ADT 类型,而是将 A01、A03、A04 等的所有可能变体滚动到一个主模式下。 This will allow you greatly reduce the amount of mapping and parsing logic needed.这将使您大大减少所需的映射和解析逻辑的数量。 Unfortunately, since this is not the HL7 accelerator's default behavior and will require some custom pipelines and orchestration logic to achieve.不幸的是,由于这不是 HL7 加速器的默认行为,并且需要一些自定义管道和编排逻辑才能实现。 Basically, you will need to modify some properties to get the Accelerator to think that your new master message is valid.基本上,您将需要修改一些属性以使加速器认为您的新主消息有效。

For mostly pass-through interfaces, I would recommend technique #1.对于大多数直通接口,我会推荐技术#1。 Otherwise, if you will be generating or needing to consume basically any message event in a canonical fashion, technique #2 can pay off in the long run.否则,如果您将以规范的方式生成或需要基本上使用任何消息事件,从长远来看,技术 #2 可以带来回报。

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

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