HL7中的“重复",“组件"和“子组件"是什么意思? [英] What does 'Repeate', 'Component' and 'Sub-Component' mean in HL7?

查看:74
本文介绍了HL7中的“重复",“组件"和“子组件"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据发现的文档构建了HL7解析器,并认为它运行良好-直到获得测试数据示例为止.我是根据以下假设构建的:

I built a parser for HL7 based on documentation I found and thought it was working well--until I got examples of test data. I built it with the following assumptions:

  • 是重复"字符.从根本上讲,传递的字段的值是给定值的数组.
  • ^ 表示该字段由数组表示,但是期望该数组项用于构建最终值.
  • & ^ 类似,但是是 ^ 内部的嵌套数组.
  • The ~ is a "repeat" character. Basically meaning the value of the field passed is an array of the given values.
  • The ^ indicates the field is represented by an array, but the expectation is the array items are used to build a final value.
  • The & is similar to the ^, but is a nested array inside of a ^.

鉴于我拥有的测试数据,这些假设似乎并不十分准确.有人可以帮助我弄清楚解释这些内容的正确方法是什么吗?

These assumptions don't appear very accurate given the test data I have. Can someone help set me straight on what the right way to interpret these are?

推荐答案

在构建解析器时,我将详细介绍一些细节.

As you are building a parser, I will go into little more details.

请参考参考:

Please refer to this reference:

(x0D)   Segment separator
|       Field separator, aka pipe
^       Component separator, aka hat
&       Sub-component separator
~       Field repeat separator
\       Escape character

段分隔符不可协商.它始终是回车符(ASCII 13或HEX 0D).其他仅是建议值,但通常如上所述使用.HL7标准允许您选择自己的名称,只要您在MSH段中显示它们即可.

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.

MSH是所有HL7消息(HL7批处理消息除外)的第一段.字段分隔符在消息中显示为第四个字符,它还表示MSH段的第一个字段.由于MSH的第一个字段通常只是一个管道,"|",因此计算MSH字段变得很棘手.MSH(MSH-2)的字段2按此顺序包含其他分隔符:组件,字段重复,转义和子组件.

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.

因此,以下是HL7消息开头的示例:MSH | ^〜\& |…

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

如上所述:

  • 表示为此特定字段提供了多个值.因此,就编程语言而言,它是一个数组或列表或类似的数据结构.您的假设是正确的.
  • ^ 代表给定字段的组成部分.这意味着一个字段可能具有多个组成部分.这些所有组合 combine 代表最终价值.我认为这不应该与编程语言中的数组有关.这里的示例是人名".整个人名是按姓氏,给定名称等形式拆分的单个数据.如您所见,这不是一个数组.这不是多个值;这是将单个值拆分为多个子值.因此,您可以将其视为 class struct 而不是数组,如组成.
  • & 是子组件,与上述组件相似,不同之处在于,它进一步将数据拆分为子组件中的给定组件.同样,我认为这应该与特定于语言的 class struct 而不是数组相关联.
  • The ~ represents that there are multiple values provided for this specific field. So, in terms of programming language, it is an array or list or similar data structure. Your assumption is correct.
  • The ^ represent component parts of the given field. That means, one field may have multiple components. All these components combine represent final value. This should not be related to array in programming language terms I think. The example here is Person Name. Entire Person Name is single data which is split in family name, given name etc. As you can see, this is not an array. This is not multiple values; this is single value split in multiple sub values. So instead of array, you can think this as class or struct as in Composition.
  • The & is sub-component which is similar to component as stated above with the difference that, it further splits data in given component in sub-components. Again, I think this should be linked with language specific class or struct instead of an array.

此外,上面列出的字符是默认字符,最常用于所述目的.但是,它们可以更改.基本上,这些字符在 MSH(2) .请注意,第一个字段始终是不可协商的字段分隔符( | ).因此,下一个(第二个)字段包含编码字符.在编写解析器时,应从此处读取编码字符,并相应地进一步使用它们.

Also, the characters listed above are default and most commonly used for the purpose stated. But, they can be changed. Basically, these characters are defined in each message in MSH(2). Note that first field is always field separator (|) which is non-negotiable. So the next (second) field holds the Encoding Characters. As you are writing parser, you should read the encoding characters from here and use them accordingly further.

字符的顺序也按此处:

2.24.1.2编码字符(ST)00002定义:该字段按以下顺序包含四个字符:组件分隔符,重复分隔符,转义符和子组件分隔符.推荐值为^〜\&(分别为ASCII 94、126、92和38).

2.24.1.2 Encoding characters (ST) 00002 Definition: 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转义序列术语.

Please refer to these other answers those discuss about HL7 Escape Sequences, conventions, and terms used.

这篇关于HL7中的“重复",“组件"和“子组件"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