简体   繁体   English

HL7 Hapi获得标准分部中存在的非标准分部,分部名称

[英]HL7 Hapi get non-standard segment, segment's name present in standard segment

I am unable to parse a non standard message segment using terser or happi API. 我无法使用terser或happi API解析非标准消息段。 The segment "PV2" is present in structure mulitple times, one stated as non-standard segment, which is my segment for parsing message. 段“PV2”在结构中存在多次,一个表示为非标准段,这是我用于解析消息的段。

After using message.printStructure(), the following structure (Sample) is shown. 使用message.printStructure()后,显示以下结构(Sample)。

ADT_A08 (start)
MSH - MSH|^~\&|||||||ADT^A08||P|2.3||||
EVN - Not populated
PID - PID|1||^^^&ISO~^^&~^^^     &ISO~^^^&||^||19230324|F||-1|  ^^ BOXES^CA^81125||||||||
[ PD1 ] - PD1||||^^
[ { NK1 } ] - NK1|1|^|CH||
             NK1|2|^|||
PV1 - PV1|1|I|^MC3706^1|C|||^^^|^^^|^^^|||||1|||^^^|IN||||||||||||||||||||||||||202308211705
[ PV2 ] - Not populated
[ { DB1 } ] - Not populated
PROCEDURE (start)
[{
   PR1 - Not populated
  [ { ROL } ] - Not populated
}]
PROCEDURE (end)
[ { GT1 } ] - GT1|1||^||  ^^^^|(408)-283-1928|||||SLF|828-46-4375||||INFORMATION UNAVAILABLE
[ { PV22 } ] (non-standard) - PV2||ABC|^XYZ
.
.
.
ADT_A08 (end) 

I need to get field any of PV2 non-standard segment. 我需要获得任何PV2非标准段的字段。 I am able to get the values of the segment "PV22" by using terser or HAPI API.(But not as intended use) 我可以使用terser或HAPI API获取段“PV22”的值。(但不是预期用途)

terser.get("/.PV22-3-2");  // outputs XYZ

How do i get "PV2" non-standard value knowing the only "PV2" as a segment name ??? 我怎么得到“PV2”非标准值知道唯一的“PV2”作为段名?

terser.get("/.PV2-3-2"); // outputs null

But i expect the output as of use of "PV22". 但我希望输出使用“PV22”。 ie. 即。 output should be "XYZ". 输出应为“XYZ”。 How do I achieve it ?? 我该如何实现? Thanks in advance.!!!!!! 提前致谢。!!!!!!

The reason for this is that your PV2 segment is in the wrong position in the source message. 原因是您的PV2段在源消息中处于错误的位置。 It should come immediately after the PV1 segment, in which case it will be parsed normally. 它应该在PV1段之后立即出现,在这种情况下,它将被正常解析。

Because it is at the end of your message, it is being parsed as a non-standard segment and HAPI adds a "2" to the end to distinguish it from the standard PV1 segment. 因为它位于消息的末尾,所以它被解析为非标准段,HAPI在末尾添加“2”以区别于标准PV1段。

James Agnew is the Master, so his reply was pretty definitive. James Agnew是大师,所以他的回答非常明确。 I don't know nearly as much about HL7 or HAPI as he does. 我不像他那样了解HL7或HAPI。 The point may be: if your message is non-standard (as it is with the PV2 tacked onto the end) you may not be able to get everything you want from HAPI. 重点可能是:如果您的消息是非标准的(因为PV2固定在最后),您可能无法从HAPI获得所需的一切。 It's not magic. 这不是魔术。 The AbstractGroup.getNonStandardNames() does seem to provider you enough access to detect the PV22 at runtime, if you write some custom code for that situation. 如果您为该情况编写一些自定义代码,AbstractGroup.getNonStandardNames()似乎确实为您提供了在运行时检测PV22的足够访问权限。 The terser seems to me like a convenience framework that is available to work with messages that stick closely to the standard; 在我看来,terser就像一个便利框架,可用于处理与标准密切相关的消息; for less conformant messages, you have to do more work. 对于不太符合要求的消息,您必须做更多工作。

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

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