繁体   English   中英

使用Chameleon Python API的Segment Iterator对象遍历HL7消息

[英]Iterating through HL7 message using Segment Iterator Object of Chameleon Python API

我正在使用Interfaceware Iguana和Chameleon生成HL7消息。 这是我第一次使用Python,因此这个问题可能还不成熟。 我正在尝试使用Segment Iterator Object遍历消息。

current_segment = environment.input_segment_iterator()  
current_segment.apply_transform()
output = current_segment.output()
if current_segment.move_next('OBX'):
    log('OBX setId is ' + current_segment.field(1).value );

我已经在全局后期处理方程式窗口中编写了此脚本,但是它总是给我一个错误提示

RuntimeError: Invalid iterator must be reset before being used while calling apply_transform
while executing the outgoing post process equation for the project.

我已经看到了许多使用迭代器的示例,并且都遵循相同的模式。 如何重置此迭代器,为什么无效?

经过一些研究工作,我发现不能在post process方程式窗口中使用input_segment_iterator ,而是在transformation窗口中使用。 现在,我可以看到使用Chameleon的“ Test Mapping功能对脚本所做的更改。 但是,如何配置此更改以在使用此vmd生成的每条消息上实施?

我认为使用INTERFACEWARE Chameleon和Iguana产品的人员可以轻松帮助我。

鬣蜥的人不多,但我相信你错过了这个

在完成对OBX的迭代之后,使用current_segment.reset() ,以便将当前段设置为MSH。

您可以在此页面上查看示例用法。

暂无
暂无

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

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