Ejemplo n.º 1
0
        /// <summary>
        /// Graph <paramref name="o"/> onto <paramref name="s"/>
        /// </summary>
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result)
        {
            PDVFormatter qtyf = new PDVFormatter();

            qtyf.Host = this.Host;
            qtyf.Graph(s, o, result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Graphs <paramref name="o"/> onto <paramref name="s"/> storing result
        /// in <paramref name="result"/>
        /// </summary>
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result)
        {
            // Get a strongly typed instance of o
            PQ opq = o as PQ;

            // Output additional attributes
            // Since a PQ with null flavor derived can still have a unit
            // we only want to check for null flavors not derived
            if (opq.NullFlavor == null || opq.NullFlavor.Equals(NullFlavor.Derived))
            {
                if (opq.Unit != null)
                {
                    s.WriteAttributeString("unit", Util.ToWireFormat(opq.Unit));
                }
                if (opq.CodingRationale != null)
                {
                    s.WriteAttributeString("codingRationale", Util.ToWireFormat(opq.CodingRationale));
                }
            }

            // Output the PDV and QTY formatter helper data
            PDVFormatter pdvFormatter = new PDVFormatter();

            pdvFormatter.Host = this.Host;
            pdvFormatter.Graph(s, o, result);

            // Output the translations (if they exist)
            if (opq.Translation != null && (opq.NullFlavor == null || opq.NullFlavor.Equals(NullFlavor.Derived)))
            {
                foreach (var trans in opq.Translation)
                {
                    s.WriteStartElement("translation", "urn:hl7-org:v3");

                    // Graph
                    var hostResult = this.Host.Graph(s, trans);
                    result.Code = hostResult.Code;
                    result.AddResultDetail(hostResult.Details);

                    s.WriteEndElement();
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Graph <paramref name="o"/> onto <paramref name="s"/>
        /// </summary>
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result)
        {
            PDVFormatter qtyf = new PDVFormatter();

            qtyf.Host = this.Host;
            qtyf.Graph(s, o, result);

            CO instance = o as CO;

            // Code property
            if (instance.NullFlavor != null)
            {
                return;
            }
            if (instance.Code != null)
            {
                s.WriteStartElement("code", "urn:hl7-org:v3");
                var hostResult = this.Host.Graph(s, instance.Code);
                result.AddResultDetail(hostResult.Details);
                s.WriteEndElement();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Graphs <paramref name="o"/> onto <paramref name="s"/> storing result
        /// in <paramref name="result"/>
        /// </summary>
        public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result)
        {
            // Get a strongly typed instance of o
            MO omo = o as MO;

            // Output additional attributes
            // Since a MO with null flavor derived can still have a currency
            // we only want to check for null flavors not derived
            if (omo.NullFlavor == null || omo.NullFlavor.Equals(NullFlavor.Derived))
            {
                if (omo.Currency != null)
                {
                    s.WriteAttributeString("currency", Util.ToWireFormat(omo.Currency));
                }
            }

            // Output the PDV and QTY formatter helper data
            PDVFormatter pdvFormatter = new PDVFormatter();

            pdvFormatter.Host = this.Host;
            pdvFormatter.Graph(s, o, result);
        }