gpt4 book ai didi

java - 'Repeate' 、 'Component' 和 'Sub-Component' 在 HL7 中意味着什么?

转载 作者:行者123 更新时间:2023-11-30 01:43:19 27 4
gpt4 key购买 nike

我根据我找到的文档为 HL7 构建了一个解析器,并认为它运行良好 - 直到我获得了测试数据的示例。我基于以下假设构建了它:

  • ~ 是一个“重复”字符。基本上意味着传递的字段值是给定值的数组。
  • ^ 表示该字段由数组表示,但期望数组项用于构建最终值。
  • &^ 类似,但它是 ^ 内部的嵌套数组。

根据我拥有的测试数据,这些假设似乎不太准确。有人可以帮助我弄清楚解释这些的正确方法是什么吗?

最佳答案

当您构建解析器时,我将介绍更多细节。

请引用this引用:

(x0D) 段分隔符|字段分隔符,又名管道^ 组件分隔符,又名帽子& 子组件分隔符~ 字段重复分隔符\转义字符

The segment separator is not negotiable. It is always a carriage return (ASCII 13 or HEX 0D). The others are suggested values only, but usually used as indicated above. The HL7 standard lets you choose your own as long as you show them in the MSH segment.

The MSH is the first segment of all HL7 messages (except HL7 batch messages). The field separator is presented as the 4th character in the message and it also represents the first field of the MSH segment. Since the first field of the MSH is typically only a pipe,’|’, counting MSH fields becomes tricky. Field 2 of the MSH (MSH-2) contains the other separator characters in this order: component, field repeat, escape, and sub-component.

Thus, the following is an example of the beginning of an HL7 message:MSH|^~&|…

如上所述:

  • ~ 表示为此特定字段提供了多个值。因此,就编程语言而言,它是数组或列表或类似的数据结构。你的假设是正确的。请引用this回答以获取更多详细信息。
  • ^ 表示给定字段的组成部分。这意味着,一个字段可能有多个组成部分。所有这些组件组合代表最终值。我认为这不应该与编程语言术语中的数组相关。这里的例子是人名。整个人名是单个数据,分为姓氏、名字等。如您所见,这不是一个数组。这不是多个值;这是拆分为多个子值的单个值。因此,您可以将其视为 classstruct,而不是数组,如 Composition 中所示。 .
  • &是子组件,与上面的组件类似,不同之处在于,它进一步将给定组件中的数据拆分为子组件。同样,我认为这应该与特定于语言的 classstruct 而不是数组链接。

此外,上面列出的字符是默认字符,并且最常用于所述目的。但是,它们是可以改变的。基本上,这些字符在 MSH(2) 中的每条消息中定义。 。请注意,第一个字段始终是不可协商的字段分隔符 (|)。因此下一个(第二个)字段保存编码字符。当您编写解析器时,您应该从这里读取编码字符并进一步相应地使用它们。

字符的顺序也按上述定义 here :

2.24.1.2 Encoding characters (ST) 00002Definition: This field contains the four characters in the following order: the component separator, repetition separator, escape character, and subcomponent separator. Recommended values are ^~&, (ASCII 94, 126, 92, and 38, respectively).

请引用讨论HL7 Escape Sequences的其他答案, conventions ,和terms使用过。

关于java - 'Repeate' 、 'Component' 和 'Sub-Component' 在 HL7 中意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59147462/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com