【问题标题】:Send HL7 using VB.NET with MLLP使用带有 MLLP 的 VB.NET 发送 HL7
【发布时间】:2016-08-01 23:48:36
【问题描述】:

我正在尝试使用带有 mllp 的 vb.net 发送 hl7,谁能告诉我这是我的代码错误

Dim StartBlock As String = "0x0b"  ' this is start block <SB>
Dim EndBlock As String = " 0x0d" ' this is end Block <EB>
Dim ReturnBlock As String = "0x1c" ' this is return  <CR>
Msg = StartBlock & Msg & EndBlock & ReturnBlock 


Dim networkStream As NetworkStream = tcpClient.GetStream()

If networkStream.CanWrite And networkStream.CanRead Then
    Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes(Msg) 

    networkStream.Write(sendBytes, 0, sendBytes.Length)
end if

【问题讨论】:

  • 不知道,怎么了?你有任何错误吗?端点得到什么?您没有向我们提供任何有助于我们发现问题的信息。

标签: vb.net tcp hl7 hl7-v2 mllp


【解决方案1】:

您交换了端块和返回块。所以交换它们

Dim EndBlock As String = "0x1c" ' this is end Block <EB>
Dim ReturnBlock As String = "0x0d" ' this is return  <CR>

由于我不熟悉 Visual Basic,我不保证您的块的语法定义是正确的,也可能是 &amp;H0D 或类似的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-01-21
    • 2017-02-01
    • 2017-01-25
    • 1970-01-01
    • 1970-01-01
    • 2016-05-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多