Пример #1
0
        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);
                        }
                    }
                }
            }
        }
Пример #2
0
        private void NewNode(ConnectionNode nodeFrom)
        {
            NodeConfig nc = new NodeConfig();

            if (null == nodeFrom)
            {
                ConnectionNodeBuilder.Defaults(nc.Node);
            }
            else
            {
                nc.Node           = nodeFrom.Clone();
                nc.Node.IsBuiltIn = false;
                nc.Node.Name      = "New Node - " + Guid.NewGuid().ToString().Substring(0, 5);
            }

            if (nc.ShowDialog() == DialogResult.OK)
            {
                ConnectionNodes.Instance().Add(nc.Node);
                BuildView();
                if (comboBox1.Items.Count > 0)
                {
                    comboBox1.SelectedIndex = comboBox1.Items.Count - 1;
                }
                UpdateView();
            }
        }
Пример #3
0
 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);
 }
Пример #4
0
 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);
 }
Пример #5
0
        public void Add(ConnectionNode node)
        {
            int index = Find(node.Name);

            if (index >= 0)
            {
                Nodes.Insert(index, node.Clone());
                Nodes.RemoveAt(index + 1);
            }
            else
            {
                Nodes.Add(node.Clone());
            }
        }
Пример #6
0
        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);
        }
Пример #7
0
 public NodeConfig()
 {
     Node = new ConnectionNode();
     InitializeComponent();
 }