首页 > 解决方案 > WSO2 ESB HL7 处理

问题描述

我目前正在构建一个处理 HL7 的中介流程。我通过 MLLP 收到 HL7。然后我将消息克隆成两部分。在第一个中,我过滤了运行良好的消息类型。然后我只想将消息转发到 MLLP 系统,但我不知道该怎么做。在第二部分中,我想将 HL7 写在一个目录中。我可以创建一个文件,但内容是用 xml 而不是 hl7 格式编写的。这是我的序列的内容:

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="NormalSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
    <propertyGroup>
        <property expression="//hl7:MSG.1[1]/text()" name="HL7_TYPE" scope="default" type="STRING" xmlns:hl7="urn:hl7-org:v2xml"/>
        <property expression="//hl7:MSG.2[1]/text()" name="HL7_SUBTYPE" scope="default" type="STRING" xmlns:hl7="urn:hl7-org:v2xml"/>
    </propertyGroup>
    <clone>
        <target>
            <sequence>
                <log>
                    <property name="ROUTE" value="MED_EQUIPMENT"/>
                </log>
                <filter regex="true" source="get-property('HL7_TYPE') = 'ADT' and get-property('HL7_SUBTYPE') = 'A04'">
                    <then>
                        <log>
                            <property name="FOR_MED_EQU" value="YES"/>
                        </log>
                        <call>
                            <endpoint key="HL7MEDEQU"/>
                        </call>
                    </then>
                    <else>
                        <log>
                            <property name="FOR_MED_EQU" value="NO"/>
                        </log>
                        <drop/>
                    </else>
                </filter>
            </sequence>
        </target>
        <target>
            <sequence>
                <propertyGroup>
                    <property name="ROUTE" scope="default" type="STRING" value="LAB"/>
                    <property expression="fn:concat(get-property('SYSTEM_DATE', 'yyyyMMdd.HHmmssSSS'), '.hl7')" name="transport.vfs.ReplyFileName" scope="transport" type="STRING"/>
                    <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
                </propertyGroup>
                <log>
                    <property expression="get-property('transport.vfs.ReplyFileName')" name="FILENAME"/>
                    <property expression="fn:concat(get-property('SYSTEM_DATE', 'yyyyMMdd.HHmmssSSS'), '.hl7')" name="SYSDATE"/>
                </log>
                <send>
                    <endpoint key="HL7_Lab_EP"/>
                </send>
            </sequence>
        </target>
        <target>
            <sequence/>
        </target>
    </clone>
</sequence>

这是入站内嵌的代码:

<?xml version="1.0" encoding="UTF-8"?>
<inboundEndpoint name="HL7GW" onError="FaultSeq" protocol="hl7" sequence="NormalSeq" suspend="false" xmlns="http://ws.apache.org/ns/synapse">
    <parameters>
        <parameter name="inbound.hl7.Port">2000</parameter>
        <parameter name="inbound.hl7.AutoAck">true</parameter>
        <parameter name="inbound.hl7.TimeOut">10000</parameter>
        <parameter name="inbound.hl7.CharSet">UTF-8</parameter>
        <parameter name="inbound.hl7.ValidateMessage">true</parameter>
        <parameter name="inbound.hl7.BuildInvalidMessages">true</parameter>
        <parameter name="inbound.hl7.PassThroughInvalidMessages">true</parameter>
    </parameters>
</inboundEndpoint>

这是端点代码:

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="HL7_ECG_EP" xmlns="http://ws.apache.org/ns/synapse">
    <address uri="hl7://localhost:2001">
        <suspendOnFailure>
            <initialDuration>-1</initialDuration>
            <progressionFactor>1.0</progressionFactor>
        </suspendOnFailure>
        <markForSuspension>
            <retriesBeforeSuspension>0</retriesBeforeSuspension>
        </markForSuspension>
    </address>
</endpoint>

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="HL7_Lab_EP" xmlns="http://ws.apache.org/ns/synapse">
    <address uri="vfs:file:///c:/temp/hl7">
        <suspendOnFailure>
            <initialDuration>-1</initialDuration>
            <progressionFactor>1.0</progressionFactor>
        </suspendOnFailure>
        <markForSuspension>
            <retriesBeforeSuspension>0</retriesBeforeSuspension>
        </markForSuspension>
    </address>
</endpoint>

总而言之,我想: 1. 在 ESB 外部的系统上以 MLLP 发送 HL7 2. 将这些 HL7 保存在 HL7 格式而不是 XML 的目录中,如下所示:

MSH|^~\&|HL7Soup|Instance1|HL7Soup|Instance2|200808181126|SECURITY|ADT^A04|MSG00001|P|2.5.1
EVN|A01-|200808181123|
PID||77291|PATID1234^9^55A||Smith^Willian^A^III||19720415|M-||2106-3|555 Upper Harbour Rd^^Springfield^NC^3401-540|NN|(919)479-4354|(919)371-654~(919)377-3455||S|AGN|PATID12345001^2^R10|1234567890|A-84334^NC
NK1|1|Smith^Barbara^K|SPO|||||20011105
NK1|1|Smith^Bill^A|FTH
PV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|||SUR||-||1|A0-
AL1|1||^PENICILLIN||PRODUCES HIVES~RASH
AL1|2||^CAT DANDER
DG1|001|I9|1550|MAL NEO LIVER, PRIMARY|20080501103005|F||
PR1|2234|M11|111^CODE151|COMMON PROCEDURES|200809081123
ROL|45^RECORDER^ROLE MASTER LIST|AD|CP|34622^SMITH^JILL|200805011201
GT1|1122|1519|BILL^GATES^A
IN1|001|A357|1234|BCMD|||||132987
IN2|ID1551001|SSN12345678

任何帮助将不胜感激。

标签: wso2esbhl7

解决方案


经过几次测试,我终于设法使 hl7 消息的记录以 hl7 格式而不是 XML 文件的形式工作。

我必须在服务器(WSO2 Enterprise Integrator 6.5.0)上部署 ESB 解决方案并激活该服务器上 axis2.xml 文件中的 HL7。

不知为何,如果我修改了 WSO2 Integration Studio 的axis2.xml 文件,一旦我在WSO2 Integration Studio 中启动解决方案,配置文件就会恢复到之前的状态。无论文件中的修改如何,都会发生这种情况。即使您添加了简单的注释,文件也会直接返回到其原始版本。


推荐阅读