예제 #1
0
        /// <summary>
        /// Serialize DVT Detail Data to Xml.
        /// </summary>
        /// <param name="streamWriter">Stream writer to serialize to.</param>
        /// <param name="level">Recursion level. 0 = Top.</param>
        /// <returns>bool - success/failure</returns>
        public bool DvtDetailToXml(StreamWriter streamWriter, int level)
        {
            foreach (System.String value in this)
            {
                streamWriter.WriteLine("<Value>{0}</Value>", DvtToXml.ConvertString(value));
            }

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Serialize DVT Detail Data to Xml.
        /// </summary>
        /// <param name="streamWriter">Stream writer to serialize to.</param>
        /// <param name="level">Recursion level. 0 = Top.</param>
        /// <returns>bool - success/failure</returns>
        public bool DvtDetailToXml(StreamWriter streamWriter, int level)
        {
            foreach (System.String value in this)
            {
                streamWriter.WriteLine("<Value>{0}</Value>", DvtToXml.ConvertString(value, true));

                // try to convert the string to Unicode - if possible
                if (_dicomUnicodeConverter != null)
                {
                    String outString = DvtToXml.ConvertStringToXmlUnicode(_dicomUnicodeConverter, value);
                    if (outString != String.Empty)
                    {
                        streamWriter.WriteLine("<Unicode>{0}</Unicode>", outString);
                    }
                }
            }

            return(true);
        }
예제 #3
0
 /// <summary>
 /// Serialize DVT Detail Data to Xml.
 /// </summary>
 /// <param name="streamWriter">Stream writer to serialize to.</param>
 /// <param name="level">Recursion level. 0 = Top.</param>
 /// <returns>bool - success/failure</returns>
 public bool DvtDetailToXml(StreamWriter streamWriter, int level)
 {
     if (streamWriter != null)
     {
         streamWriter.WriteLine("<AttributeComparisonResults>");
         string group = _Tag.GroupNumber.ToString("X");
         while (group.Length < 4)
         {
             group = "0" + group;
         }
         string element = _Tag.ElementNumber.ToString("X");
         while (element.Length < 4)
         {
             element = "0" + element;
         }
         streamWriter.WriteLine("<AttributeComparison Id=\"({0},{1})\" Name=\"{2}\">", group, element, DvtToXml.ConvertString(_Name));
         streamWriter.WriteLine("<Value1>{0}</Value1>", _Value1);
         streamWriter.WriteLine("<Value2>{0}</Value2>", _Value2);
         streamWriter.WriteLine("</AttributeComparison>");
         Messages.DvtDetailToXml(streamWriter, level);
         streamWriter.WriteLine("</AttributeComparisonResults>");
     }
     return(true);
 }
예제 #4
0
        /// <summary>
        /// Serialize DVT Summary Data to Xml.
        /// </summary>
        /// <param name="streamWriter">Stream writer to serialize to.</param>
        /// <param name="level">Recursion level. 0 = Top.</param>
        /// <returns>bool - success/failure</returns>
        public bool DvtSummaryToXml(StreamWriter streamWriter, int level)
        {
            if (
                (streamWriter != null) &&
                this.ContainsMessages()
                )
            {
                System.String dicomTag = System.String.Empty;
                if (_tag != Tag.UNDEFINED)
                {
                    string group   = _tag.GroupNumber.ToString("X").PadLeft(4, '0');
                    string element = _tag.ElementNumber.ToString("X").PadLeft(4, '0');
                    dicomTag = System.String.Format("({0},{1})", group, element);
                }

                System.String hl7Tag = System.String.Empty;
                if (_segment != System.String.Empty)
                {
                    hl7Tag = System.String.Format("{0}-{1}", _segment, _fieldIndex);
                }

                System.String id = System.String.Empty;

                if ((dicomTag != System.String.Empty) &&
                    (hl7Tag != System.String.Empty))
                {
                    id = hl7Tag + "=" + dicomTag;
                }
                else if (dicomTag != System.String.Empty)
                {
                    id = dicomTag;
                }
                else if (hl7Tag != System.String.Empty)
                {
                    id = hl7Tag;
                }

                streamWriter.WriteLine("<AttributeComparisonResults>");
                streamWriter.WriteLine("<AttributeComparison Id=\"{0}\" Name=\"{1}\">", id, DvtToXml.ConvertString(_name, false));
                streamWriter.WriteLine("<Value1>{0}</Value1>", _value1);
                streamWriter.WriteLine("<Value2>{0}</Value2>", _value2);
                streamWriter.WriteLine("</AttributeComparison>");
                Messages.DvtDetailToXml(streamWriter, level);
                streamWriter.WriteLine("</AttributeComparisonResults>");
            }
            return(true);
        }