使用 Mirth Connect 将 XML 转换为 HL7 消息

发布于 2024-10-21 22:28:15 字数 194 浏览 3 评论 0原文

我正在使用 Mirth Connect v2.0,但陷入了一项任务:将 XML 转换为 HL7 v3。我已连接到 Ms-Access 数据库(医院系统位于 Access 中),我已设置通道并将目标选项卡中的连接器类型设置为文件写入器。当我部署通道时,我可以看到日志文件中填充有 XML 格式的记录,现在我陷入了如何将 XML 消息转换/转换为 HL7 的困境。有什么指示吗?

I'm working with Mirth Connect v2.0 and getting stuck on one task, transformation of XML to HL7 v3. I've connected to an Ms-Access Database (the hospital system is in Access), I've set up the channel and set the Connector Type to File Writer in the destination tab. When I deploy the channel I can see the log file is populated with the records in XML format, now I'm stuck on how to convert/transform the XML message to HL7. Any pointers out there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

我是有多爱你 2024-10-28 22:28:15

在通道摘要选项卡中

  1. 单击“设置数据类型”,并确保源入站设置为 XML,源出站设置为 HL7 v3,目标出站设置为 HL7 v3。

  2. 选项卡上,单击左侧边栏上的编辑转换器

  3. 在左侧的编辑转换器窗口中选择消息模板选项卡。

  4. 您可以使用小文件夹图标将示例文件加载到入站出站模板中。

  5. 您可以在入站模板和出站模板之间拖放节点来创建转换。

这是非常标准的欢乐内容,所以我希望我没有过于简单化。希望这能让您朝着正确的方向前进。

In the channel Summary tab

  1. Click "Set Data Types" and make sure the Source inbound is set to XML and the Source outbound is set to HL7 v3 and the destination outbound is set to HL7 v3.

  2. On the Source tab click Edit Transformer on the left sidebar

  3. In the Edit Transformer window on the left select the Message Templates tab.

  4. You can load sample files into the Inbound and Outbound templates using the little folder icons.

  5. You can drag and drop nodes between the inbound and the outbound templates to create your transform.

This is pretty standard Mirth stuff so I hope I haven't oversimplified. Hope this gets you moving in the right direction.

笛声青案梦长安 2024-10-28 22:28:15

我正在使用示例 xml 数据将 XML 转换为 hl7,您可以使用自己的数据。
您可以将以下代码粘贴到源变压器中:

  var length = msg['orderList']['order'].length();
   var rcount = 0;
   for(var i=0;i<length;i++)
   {
    var SEG = new XML("<OBR/>");
    SEG['OBR.1']['OBR.1.1']=i+1;
    SEG['OBR.16']['OBR.16.1']=msg['orderList']['order'][i]['provider'].toString();
    tmp['OBR'][i]=SEG;
    var reslen = msg['orderList']['order'][i]['result'].length();
    logger.info(reslen);
    for(var j=0;j<reslen;j++)
    {
        var RSEG = new XML("<OBX/>");
        RSEG['OBX.1']['OBX.1.1'] = rcount;
        RSEG['OBX.3']['OBX.3.1'] = msg['orderList']['order'][i]['result'][j]['resultcode'].toString();
        RSEG['OBX.3']['OBX.3.2']=msg['orderList']['order'][i]['result'][j]['text'].toString();
        RSEG['OBX.7'] = msg['orderList']['order'][i]['result'][j]['range'].toString();
        RSEG['OBX.6']['OBX.6.2'] = msg['orderList']['order'][i]['result'][j]['unit'].toString();
        tmp['OBX'][rcount]=RSEG;
        rcount++;
    }
}
logger.info(**SerializerFactory.getSerializer('HL7V2').fromXML(tmp)**);

不要忘记创建 HL&源出站中的模板

**MSH|^~\&|||||||||
PID

