public abstract WriteComment ( string text ) : void | ||
text | string | |
Результат | void |
internal override void WriteTo(XmlWriter xml) { if (xml == null) return; xml.WriteComment(SR.GetString(SR.ServiceNameFromClient)); xml.WriteElementString("ServiceName", this.serviceBindingNameSentByClient); xml.WriteComment(SR.GetString(SR.ServiceNameOnService)); xml.WriteStartElement("ServiceNameCollection"); if (this.serviceNameCollectionConfiguredOnServer == null || this.serviceNameCollectionConfiguredOnServer.Count < 1) { xml.WriteElementString("ServiceName", this.defaultServiceBindingNameOfServer); } else { foreach (string serviceName in this.serviceNameCollectionConfiguredOnServer) { xml.WriteElementString("ServiceName", serviceName); } } xml.WriteFullEndElement(); }
protected void EndExport(XmlWriter xmlWriter) { xmlWriter.WriteEndElement(); xmlWriter.WriteComment("*************************************"); xmlWriter.WriteComment(".NET SQL Authorization Manager (Ms-PL)"); xmlWriter.WriteComment("*************************************"); }
public void WriteXml(System.Xml.XmlWriter writer) { writer.WriteComment("Definición del flujograma que debe seguir el proceso"); XmlSerializer serializer = new XmlSerializer(xmlFlujogramaType); serializer.Serialize(writer, FlujogramaDef); writer.WriteComment("Estado Actual en el que se encuentra el proceso"); serializer = new XmlSerializer(xmlEstadoType); serializer.Serialize(writer, EstadoActual); writer.WriteComment("Última transición que se realizó en el proceso"); serializer = new XmlSerializer(xmlTransicionType); serializer.Serialize(writer, UltimaTransicion); if (Convert.ToBoolean(_procesosAnteriores.Count)) { writer.WriteComment("Histórico de transiciones"); writer.WriteStartElement("Historico"); foreach (var item in _procesosAnteriores) { serializer.Serialize(writer, item.Value); } writer.WriteEndElement(); } }
protected void BeginExport(XmlWriter xmlWriter) { xmlWriter.WriteComment("*************************************"); xmlWriter.WriteComment(".NET SQL Authorization Manager (Ms-PL)"); xmlWriter.WriteComment("*************************************"); xmlWriter.WriteComment("http://netsqlazman.codeplex.com"); xmlWriter.WriteComment("Andrea Ferendeles"); xmlWriter.WriteComment("*************************************"); xmlWriter.WriteComment(String.Format("Creation Date: {0}", DateTime.Now.ToString())); xmlWriter.WriteComment(String.Format("NetSqlAzMan Run-Time version: {0}", this.storage.GetType().Assembly.GetName().Version.ToString())); xmlWriter.WriteComment(String.Format("NetSqlAzMan Database version: {0}", this.storage.DatabaseVesion)); xmlWriter.WriteComment("*************************************"); xmlWriter.WriteStartElement("NetSqlAzMan"); }
public static void WriteXmlLogStart(XmlWriter xw) { xw.WriteStartDocument(); xw.WriteStartElement("LogEntries"); xw.WriteString("\r\n"); xw.WriteComment(StaticVariables.Logo(false) + "\r\n" + CurrentQuery + "\r\n"); //+ CurrentEntryCount + "\r\n"); }
private static void WriteNode(XmlReader reader, XmlWriter writer) { while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: writer.WriteStartElement(reader.Name); break; case XmlNodeType.Text: writer.WriteString(reader.Value); break; case XmlNodeType.CDATA: writer.WriteCData(reader.Value); break; case XmlNodeType.ProcessingInstruction: writer.WriteProcessingInstruction(reader.Name, reader.Value); break; case XmlNodeType.Comment: writer.WriteComment(reader.Value); break; case XmlNodeType.XmlDeclaration: break; case XmlNodeType.Document: break; case XmlNodeType.DocumentType: break; case XmlNodeType.EntityReference: break; case XmlNodeType.EndElement: writer.WriteEndElement(); break; } } }
public override void AddComments(string comments) { if (comments != null && comments.Length > 0) { output.WriteComment(comments); } }
/// <summary> /// Writes a comment to the debug XML. /// </summary> /// <param name="comment">The comment to write</param> protected void WriteDebugXmlComment(string comment) { if (_xmlDebugging) { _debugXmlWriter.WriteComment(comment); } }
public void Save(object obj, XmlWriter writer) { Type t = obj.GetType(); // writer.WriteStartElement(GetTypeName(t)); // System.Console.WriteLine("\tSave <{0}>",GetTypeName(t)); writer.WriteStartElement(obj.GetType().Name); PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(obj); PropertyInfo [] propertyInfos = new PropertyInfo[properties.Count]; for (int i = 0;i < properties.Count ; i ++){ propertyInfos[i] = t.GetProperty(properties[i].Name); } foreach (PropertyInfo info in propertyInfos) { if (info == null){ continue; } if (!info.CanRead) continue; if (info.GetCustomAttributes(typeof(XmlIgnoreAttribute), true).Length != 0) continue; object val = info.GetValue(obj, null); if (val == null) continue; if (val is ICollection) { // PropertyInfo pinfo = t.GetProperty(info.Name); // Console.WriteLine("pinfo {0}",pinfo.Name); if (info.Name.StartsWith("Contr")) { writer.WriteStartElement("Items"); } else { writer.WriteStartElement(info.Name); } foreach (object element in (ICollection)val) { Save(element, writer); } writer.WriteEndElement(); } else { if (!info.CanWrite) continue; TypeConverter c = TypeDescriptor.GetConverter(info.PropertyType); if (c.CanConvertFrom(typeof(string)) && c.CanConvertTo(typeof(string))) { try { writer.WriteElementString(info.Name, c.ConvertToInvariantString(val)); } catch (Exception ex) { writer.WriteComment(ex.ToString()); } } else if (info.PropertyType == typeof(Type)) { writer.WriteElementString(info.Name, ((Type)val).AssemblyQualifiedName); } else { // System.Diagnostics.Trace.WriteLine("Serialize Pagelayout"); // writer.WriteStartElement(info.Name); // Save(val, writer); // writer.WriteEndElement(); } } } writer.WriteEndElement(); }
public override void WriteTo(XmlWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.WriteComment(this.value); }
public bool writeComment(string content) { if (_state.Count != 0) { return(false); } return(CheckedCall(() => _writer.WriteComment(content))); }
/// <summary> /// Writes the section using an XML writer /// </summary> /// <param name="writer">XML writer to use</param> /// <param name="project">The project to generate .csproj for</param> /// <param name="context">Current .csproj generation context</param> public override void Write(XmlWriter writer, Project project, IMSBuildProjectGeneratorContext context) { writer.WriteStartElement("ItemGroup"); foreach (var refPath in context.References.Where(IsValidReference)) { if (IsSolutionReference(refPath)) { var moduleAndprojectName = ((string) refPath).Substring(4); var parts = moduleAndprojectName.Split('#'); var moduleName = parts[0]; var projectName = parts[1]; var referredProject = Suite.GetModule(moduleName).GetProjectOrTestProject(projectName); if (referredProject.Type == ProjectType.Library || referredProject.Type == ProjectType.Executable) { writer.WriteComment("Project reference " + projectGuidManagement.GetGuid(referredProject)); writer.WriteStartElement("Reference"); writer.WriteAttributeString("Include", projectName); writer.WriteElementString("HintPath", ToProjectRelativePath(project, Path.Combine(Suite.SuiteRoot.GetRelativePath(targetDir), referredProject.Module.Name, referredProject.Name + ".dll"), sourceSetName)); writer.WriteElementString("SpecificVersion", "False"); writer.WriteEndElement(); } } else { writer.WriteStartElement("Reference"); if (IsGACReference(refPath)) { var assemblyName = ((string) refPath).Substring(4); writer.WriteAttributeString("Include", assemblyName); } else { string relativePath = ToProjectRelativePath(project, Path.Combine("target", refPath), sourceSetName); writer.WriteAttributeString("Include", Path.GetFileNameWithoutExtension(relativePath)); writer.WriteElementString("HintPath", relativePath); writer.WriteElementString("SpecificVersion", "False"); writer.WriteElementString("Private", "True"); } writer.WriteEndElement(); } } writer.WriteEndElement(); }
public static void startLocal() { local = true; if (Xmlw == null) { byte[] b = Encoding.UTF8.GetBytes(DateTime.Now.ToString()); log = Convert.ToBase64String(b) + ".gh"; Xmlw = XmlWriter.Create(log); Xmlw.WriteStartElement("doc"); Xmlw.WriteComment(DateTime.Now.ToString()); Xmlw.Flush(); } }
internal override void WriteTo(XmlWriter writer) { base.WriteTo(writer); // // canonical element string // byte[] contentBuffer = _logStream.GetBuffer(); string contentAsString = System.Text.Encoding.UTF8.GetString(contentBuffer, 0, (int)_logStream.Length); writer.WriteElementString(CanonicalElementStringLength, contentAsString.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteComment(CanonicalElementString + ":" + contentAsString); // // canonical element base64 format // writer.WriteElementString(CanonicalOctetsLength, contentBuffer.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString(CanonicalOctets, Convert.ToBase64String(contentBuffer)); // // Hash // writer.WriteElementString(CanonicalOctetsHashLength, _hash.Hash.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString(CanonicalOctetsHash, Convert.ToBase64String(_hash.Hash)); // // Key: this will only be printed out for the symmetric key case // if (_hash is KeyedHashAlgorithm) { KeyedHashAlgorithm keyedHash = _hash as KeyedHashAlgorithm; byte[] key = keyedHash.Key; writer.WriteStartElement(Key); // start the key element writer.WriteElementString(Length, key.Length.ToString(CultureInfo.InvariantCulture)); // key length writer.WriteElementString(FirstByte, key[0].ToString(CultureInfo.InvariantCulture)); // first byte of the key writer.WriteElementString(LastByte, key[key.Length - 1].ToString(CultureInfo.InvariantCulture)); // last byte of the key writer.WriteEndElement(); // close the key element } }
public void WriteXml(XmlWriter writer) { var w = new APIWriter(writer); writer.WriteComment(DateTime.Now.ToString()); foreach (var pi in typeof(OnlineRegModel).GetProperties(BindingFlags.Public | BindingFlags.Instance) .Where(vv => vv.CanRead && vv.CanWrite)) { switch (pi.Name) { case "List": w.Start("List"); foreach (var i in _list) Util.Serialize(i, writer); w.End(); break; case "History": w.Start("History"); foreach (var i in History) w.Add("item", i); w.End(); break; case "password": break; case "testing": if (testing == true) w.Add(pi.Name, testing); break; case "FromMobile": if (FromMobile.HasValue()) w.Add(pi.Name, FromMobile); else if (MobileAppMenuController.Source.HasValue()) w.Add(pi.Name, MobileAppMenuController.Source); break; case "prospect": if (prospect) w.Add(pi.Name, prospect); break; default: w.Add(pi.Name, pi.GetValue(this, null)); break; } } }
protected void WriteActivity (XmlWriter _xmlWriter, string _name, string _theme = null, string _orientation = null, string _configChanges = null, string _comment = null) { if (_comment != null) _xmlWriter.WriteComment(_comment); _xmlWriter.WriteStartElement("activity"); { _xmlWriter.WriteAttributeString("android:name", _name); if (_theme != null) _xmlWriter.WriteAttributeString("android:theme", _theme); if (_orientation != null) _xmlWriter.WriteAttributeString("android:screenOrientation", _orientation); if (_configChanges != null) _xmlWriter.WriteAttributeString("android:configChanges", _configChanges); } _xmlWriter.WriteEndElement(); }
internal override void WriteTo(XmlWriter writer) { base.WriteTo(writer); byte[] bytes = this._logStream.GetBuffer(); string str = Encoding.UTF8.GetString(bytes, 0, (int) this._logStream.Length); writer.WriteElementString("CanonicalElementStringLength", str.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteComment("CanonicalElementString:" + str); writer.WriteElementString("CanonicalOctetsLength", bytes.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("CanonicalOctets", Convert.ToBase64String(bytes)); writer.WriteElementString("CanonicalOctetsHashLength", this._hash.Hash.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("CanonicalOctetsHash", Convert.ToBase64String(this._hash.Hash)); if (this._hash is KeyedHashAlgorithm) { KeyedHashAlgorithm algorithm = this._hash as KeyedHashAlgorithm; byte[] key = algorithm.Key; writer.WriteStartElement("Key"); writer.WriteElementString("Length", key.Length.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("FirstByte", key[0].ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("LastByte", key[key.Length - 1].ToString(CultureInfo.InvariantCulture)); writer.WriteEndElement(); } }
public void Save(object obj, XmlWriter writer) { Type t = obj.GetType(); writer.WriteStartElement(GetTypeName(t)); foreach (PropertyInfo info in t.GetProperties(BindingFlags.Public | BindingFlags.Instance)) { if (!info.CanRead) continue; if (info.GetCustomAttributes(typeof(XmlIgnoreAttribute), true).Length != 0) continue; object val = info.GetValue(obj, null); if (val == null) continue; if (val is ICollection) { writer.WriteStartElement(info.Name); foreach (object element in (ICollection)val) { Save(element, writer); } writer.WriteEndElement(); } else { if (!info.CanWrite) continue; TypeConverter c = TypeDescriptor.GetConverter(info.PropertyType); if (c.CanConvertFrom(typeof(string)) && c.CanConvertTo(typeof(string))) { try { writer.WriteElementString(info.Name, c.ConvertToInvariantString(val)); } catch (Exception ex) { writer.WriteComment(ex.ToString()); } } else if (info.PropertyType == typeof(Type)) { writer.WriteElementString(info.Name, ((Type)val).AssemblyQualifiedName); } else { writer.WriteStartElement(info.Name); Save(val, writer); writer.WriteEndElement(); } } } writer.WriteEndElement(); }
public bool SaveTheme(XmlWriter writer) { if (_ThemeLoaded) { writer.WriteStartElement(_Theme.Name); writer.WriteComment("<Type>: Background type: " + CConfig.ListStrings(Enum.GetNames(typeof(EBackgroundTypes)))); writer.WriteElementString("Type", Enum.GetName(typeof(EBackgroundTypes), _Theme.Type)); writer.WriteComment("<Video>: Background video name"); writer.WriteElementString("Video", _Theme.VideoName); writer.WriteComment("<Skin>: Background Texture name"); writer.WriteElementString("Skin", _Theme.TextureName); writer.WriteComment("<Color>: Background color for type \"Color\" from ColorScheme (high priority)"); writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)"); if (_Theme.ColorName != String.Empty) { writer.WriteElementString("Color", _Theme.ColorName); } else { if (_Theme.Type != EBackgroundTypes.None) { writer.WriteElementString("R", Color.R.ToString("#0.00")); writer.WriteElementString("G", Color.G.ToString("#0.00")); writer.WriteElementString("B", Color.B.ToString("#0.00")); writer.WriteElementString("A", Color.A.ToString("#0.00")); } } writer.WriteEndElement(); return true; } return false; }
internal void WriteURLCountExceeded(XmlWriter writer) { writer.WriteComment("The URL Count has reached 10,000. The Google limit for a sitemap is 10,000 entries"); }
public override void WriteComment(string text) { writer.WriteComment(text); }
void WriteXml(XmlWriter writer) { CommonUtility.AssertNotNull("writer", writer); writer.WriteComment(SR.ExceptionOccurred); writer.WriteStartElement("RequestResult"); writer.WriteElementString("HTTPStatusCode", Convert.ToString(this.HttpStatusCode, CultureInfo.InvariantCulture)); writer.WriteElementString("HttpStatusMessage", this.HttpStatusMessage); writer.WriteElementString("TargetLocation", this.TargetLocation.ToString()); // Headers writer.WriteElementString("ServiceRequestID", this.ServiceRequestID); writer.WriteElementString("ContentMd5", this.ContentMd5); writer.WriteElementString("Etag", this.Etag); writer.WriteElementString("RequestDate", this.RequestDate); // Dates - using RFC 1123 pattern writer.WriteElementString("StartTime", this.StartTime.ToUniversalTime().ToString("R", CultureInfo.InvariantCulture)); writer.WriteElementString("EndTime", this.EndTime.ToUniversalTime().ToString("R", CultureInfo.InvariantCulture)); // Extended info if (this.ExtendedErrorInformation != null) { this.ExtendedErrorInformation.WriteXml(writer); } else { // Write empty writer.WriteStartElement(Constants.ErrorRootElement); writer.WriteFullEndElement(); } #if WINDOWS_RT || ASPNET_K // Exception if (this.ExceptionInfo != null) { this.ExceptionInfo.WriteXml(writer); } else { // Write empty writer.WriteStartElement("ExceptionInfo"); writer.WriteFullEndElement(); } #endif // End RequestResult writer.WriteEndElement(); }
public override void WriteComment(string comment) { CheckState(); w.WriteComment(comment); }
/// <summary> /// Replay all cached events to an XmlWriter. /// </summary> public void EventsToWriter(XmlWriter writer) { XmlEvent[] page; int idxPage, idxEvent; byte[] bytes; char[] chars; XmlRawWriter rawWriter; // Special-case single text node at the top-level if (this.singleText.Count != 0) { writer.WriteString(this.singleText.GetResult()); return; } rawWriter = writer as XmlRawWriter; // Loop over set of pages for (idxPage = 0; idxPage < this.pages.Count; idxPage++) { page = this.pages[idxPage]; // Loop over events in each page for (idxEvent = 0; idxEvent < page.Length; idxEvent++) { switch (page[idxEvent].EventType) { case XmlEventType.Unknown: // No more events Debug.Assert(idxPage + 1 == this.pages.Count); return; case XmlEventType.DocType: writer.WriteDocType(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3, (string) page[idxEvent].Object); break; case XmlEventType.StartElem: writer.WriteStartElement(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); break; case XmlEventType.StartAttr: writer.WriteStartAttribute(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); break; case XmlEventType.EndAttr: writer.WriteEndAttribute(); break; case XmlEventType.CData: writer.WriteCData(page[idxEvent].String1); break; case XmlEventType.Comment: writer.WriteComment(page[idxEvent].String1); break; case XmlEventType.PI: writer.WriteProcessingInstruction(page[idxEvent].String1, page[idxEvent].String2); break; case XmlEventType.Whitespace: writer.WriteWhitespace(page[idxEvent].String1); break; case XmlEventType.String: writer.WriteString(page[idxEvent].String1); break; case XmlEventType.Raw: writer.WriteRaw(page[idxEvent].String1); break; case XmlEventType.EntRef: writer.WriteEntityRef(page[idxEvent].String1); break; case XmlEventType.CharEnt: writer.WriteCharEntity((char) page[idxEvent].Object); break; case XmlEventType.SurrCharEnt: chars = (char[]) page[idxEvent].Object; writer.WriteSurrogateCharEntity(chars[0], chars[1]); break; case XmlEventType.Base64: bytes = (byte[]) page[idxEvent].Object; writer.WriteBase64(bytes, 0, bytes.Length); break; case XmlEventType.BinHex: bytes = (byte[]) page[idxEvent].Object; writer.WriteBinHex(bytes, 0, bytes.Length); break; case XmlEventType.XmlDecl1: if (rawWriter != null) rawWriter.WriteXmlDeclaration((XmlStandalone) page[idxEvent].Object); break; case XmlEventType.XmlDecl2: if (rawWriter != null) rawWriter.WriteXmlDeclaration(page[idxEvent].String1); break; case XmlEventType.StartContent: if (rawWriter != null) rawWriter.StartElementContent(); break; case XmlEventType.EndElem: if (rawWriter != null) rawWriter.WriteEndElement(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); else writer.WriteEndElement(); break; case XmlEventType.FullEndElem: if (rawWriter != null) rawWriter.WriteFullEndElement(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); else writer.WriteFullEndElement(); break; case XmlEventType.Nmsp: if (rawWriter != null) rawWriter.WriteNamespaceDeclaration(page[idxEvent].String1, page[idxEvent].String2); else writer.WriteAttributeString("xmlns", page[idxEvent].String1, XmlReservedNs.NsXmlNs, page[idxEvent].String2); break; case XmlEventType.EndBase64: if (rawWriter != null) rawWriter.WriteEndBase64(); break; case XmlEventType.Close: writer.Close(); break; case XmlEventType.Flush: writer.Flush(); break; case XmlEventType.Dispose: ((IDisposable)writer).Dispose(); break; default: Debug.Assert(false, "Unknown event: " + page[idxEvent].EventType); break; } } } Debug.Assert(false, "Unknown event should be added to end of event sequence."); }
public void EventsToWriter(XmlWriter writer) { if (this.singleText.Count != 0) { writer.WriteString(this.singleText.GetResult()); } else { XmlRawWriter writer2 = writer as XmlRawWriter; for (int i = 0; i < this.pages.Count; i++) { XmlEvent[] eventArray = this.pages[i]; for (int j = 0; j < eventArray.Length; j++) { byte[] buffer; switch (eventArray[j].EventType) { case XmlEventType.Unknown: return; case XmlEventType.DocType: { writer.WriteDocType(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3, (string)eventArray[j].Object); continue; } case XmlEventType.StartElem: { writer.WriteStartElement(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.StartAttr: { writer.WriteStartAttribute(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.EndAttr: { writer.WriteEndAttribute(); continue; } case XmlEventType.CData: { writer.WriteCData(eventArray[j].String1); continue; } case XmlEventType.Comment: { writer.WriteComment(eventArray[j].String1); continue; } case XmlEventType.PI: { writer.WriteProcessingInstruction(eventArray[j].String1, eventArray[j].String2); continue; } case XmlEventType.Whitespace: { writer.WriteWhitespace(eventArray[j].String1); continue; } case XmlEventType.String: { writer.WriteString(eventArray[j].String1); continue; } case XmlEventType.Raw: { writer.WriteRaw(eventArray[j].String1); continue; } case XmlEventType.EntRef: { writer.WriteEntityRef(eventArray[j].String1); continue; } case XmlEventType.CharEnt: { writer.WriteCharEntity((char)eventArray[j].Object); continue; } case XmlEventType.SurrCharEnt: { char[] chArray = (char[])eventArray[j].Object; writer.WriteSurrogateCharEntity(chArray[0], chArray[1]); continue; } case XmlEventType.Base64: { buffer = (byte[])eventArray[j].Object; writer.WriteBase64(buffer, 0, buffer.Length); continue; } case XmlEventType.BinHex: { buffer = (byte[])eventArray[j].Object; writer.WriteBinHex(buffer, 0, buffer.Length); continue; } case XmlEventType.XmlDecl1: { if (writer2 != null) { writer2.WriteXmlDeclaration((XmlStandalone)eventArray[j].Object); } continue; } case XmlEventType.XmlDecl2: { if (writer2 != null) { writer2.WriteXmlDeclaration(eventArray[j].String1); } continue; } case XmlEventType.StartContent: { if (writer2 != null) { writer2.StartElementContent(); } continue; } case XmlEventType.EndElem: { if (writer2 == null) { break; } writer2.WriteEndElement(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.FullEndElem: { if (writer2 == null) { goto Label_0367; } writer2.WriteFullEndElement(eventArray[j].String1, eventArray[j].String2, eventArray[j].String3); continue; } case XmlEventType.Nmsp: { if (writer2 == null) { goto Label_0394; } writer2.WriteNamespaceDeclaration(eventArray[j].String1, eventArray[j].String2); continue; } case XmlEventType.EndBase64: { if (writer2 != null) { writer2.WriteEndBase64(); } continue; } case XmlEventType.Close: { writer.Close(); continue; } case XmlEventType.Flush: { writer.Flush(); continue; } case XmlEventType.Dispose: { writer.Dispose(); continue; } default: { continue; } } writer.WriteEndElement(); continue; Label_0367: writer.WriteFullEndElement(); continue; Label_0394: writer.WriteAttributeString("xmlns", eventArray[j].String1, "http://www.w3.org/2000/xmlns/", eventArray[j].String2); } } } }
private static void WriteMinimapTileIDObjectToXML(XmlWriter writer, MinimapTileIDObject obj) { writer.WriteStartElement("MinimapTileIDObject"); //writer.WriteElementString("TileID", obj.Parameters[0].ToString()); writer.WriteComment(obj.Parameters[0].ToString()); if (obj.Parameters[0] != 0) { WriteFilenameToXML(writer, "Tilemap", obj.Parameters[0], new Dictionary<string, string> { /*{ "overrideFileID", "FALSE" }*/ }); } writer.WriteEndElement(); }
private static void WriteStandardObjectToXML(XmlWriter writer, StandardObject obj) { writer.WriteStartElement("StandardObject"); writer.WriteAttributeString("area", obj.m_Area.ToString()); writer.WriteAttributeString("star", obj.m_Layer.ToString()); writer.WriteComment(ObjectDatabase.m_ObjectInfo[obj.ID].m_InternalName); writer.WriteElementString("ObjectID", obj.ID.ToString()); writer.WriteStartElement("Position"); writer.WriteElementString("X", obj.Position.X.ToString(usa)); writer.WriteElementString("Y", obj.Position.Y.ToString(usa)); writer.WriteElementString("Z", obj.Position.Z.ToString(usa)); writer.WriteEndElement(); writer.WriteElementString("YRotation", obj.YRotation.ToString(usa)); writer.WriteStartElement("Parameters"); writer.WriteAttributeString("count", "3"); for (int j = 0; j < 3; j++) { writer.WriteStartElement("Parameter"); writer.WriteAttributeString("id", j.ToString()); writer.WriteString(obj.Parameters[j].ToString()); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteEndElement(); }
internal void BuildSubtree(XmlReader reader, XmlWriter writer) { string ns = "http://www.w3.org/2000/xmlns/"; ReadState readState = reader.ReadState; if ((readState != ReadState.Initial) && (readState != ReadState.Interactive)) { throw new ArgumentException(Res.GetString("Xml_InvalidOperation"), "reader"); } int num = 0; if (readState == ReadState.Initial) { if (!reader.Read()) { return; } num++; } do { switch (reader.NodeType) { case XmlNodeType.Element: { writer.WriteStartElement(reader.Prefix, reader.LocalName, reader.NamespaceURI); bool isEmptyElement = reader.IsEmptyElement; while (reader.MoveToNextAttribute()) { if (reader.NamespaceURI == ns) { if (reader.Prefix.Length == 0) { writer.WriteAttributeString("", "xmlns", ns, reader.Value); } else { writer.WriteAttributeString("xmlns", reader.LocalName, ns, reader.Value); } } else { writer.WriteStartAttribute(reader.Prefix, reader.LocalName, reader.NamespaceURI); writer.WriteString(reader.Value); writer.WriteEndAttribute(); } } reader.MoveToElement(); if (isEmptyElement) { writer.WriteEndElement(); } else { num++; } break; } case XmlNodeType.Attribute: if (reader.NamespaceURI != ns) { writer.WriteStartAttribute(reader.Prefix, reader.LocalName, reader.NamespaceURI); writer.WriteString(reader.Value); writer.WriteEndAttribute(); break; } if (reader.Prefix.Length != 0) { writer.WriteAttributeString("xmlns", reader.LocalName, ns, reader.Value); break; } writer.WriteAttributeString("", "xmlns", ns, reader.Value); break; case XmlNodeType.Text: case XmlNodeType.CDATA: writer.WriteString(reader.Value); break; case XmlNodeType.EntityReference: reader.ResolveEntity(); break; case XmlNodeType.ProcessingInstruction: writer.WriteProcessingInstruction(reader.LocalName, reader.Value); break; case XmlNodeType.Comment: writer.WriteComment(reader.Value); break; case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: writer.WriteString(reader.Value); break; case XmlNodeType.EndElement: writer.WriteFullEndElement(); num--; break; } } while (reader.Read() && (num > 0)); }
private static void WriteFilenameToXML(XmlWriter writer, string element, ushort fileID, Dictionary<string, string> attributes = null) { writer.WriteStartElement(element); if (attributes != null) { foreach (string attr in attributes.Keys) writer.WriteAttributeString(attr, attributes[attr]); } NitroFile file = Program.m_ROM.GetFileFromInternalID(fileID); string filename = file.m_Name; //writer.WriteElementString("Filename", filename); writer.WriteComment(filename); writer.WriteElementString("Location", "." + filename.Substring(filename.LastIndexOf('/'))); writer.WriteEndElement(); System.IO.File.WriteAllBytes(m_Path + "/" + filename.Substring(filename.LastIndexOf('/'), filename.Length - (filename.LastIndexOf('/'))), file.m_Data); }
/// <summary> /// Replay all cached events to an XmlWriter. /// </summary> public void EventsToWriter(XmlWriter writer) { XmlEvent[] page; int idxPage, idxEvent; byte[] bytes; char[] chars; XmlRawWriter rawWriter; // Special-case single text node at the top-level if (this.singleText.Count != 0) { writer.WriteString(this.singleText.GetResult()); return; } rawWriter = writer as XmlRawWriter; // Loop over set of pages for (idxPage = 0; idxPage < this.pages.Count; idxPage++) { page = this.pages[idxPage]; // Loop over events in each page for (idxEvent = 0; idxEvent < page.Length; idxEvent++) { switch (page[idxEvent].EventType) { case XmlEventType.Unknown: // No more events Debug.Assert(idxPage + 1 == this.pages.Count); return; case XmlEventType.DocType: writer.WriteDocType(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3, (string)page[idxEvent].Object); break; case XmlEventType.StartElem: writer.WriteStartElement(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); break; case XmlEventType.StartAttr: writer.WriteStartAttribute(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); break; case XmlEventType.EndAttr: writer.WriteEndAttribute(); break; case XmlEventType.CData: writer.WriteCData(page[idxEvent].String1); break; case XmlEventType.Comment: writer.WriteComment(page[idxEvent].String1); break; case XmlEventType.PI: writer.WriteProcessingInstruction(page[idxEvent].String1, page[idxEvent].String2); break; case XmlEventType.Whitespace: writer.WriteWhitespace(page[idxEvent].String1); break; case XmlEventType.String: writer.WriteString(page[idxEvent].String1); break; case XmlEventType.Raw: writer.WriteRaw(page[idxEvent].String1); break; case XmlEventType.EntRef: writer.WriteEntityRef(page[idxEvent].String1); break; case XmlEventType.CharEnt: writer.WriteCharEntity((char)page[idxEvent].Object); break; case XmlEventType.SurrCharEnt: chars = (char[])page[idxEvent].Object; writer.WriteSurrogateCharEntity(chars[0], chars[1]); break; case XmlEventType.Base64: bytes = (byte[])page[idxEvent].Object; writer.WriteBase64(bytes, 0, bytes.Length); break; case XmlEventType.BinHex: bytes = (byte[])page[idxEvent].Object; writer.WriteBinHex(bytes, 0, bytes.Length); break; case XmlEventType.XmlDecl1: if (rawWriter != null) { rawWriter.WriteXmlDeclaration((XmlStandalone)page[idxEvent].Object); } break; case XmlEventType.XmlDecl2: if (rawWriter != null) { rawWriter.WriteXmlDeclaration(page[idxEvent].String1); } break; case XmlEventType.StartContent: if (rawWriter != null) { rawWriter.StartElementContent(); } break; case XmlEventType.EndElem: if (rawWriter != null) { rawWriter.WriteEndElement(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); } else { writer.WriteEndElement(); } break; case XmlEventType.FullEndElem: if (rawWriter != null) { rawWriter.WriteFullEndElement(page[idxEvent].String1, page[idxEvent].String2, page[idxEvent].String3); } else { writer.WriteFullEndElement(); } break; case XmlEventType.Nmsp: if (rawWriter != null) { rawWriter.WriteNamespaceDeclaration(page[idxEvent].String1, page[idxEvent].String2); } else { writer.WriteAttributeString("xmlns", page[idxEvent].String1, XmlReservedNs.NsXmlNs, page[idxEvent].String2); } break; case XmlEventType.EndBase64: if (rawWriter != null) { rawWriter.WriteEndBase64(); } break; case XmlEventType.Close: writer.Close(); break; case XmlEventType.Flush: writer.Flush(); break; case XmlEventType.Dispose: ((IDisposable)writer).Dispose(); break; default: Debug.Assert(false, "Unknown event: " + page[idxEvent].EventType); break; } } } Debug.Assert(false, "Unknown event should be added to end of event sequence."); }
internal static void WriteProjectXml( XmlWriter writer, string projectPath, string sourcePath, string filters, string startupFile, bool excludeNodeModules, out Guid projectGuid ) { var projectHome = CommonUtils.GetRelativeDirectoryPath(Path.GetDirectoryName(projectPath), sourcePath); projectGuid = Guid.NewGuid(); writer.WriteStartDocument(); writer.WriteStartElement("Project", "http://schemas.microsoft.com/developer/msbuild/2003"); writer.WriteAttributeString("DefaultTargets", "Build"); writer.WriteStartElement("PropertyGroup"); writer.WriteStartElement("Configuration"); writer.WriteAttributeString("Condition", " '$(Configuration)' == '' "); writer.WriteString("Debug"); writer.WriteEndElement(); writer.WriteElementString("SchemaVersion", "2.0"); writer.WriteElementString("ProjectGuid", projectGuid.ToString("B")); writer.WriteElementString("ProjectHome", projectHome); writer.WriteElementString("ProjectView", "ShowAllFiles"); if (CommonUtils.IsValidPath(startupFile)) { writer.WriteElementString("StartupFile", Path.GetFileName(startupFile)); } else { writer.WriteElementString("StartupFile", String.Empty); } writer.WriteElementString("WorkingDirectory", "."); writer.WriteElementString("OutputPath", "."); writer.WriteElementString("ProjectTypeGuids", "{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}"); bool typeScriptSupport = EnumerateAllFiles(sourcePath, filters, excludeNodeModules) .Any(filename => NodejsConstants.TypeScriptExtension.Equals(Path.GetExtension(filename), StringComparison.OrdinalIgnoreCase)); if (typeScriptSupport) { writer.WriteElementString("TypeScriptSourceMap", "true"); writer.WriteElementString("TypeScriptModuleKind", "CommonJS"); writer.WriteElementString("EnableTypeScript", "true"); } writer.WriteStartElement("VisualStudioVersion"); writer.WriteAttributeString("Condition", "'$(VisualStudioVersion)' == ''"); writer.WriteString("14.0"); writer.WriteEndElement(); writer.WriteStartElement("VSToolsPath"); writer.WriteAttributeString("Condition", "'$(VSToolsPath)' == ''"); writer.WriteString(@"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)"); writer.WriteEndElement(); writer.WriteEndElement(); // </PropertyGroup> // VS requires property groups with conditions for Debug // and Release configurations or many COMExceptions are // thrown. writer.WriteStartElement("PropertyGroup"); writer.WriteAttributeString("Condition", "'$(Configuration)' == 'Debug'"); writer.WriteEndElement(); writer.WriteStartElement("PropertyGroup"); writer.WriteAttributeString("Condition", "'$(Configuration)' == 'Release'"); writer.WriteEndElement(); var folders = new HashSet<string>( Directory.EnumerateDirectories(sourcePath, "*", SearchOption.AllDirectories) .Select(dirName => CommonUtils.TrimEndSeparator( CommonUtils.GetRelativeDirectoryPath(sourcePath, dirName) ) ) .Where(ShouldIncludeDirectory) ); // Exclude node_modules and bower_components folders. if (excludeNodeModules) { folders.RemoveWhere(NodejsConstants.ContainsNodeModulesOrBowerComponentsFolder); } writer.WriteStartElement("ItemGroup"); foreach (var file in EnumerateAllFiles(sourcePath, filters, excludeNodeModules)) { var ext = Path.GetExtension(file); if (NodejsConstants.JavaScriptExtension.Equals(ext, StringComparison.OrdinalIgnoreCase)) { writer.WriteStartElement("Compile"); } else if (NodejsConstants.TypeScriptExtension.Equals(ext, StringComparison.OrdinalIgnoreCase)) { writer.WriteStartElement("TypeScriptCompile"); } else { writer.WriteStartElement("Content"); } writer.WriteAttributeString("Include", file); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("ItemGroup"); foreach (var folder in folders.Where(s => !string.IsNullOrWhiteSpace(s)).OrderBy(s => s)) { writer.WriteStartElement("Folder"); writer.WriteAttributeString("Include", folder); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("Import"); writer.WriteAttributeString("Project", @"$(MSBuildToolsPath)\Microsoft.Common.targets"); writer.WriteAttributeString("Condition", @"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"); writer.WriteEndElement(); writer.WriteComment("Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them."); writer.WriteStartElement("Import"); writer.WriteAttributeString("Project", @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets"); writer.WriteAttributeString("Condition", @"False"); writer.WriteEndElement(); writer.WriteStartElement("Import"); writer.WriteAttributeString("Project", @"$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets"); writer.WriteEndElement(); writer.WriteRaw(@" <ProjectExtensions> <VisualStudio> <FlavorProperties GUID=""{349c5851-65df-11da-9384-00065b846f21}""> <WebProjectProperties> <UseIIS>False</UseIIS> <AutoAssignPort>True</AutoAssignPort> <DevelopmentServerPort>0</DevelopmentServerPort> <DevelopmentServerVPath>/</DevelopmentServerVPath> <IISUrl>http://localhost:48022/</IISUrl> <NTLMAuthentication>False</NTLMAuthentication> <UseCustomServer>True</UseCustomServer> <CustomServerUrl>http://localhost:1337</CustomServerUrl> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> </WebProjectProperties> </FlavorProperties> <FlavorProperties GUID=""{349c5851-65df-11da-9384-00065b846f21}"" User=""""> <WebProjectProperties> <StartPageUrl> </StartPageUrl> <StartAction>CurrentPage</StartAction> <AspNetDebugging>True</AspNetDebugging> <SilverlightDebugging>False</SilverlightDebugging> <NativeDebugging>False</NativeDebugging> <SQLDebugging>False</SQLDebugging> <ExternalProgram> </ExternalProgram> <StartExternalURL> </StartExternalURL> <StartCmdLineArguments> </StartCmdLineArguments> <StartWorkingDirectory> </StartWorkingDirectory> <EnableENC>False</EnableENC> <AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug> </WebProjectProperties> </FlavorProperties> </VisualStudio> </ProjectExtensions> "); writer.WriteEndElement(); // </Project> writer.WriteEndDocument(); }
public override void WriteComment(string text) { CheckAsync(); _coreWriter.WriteComment(text); }
// Saves the node to the specified XmlWriter. public override void WriteTo(XmlWriter w) { w.WriteComment(Data); }
public bool writeComment(string content) => CheckedCall(() => _writer.WriteComment(content));
public virtual void WriteXml(System.Xml.XmlWriter writer) { writer.WriteStartElement("WriteComment"); writer.WriteComment("<hello world/>"); writer.WriteEndElement(); // WriteComment }
/* ------------------------------------------------------------------------------------- * Name: WriteShallowNode * Goal: Copy piece-by-piece * History: * 2/oct/2015 ERK Created ------------------------------------------------------------------------------------- */ public void WriteShallowNode(XmlReader reader, XmlWriter writer) { if (reader == null) { throw new ArgumentNullException("reader"); } if (writer == null) { throw new ArgumentNullException("writer"); } try { switch (reader.NodeType) { case XmlNodeType.Element: writer.WriteStartElement(reader.Prefix, reader.LocalName, reader.NamespaceURI); bool bIsFOLIA = (reader.LocalName == "FoLiA"); string sLocalName = reader.LocalName; // Process attributes one by one if (reader.HasAttributes) { if (reader.MoveToFirstAttribute()) { do { if (reader.Name != "xmlns") { bool bWritten = false; // Action depends on local name switch (sLocalName) { case "FoLiA": // Is the the attribute @version? if (reader.Name == "version") { writer.WriteAttributeString(reader.Name, FOLIA_VERSION); bWritten = true; } break; case "t": // is this the attribute @class? if (reader.Name == "class") { writer.WriteAttributeString(reader.Name, "eng"); bWritten = true; } break; } if (!bWritten) { String[] arName = reader.Name.Split(':'); if (arName.Length > 1) { writer.WriteAttributeString(arName[0], arName[1], null, reader.Value); } else { writer.WriteAttributeString(reader.Name, reader.Value); } } /* // Check for FoLiA version if (bIsFOLIA && reader.Name == "version") { // Adapt version number writer.WriteAttributeString(reader.Name, FOLIA_VERSION); } else { String[] arName = reader.Name.Split(':'); if (arName.Length > 1) { writer.WriteAttributeString(arName[0], arName[1], null, reader.Value); } else { writer.WriteAttributeString(reader.Name, reader.Value); } } */ } } while (reader.MoveToNextAttribute()); } } if (reader.IsEmptyElement) { writer.WriteEndElement(); } break; case XmlNodeType.Text: writer.WriteString(reader.Value); break; case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: writer.WriteWhitespace(reader.Value); break; case XmlNodeType.CDATA: writer.WriteCData(reader.Value); break; case XmlNodeType.EntityReference: writer.WriteEntityRef(reader.Name); break; case XmlNodeType.XmlDeclaration: case XmlNodeType.ProcessingInstruction: writer.WriteProcessingInstruction(reader.Name, reader.Value); break; case XmlNodeType.DocumentType: writer.WriteDocType(reader.Name, reader.GetAttribute("PUBLIC"), reader.GetAttribute("SYSTEM"), reader.Value); break; case XmlNodeType.Comment: writer.WriteComment(reader.Value); break; case XmlNodeType.EndElement: writer.WriteFullEndElement(); break; } } catch (Exception ex) { errHandle.DoError("WriteShallowNode", ex); // Provide standard error message } }
/// <summary> /// Writes a comment from the reader to the writer /// </summary> protected virtual void WriteComment(XmlReader reader, XmlWriter writer) { Contract.Requires(reader != null); Contract.Requires(writer != null); writer.WriteComment(reader.Value); }
public void appendXml(XmlWriter writer) { writer.WriteStartElement("ds"); writer.WriteElementString("name", dsName.get()); writer.WriteElementString("type", dsTypeName.get()); writer.WriteElementString("minimal_heartbeat", heartbeat.get().ToString()); writer.WriteElementString("min", minValue.get().ToString()); writer.WriteElementString("max", maxValue.get().ToString()); writer.WriteComment("PDP Status"); writer.WriteElementString("last_ds", lastValue.get().ToString()); writer.WriteElementString("value", accumValue.get().ToString()); writer.WriteElementString("unknown_sec", nanSeconds.get().ToString()); writer.WriteEndElement(); // ds }
private void WriteNode(XmlWriter xtw, bool defattr) { int num = (this.NodeType == XmlNodeType.None) ? -1 : this.Depth; while (this.Read() && (num < this.Depth)) { switch (this.NodeType) { case XmlNodeType.Element: xtw.WriteStartElement(this.Prefix, this.LocalName, this.NamespaceURI); ((XmlTextWriter) xtw).QuoteChar = this.QuoteChar; xtw.WriteAttributes(this, defattr); if (this.IsEmptyElement) { xtw.WriteEndElement(); } break; case XmlNodeType.Text: xtw.WriteString(this.Value); break; case XmlNodeType.CDATA: xtw.WriteCData(this.Value); break; case XmlNodeType.EntityReference: xtw.WriteEntityRef(this.Name); break; case XmlNodeType.ProcessingInstruction: case XmlNodeType.XmlDeclaration: xtw.WriteProcessingInstruction(this.Name, this.Value); break; case XmlNodeType.Comment: xtw.WriteComment(this.Value); break; case XmlNodeType.DocumentType: xtw.WriteDocType(this.Name, this.GetAttribute("PUBLIC"), this.GetAttribute("SYSTEM"), this.Value); break; case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: xtw.WriteWhitespace(this.Value); break; case XmlNodeType.EndElement: xtw.WriteFullEndElement(); break; } } if ((num == this.Depth) && (this.NodeType == XmlNodeType.EndElement)) { this.Read(); } }
// Writes the content (inner XML) of the current node into the provided XmlWriter. private async Task WriteNodeAsync(XmlWriter xtw, bool defattr) { #if !SILVERLIGHT Debug.Assert(xtw is XmlTextWriter); #endif int d = this.NodeType == XmlNodeType.None ? -1 : this.Depth; while (await this.ReadAsync().ConfigureAwait(false) && (d < this.Depth)) { switch (this.NodeType) { case XmlNodeType.Element: xtw.WriteStartElement(this.Prefix, this.LocalName, this.NamespaceURI); #if !SILVERLIGHT // Removing dependency on XmlTextWriter ((XmlTextWriter)xtw).QuoteChar = this.QuoteChar; #endif xtw.WriteAttributes(this, defattr); if (this.IsEmptyElement) { xtw.WriteEndElement(); } break; case XmlNodeType.Text: xtw.WriteString(await this.GetValueAsync().ConfigureAwait(false)); break; case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: xtw.WriteWhitespace(await this.GetValueAsync().ConfigureAwait(false)); break; case XmlNodeType.CDATA: xtw.WriteCData(this.Value); break; case XmlNodeType.EntityReference: xtw.WriteEntityRef(this.Name); break; case XmlNodeType.XmlDeclaration: case XmlNodeType.ProcessingInstruction: xtw.WriteProcessingInstruction(this.Name, this.Value); break; case XmlNodeType.DocumentType: xtw.WriteDocType(this.Name, this.GetAttribute("PUBLIC"), this.GetAttribute("SYSTEM"), this.Value); break; case XmlNodeType.Comment: xtw.WriteComment(this.Value); break; case XmlNodeType.EndElement: xtw.WriteFullEndElement(); break; } } if (d == this.Depth && this.NodeType == XmlNodeType.EndElement) { await ReadAsync().ConfigureAwait(false); } }
private static void GenerateQRDACatOne(List<QualityMeasure> listQMs,DateTime dateStart,DateTime dateEnd,string folderRoot) { //create a list of all unique patients who belong to the initial patient population for any of the 9 CQMs List<EhrCqmPatient> listAllEhrPats=new List<EhrCqmPatient>(); //create a dictionary linking a patient to the measures to which they belong Dictionary<long,List<QualityMeasure>> dictPatNumListQMs=new Dictionary<long,List<QualityMeasure>>(); for(int i=0;i<listQMs.Count;i++) { for(int j=0;j<listQMs[i].ListEhrPats.Count;j++) { if(!dictPatNumListQMs.ContainsKey(listQMs[i].ListEhrPats[j].EhrCqmPat.PatNum)) { dictPatNumListQMs.Add(listQMs[i].ListEhrPats[j].EhrCqmPat.PatNum,new List<QualityMeasure>() { listQMs[i] }); listAllEhrPats.Add(listQMs[i].ListEhrPats[j]); } else { dictPatNumListQMs[listQMs[i].ListEhrPats[j].EhrCqmPat.PatNum].Add(listQMs[i]); } } } //listAllPats contains every unique patient who belongs to one of the initial patient population for any of the 9 CQMs //dictPatNumListQMs is a dictionary linking a patient to a list of measure for which they are in the initial patient population StringBuilder strBuilder=new StringBuilder(); StringBuilder strBuilderPatDataEntries=new StringBuilder(); //this dictionary links a PatNum key to the patient's Cat I xml dictionary value Dictionary<long,string> dictPatNumXml=new Dictionary<long,string>(); #region Cateogry I QRDA Documents for(int i=0;i<listAllEhrPats.Count;i++) { strBuilder=new StringBuilder(); strBuilderPatDataEntries=new StringBuilder(); EhrCqmPatient ehrPatCur=listAllEhrPats[i]; Patient patCur=ehrPatCur.EhrCqmPat;//just to make referencing easier long patNumCur=ehrPatCur.EhrCqmPat.PatNum;//just to make referencing easier XmlWriterSettings xmlSettings=new XmlWriterSettings(); xmlSettings.Encoding=Encoding.UTF8; xmlSettings.OmitXmlDeclaration=true; xmlSettings.Indent=true; xmlSettings.IndentChars=" "; xmlSettings.ConformanceLevel=ConformanceLevel.Fragment; using(_w=XmlWriter.Create(strBuilder,xmlSettings)) { //Begin Clinical Document _w.WriteRaw("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); _w.WriteProcessingInstruction("xml-stylesheet","type=\"text/xsl\" href=\"cda.xsl\""); _w.WriteWhitespace("\r\n"); _w.WriteStartElement("ClinicalDocument","urn:hl7-org:v3"); _w.WriteAttributeString("xmlns","xsi",null,"http://www.w3.org/2001/XMLSchema-instance"); _w.WriteAttributeString("xsi","schemaLocation",null,"urn:./CDA.xsd"); _w.WriteAttributeString("xmlns","voc",null,"urn:hl7-org:v3/voc"); _w.WriteAttributeString("xmlns","sdtc",null,"urn:hl7-org:sdtc"); #region QRDA I Header _w.WriteComment("QRDA Header"); StartAndEnd("realmCode","code","US"); StartAndEnd("typeId","root","2.16.840.1.113883.1.3","extension","POCD_HD000040");//template id to assert use of the CDA standard _w.WriteComment("US General Header Template"); TemplateId("2.16.840.1.113883.10.20.22.1.1"); _w.WriteComment("QRDA Template"); TemplateId("2.16.840.1.113883.10.20.24.1.1"); _w.WriteComment("QDM-based QRDA Template"); TemplateId("2.16.840.1.113883.10.20.24.1.2"); _w.WriteComment("This is the globally unique identifier for this QRDA document"); Guid(); _w.WriteComment("QRDA document type code"); StartAndEnd("code","code","55182-0","codeSystem",strCodeSystemLoinc,"codeSystemName",strCodeSystemNameLoinc,"displayName","Quality Measure Report"); _w.WriteElementString("title","QRDA Incidence Report"); _w.WriteComment("This is the document creation time"); TimeElement("effectiveTime",DateTime.Now); StartAndEnd("confidentialityCode","code","N","codeSystem","2.16.840.1.113883.5.25");//Fixed value. Confidentiality Code System. Codes: N=(Normal), R=(Restricted),V=(Very Restricted) StartAndEnd("languageCode","code","en-US"); #region recordTarget _w.WriteComment("Reported patient"); Start("recordTarget"); #region patientRole Start("patientRole"); string strHICNum=ValidateMedicaidID(patCur.MedicaidID); if(strHICNum!="") { _w.WriteComment("This is the patient's Medicare HIC (Health Insurance Claim) number"); StartAndEnd("id","root","2.16.840.1.113883.4.572","extension",strHICNum); } //_w.WriteComment("The extension is the patient's Open Dental number, the root is the assigning authority"); //StartAndEnd("id","root",_strOIDInternalPatRoot,"extension",patNumCur.ToString()); if(patCur.SSN.Trim().Length==9) { _w.WriteComment("This is the patient's SSN using the HL7 SSN OID"); StartAndEnd("id","root","2.16.840.1.113883.4.1","extension",patCur.SSN.Trim());//HL7 SSN OID root with patient's SSN if they have a valid one } AddressUnitedStates(patCur.Address,patCur.Address2,patCur.City,patCur.State,patCur.Zip,"HP");//Validated if(patCur.WirelessPhone.Trim()!="") {//There is at least one phone, due to validation. StartAndEnd("telecom","use","MC","value","tel:"+patCur.WirelessPhone.Trim()); _w.WriteComment("MC is \"mobile contact\" from codeSystem 2.16.840.1.113883.5.1119"); } else if(patCur.HmPhone.Trim()!="") { StartAndEnd("telecom","use","HP","value","tel:"+patCur.HmPhone.Trim()); _w.WriteComment("HP is \"primary home\" from codeSystem 2.16.840.1.113883.5.1119"); } else if(patCur.WkPhone.Trim()!="") { StartAndEnd("telecom","use","WP","value","tel:"+patCur.WkPhone.Trim()); _w.WriteComment("WP is \"work place\" from codeSystem 2.16.840.1.113883.5.1119"); } #region patient Start("patient"); #region name Start("name","use","L"); _w.WriteComment("L is \"Legal\" from codeSystem 2.16.840.1.113883.5.45"); _w.WriteElementString("given",patCur.FName);//Validated if(patCur.MiddleI!="") { _w.WriteElementString("given",patCur.MiddleI); } _w.WriteElementString("family",patCur.LName);//Validated if(patCur.Title!="") { Start("suffix","qualifier","TITLE"); _w.WriteString(patCur.Title); End("suffix"); } End("name"); #endregion name //Will always be present, because there are only 3 options and the user is forced to make a choice in the UI. if(patCur.Gender==PatientGender.Female) { StartAndEnd("administrativeGenderCode","code","F","codeSystem","2.16.840.1.113883.5.1","displayName","Female","codeSystemName","HL7 AdministrativeGender"); } else if(patCur.Gender==PatientGender.Male) { StartAndEnd("administrativeGenderCode","code","M","codeSystem","2.16.840.1.113883.5.1","displayName","Male","codeSystemName","HL7 AdministrativeGender"); } else { StartAndEnd("administrativeGenderCode","code","UN","codeSystem","2.16.840.1.113883.5.1","displayName","Undifferentiated","codeSystemName","HL7 AdministrativeGender"); } DateElement("birthTime",patCur.Birthdate);//Validated if(patCur.Position==PatientPosition.Divorced) { StartAndEnd("maritalStatusCode","code","D","displayName","Divorced","codeSystem","2.16.840.1.113883.5.2","codeSystemName","MaritalStatusCode"); } else if(patCur.Position==PatientPosition.Married) { StartAndEnd("maritalStatusCode","code","M","displayName","Married","codeSystem","2.16.840.1.113883.5.2","codeSystemName","MaritalStatusCode"); } else if(patCur.Position==PatientPosition.Widowed) { StartAndEnd("maritalStatusCode","code","W","displayName","Widowed","codeSystem","2.16.840.1.113883.5.2","codeSystemName","MaritalStatusCode"); } else {//Single and child StartAndEnd("maritalStatusCode","code","S","displayName","Never Married","codeSystem","2.16.840.1.113883.5.2","codeSystemName","MaritalStatusCode"); } #region raceCode string strRaceDescript=""; string strRaceCode="2131-1";//default will be "Other Race" //if declined to specify race, null flavor is "ASKU" - Asked, but not known. Information was sought, but not found //if race is not present, null flavor is "UNK" - Unknown. A proper value is applicable, but is not known. //These will appear as <raceCode nullFlavor=”ASKU”/> or <raceCode nullFlavor=”UNK”/> respectively bool isRaceNull=false; if(ehrPatCur.ListPatientRaces.Count==0) { isRaceNull=true; strRaceDescript="UNK"; } else if(ehrPatCur.ListPatientRaces.Count==1) {//if only one race is entered (already separated out the ethnicities) then we can construct the raceCode element with selected race switch(ehrPatCur.ListPatientRaces[0].Race) { case PatRace.AfricanAmerican: strRaceDescript="Black or African American"; strRaceCode=ehrPatCur.ListPatientRaces[0].CdcrecCode; break; case PatRace.AmericanIndian: strRaceDescript="American Indian or Alaska Native"; strRaceCode=ehrPatCur.ListPatientRaces[0].CdcrecCode; break; case PatRace.Asian: case PatRace.White: strRaceDescript=ehrPatCur.ListPatientRaces[0].Race.ToString(); strRaceCode=ehrPatCur.ListPatientRaces[0].CdcrecCode; break; case PatRace.HawaiiOrPacIsland: strRaceDescript="Native Hawaiian or Other Pacific Islander"; strRaceCode=ehrPatCur.ListPatientRaces[0].CdcrecCode; break; case PatRace.DeclinedToSpecifyRace: isRaceNull=true; strRaceDescript="ASKU"; break; default://any other race will be reported as "Other race" strRaceDescript="Other Race"; break; } } //"If there are multiple race values reported for a patient, count as ‘Other Race’ value" from downloaded implementation guide found: //\\SERVERFILES\storage\EHR\Quality Measures\QRDA\QRDAIII_CMS_EP_2014_ImplementationGuide_Vol1\QRDA_III_CMS_EP_2014_IG_Vol 2.pdf page 49 else { strRaceDescript="Other Race"; } if(isRaceNull) {//either declined to specify (flavor "ASKU") or no race recorded (flavor "UNK") StartAndEnd("raceCode","nullFlavor",strRaceDescript); } else { StartAndEnd("raceCode","code",strRaceCode,"displayName",strRaceDescript,"codeSystem","2.16.840.1.113883.6.238","codeSystemName","CDC Race and Ethnicity"); } #endregion raceCode #region ethnicityGroupCode string strEthnicityCode=""; string strEthnicityDescript=""; bool isDeclinedEthnicity=false; if(ehrPatCur.Ethnicity!=null) { if(ehrPatCur.Ethnicity.Race==PatRace.Hispanic) { strEthnicityDescript="Hispanic"; strEthnicityCode=ehrPatCur.Ethnicity.CdcrecCode; } else if(ehrPatCur.Ethnicity.Race==PatRace.NotHispanic) { strEthnicityDescript="Not Hispanic or Latino"; strEthnicityCode=ehrPatCur.Ethnicity.CdcrecCode; } else { isDeclinedEthnicity=true; } } if(ehrPatCur.Ethnicity==null) { StartAndEnd("ethnicGroupCode","nullFlavor","UNK"); } else if(isDeclinedEthnicity) { StartAndEnd("ethnicGroupCode","nullFlavor","ASKU"); } else if(strEthnicityCode!="" && strEthnicityDescript!=""){ StartAndEnd("ethnicGroupCode","code",strEthnicityCode,"displayName",strEthnicityDescript,"codeSystem","2.16.840.1.113883.6.238","codeSystemName","CDC Race and Ethnicity"); } #endregion ethnicityGroupCode End("patient"); #endregion patient End("patientRole"); #endregion patientRole End("recordTarget"); #endregion recordTarget #region comments //The author element represents the creator of the clinical document. The author may be a device, or a person. Section 4.1.2, page 69. //Participant Scenarios in a QRDA Category I Document (section 5.1.5.3, page 94) //Three possible scenarios given, the first sounds like it applies to us //1.) QRDA is wholly constructed automatically by device //Author - Device //Custodian - Organization that owns and reports the data (e.g. hospital, dental practice) //Informant - N/A //Legal Authenticator - A designated person in the organization (may be assigned to the report automatically) //2.) QRDA is partially constructed automatically by device, partially constructed by quality manager //3.) QRDA is constructed manually (e.g. by an organization that doesn't have an EHR) //We will generate a device author element, a practice custodian element, no informant element, and a Legal Authenticator element using the practice default provider #endregion #region author Start("author"); TimeElement("time",DateTime.Now); Start("assignedAuthor"); StartAndEnd("id","root","2.16.840.1.113883.3.4337","assigningAuthorityName","HL7 OID Registry"); AddressUnitedStates("3995 Fairview Industrial Dr. SE","Suite 110","Salem","OR","97302","WP"); StartAndEnd("telecom","use","WP","value","tel:(503)363-5432"); Start("assignedAuthoringDevice"); _w.WriteElementString("manufacturerModelName","Open Dental version "+PrefC.GetString(PrefName.ProgramVersion)); _w.WriteElementString("softwareName","Open Dental Software Inc."); End("assignedAuthoringDevice"); End("assignedAuthor"); End("author"); #endregion author #region custodian //"Represents the organization in charge of maintaining the document." Section 4.1.5, page 77 //The custodian is the steward that is entrusted with the care of the document. Every CDA document has exactly one custodian. Start("custodian"); Start("assignedCustodian"); Start("representedCustodianOrganization"); StartAndEnd("id","root",_strOIDInternalRoot);//This is the root assigned to the practice, based on the OD root 2.16.840.1.113883.3.4337 _w.WriteElementString("name",PrefC.GetString(PrefName.PracticeTitle));//Validated string strPracticePhone=PrefC.GetString(PrefName.PracticePhone);//Validated strPracticePhone="("+strPracticePhone.Substring(0,3)+")"+strPracticePhone.Substring(3,3)+"-"+strPracticePhone.Substring(6); StartAndEnd("telecom","use","WP","value","tel:"+strPracticePhone);//Validated AddressUnitedStates(PrefC.GetString(PrefName.PracticeAddress),PrefC.GetString(PrefName.PracticeAddress2),PrefC.GetString(PrefName.PracticeCity),PrefC.GetString(PrefName.PracticeST),PrefC.GetString(PrefName.PracticeZip),"WP");//Validated End("representedCustodianOrganization"); End("assignedCustodian"); End("custodian"); #endregion custodian #region legalAuthenticator //This element identifies the single person legally responsible for the document and must be present if the document has been legally authenticated. Start("legalAuthenticator"); TimeElement("time",DateTime.Now); StartAndEnd("signatureCode","code","S"); Start("assignedEntity"); Provider provLegal=Providers.GetProv(PrefC.GetLong(PrefName.PracticeDefaultProv)); StartAndEnd("id","root","2.16.840.1.113883.4.6","extension",provLegal.NationalProvID,"assigningAuthorityName","NPI");//Validated NPI AddressUnitedStates(PrefC.GetString(PrefName.PracticeAddress),PrefC.GetString(PrefName.PracticeAddress2),PrefC.GetString(PrefName.PracticeCity),PrefC.GetString(PrefName.PracticeST),PrefC.GetString(PrefName.PracticeZip),"WP");//Validated StartAndEnd("telecom","use","WP","value","tel:"+strPracticePhone);//Validated Start("assignedPerson"); Start("name"); _w.WriteElementString("given",provLegal.FName);//Validated _w.WriteElementString("family",provLegal.LName);//Validated End("name"); End("assignedPerson"); End("assignedEntity"); End("legalAuthenticator"); #endregion legalAuthenticator #region documentationOf Start("documentationOf","typeCode","DOC"); _w.WriteComment("care provision"); Start("serviceEvent","classCode","PCPR"); Start("effectiveTime"); DateElement("low",dateStart); DateElement("high",dateEnd); End("effectiveTime"); #region performer Start("performer","typeCode","PRF"); Start("assignedEntity"); if(_provOutQrda.NationalProvID!="") { _w.WriteComment("This is the provider NPI"); StartAndEnd("id","root","2.16.840.1.113883.4.6","extension",_provOutQrda.NationalProvID); } if(_provOutQrda.UsingTIN && _provOutQrda.SSN!="") { _w.WriteComment("This is the provider TIN"); StartAndEnd("id","root","2.16.840.1.113883.4.2","extension",_provOutQrda.SSN); } _w.WriteComment("This is the practice OID provider root and Open Dental assigned ProvNum extension"); StartAndEnd("id","root",_strOIDInternalProvRoot,"extension",_provOutQrda.ProvNum.ToString()); Start("representedOrganization"); //we don't currently have an organization level TIN or an organization Facility CMS Certification Number (CCN) //both id's are identified as "SHOULD" elements. We will include the practice name //_w.WriteComment("This is the organization TIN"); //_w.WriteComment("This is the organization CCN"); _w.WriteElementString("name",PrefC.GetString(PrefName.PracticeTitle));//Validated End("representedOrganization"); End("assignedEntity"); End("performer"); #endregion performer End("serviceEvent"); End("documentationOf"); #endregion documentationOf #endregion QRDA I Header #region QRDA I Body _w.WriteComment("QRDA Body"); Start("component"); Start("structuredBody"); #region Reporting Parameters Start("component"); Start("section"); _w.WriteComment(@" ***************************************************************** Reporting Parameters Section ***************************************************************** "); _w.WriteComment("Reporting Parameters Section Template"); TemplateId("2.16.840.1.113883.10.20.17.2.1"); StartAndEnd("code","code","55187-9","codeSystem",strCodeSystemLoinc,"codeSystemName",strCodeSystemNameLoinc,"displayName","Reporting Parameters"); _w.WriteElementString("title","Reporting Parameters"); Start("text"); Start("list"); _w.WriteElementString("item","Reporting period: "+dateStart.ToString("MMMM dd, yyyy")+" 00:00 - "+dateEnd.ToString("MMMM dd, yyyy")+" 23:59"); End("list"); End("text"); Start("entry","typeCode","DRIV"); Start("act","classCode","ACT","moodCode","EVN"); _w.WriteComment("Reporting Parameteres Act Template"); TemplateId("2.16.840.1.113883.10.20.17.3.8"); StartAndEnd("code","code","252116004","codeSystem",strCodeSystemSnomed,"codeSystemName",strCodeSystemNameSnomed,"displayName","Observation Parameters"); Start("effectiveTime"); StartAndEnd("low","value",dateStart.ToString("yyyyMMdd")+"000000"); StartAndEnd("high","value",dateEnd.ToString("yyyyMMdd")+"235959"); End("effectiveTime"); End("act"); End("entry"); End("section"); End("component"); #endregion Reporting Parameters #region Measure Section Start("component"); Start("section"); _w.WriteComment(@" ***************************************************************** Measure Section ***************************************************************** "); _w.WriteComment("Measure Section Template"); TemplateId("2.16.840.1.113883.10.20.24.2.2"); _w.WriteComment("Measure Section QDM Template"); TemplateId("2.16.840.1.113883.10.20.24.2.3"); _w.WriteComment("This is the LOINC code for \"Measure document\". This stays the same for all measure sections required by QRDA standard"); StartAndEnd("code","code","55186-1","codeSystem",strCodeSystemLoinc,"codeSystemName",strCodeSystemNameLoinc,"displayName","Measure Document"); _w.WriteElementString("title","Measure Section"); #region text version of eMeasures as table Start("text"); Start("table","border","1","width","100%"); Start("thead"); Start("tr"); _w.WriteElementString("th","eMeasure Identifier (MAT)"); _w.WriteElementString("th","eMeasure Title"); _w.WriteElementString("th","Version neutral identifier"); _w.WriteElementString("th","eMeasure Version Number"); _w.WriteElementString("th","Version specific identifier"); End("tr"); End("thead"); Start("tbody"); for(int j=0;j<listQMs.Count;j++) { //_listExtraPopIndxs will contain all of the Type2014 enum types that are stratifications or extra populations of other measures, so skip them here if(_listExtraPopIndxs.Contains(i)) { continue; } MeasureTextTableRow(listQMs[j].eMeasureTitle,listQMs[j].eMeasureNum,listQMs[j].eMeasureVNeutralId,listQMs[j].eMeasureVersion,listQMs[j].eMeasureVSpecificId); } End("tbody"); End("table"); End("text"); #endregion text version of eMeasures as table #region eMeasure entries _w.WriteComment("1..* Organizers, each containing a reference to an eMeasure"); for(int j=0;j<listQMs.Count;j++) { //_listExtraPopIndxs will contain all of the Type2014 enum types that are stratifications or extra populations of other measures, so skip them here if(_listExtraPopIndxs.Contains(i)) { continue; } MeasureEntry(listQMs[j].eMeasureVSpecificId,listQMs[j].eMeasureTitle,listQMs[j].eMeasureVNeutralId,listQMs[j].eMeasureVersion); } #endregion eMeasure entries End("section"); End("component"); #endregion Measure Section #region Patient Data Start("component"); Start("section"); _w.WriteComment(@" ***************************************************************** Patient Data Section ***************************************************************** "); _w.WriteComment("Patient Data Section Template"); TemplateId("2.16.840.1.113883.10.20.17.2.4"); _w.WriteComment("Patient Data QDM Section Template"); TemplateId("2.16.840.1.113883.10.20.24.2.1"); StartAndEnd("code","code","55188-7","codeSystem",strCodeSystemLoinc,"codeSystemName",strCodeSystemNameLoinc,"displayName","Patient Data"); _w.WriteElementString("title","Patient Data"); Start("text"); Start("table","border","1","width","100%"); Start("thead"); Start("tr"); _w.WriteElementString("th","Description"); _w.WriteElementString("th","Value Set"); _w.WriteElementString("th","Code"); _w.WriteElementString("th","Date/Time"); _w.WriteElementString("th","Results"); End("tr"); End("thead"); Start("tbody"); using(_x=XmlWriter.Create(strBuilderPatDataEntries,xmlSettings)) { _x.WriteStartElement("ClinicalDocument","urn:hl7-org:v3"); _x.WriteAttributeString("xmlns","xsi",null,"http://www.w3.org/2001/XMLSchema-instance"); _x.WriteAttributeString("xsi","schemaLocation",null,"urn:./CDA.xsd"); _x.WriteAttributeString("xmlns","voc",null,"urn:hl7-org:v3/voc"); _x.WriteAttributeString("xmlns","sdtc",null,"urn:hl7-org:sdtc"); List<QualityMeasure> listQMsCur=dictPatNumListQMs[patNumCur]; //this list of unique item ids is used when building the plain text version so that the encounter/procedure/item will only be in the plain text version once //we will add the item to the entries multiple times since the item can belong to different value sets //and must have the value set specific to the measure for which it qualifies the patient List<string> listUniqueItemExtensionsWithValueSetOIDs=new List<string>(); List<string> listUniqueItemExtensions=new List<string>(); //create encounter entries for each measure for this patient #region encounters for(int j=0;j<listQMsCur.Count;j++) { if(!listQMsCur[j].DictPatNumListEncounters.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListEncounters[patNumCur].Count;k++) { EhrCqmEncounter encCur=listQMsCur[j].DictPatNumListEncounters[patNumCur][k]; //if in this list with ValueSetOID, then it must be in the non-ValueSetOID list, so just continue string extensCur=CqmItemAbbreviation.Enc.ToString()+encCur.ValueSetOID+"Num"+encCur.EhrCqmEncounterNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateEncounterEntry(encCur); } extensCur=CqmItemAbbreviation.Enc.ToString()+encCur.EhrCqmEncounterNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript="Encounter, Performed: "+encCur.ValueSetName; PatientDataTextTableRow(descript,encCur.ValueSetOID,encCur.CodeSystemName,encCur.CodeValue,encCur.DateEncounter,encCur.DateEncounter,""); #endregion BuildPlainTextVersion } } #endregion encounters //create intervention entries for each measure for this patient #region interventions for(int j=0;j<listQMsCur.Count;j++) { if(!listQMsCur[j].DictPatNumListInterventions.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListInterventions[patNumCur].Count;k++) { EhrCqmIntervention iCur=listQMsCur[j].DictPatNumListInterventions[patNumCur][k]; string extensCur=CqmItemAbbreviation.Ivn.ToString()+iCur.ValueSetOID+"Num"+iCur.EhrCqmInterventionNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateInterventionEntry(iCur); } extensCur=CqmItemAbbreviation.Ivn.ToString()+iCur.EhrCqmInterventionNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript=""; if(listQMsCur[j].Type2014==QualityType2014.WeightAdult || listQMsCur[j].Type2014==QualityType2014.WeightOver65) {//interventions in these two measures are ordered descript="Intervention, Order: "; } else { descript="Intervention, Performed: "; } descript+=iCur.ValueSetName; PatientDataTextTableRow(descript,iCur.ValueSetOID,iCur.CodeSystemName,iCur.CodeValue,iCur.DateEntry,iCur.DateEntry,""); #endregion BuildPlainTextVersion } } #endregion interventions //create ehrmeasureevents for each measure for this patient #region ehrmeasureevents for(int j=0;j<listQMsCur.Count;j++) { if(!listQMsCur[j].DictPatNumListMeasureEvents.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListMeasureEvents[patNumCur].Count;k++) { EhrCqmMeasEvent mCur=listQMsCur[j].DictPatNumListMeasureEvents[patNumCur][k]; string extensCur=CqmItemAbbreviation.MeasEvn.ToString()+mCur.ValueSetOID+"Num"+mCur.EhrCqmMeasEventNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateMeasEventEntry(mCur); } extensCur=CqmItemAbbreviation.MeasEvn.ToString()+mCur.EhrCqmMeasEventNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript=""; if(mCur.EventType==EhrMeasureEventType.TobaccoUseAssessed) { descript="Patient Characteristic: "; } else if(mCur.EventType==EhrMeasureEventType.CurrentMedsDocumented) { descript="Procedure, Performed: "; } descript+=mCur.ValueSetName+" - "+mCur.Description; PatientDataTextTableRow(descript,mCur.ValueSetOID,mCur.CodeSystemName,mCur.CodeValue,mCur.DateTEvent,mCur.DateTEvent,""); #endregion BuildPlainTextVersion } } #endregion ehrmeasureevents //create medicationpats for each measure for this patient #region medicationpats for(int j=0;j<listQMsCur.Count;j++) { //have to check for CompletionStatus=NotAdministered if vaccine, vaccines given are procedures performed, not given are medication allergy or intolerance if(!listQMsCur[j].DictPatNumListMedPats.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListMedPats[patNumCur].Count;k++) { EhrCqmMedicationPat mPatCur=listQMsCur[j].DictPatNumListMedPats[patNumCur][k]; string extensCur=CqmItemAbbreviation.MedPat.ToString()+mPatCur.ValueSetOID+"Num"; if(mPatCur.EhrCqmMedicationPatNum!=0) { extensCur+=mPatCur.EhrCqmMedicationPatNum.ToString(); } else { extensCur+=mPatCur.EhrCqmVaccinePatNum.ToString(); } if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateMedPatsEntry(mPatCur); } extensCur=CqmItemAbbreviation.MedPat.ToString(); if(mPatCur.EhrCqmMedicationPatNum!=0) { extensCur+=mPatCur.EhrCqmMedicationPatNum.ToString(); } else { extensCur+=mPatCur.EhrCqmVaccinePatNum.ToString(); } if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript=""; string codeValue=""; //represents a medication. Used by tobacco cessation or above/below normal weight meds if(mPatCur.EhrCqmMedicationPatNum!=0) { codeValue=mPatCur.RxCui.ToString(); //Will be Medication, Active/Order if(mPatCur.PatNote!="") {//PatNote means an order descript="Medication, Ordered: "; } else { descript="Medication, Active: "; } } //EhrCqmVaccinePatNum will only be set if pneumonia or influenza measure and it represents a vaccine else { codeValue=mPatCur.CVXCode; if(mPatCur.CompletionStatus==VaccineCompletionStatus.NotAdministered) {//NotAdministered is due to an allergy or intolerance descript="Medication, Allergy: "; } else {//only getting CompletionStatus=Complete or NotAdministered, the else is for Complete descript="Medication, Administered: "; } } descript+=mPatCur.ValueSetName+" - "+mPatCur.Description; PatientDataTextTableRow(descript,mPatCur.ValueSetOID,mPatCur.CodeSystemName,codeValue,mPatCur.DateStart,mPatCur.DateStop,""); #endregion BuildPlainTextVersion } } #endregion medicationpats //create ehrnotperformeds for each measure for this patient #region ehrnotperformeds for(int j=0;j<listQMsCur.Count;j++) { //have to determine what is not being performed, Procedure (flu vaccine, current meds documented), Medication (flu vaccine), Physical Exam, Tobacco screening //if ValueSetOID=2.16.840.1.113883.3.526.3.1254, then Medication, Administered not done: Medical/Patient/System Reason (flu vaccine med) //if ValueSetOID=2.16.840.1.113883.3.526.3.402, then Procedure, Performed not done: Medical/Patient/System Reason (flu vaccine proc) //if ValueSetOID=2.16.840.1.113883.3.600.1.462, then Procedure, Performed not done: Medical or Other reason not done (current meds documented proc) //if ValueSetOID=2.16.840.1.113883.3.600.1.681, then Physical Exam, Performed not done: Medical or Other reason not done/Patient Reason Refused (vitalsign exam) //if ValueSetOID=2.16.840.1.113883.3.526.3.1278, then Risk Category Assessment not done: Medical Reason (tobacco assessment) //Then use the negationInd="true" attribute to indicate that it was not performed if(!listQMsCur[j].DictPatNumListNotPerfs.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListNotPerfs[patNumCur].Count;k++) { EhrCqmNotPerf npCur=listQMsCur[j].DictPatNumListNotPerfs[patNumCur][k]; string extensCur=CqmItemAbbreviation.NotPerf.ToString()+npCur.ValueSetOID+"Num"+npCur.EhrCqmNotPerfNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateNotPerfEntry(npCur); } extensCur=CqmItemAbbreviation.NotPerf.ToString()+npCur.EhrCqmNotPerfNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); #region BuildPlainTextVersion string descript=""; if(npCur.ValueSetOID=="2.16.840.1.113883.3.526.3.1254") { descript="Medication, Administered not done: "; } else if(npCur.ValueSetOID=="2.16.840.1.113883.3.526.3.402" || npCur.ValueSetOID=="2.16.840.1.113883.3.600.1.462") { descript="Procedure, Performed not done: "; } else if(npCur.ValueSetOID=="2.16.840.1.113883.3.600.1.681") { descript="Physical Exam, Performed not done: "; } else {//must be a 2.16.840.1.113883.3.526.3.1278, not performed items restricted to one of these 5 value sets descript="Risk Category Assessment not done: "; } descript+=npCur.ValueSetName+" - "+npCur.DescriptionReason; PatientDataTextTableRow(descript,npCur.ValueSetOID,npCur.CodeSystemName,npCur.CodeValue,npCur.DateEntry,npCur.DateEntry,""); #endregion BuildPlainTextVersion } } #endregion ehrnotperformeds //create problems for each measure for this patient #region problems for(int j=0;j<listQMsCur.Count;j++) { //if ValueSetOID = 2.16.840.1.113883.3.526.3.1255, SNOMEDCT - 315640000 - Influenza vaccination declined (situation), then it is a Communication, From patient to provider: //if ValueSetOID = 2.16.840.1.113883.3.464.1003.110.12.1028, SNOMEDCT - 310578008 - Pneumococcal vaccination given (finding), then it is a Risk Category Assessment: //if ValueSetOID = 2.16.840.1.113883.3.600.1.1579 - Palliative Care, then it is a Procedure, Order: //Otherwise it is a Diagnosis, Active: if(!listQMsCur[j].DictPatNumListProblems.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListProblems[patNumCur].Count;k++) { EhrCqmProblem probCur=listQMsCur[j].DictPatNumListProblems[patNumCur][k]; string extensCur=CqmItemAbbreviation.Prob.ToString()+probCur.ValueSetOID+"Num"+probCur.EhrCqmProblemNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); switch(probCur.ValueSetOID) { case "2.16.840.1.113883.3.526.3.1255": GenerateCommunicationEntry(probCur); break; case "2.16.840.1.113883.3.464.1003.110.12.1028": GenerateRiskAssessEntry(probCur); break; case "2.16.840.1.113883.3.600.1.1579": GenerateProcedureEntry(null,probCur); break; default: GenerateDiagnosisEntry(probCur); break; } } extensCur=CqmItemAbbreviation.Prob.ToString()+probCur.EhrCqmProblemNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript=""; switch(probCur.ValueSetOID) { case "2.16.840.1.113883.3.526.3.1255": descript="Communication, From patient to provider: "; break; case "2.16.840.1.113883.3.464.1003.110.12.1028": descript="Risk Category Assessment: "; break; case "2.16.840.1.113883.3.600.1.1579": descript="Procedure, Order: "; break; default: descript="Diagnosis, Active: "; break; } descript+=probCur.ValueSetName+" - "+probCur.Description; PatientDataTextTableRow(descript,probCur.ValueSetOID,probCur.CodeSystemName,probCur.CodeValue,probCur.DateStart,probCur.DateStop,""); #endregion BuildPlainTextVersion } } #endregion problems //create procs for each measure for this patient #region procs for(int j=0;j<listQMsCur.Count;j++) { if(!listQMsCur[j].DictPatNumListProcs.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListProcs[patNumCur].Count;k++) { EhrCqmProc procCur=listQMsCur[j].DictPatNumListProcs[patNumCur][k]; string extensCur=CqmItemAbbreviation.Proc.ToString()+procCur.ValueSetOID+"Num"+procCur.EhrCqmProcNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateProcedureEntry(procCur,null); } extensCur=CqmItemAbbreviation.Proc.ToString()+procCur.EhrCqmProcNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript="Procedure, Performed: "+procCur.ValueSetName+" - "+procCur.Description; PatientDataTextTableRow(descript,procCur.ValueSetOID,procCur.CodeSystemName,procCur.ProcCode,procCur.ProcDate,procCur.ProcDate,""); #endregion BuildPlainTextVersion } } #endregion procs //create vitalsigns for each measure for this patient #region vitalsigns for(int j=0;j<listQMsCur.Count;j++) { if(!listQMsCur[j].DictPatNumListVitalsigns.ContainsKey(patNumCur)) { continue; } for(int k=0;k<listQMsCur[j].DictPatNumListVitalsigns[patNumCur].Count;k++) { EhrCqmVitalsign vCur=listQMsCur[j].DictPatNumListVitalsigns[patNumCur][k]; string extensCur=""; if(vCur.BpDiastolic>0) { extensCur=CqmItemAbbreviation.Vital.ToString()+"2.16.840.1.113883.3.526.3.1033"+"Num"+vCur.EhrCqmVitalsignNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateVitalsignEntry(vCur,"BPd"); } } if(vCur.BpSystolic>0) { extensCur=CqmItemAbbreviation.Vital.ToString()+"2.16.840.1.113883.3.526.3.1032"+"Num"+vCur.EhrCqmVitalsignNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateVitalsignEntry(vCur,"BPs"); } } if(vCur.BMI>0) { extensCur=CqmItemAbbreviation.Vital.ToString()+"2.16.840.1.113883.3.464.1003.121.12.1014"+"Num"+vCur.EhrCqmVitalsignNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateVitalsignEntry(vCur,"Ht"); } extensCur=CqmItemAbbreviation.Vital.ToString()+"2.16.840.1.113883.3.464.1003.121.12.1015"+"Num"+vCur.EhrCqmVitalsignNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateVitalsignEntry(vCur,"Wt"); } extensCur=CqmItemAbbreviation.Vital.ToString()+"2.16.840.1.113883.3.600.1.681"+vCur.EhrCqmVitalsignNum.ToString(); if(!listUniqueItemExtensionsWithValueSetOIDs.Contains(extensCur)) { listUniqueItemExtensionsWithValueSetOIDs.Add(extensCur); GenerateVitalsignEntry(vCur,"BMI"); } } //if(vCur.BMIPercentile>-1) { // GenerateVitalsignEntry(vCur,"BMIp"); //} extensCur=CqmItemAbbreviation.Vital.ToString()+vCur.EhrCqmVitalsignNum.ToString(); if(listUniqueItemExtensions.Contains(extensCur)) { continue; } listUniqueItemExtensions.Add(extensCur); #region BuildPlainTextVersion string descript=""; if(vCur.BpDiastolic>0) { descript="Physical Exam, Finding: Diastolic Blood Pressure"; PatientDataTextTableRow(descript,"2.16.840.1.113883.3.526.3.1033","LOINC","8462-4",vCur.DateTaken,vCur.DateTaken,vCur.BpDiastolic.ToString()+" mmHg"); } if(vCur.BpSystolic>0) { descript="Physical Exam, Finding: Systolic Blood Pressure"; PatientDataTextTableRow(descript,"2.16.840.1.113883.3.526.3.1032","LOINC","8480-6",vCur.DateTaken,vCur.DateTaken,vCur.BpSystolic.ToString()+" mmHg"); } if(vCur.BMI>0) { descript="Physical Exam, Finding: Height"; PatientDataTextTableRow(descript,"2.16.840.1.113883.3.464.1003.121.12.1014","LOINC",vCur.HeightExamCode,vCur.DateTaken,vCur.DateTaken,vCur.Height.ToString()+" in"); descript="Physical Exam, Finding: Weight"; PatientDataTextTableRow(descript,"2.16.840.1.113883.3.464.1003.121.12.1015","LOINC",vCur.WeightExamCode,vCur.DateTaken,vCur.DateTaken,vCur.Weight.ToString()+" lb"); descript="Physical Exam, Finding: BMI LOINC Value"; PatientDataTextTableRow(descript,"2.16.840.1.113883.3.600.1.681","LOINC","39156-5",vCur.DateTaken,vCur.DateTaken,vCur.BMI.ToString("0.00")+" kg/m2"); } //if(vCur.BMIPercentile>-1) { // descript="Physical Exam, Finding: BMI Percentile"; // PatientDataTextTableRow(descript,"2.16.840.1.113883.3.464.1003.121.12.1012","LOINC",vCur.BMIExamCode,vCur.DateTaken,vCur.DateTaken,vCur.BMIPercentile.ToString()); //} #endregion BuildPlainTextVersion } } #endregion vitalsigns _x.WriteEndElement(); } End("tbody"); End("table"); End("text"); XmlDocument doc=new XmlDocument(); doc.LoadXml(strBuilderPatDataEntries.ToString()); XmlElement elementClinicalDocument=doc.DocumentElement; for(int n=0;n<elementClinicalDocument.ChildNodes.Count;n++) { elementClinicalDocument.ChildNodes[n].WriteTo(_w); } Start("entry"); Start("observation","classCode","OBS","moodCode","EVN"); _w.WriteComment("Patient Characteristic Payer Template"); TemplateId("2.16.840.1.113883.10.20.24.3.55"); StartAndEnd("id","root",_strOIDInternalCQMRoot,"extension",CqmItemAbbreviation.Payer.ToString()+patCur.PatNum.ToString()); StartAndEnd("code","code","48768-6","displayName","Payment source","codeSystem",strCodeSystemLoinc,"codeSystemName",strCodeSystemNameLoinc); StartAndEnd("statusCode","code","completed"); Start("value"); _w.WriteAttributeString("xsi","type",null,"CD"); Attribs("code",ehrPatCur.PayorSopCode,"displayName",ehrPatCur.PayorDescription,"codeSystem","2.16.840.1.113883.3.221.5","codeSystemName","Source of Payment Typology"); _w.WriteAttributeString("sdtc","valueSet",null,ehrPatCur.PayorValueSetOID); End("value"); End("observation"); End("entry"); End("section"); End("component"); #endregion Patient Data End("structuredBody"); #endregion QRDA I Body End("component"); End("ClinicalDocument"); } string xmlResult=strBuilder.ToString(); dictPatNumXml.Add(patNumCur,xmlResult); SecurityLogs.MakeLogEntry(Permissions.Copy,patNumCur,"QRDA Category I generated");//Create audit log entry. } for(int i=0;i<listAllEhrPats.Count;i++) { Patient patCur=listAllEhrPats[i].EhrCqmPat; if(!dictPatNumXml.ContainsKey(patCur.PatNum)) {//every patient will be in the dictionary, this is just in case continue; } List<QualityMeasure> listPatQMs=dictPatNumListQMs[patCur.PatNum]; for(int j=0;j<listPatQMs.Count;j++) { System.IO.File.WriteAllText(folderRoot+"\\Measure_"+listPatQMs[j].eMeasureNum+"\\"+patCur.PatNum+"_"+patCur.LName+"_"+patCur.FName+".xml",dictPatNumXml[patCur.PatNum]); } } try { string[] allMeasDirs=System.IO.Directory.GetDirectories(folderRoot); for(int i=0;i<allMeasDirs.Length;i++) { using(ZipFile zipCur=new ZipFile()) { string[] allPatFiles=System.IO.Directory.GetFiles(allMeasDirs[i]); zipCur.AddFiles(allPatFiles,""); zipCur.Save(allMeasDirs[i]+".zip"); System.IO.Directory.Delete(allMeasDirs[i],true); } } } catch(Exception ex){ throw new ApplicationException("Zipfile creation error: "+ex.Message); } _w.Flush(); _w.Close(); #endregion Cateogry I QRDA Documents }
public override void WriteComment(string text) { EndCDataSection(); _wrapped.WriteComment(text); }
// Saves the node to the specified XmlWriter. public override void WriteTo(XmlWriter w) { w.WriteComment(Data); }
public bool SaveTheme(XmlWriter writer) { if (_ThemeLoaded) { writer.WriteStartElement(_Theme.Name); writer.WriteComment("<SkinLeft>: Texture name of note begin"); writer.WriteElementString("SkinLeft", _Theme.SkinLeftName); writer.WriteComment("<SkinMiddle>: Texture name of note middle"); writer.WriteElementString("SkinMiddle", _Theme.SkinMiddleName); writer.WriteComment("<SkinRight>: Texture name of note end"); writer.WriteElementString("SkinRight", _Theme.SkinRightName); writer.WriteComment("<SkinBackgroundLeft>: Texture name of note background begin"); writer.WriteElementString("SkinBackgroundLeft", _Theme.SkinBackgroundLeftName); writer.WriteComment("<SkinBackgroundMiddle>: Texture name of note background middle"); writer.WriteElementString("SkinBackgroundMiddle", _Theme.SkinBackgroundMiddleName); writer.WriteComment("<SkinBackgroundRight>: Texture name of note background right"); writer.WriteElementString("SkinBackgroundRight", _Theme.SkinBackgroundRightName); writer.WriteComment("<SkinGoldenStar>: Texture name of golden star"); writer.WriteElementString("SkinGoldenStar", _Theme.SkinGoldenStarName); writer.WriteComment("<SkinToneHelper>: Texture name of tone helper"); writer.WriteElementString("SkinToneHelper", _Theme.SkinToneHelperName); writer.WriteComment("<SkinPerfectNoteStar>: Texture name of perfect star"); writer.WriteElementString("SkinPerfectNoteStar", _Theme.SkinPerfectNoteStarName); writer.WriteComment("<BarPositions>"); writer.WriteComment(" <P$N$X>, <P$N$Y>, <P$N$Z>, <P$N$W>, <P$N$H>"); writer.WriteComment(" position, width and height of note bars: first index = player number; second index = num players seen on screen"); writer.WriteStartElement("BarPositions"); for (int numplayer = 0; numplayer < CSettings.MaxNumPlayer; numplayer++) { for (int player = 0; player < CSettings.MaxNumPlayer; player++) { if (player <= numplayer) { string target = "P" + (player + 1).ToString() + "N" + (numplayer + 1).ToString(); writer.WriteElementString(target + "X", _BarPos[player, numplayer].X.ToString("#0")); writer.WriteElementString(target + "Y", _BarPos[player, numplayer].Y.ToString("#0")); writer.WriteElementString(target + "Z", _BarPos[player, numplayer].Z.ToString("#0.00")); writer.WriteElementString(target + "W", _BarPos[player, numplayer].W.ToString("#0")); writer.WriteElementString(target + "H", _BarPos[player, numplayer].H.ToString("#0")); } } } writer.WriteEndElement(); //BarPositions writer.WriteEndElement(); return true; } return false; }