public void SendMessage(ConnectionNode node) { ConfigMessageForSending(Message, node.ClientAppName, node.ClientFacility, node.RemoteAppName, node.RemoteFacility); string pipeMessage = SegmentStructureConverter.MessageToPipe(Message); IPEndPoint EndPoint = new IPEndPoint(IPAddress.Parse(node.RemoteIP), node.RemotePort); using (TcpClient _client = new TcpClient()) { _client.SendTimeout = node.Timeout; _client.ReceiveTimeout = node.Timeout; _client.Connect(EndPoint); using (HL7Response rsp = new HL7Response(_client) { WaitForReply = node.WaitForACK, EnvelopPrefix = InternalFormatter.StringToByteArray(node.MLPPrefix), EnvelopSuffix = InternalFormatter.StringToByteArray(node.MLPSuffix) }) { rsp.Send(pipeMessage); if (node.WaitForACK) { if (rsp.IsFailureCode) { throw new Exception(string.IsNullOrEmpty(rsp.TextMessage) ? "Unspecified error from server" : rsp.TextMessage); } } } } }
static public ConnectionNode MWL(ConnectionNode node) { node.IsBuiltIn = true; node.Name = "[Demo] Storage Server's MWL Plug-in"; node.RemoteIP = "127.0.0.1"; node.RemotePort = 6788; node.MLPPrefix = InternalFormatter.ToHexString(MLPEnvelope.Envelop_Header); node.MLPSuffix = InternalFormatter.ToHexString(MLPEnvelope.Envelop_Trailer); node.Timeout = 0; node.WaitForACK = true; return(node); }
static public ConnectionNode Defaults(ConnectionNode node) { node.Name = ""; node.RemoteIP = "127.0.0.1"; node.RemotePort = 6790; node.MLPPrefix = InternalFormatter.ToHexString(MLPEnvelope.Envelop_Header); node.MLPSuffix = InternalFormatter.ToHexString(MLPEnvelope.Envelop_Trailer); node.Timeout = 0; node.WaitForACK = true; node.ClientFacility = "LEAD Tech"; node.ClientAppName = "LEADTOOLS HL7 Sender"; return(node); }
static public ConnectionNode PatientUpdate(ConnectionNode node) { node.IsBuiltIn = true; node.Name = "[Demo] Storage Server's Patient Update Plug-in"; node.RemoteIP = "127.0.0.1"; node.RemotePort = 6787; node.MLPPrefix = InternalFormatter.ToHexString(MLPEnvelope.Envelop_Header); node.MLPSuffix = InternalFormatter.ToHexString(MLPEnvelope.Envelop_Trailer); node.Timeout = 0; node.WaitForACK = true; #if FOR_WIN64 node.ClientAppName = "L20_CLIENT64"; #else node.ClientAppName = "L20_CLIENT32"; #endif return(node); }