示例#1
0
        /// <summary>
        /// Returns a simple HL7 data item with all the data needed for the later HL7 ACK message
        /// </summary>
        /// <param name="hl7">HL7 object</param>
        /// <returns>HL7 data item</returns>
        private DataForHL7Acknowledgement GetDataForHL7Acknowledgement(ORU_R30 hl7)
        {
            DataForHL7Acknowledgement data = new DataForHL7Acknowledgement();

            data.SendingApplicationNamespaceID     = hl7.MSH.SendingApplication.NamespaceID.Value.ToString();
            data.SendingApplicationUniversalID     = hl7.MSH.SendingApplication.UniversalID.Value.ToString();
            data.SendingApplicationUniversalIDType = hl7.MSH.SendingApplication.UniversalIDType.Value.ToString();
            data.MessageControlID = hl7.MSH.MessageControlID.Value.ToString();
            return(data);
        }
示例#2
0
        /// <summary>
        /// Turns a simple HL7 data item into a full blown HL7-ACK message
        /// </summary>
        /// <param name="messageData">Simple HL7 data item</param>
        /// <returns>HL7-ACK message</returns>
        private string ConstructHL7Acknowledgement(DataForHL7Acknowledgement messageData)
        {
            // construct HL7-ACK
            NHapi.Model.V25.Message.ACK ack = new NHapi.Model.V25.Message.ACK();

            // MSH-segment:
            ack.MSH.SendingApplication.NamespaceID.Value       = "BigPicture";
            ack.MSH.ReceivingApplication.NamespaceID.Value     = messageData.SendingApplicationNamespaceID;
            ack.MSH.ReceivingApplication.UniversalID.Value     = messageData.SendingApplicationUniversalID;
            ack.MSH.ReceivingApplication.UniversalIDType.Value = messageData.SendingApplicationUniversalIDType;
            ack.MSH.MessageControlID.Value              = messageData.MessageControlID;
            ack.MSH.ProcessingID.ProcessingID.Value     = "P";
            ack.MSH.AcceptAcknowledgmentType.Value      = "NE";
            ack.MSH.ApplicationAcknowledgmentType.Value = "NE";

            // MSA-segment
            ack.MSA.AcknowledgmentCode.Value = "CA";
            ack.MSA.MessageControlID.Value   = messageData.MessageControlID;

            // use parser to convert or HL7-ACK to string for sending
            PipeParser parserResponse = new PipeParser();

            return(parserResponse.Encode(ack));
        }