法国Sebia 公司是全球著名的临床电泳及扫描分析仪专业厂家,从开始生产手工电泳分析仪及配套试剂至今已有30多年历史。1993年,Hydrasys全自动电泳分析仪的出现,由于简化了传统电泳中存在的冗长繁琐的操作步骤和统一了实验条件,从而带动了全球电泳业的革命。目前,Sebai 公司的自动电泳分析仪已从1600 Hydrasys、 Hyrys Densitometer发展到第二代Hydrasys LC、Hyrys HIT。但是其基本的通讯协议却没有多大的变化。
本文翻译和解说了毛细管电电泳和电泳扫描仪链接电脑主机或者LIS(实验室信息)系统的通讯协议。包括RS232C串口通讯,tcp协议,以及直接文件传输这三种形式,重在描述电泳仪的端口和标准化消息。
RS-232C串口连接和TCP-IP连接。
通过本连接,你可以方便的导入工作列表和病人信息,并在标本执行之后,回传结果。
你可以点击上图所展示的电泳工作软件的HOST进入功能界面,进行数据的导入和导出。
以下六种消息是允许的:
MSG1 Worklist request (or Total request) 所有工作单请求
MSG2 Transfer OK (ACK) 传输正确
MSG3 Demographic data of a single patient 一个标本的统计数据,应该是指一个病人的数据结构。(猜的)
MSG4 Transfer error (NACK) 传输错误
MSG5 Result data of a single patient 一个标本的结果数据
MSG6 Query request (or Partial request of a single patient by patient ID number) 部分工作单请求,通过id号请求。
MSG7 No data (EOT) 无数据
所有的消息都是以STX character (ASCII 02h)开始,以ETX character (ASCII 03h)结束。
例外:在Worklist mode即工作单传输模式下的uzihou一个病人的资料将以MSG3结束,最后一个病人的结果传输到主机将以一个EOT character (ASCII 04h)标志结束,这两条都是为了明确传输结果是最后一条而做的改变。
从电脑主机或者LIS导入一全部工作列表
传输协议如下:
协议解说:
电泳仪发送MSG1到主机然后等待MSG2,然后等待MSG3。
当电泳仪从主机收到一个MSG3的消息,如果它接受到了所有病人的数据,它将回答一个MSG2消息,如果发生错误将会回答MSG4消息。通常如果主机收到MS4消息后将会发送最大3次该病人的数据,然后转到下一病人。
如果主机已经没有样本数据再传送了,那么最后一个字符就是 EOT (ASCII 04h)而不是ETX (ASCII 03h)。
如果操作者不知道标本的编号但是也想传输数据的话,他可以输入9999进行传输,但是这样子就都传输了。
所有的消息都有一个固定的长度。
这种方式不推荐于扫条码的标本。
以上内容tcp连接同样适用。
通过ID号导入部分工作单
通讯协议:
协议解说:
电泳仪发送MSG6到主机然后等待MSG2,然后等待MSG3。
当电泳仪从主机收到一个MSG3的消息,如果它接受到了所有病人的数据,它将回答一个MSG2消息,如果发生错误将会回答MSG4消息。通常如果主机收到MS4消息后将会发送MSG3消息(最大3次),然后转到下一病人。
如果主机没有该人的数据,它将会返回MSG7。
如果一个ID号已经存在于电泳仪的工作列表了,那么主机应该返回0000,即便是返回一个其它的值,电泳仪也会忽略它。
导出结果到电脑主机或者LIS
该模式能够导出选定的样本结果到主机或者是LIS。
通讯协议:
协议解析:
电泳仪发送MSG5,等待主机回复MSG2,然后继续发送下一个病人数据的MSG5,然后等待主机回复MSG2,知道所有的样本传送完毕。
如果主机回复MSG4,电泳仪将会重新传送样本数据(最大3次),直到接受MSG2,然后继续传下一条。
如果电泳仪已经没有样本数据传送了,最后结尾的字符就是EOT (ASCII 04h)。
每一条记录都有一个固定的长度。
每条消息的解析
一下是每条消息的详细解析,包括了病人的数据等等,具体的我不再翻译,你有能力也应该看得懂得。
MESSAGE 1 DESCRIPTION (MSG1) TOTAL 11 bytes
No. | Description | Start | Length | Note |
1 | STX | 1 | 1 | ASCII 02h |
2 | Analysis program code | 2 | 1 | Letter from A to Z , 0 to 9 (see index 1 ) |
3 | Start sample number | 3 | 4 | Aligned right e.g. 0001 (1) |
4 | End sample number | 7 | 4 | Aligned right e.g.0010 (9999 or nothing) |
5 | ETX | 11 | 1 | ASCII 03h |
MESSAGE 2 DESCRIPTION (MSG2) TOTAL 3 bytes
No. | Description | Start | Length | Note |
1 | STX | 1 | 1 | ASCII 02h |
2 | ACK | 2 | 1 | ASCII 06h |
3 | ETX | 3 | 1 | ASCII 03h |
MESSAGE 3 DESCRIPTION (MSG3) TOTAL 247 bytes
No. | Description | Start | Length | Note |
1 | STX | 1 | 1 | ASCII 02h |
2 | Analysis program code | 2 | 1 | Letter from A to Z , 0 to 9 (see index 1 ) |
3 | Sample number | 3 | 4 | Aligned right e.g. 0001 |
4 | Patient ID number | 7 | 15 | Alphanum. charact., aligned left and spaces |
5 | Patient Name | 22 | 30 | Alphanum. charact., aligned left and spaces |
6 | Date of birth | 52 | 8 | DDMMYYYY |
7 | Sex | 60 | 1 | M or F |
8 | Age in years | 61 | 3 | Aligned right e.g. 015 |
9 | Department | 64 | 20 | Alphanum. charact., aligned left and spaces |
10 | Sample date | 84 | 8 | DDMMYYYY |
11 | Concentration (e.g. total protein) | 92 | 5 | Not fixed with a decimal separator: “.” (2Eh) |
12 | Free 1 | 97 | 30 | Alphanum. charact., aligned left and spaces |
13 | Free 2 | 27 | 30 | Alphanum. charact., aligned left and spaces |
14 | Free 3 | 57 | 30 | Alphanum. charact., aligned left and spaces |
15 | Free 4 | 87 | 30 | Alphanum. charact., aligned left and spaces |
16 | Free 5 | 17 | 30 | Alphanum. charact., aligned left and spaces |
17 | ETX or EOT | 47 | 1 | ASCII 03h or 04h for the last sample |
MESSAGE 4 DESCRIPTION (MSG4) TOTAL 3 bytes
No. | Description | Start | Length | Note |
1 | STX | 1 | 1 | ASCII 02h |
2 | NACK | 2 | 1 | ASCII 15h |
3 | ETX | 3 | 1 | ASCII 03h |
MESSAGE 5 DESCRIPTION (MSG5) TOTAL Variable 791 bytes without optional fields ;GLOBAL/POSITION: 790 + 1 = 791 bytes/Line
No. | Description | Start | Length | Note |
1 | Description | 1 | 1 | ASCII 02h |
2 | STX | 2 | 1 | Letter from A to Z , 0 to 9 (see index 1 ) |
3 | Program code | 3 | 4 | Aligned right e.g. 0001 |
4 | Sample number | 7 | 15 | Alphanum. charact., aligned left and spaces |
5 | Patient ID code | 22 | 30 | Alphanum. charact., aligned left and spaces |
6 | Patient Name | 52 | 8 | DDMMYYYY |
7 | Date of Birth | 60 | 1 | M or F |
8 | Sex | 61 | 3 | Aligned right e.g. 015 |
9 | Age in years | 64 | 20 | Alphanum. charact., aligned left and spaces |
10 | Department | 84 | 8 | Format DDMMYYYY |
11 | Sample date | 92 | 5 | Not fixed with a decimal separator “.” (2Eh) |
12 | Concentration (e.g. total protein) | 97 | 8 | Alphanum. charact., aligned left and spaces |
13 | Measurement unit of concentration | 105 | 30 | Alphanum. charact., aligned left and spaces |
14 | Free field 1 | 135 | 30 | Alphanum. charact., aligned left and spaces |
15 | Free field 2 | 165 | 30 | Alphanum. charact., aligned left and spaces |
16 | Free field 3 | 195 | 30 | Alphanum. charact., aligned left and spaces |
17 | Free field 4 | 225 | 30 | Alphanum. charact., aligned left and spaces |
18 | Operator ID | 255 | 3 | Alphanum. charact. e.g. JON |
19 | Date of Analysis | 258 | 8 | Format DDMMYYYY |
20 | Number of fractions (max. 10) | 266 | 2 | Aligned right e.g. 06 |
21 | Fraction 1 name | 268 | 10 | Alphanum. charact., aligned left and spaces |
22 | Fraction 2 name | 278 | 10 | Alphanum. charact., aligned left and spaces |
23 | Fraction 3 name | 288 | 10 | Alphanum. charact., aligned left and spaces |
24 | Fraction 4 name | 298 | 10 | Alphanum. charact., aligned left and spaces |
25 | Fraction 5 name | 308 | 10 | Alphanum. charact., aligned left and spaces |
26 | Fraction 6 name | 318 | 10 | Alphanum. charact., aligned left and spaces |
27 | Fraction 7 name | 328 | 10 | Alphanum. charact., aligned left and spaces |
28 | Fraction 8 name | 338 | 10 | Alphanum. charact., aligned left and spaces |
29 | Fraction 9 name | 348 | 10 | Alphanum. charact., aligned left and spaces |
30 | Fraction 10 name | 358 | 10 | Alphanum. charact., aligned left and spaces |
31 | Fraction 1 % value | 368 | 5 | Not fixed with a decimal separator “.” (2Eh) |
32 | Fraction 2 % value | 373 | 5 | Not fixed with a decimal separator “.” (2Eh) |
33 | Fraction 3 % value | 378 | 5 | Not fixed with a decimal separator “.” (2Eh) |
34 | Fraction 4 % value | 383 | 5 | Not fixed with a decimal separator “.” (2Eh) |
35 | Fraction 5 % value | 388 | 5 | Not fixed with a decimal separator “.” (2Eh) |
36 | Fraction 6 % value | 393 | 5 | Not fixed with a decimal separator “.” (2Eh) |
37 | Fraction 7 % value | 398 | 5 | Not fixed with a decimal separator “.” (2Eh) |
38 | Fraction 8 % value | 403 | 5 | Not fixed with a decimal separator “.” (2Eh) |
39 | Fraction 9 % value | 408 | 5 | Not fixed with a decimal separator “.” (2Eh) |
40 | Fraction 10 % value | 413 | 5 | Not fixed with a decimal separator “.” (2Eh) |
41 | Fraction 1 conc. value | 418 | 5 | Not fixed with a decimal separator “.” (2Eh) |
42 | Fraction 2 conc. value | 423 | 5 | Not fixed with a decimal separator “.” (2Eh) |
43 | Fraction 3 conc. value | 428 | 5 | Not fixed with a decimal separator “.” (2Eh) |
44 | Fraction 4 conc. value | 433 | 5 | Not fixed with a decimal separator “.” (2Eh) |
45 | Fraction 5 conc. value | 438 | 5 | Not fixed with a decimal separator “.” (2Eh) |
46 | Fraction 6 conc. value | 443 | 5 | Not fixed with a decimal separator “.” (2Eh) |
47 | Fraction 7 conc. value | 448 | 5 | Not fixed with a decimal separator “.” (2Eh) |
48 | Fraction 8 conc. value | 453 | 5 | Not fixed with a decimal separator “.” (2Eh) |
49 | Fraction 9 conc. value | 458 | 5 | Not fixed with a decimal separator “.” (2Eh) |
50 | Fraction 10 conc. value | 463 | 5 | Not fixed with a decimal separator “.” (2Eh) |
51 | Peak 1 name | 468 | 10 | Alphanum. charact., aligned left and spaces |
52 | Peak 2 name | 478 | 10 | Alphanum. charact., aligned left and spaces |
53 | Peak 3 name | 488 | 10 | Alphanum. charact., aligned left and spaces |
54 | Peak 4 name | 498 | 10 | Alphanum. charact., aligned left and spaces |
55 | Peak 1 % value | 508 | 5 | Not fixed with a decimal separator “.” (2Eh) |
56 | Peak 2 % value | 513 | 5 | Not fixed with a decimal separator “.” (2Eh) |
57 | Peak 3 % value | 518 | 5 | Not fixed with a decimal separator “.” (2Eh) |
58 | Peak 4 % value | 523 | 5 | Not fixed with a decimal separator “.” (2Eh) |
59 | Peak 1 conc. value | 528 | 5 | Not fixed with a decimal separator “.” (2Eh) |
60 | Peak 2 conc. value | 533 | 5 | Not fixed with a decimal separator “.” (2Eh) |
61 | Peak 3 conc. value | 538 | 5 | Not fixed with a decimal separator “.” (2Eh) |
62 | Peak 4 conc. value | 543 | 5 | Not fixed with a decimal separator “.” (2Eh) |
63 | Pathological Flag | 548 | 1 | 0 = Normal , 1 = Pathological |
64 | Ratio 1 (e.g. A/G for the proteins) | 549 | 5 | Not fixed with a decimal separator “.” (2Eh) |
65 | Ratio 2 | 554 | 5 | Not fixed with a decimal separator “.” (2Eh) |
66 | Comment | 559 | 230 | Alphanum. charact., aligned left and spaces |
67 | Reference pattern flag | 789 | 1 | 0 = Normal pattern , 1 = Reference pattern |
68 | QC sample flag | 790 | 1 | 0 = Normal sample , 1 = QC sample |
Optional fields | Curve | |||
69 | ETX or EOT | Programmable fields + the attached card comment | ||
82 | Extended comment | |||
124 | ASCII 03h or 04h for the last sample | |||
69/82/124/125 | 791/XXX | 1 | ut optional fields |
MESSAGE 6 DESCRIPTION (MSG6) TOTAL 18 bytes
No. | Description | Start | Length | Note |
1 | STX | 1 | 1 | ASCII 02h |
2 | Program Code | 2 | 1 | Letter from A to Z , 0 to 9 (see index 1 ) |
3 | Patient ID number | 3 | 15 | Alphanumeric. character., aligned left and spaces |
4 | ETX | 18 | 1 | ASCII 03h |
MESSAGE 7 DESCRIPTION (MSG7) TOTAL 3 bytes
No. | Description | Start | Length | Note |
1 | STX | 1 | 1 | ASCII 02h |
2 | EOT | 2 | 1 | ASCII 04h |
3 | ETX | 3 | 1 | ASCII 03h |
文件导出
文件导出的格式与rs232或者tcp连接类似,结果的格式为,这种格式可以好好研究一下,因为大部分与lis相连都是导出文件,然后上传结果的,以下为部分格式,实在太多了,不想折腾了。
No. | Description | Start | Length | Note |
1 | Program code | 1 | 1 | Note |
2 | Sample number | 2 | 4 | Letter from A to Z , 0 to 9 (see index 1 ) |
3 | Patient ID number | 6 | 15 | Aligned right e.g. 0001 |
4 | Patient Name | 21 | 30 | Alphanum. charact. aligned left and spaces |
5 | Date of Birth | 51 | 8 | Alphanum. charact. aligned left and spaces |
6 | Sex | 59 | 1 | Format DDMMYYYY |
7 | Age in years | 60 | 3 | M or F |
8 | Department | 63 | 20 | Aligned right e.g. 015 |
9 | Sample date | 83 | 8 | Alphanum. charact. aligned left and spaces |
10 | Concentration (e.g. total protein) | 91 | 5 | Format DDMMYYYY |
11 | Measurement unit of concentration | 96 | 8 | Not fixed decimal separator “.” (2Eh) |
12 | Free field 1 | 104 | 30 | Alphanum. charact. aligned left and spaces |
13 | Free field 2 | 134 | 30 | Alphanum. charact. aligned left and spaces |
14 | Free field 3 | 164 | 30 | Alphanum. charact. aligned left and spaces |
15 | Free field 4 | 194 | 30 | Alphanum. charact. aligned left and spaces |
16 | Free field 5 | 224 | 30 | Alphanum. charact. aligned left and spaces |
17 | Operator ID | 254 | 3 | Alphanum. charact. aligned left and spaces |
18 | Date of Analysis | 257 | 8 | Alphanum. character e.g. JON |
19 | Number of fractions (max.10) | 265 | 2 | DDMMYYYY |
10 | Fraction 1 name | 267 | 10 | Aligned right with e.g. 06 |
21 | Fraction 2 name | 277 | 10 | Alphanum. charact. aligned left and spaces |
22 | Fraction 3 name | 287 | 10 | Alphanum. charact. aligned left and spaces |
23 | Fraction 4 name | 297 | 10 | Alphanum. charact. aligned left and spaces |
24 | Fraction 5 name | 307 | 10 | Alphanum. charact. aligned left and spaces |
好了,讲了半天也累死我了,该协议也不像是标准的hl7协议,大部分的格式可能还来不及仔细研究,但是应该已经不难了,因为你已经知道该怎么做了。等到我们要用的时候再看看那个字段是怎么对应的吧。
如无特别说明,本博客文章皆为原创。转载请说明,来自吵吵博客。
原文链接:http://chaochaoblog.com/archives/1927
吵吵微信朋友圈,请付款实名加入:
分析的很透彻,很欣赏你的看法,学习了。
路来过来看看,支持。
不错,多谢分享!