#Embedded Python #HL7 #InterSystems IRIS for Health
写在回复社区帖子《Python能否动态创建HL7消息》中。
前提条件和设置
使用一个启用了集成的命名空间。
注意:USER命名空间默认不启用互操作性。
如果以下建议创建一个新的互操作性命名空间来探索功能。
# 切换到
ZN "[互操作性名称空间名称]"
# 启动交互式Python shell:
Do $SYSTEM.Python.Shell()
启动脚本
#Load dependencies
import datetime as dt
import uuid
# Cache current time in CCYYMMDDHHMMss format
hl7_datetime_now=dt.datetime.now().strftime('%Y%m%d%H%M%S')
# Create HL7 Message
hl7=iris.cls("EnsLib.HL7.Message")._New()
# Set the doc type
# 2.5.1:ORU_R01 - Unsolicited transmission of an observation message
hl7.PokeDocType("2.5..png)
.png)
.png)