简体   繁体   English

通过 TCP 连接时,Mirth Connect 确实回复/回复

[英]Mirth Connect does reply/response back at all when connected through TCP

I have requirement to connect to Mirth/Rosetta (NextGen) through TCP connection, in order to send HL7 message an receive back response.我需要通过TCP连接连接到Mirth/Rosetta (NextGen) ,以便发送HL7消息接收回响应。 Since this is my first time interaction with mirth, so I'm starting as test in order to get to know if it works.由于这是我第一次与 mirth 互动,所以我从测试开始,以了解它是否有效。

Problem: When I try to send a random text to mirth, or even MLLP HL7 message , it doesn't respond at all.问题:当我尝试向 mirth 甚至MLLP HL7 message发送随机文本时,它根本没有响应。 I'm using very basic TCP connection code (as shown below) in order to test connection.我正在使用非常基本TCP连接代码(如下所示)来测试连接。 I'm expecting mirth to send ACK with error, or at least some error.我期待愉快地发送带有错误的 ACK,或者至少是一些错误。 But it stays blank when stream.Read line is executed.但是在执行stream.Read行时它保持空白。

TcpClient client = new TcpClient("x.x.x.x", 1234);
var message = "HELLO MIRTH";
Byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
NetworkStream stream = client.GetStream();
stream.Write(data, 0, data.Length);
Console.WriteLine("Sent: {0}", message);
data = new Byte[256];
while (true)
{
    bytes = stream.Read(data, 0, data.Length);
    if (bytes > 0)
        break;
}
var responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes);
Console.WriteLine(DateTime.Now.ToString());
Console.WriteLine("Received: {0}", responseData);

What's surprising is that when I send the same message from some HAPI TestPanel (a test tool to connect/send message to through TCP) it works fine and I receive response (as shown in following screenshot).令人惊讶的是,当我从某个HAPI TestPanel (通过 TCP 连接/发送消息的测试工具)发送相同的消息时,它工作正常并且我收到响应(如下面的屏幕截图所示)。 This makes me think like there is something I'm missing.这让我觉得好像有什么我错过了。 Even though my test code shown above works well if I connect it with my own TCP listener.即使上面显示的测试代码与我自己的 TCP 侦听器连接起来效果很好。 But when it tries to connect with Mirth, it doesn't get any response.但是当它试图与 Mirth 连接时,它没有得到任何响应。

通过测试工具发送的消息

Question: is there anything special that I need to add in my TCP sender, in order to talk to TCP server of Mirth (or any HL7 standard TCP server)?问题:为了与 Mirth 的 TCP 服务器(或任何 HL7 标准 TCP 服务器)通信,我需要在我的 TCP 发件人中添加什么特别的东西吗? If not, please guide me in this regards.如果没有,请在这方面指导我。 I need to connect and get response back.我需要连接并获得回复。

Messages I tried:我试过的消息:

  • "Hello World" “你好世界”
  • "MSH|^~&|xyz|xyz|xyzz||20210224162555.3992||ADT^A28|13391074-7b39-42f7-b6bf-f174fb6e8231|P|2.5..." “MSH|^~&|xyz|xyz|xyzz||20210224162555.3992||ADT^A28|13391074-7b39-42f7-b6bf-f174fb6e8231|P|2.5...”
  • HL7 message enclosed in VT and FS CR tags包含在 VT 和 FS CR 标记中的 HL7 消息

Try out this on the Mirth Connect server receiving the message.在收到消息的 Mirth Connect 服务器上试试这个。 Define a transformer step on the destination connector with the desired output/response format.使用所需的输出/响应格式在目标连接器上定义一个转换器步骤。 If the desired response is the raw data then just have a Javascript transformer then call the in-built function connectorMessage.getRawData().如果所需的响应是原始数据,则只需使用 Javascript 转换器,然后调用内置的 function connectorMessage.getRawData()。 Finally, on the TCP listener, select the transformer name (created at the destination connector) in the item list under the response (just below the source queue).最后,在 TCP 监听器上,select 在响应下的项目列表中(在源队列下方)中的变压器名称(在目标连接器处创建)。

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

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