简体   繁体   English

如何使用HAPI解析HL7中的多个OBR段

[英]How to parse the Multiple OBR Segment in HL7 using HAPI

The following text is the hl7 message , i could able to parse many segments except NTE segment .'m using HAPI to parse the hl7 messages.'m newvbie to HL7 so please can any one suggest relevant classes in HAPI how to parse NTE segments ? 以下文本是hl7消息,我能够解析除NTE段之外的许多段。使用HAPI来解析hl7消息。这对于HL7来说是新手,所以请任何人建议HAPI中的相关类如何解析NTE段? it would be better if explanation is with few examples, 如果用很少的例子说明,那会更好,

MSH|^~\&|LCS|LCA|LIS|TEST9999|199807311532||ORU^R01|3629|P|2.2
PID|2|2161348462|20809880170|1614614|20809880170^TESTPAT||19760924|M|||^^^^
00000-0000|||||||86427531^^^03|SSN# HERE
ORC|NW|8642753100012^LIS|20809880170^LCS||||||19980727000000|||HAVILAND
OBR|1|8642753100012^LIS|20809880170^LCS|008342^UPPER RESPIRATORY
CULTURE^L|||19980727175800||||||SS#634748641 CH14885 SRC:THROA
SRC:PENI|19980727000000||||||20809880170||19980730041800||BN|F
OBX|1|ST|008342^UPPER RESPIRATORY CULTURE^L||FINALREPORT|||||N|F||| 19980729160500|BN
ORC|NW|8642753100012^LIS|20809880170^LCS||||||19980727000000|||HAVILAND
OBR|2|8642753100012^LIS|20809880170^LCS|997602^.^L|||19980727175800||||G|||
19980727000000||||||20809880170||19980730041800|||F|997602|||008342
OBX|2|CE|997231^RESULT 1^L||M415|||||N|F|||19980729160500|BN
NTE|1|L|MORAXELLA (BRANHAMELLA) CATARRHALIS
NTE|2|L| HEAVY GROWTH
NTE|3|L| BETA LACTAMASE POSITIVE
OBX|3|CE|997232^RESULT 2^L||MR105|||||N|F|||19980729160500|BN
NTE|1|L|ROUTINE RESPIRATORY FLORA

EDITED EDITED

Here I am supposed to parse multiple OBR segments, can anybody please guide me? 在这里,我应该解析多个OBR细分,有人可以指导我吗?

It looks like the message you have is valid , but the issue that you may be having is with the formatting of the sample. 看起来您所拥有的消息是有效的 ,但您可能遇到的问题是样本的格式。 It looks like a couple of the lines were wrapped. 它看起来像几条线被包裹了。 If you properly format them, then the message can be parsed properly. 如果您正确格式化它们,则可以正确解析消息。

In HL7 2.x, all new lines must start with a segment identifier (eg MSH, PID, OBX, ...). 在HL7 2.x中,所有新行必须以段标识符(例如MSH,PID,OBX,...)开头。 If the line does not start with one of these identifiers, then the parser will not know how to interpret that line or the remainder of the message. 如果该行不以这些标识符之一开头,则解析器将不知道如何解释该行或消息的其余部分。

If you are using HAPI and looking to test message, I would recommend using their HAPI test panel . 如果您正在使用HAPI并希望测试消息,我建议您使用他们的HAPI测试面板 It is an extremely easy to use tool that can help you verify a message and test message transmission. 它是一个非常易于使用的工具,可以帮助您验证消息和测试消息传输。

Below is a screenshot of what the message looked like in the test panel, once the formatting was cleaned up. 下面是清理格式后,测试面板中消息的截图。

hapi hl7消息

I have solved the issue by creating looping for every other segments with NTE segments loop , every segments has the optional NTE segments so iterated with every segment . 我通过使用NTE段循环为每个其他段创建循环来解决该问题,每个段都具有可选的NTE段,因此对每个段进行迭代。 Now its working fine ... 现在它的工作正常......

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

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