/// <summary>
        /// Extract HL7 File & insert messages into MongoDB
        /// This method expects an argument of type LoadData to write messages on Form
        /// </summary>
        /// <param name="_frm">LoadData</param>
        public void ProcessFile(LoadData _frm)
        {
            List <String> Messages = extractMessagesFromFile(MessagePath);
            int           MsgCount = Messages.Count;

            _frm.UpdateLabelTotal(MsgCount);

            String connectionString = "mongodb://" + DBServer + ":" + DBPort;

            if (DBUser.Length > 0 && DBPassword.Length > 0)
            {
                connectionString = "mongodb://" + DBUser + ":" + DBPassword + "@" + DBServer + ":" + DBPort;
            }

            MongoUrl url = new MongoUrl(connectionString);

            MongoClient mc     = new MongoClient(url);
            MongoServer server = mc.GetServer();

            String DBName = Feed + "_Analysis";

            MongoDatabase AnalysisDB = server.GetDatabase(DBName);

            var msgCollection = AnalysisDB.GetCollection <BsonDocument>("Message");

            for (int index = 0; index < MsgCount; ++index)
            {
                _frm.UpdateLabelCurrent(index + 1);

                string strMsg = Messages[index];

                try
                {
                    HL7Helper h = new HL7Helper();

                    BsonDocument doc = h.GetBsonFromMessage(strMsg);
                    msgCollection.Insert(doc);
                }
                catch (Exception ex)
                {
                    StringBuilder buf = new StringBuilder();
                    buf.Append("Origional Message: " + strMsg);
                    buf.Append("\n");
                    buf.Append("Error: " + ex.Message);
                    _frm.UpdateActivity_Error(buf.ToString());

                    System.Threading.Thread.Sleep(100);
                }
            }
            _frm.UpdateActivity_Info("Processed File : " + MessagePath);
        }
        /// <summary>
        /// Extract HL7 File & insert messages into MongoDB
        /// This method expects an argument of type LoadData to write messages on Form
        /// </summary>
        /// <param name="_frm">LoadData</param>
        public void ProcessFile(LoadData _frm)
        {
            List<String> Messages = extractMessagesFromFile(MessagePath);
            int MsgCount = Messages.Count;

            _frm.UpdateLabelTotal(MsgCount);

            String connectionString = "mongodb://" + DBServer + ":" + DBPort;

            if(DBUser.Length > 0 && DBPassword.Length > 0)
                connectionString = "mongodb://" + DBUser + ":" + DBPassword + "@" +DBServer + ":" + DBPort;

            MongoUrl url = new MongoUrl(connectionString);

            MongoClient mc = new MongoClient(url);
            MongoServer server = mc.GetServer();

            String DBName = Feed + "_Analysis";

            MongoDatabase AnalysisDB = server.GetDatabase(DBName);

            var msgCollection = AnalysisDB.GetCollection<BsonDocument>("Message");

            for (int index = 0; index < MsgCount; ++index)
            {
                _frm.UpdateLabelCurrent(index + 1);

                string strMsg = Messages[index];

                try
                {
                    HL7Helper h = new HL7Helper();

                    BsonDocument doc = h.GetBsonFromMessage(strMsg);
                    msgCollection.Insert(doc);
                }
                catch (Exception ex)
                {
                    StringBuilder buf = new StringBuilder();
                    buf.Append("Origional Message: " + strMsg);
                    buf.Append("\n");
                    buf.Append("Error: " + ex.Message);
                    _frm.UpdateActivity_Error(buf.ToString());

                    System.Threading.Thread.Sleep(100);
                }
            }
            _frm.UpdateActivity_Info("Processed File : " + MessagePath);
        }