I am converting XML into hl7 using sample xml data, you can use your own.
You can paste the below code in soure transformer:

  var length = msg['orderList']['order'].length();
   var rcount = 0;
   for(var i=0;i<length;i++)
   {
    var SEG = new XML("<OBR/>");
    SEG['OBR.1']['OBR.1.1']=i+1;
    SEG['OBR.16']['OBR.16.1']=msg['orderList']['order'][i]['provider'].toString();
    tmp['OBR'][i]=SEG;
    var reslen = msg['orderList']['order'][i]['result'].length();
    logger.info(reslen);
    for(var j=0;j<reslen;j++)
    {
        var RSEG = new XML("<OBX/>");
        RSEG['OBX.1']['OBX.1.1'] = rcount;
        RSEG['OBX.3']['OBX.3.1'] = msg['orderList']['order'][i]['result'][j]['resultcode'].toString();
        RSEG['OBX.3']['OBX.3.2']=msg['orderList']['order'][i]['result'][j]['text'].toString();
        RSEG['OBX.7'] = msg['orderList']['order'][i]['result'][j]['range'].toString();
        RSEG['OBX.6']['OBX.6.2'] = msg['orderList']['order'][i]['result'][j]['unit'].toString();
        tmp['OBX'][rcount]=RSEG;
        rcount++;
    }
}
logger.info(**SerializerFactory.getSerializer('HL7V2').fromXML(tmp)**);

Dont forgot to create a HL& template in source outbound

**MSH|^~\&|||||||||
PID

剧终人散尽 2024-10-28 22:28:15

|||||||
ORC

|||||||
ORC

寄与心 2024-10-28 22:28:15

|||||||||**

XML 示例

<PatientOrder>
<patient>
<name><fullname>XXXXXXXXXXX, XXXX.</fullname><firstname>XXXXX</firstname><lastname>XXXXX</lastname></name>
<address>
<address1>XXXXXX XXXX XXXX Med XXXX</address1><address2>Information XXXXX Fl</address2><address3>XXXX XXXX St  </address3><address4>XXXXXX XXXXXX, XX XXXXX</address4><telephone>XXX/XXXX-XXXX</telephone><fax>XXX/XXX-XXX</fax><latitude>X2.XXXXX</latitude><longitude>-X1.XXXXX</longitude></address>
</patient>
<orderList>
 <order>
    <provider>57423</provider>
    <result>result
            <resultcode>7685-1</resultcode>
            <text>Hemoglobin test2</text>
            <resultdate></resultdate>
            <range>3to52</range>
            <unit>mg</unit>
        </result>
        <result>result
            <resultcode>7685-1</resultcode>
            <text>Hemoglobin test2</text>
            <resultdate></resultdate>
            <range>3to52</range>
            <unit>mg</unit>
        </result>
    </order>
<order>
    <provider>57423</provider>
    <result>result
            <resultcode>7685-1</resultcode>
            <text>Hemoglobin test2</text>
            <resultdate></resultdate>
            <range>3to52</range>
            <unit>mg</unit>
        </result>
    </order>
</orderList>
</PatientOrder>

|||||||||**

sample XML

<PatientOrder>
<patient>
<name><fullname>XXXXXXXXXXX, XXXX.</fullname><firstname>XXXXX</firstname><lastname>XXXXX</lastname></name>
<address>
<address1>XXXXXX XXXX XXXX Med XXXX</address1><address2>Information XXXXX Fl</address2><address3>XXXX XXXX St  </address3><address4>XXXXXX XXXXXX, XX XXXXX</address4><telephone>XXX/XXXX-XXXX</telephone><fax>XXX/XXX-XXX</fax><latitude>X2.XXXXX</latitude><longitude>-X1.XXXXX</longitude></address>
</patient>
<orderList>
 <order>
    <provider>57423</provider>
    <result>result
            <resultcode>7685-1</resultcode>
            <text>Hemoglobin test2</text>
            <resultdate></resultdate>
            <range>3to52</range>
            <unit>mg</unit>
        </result>
        <result>result
            <resultcode>7685-1</resultcode>
            <text>Hemoglobin test2</text>
            <resultdate></resultdate>
            <range>3to52</range>
            <unit>mg</unit>
        </result>
    </order>
<order>
    <provider>57423</provider>
    <result>result
            <resultcode>7685-1</resultcode>
            <text>Hemoglobin test2</text>
            <resultdate></resultdate>
            <range>3to52</range>
            <unit>mg</unit>
        </result>
    </order>
</orderList>
</PatientOrder>
请别遗忘我 2024-10-28 22:28:15

如果我正确理解你的问题,你的问题是当你处理cms文件时,文件服务器上写入的日志文件是xml格式而不是HL7格式。请使用 mirths 内置序列化器功能

If i understood your question correctly, your issue is that when you process an cms file, the log file written on the file server is in xml format rather than in HL7. Please use mirths inbuilt serializer function

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文