|
发表于 2003-5-22 19:26:10
|
显示全部楼层
[讨论]JB的Specification示例讲解
唉,这不是逼我嘛,这是中英文对照的相关部分
2.11MESSAGE CONSTRUCTION RULES消息构筑规则
Note: These message construction rules define the standard HL7 encoding rules, creating variable length delimited messages. Although only one set of encoding rules is defined as a standard in HL7 Version 2.3, other encoding rules are possible (but since they are non-standard, they may only be used by a site-specific agreement).
注意: 消息构筑规则中定义了HL7编码规则标准,创建了不同长度的定界消息。尽管HL7版本2.3中只定义了一套编码规则,但其它的编码规则也具有潜在的使用可能性。(因为其它的编码规则是非标准的,所以只在指定地点的约定中使用。)
Step 1Construct the segments in the order defined for the message. Each message is constructed as follows:
步骤1 以消息定义的顺序构筑段。每一个消息按以下步骤构筑:
a)the first three characters are the segment ID code
a) 前三个字符为段ID代码
b)each data field in sequence is inserted in the segment in the following manner:
b) 序列中每一个数据字段都按以下的方式插入到段中:
1)a field separator is placed in the segment
1) 字段分隔符被放到段中
2)if the value is not present, no further characters are required
2) 如果值未给出,则不需要任何字符
3)if the value is present, but null, the characters "" (two consecutive double quotation marks) are placed in the field
3) 如果值已给出,但为空值,应将字段置为""(两个连续的双引号)
4)otherwise, place the characters of the value in the segment. As many characters can be included as the maximum defined for the data field. It is not necessary, and is undesirable, to pad fields to fixed lengths. Padding to fixed lengths is permitted. Encode the individual data fields as shown in Section 2.9, “Data types.”
4)另外,将值放入段中。字符的个数由数据字段中定义的最大值决定。不需要将字段填充到固定长度,但填充字段到固定长度也是允许的。单独数据字段的编码方法在2.9节“Data types.数据类型”中介绍。
5)if the field definition calls for a field to be broken into components, the following rules are used:
i.if more than one component is included they are separated by the component separator
ii.components that are present but null are represented by the characters ""
iii.components that are not present are treated by including no characters in the component
iv.components that are not present at the end of a field need not be represented by component separators. For example, the two data fields are equivalent:
|ABC^DEF^^| and |ABC^DEF|.
5)如果字段定义需要将一个字段插入到组分中时,应当使用下面的规则:
i)如果不只包括一个组分,各组分应由组分分隔符分隔开。
ii)组分已给出,但为空值时,应由""表示出来。
iii)未给出组分时,可以看作组分中不包含任何字符。
iv)字段末尾未给出的组分不需要使用分隔符。例如,以下的两个数据字段等同:|ABC^DEF^^| 和 |ABC^DEF|
6)if the component definition calls for a component to be broken into subcomponents, the following rules are used:
i.if more than one subcomponent is included they are separated by the subcomponent separator
ii.subcomponents that are present but null are represented by the characters ""
iii.subcomponents that are not present are treated by including no characters in the subcomponent
iv.subcomponents that are not present at the end of a component need not be represented by sub-component separators. For example, the two data components are equivalent:
^XXX&YYY&&^ and ^XXX&YYY^.
6)组分定义需要将组分插入到子组分中时,使用以下规则:
i)如果不只包含一个子组分,各个子组分应由子组分分隔符分隔开。
ii)子组分已给出,但为空值时,应由""表示出来
iii)子组件未给出时,可以看作其中不包含任何字符
iv)字段末尾未给出的子组件不需要使用分隔符。例如,以下的两个数据字段等同:
^XXX&YYY&&^ and ^XXX&YYY^.
7)if the field definition permits repetition of a field, the repetition separator is used only if more than one occurrence is transmitted. In such a case, the repetition separator is placed between occurrences. If three occurrences are transmitted, two repetition separators are used.)
In the example below, two occurrences of telephone number are being sent:
|234-7120~599-1288B1234|
7)如果字段定义中允许字段重复,应使用下面的规则定义,如果不只传输一个事件或放在两个事件中传输时,应使用重复分隔符。(如果传输三个事件,应使用两个重复分隔符。)在下面的例子中,发送两个电话号码事件:
|234-7120~599-1288B1234|]
c)repeat Step 1b while there are any fields present to be sent. If all the data fields remaining in the seg-ment definition are not present there is no requirement to include any more delimiters.
c) 给出所要发送的字段时,重复步骤1b。如果保留在段定义中的所有数据字段未给出值时,不需要包含更多定界符。
d)end each segment with an ASCII carriage return character
d) 用回车符的ASCII结束每一个段。
Step 2Repeat Step 1 until all segments have been generated.
步骤2 重复步骤1,直到所有段都产生为止
The following rules apply to receiving HL7 messages and converting their contents to data values:
a)ignore segments, fields, components, subcomponents, and extra repetitions of a field that are present but were not expected
b)treat segments that were expected but are not present as consisting entirely of fields that are not present
c)treat fields and components that are expected but were not included in a segment as not present.
下面的规则适用于接收HL7消息和将内容转化为数据值的情况:
a)给出的段,字段,组分,子组分和特别的重复字段并非所需内容时,可将它们忽略。
b)所需段未给出时,该段可看成是由未给出的字段组成的。
c)所需字段和组分不包括在一个段中时,字段和组分被看作是未给出的。
|
|