コード例 #1
0
ファイル: Program.cs プロジェクト: udeveloper/HL7Integration
        private static void SendMessageHL7()
        {
            // create the HL7 message
            // this AdtMessageFactory class is not from NHAPI but my own wrapper
            LogToDebugConsole("Creating ADT A01 message...");
            var adtMessage = AdtMessageFactory.CreateMessage("A01");

            // create a new MLLP client over the specified port (note this class is from NHAPI Tools)
            //Note that using higher level encodings such as UTF-16 is not recommended due to conflict with
            //MLLP wrapping characters
            var connection = new SimpleMLLPClient("localhost", PORT_NUMBER, Encoding.UTF8);

            var parser = new PipeParser();

            LogToDebugConsole("Sending message:" + "\n" + parser.Encode(adtMessage));
            var response = connection.SendHL7Message(adtMessage);

            var responseString = parser.Encode(response);

            LogToDebugConsole("Received response:\n" + responseString);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: udeveloper/HL7Integration
        private static void SendBinaryDataB64InMessageHL7(SimpleMLLPClient connection)
        {
            // create the HL7 message
            // this OruMessageFactory class is not from NHAPI but my own wrapper class
            var oruMessage = AdtMessageFactory.CreateMessage("R01");

            // send the previously created HL7 message over the connection established
            var pipeParser = new PipeParser();

            LogToDebugConsole($"Sending  :" + "\n" + pipeParser.Encode(oruMessage));
            var responseMessage = connection.SendHL7Message(oruMessage);

            //var ackError=  new Ack("HL7ServerIntegration360","Development").MakeACK(oruMessage, AckTypes.AE, "Error por malos datos");
            //LogToDebugConsole("Received response:\n" + pipeParser.Encode(ackError));

            // display the message response received from the remote party
            var responseString = pipeParser.Encode(responseMessage);

            LogToDebugConsole("Received response:\n" + responseString);

            //connection.Disconnect();
        }