protected virtual void WriteVR_Default(DicomDataset ds, DicomElement element, XmlWriter writer) { DicomVR dicomVr = element.ValueRepresentation; for (int index = 0; index < element.Count; index++) { writer.WriteStartElement(Constants.ATTRIBUTE_VALUE_NAME); WriteNumberAttrib(writer, index); if (dicomVr.Equals(DicomVR.AT)) { var atElement = ds.GetSingleValueOrDefault <DicomElement> (element.Tag, null); if (null != atElement) { var tagValue = atElement.Get <DicomTag> ( ); string stringValue = tagValue.ToString("J", null); writer.WriteString(stringValue); } else { writer.WriteString(string.Empty); } } else { writer.WriteString(GetTrimmedString(ds.GetValueOrDefault(element.Tag, index, string.Empty))); } writer.WriteEndElement( ); } }
private bool MatchVr(DicomItem element) { DicomVR elementVr = element.ValueRepresentation; if (!elementVr.Equals(DicomVR.DA) && !elementVr.Equals(DicomVR.TM) && !elementVr.Equals(DicomVR.DT)) { return(false); } if (HasWildcardMatching(element.ToString( ))) { return(false); } return(true); }