예제 #1
0
        /// <seealso cref="Genetibase.NuGenHL7.protocol.Initiator.sendAndReceive(Genetibase.NuGenHL7.model.Message)">
        /// </seealso>
        public virtual Message sendAndReceive(Message theMessage)
        {
            Terser t = new Terser(theMessage);

            System.String appAckNeeded = t.get_Renamed("/MSH-16");
            System.String msgId        = t.get_Renamed("/MSH-10");

            System.String messageText = Parser.encode(theMessage);
            System.Collections.IDictionary metadata    = getMetadata(theMessage);
            NuGenTransportable             out_Renamed = new NuGenTransportableImpl(messageText, metadata);

            if (needAck(appAckNeeded))
            {
                myProcessor.reserve(msgId, ReceiveTimeout);
            }

            myProcessor.send(out_Renamed, MaxRetries, RetryInterval);

            Message in_Renamed = null;

            if (needAck(appAckNeeded))
            {
                NuGenTransportable received = myProcessor.receive(msgId, ReceiveTimeout);
                if (received != null && received.Message != null)
                {
                    in_Renamed = Parser.parse(received.Message);
                }
            }

            return(in_Renamed);
        }
        /// <seealso cref="Genetibase.NuGenHL7.protocol.ApplicationRouter.processMessage(Genetibase.NuGenHL7.protocol.Transportable)">
        /// </seealso>
        public virtual NuGenTransportable processMessage(NuGenTransportable theMessage)
        {
            System.String[]    result   = processMessage(theMessage.Message, theMessage.Metadata);
            NuGenTransportable response = new NuGenTransportableImpl(result[0]);

            if (result[1] != null)
            {
                response.Metadata["MSH-18"] = result[1];
            }

            return(response);
        }
		/// <seealso cref="Genetibase.NuGenHL7.protocol.ApplicationRouter.processMessage(Genetibase.NuGenHL7.protocol.Transportable)">
		/// </seealso>
		public virtual NuGenTransportable processMessage(NuGenTransportable theMessage)
		{
			System.String[] result = processMessage(theMessage.Message, theMessage.Metadata);
			NuGenTransportable response = new NuGenTransportableImpl(result[0]);
			
			if (result[1] != null)
			{
				response.Metadata["MSH-18"] = result[1];
			}
			
			return response;
		}
예제 #4
0
        /// <seealso cref="Genetibase.NuGenHL7.protocol.impl.AbstractTransport.doReceive()">
        /// </seealso>
        public override NuGenTransportable doReceive()
        {
            NuGenTransportable result = null;

            try
            {
                System.String message = myReader.getMessage();
                if (message != null)
                {
                    result = new NuGenTransportableImpl(message);
                }
            }
            catch (LLPException e)
            {
                throw new NuGenTransportException(e);
            }
            catch (System.IO.IOException e)
            {
                throw new NuGenTransportException(e);
            }
            return(result);
        }