コード例 #1
0
        public String sendHL7Message()
        {
            String ackReceived = null;

            if ((this.destinationAddress != null) && (this.message != null))
            {
                try
                {
                    SimpleMLLPClient mllpClient = new SimpleMLLPClient(destinationAddress.Address.ToString(), destinationAddress.Port);
                    IMessage         response   = mllpClient.SendHL7Message(message);
                    ackReceived = TransformHL7Message.EncodeHL7Message(response);
                    mllpClient.Disconnect();
                }
                catch (Exception exception)
                {
                    ConnectionStatus.AddConnectionStatus(exception);
                }
            }
            return(ackReceived);
        }
コード例 #2
0
        private void sendMessage(object sender, RoutedEventArgs e)
        {
            MLLPConectorHL7Message mllpConectorHL7Message = new MLLPConectorHL7Message(destinationIPTextbox.Text, destinationPortTextbox.Text, TransformHL7Message.DecodeHL7Message(messageContent.Text));

            String ackResponse = mllpConectorHL7Message.sendHL7Message();

            if (String.IsNullOrEmpty(ackResponse))
            {
                messageReceivedTextbox.Text = @"No message received!!";
                ShowConnectionStatus(false);
            }
            else
            {
                messageReceivedTextbox.Text = ackResponse;
                ShowConnectionStatus(true);
            }
        }