示例#1
0
        /// <summary>
        /// Get the XmlHl7Profile that corresponds with the Hl7ProfileId.
        /// </summary>
        /// <param name="profileId">HL7 Profile Id.</param>
        /// <returns>XmlHl7Profile.</returns>
        public System.String GetXmlHl7Profile(Hl7ProfileId profileId)
        {
            System.String xmlHl7Profile = System.String.Empty;
            Hl7Profile    hl7Profile    = (Hl7Profile)_hl7ProfileStore[profileId.Id];

            if (hl7Profile != null)
            {
                xmlHl7Profile = hl7Profile.XmlProfile;
            }
            return(xmlHl7Profile);
        }
示例#2
0
        private void Load()
        {
            _hl7ProfileStore = new Hashtable();

            try
            {
                XmlTextReader reader = new XmlTextReader(_directory + "/" + _filename);
                while (reader.EOF == false)
                {
                    reader.ReadStartElement("Hl7ProfileStore");

                    while ((reader.IsStartElement()) &&
                           (reader.Name == "Hl7Profile"))
                    {
                        reader.ReadStartElement("Hl7Profile");
                        reader.ReadStartElement("Hl7ProfileId");
                        System.String facility    = reader.ReadElementString("Facility");
                        System.String version     = reader.ReadElementString("Version");
                        System.String messageType = reader.ReadElementString("MessageType");
                        reader.ReadEndElement();

                        System.String filename = reader.ReadElementString("Filename");
                        reader.ReadEndElement();

                        Hl7Profile hl7Profile = new Hl7Profile(facility, version, messageType, _directory, filename);
                        _hl7ProfileStore.Add(hl7Profile.Id, hl7Profile);
                    }
                    reader.ReadEndElement();
                }
                reader.Close();
            }
            catch (System.Exception e)
            {
                System.String message = System.String.Format("Failed to read HL7 Profile: \"{0}\"", _directory + "/" + _filename);
                throw new System.SystemException(message, e);
            }
        }
示例#3
0
        private void Load()
        {
            _hl7ProfileStore = new Hashtable();

            try
            {
                XmlTextReader reader = new XmlTextReader(_directory + "/" + _filename);
                while (reader.EOF == false)
                {
                    reader.ReadStartElement("Hl7ProfileStore");

                    while ((reader.IsStartElement()) &&
                        (reader.Name == "Hl7Profile"))
                    {
                        reader.ReadStartElement("Hl7Profile");
                        reader.ReadStartElement("Hl7ProfileId");
                        System.String facility = reader.ReadElementString("Facility");
                        System.String version = reader.ReadElementString("Version");
                        System.String messageType = reader.ReadElementString("MessageType");
                        reader.ReadEndElement();

                        System.String filename = reader.ReadElementString("Filename");
                        reader.ReadEndElement();

                        Hl7Profile hl7Profile = new Hl7Profile(facility, version, messageType, _directory, filename);
                        _hl7ProfileStore.Add(hl7Profile.Id, hl7Profile);
                    }
                    reader.ReadEndElement();
                }
                reader.Close();
            }
            catch (System.Exception e)
            {
                System.String message = System.String.Format("Failed to read HL7 Profile: \"{0}\"", _directory + "/" + _filename);
                throw new System.SystemException(message, e);
            }
        }