Пример #1
0
        public static Notice FromAtomEntry(AtomEntry entry)
        {
            Notice notice = new Notice();

            notice.DatePublished = entry.Published;
            notice.DateUpdated   = entry.Updated;
            notice.Id            = entry.Id.Uri.Content;
            notice.ContentType   = entry.Content.Type;
            notice.Content       = entry.Content.Content;
            notice.Subject       = entry.Title.Text;
            IExtensionElementFactory factory = entry.FindExtension("ContinuityOfCareRecord", "urn:astm-org:CCR");

            if (factory != null)
            {
                XmlExtension  extension  = factory as XmlExtension;
                XmlSerializer serializer = new XmlSerializer(typeof(ContinuityOfCareRecord));
                XmlTextReader reader     = new XmlTextReader(new StringReader(extension.Node.OuterXml));
                notice.CareRecord = serializer.Deserialize(reader) as ContinuityOfCareRecord;
            }
            return(notice);
        }