public static void SerializeDeviceCapabilitiesVirtualDeviceChannelMetricFacetComponent(Hl7.Fhir.Model.DeviceCapabilities.DeviceCapabilitiesVirtualDeviceChannelMetricFacetComponent value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

            // Serialize element _id
            if (value.LocalIdElement != null)
            {
                writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
            }

            // Serialize element extension
            if (value.Extension != null && !summary && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element code
            if (value.Code != null)
            {
                writer.WriteStartElement("code");
                CodeableConceptSerializer.SerializeCodeableConcept(value.Code, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element scale
            if (value.ScaleElement != null)
            {
                writer.WriteStartElement("scale");
                FhirDecimalSerializer.SerializeFhirDecimal(value.ScaleElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element key
            if (value.KeyElement != null)
            {
                writer.WriteStartElement("key");
                FhirStringSerializer.SerializeFhirString(value.KeyElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element info
            if (value.Info != null)
            {
                writer.WriteStartElement("info");
                DeviceCapabilitiesSerializer.SerializeDeviceCapabilitiesVirtualDeviceChannelMetricInfoComponent(value.Info, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Exemple #2
0
        public static void SerializeLocationPositionComponent(Hl7.Fhir.Model.Location.LocationPositionComponent value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

            // Serialize element _id
            if (value.LocalIdElement != null)
            {
                writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
            }

            // Serialize element extension
            if (value.Extension != null && !summary && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element longitude
            if (value.LongitudeElement != null)
            {
                writer.WriteStartElement("longitude");
                FhirDecimalSerializer.SerializeFhirDecimal(value.LongitudeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element latitude
            if (value.LatitudeElement != null)
            {
                writer.WriteStartElement("latitude");
                FhirDecimalSerializer.SerializeFhirDecimal(value.LatitudeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element altitude
            if (value.AltitudeElement != null)
            {
                writer.WriteStartElement("altitude");
                FhirDecimalSerializer.SerializeFhirDecimal(value.AltitudeElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Exemple #3
0
        public static void SerializeArray(Hl7.Fhir.Model.Array value, IFhirWriter writer)
        {
            writer.WriteStartComplexContent();

            // Serialize element extension
            if (value.Extension != null && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element _id
            if (value.LocalId != null)
            {
                writer.WriteStartElement("_id");
                IdSerializer.SerializeId(value.LocalId, writer);
                writer.WriteEndElement();
            }

            // Serialize element origin
            if (value.Origin != null)
            {
                writer.WriteStartElement("origin");
                QuantitySerializer.SerializeQuantity(value.Origin, writer);
                writer.WriteEndElement();
            }

            // Serialize element period
            if (value.Period != null)
            {
                writer.WriteStartElement("period");
                FhirDecimalSerializer.SerializeFhirDecimal(value.Period, writer);
                writer.WriteEndElement();
            }

            // Serialize element factor
            if (value.Factor != null)
            {
                writer.WriteStartElement("factor");
                FhirDecimalSerializer.SerializeFhirDecimal(value.Factor, writer);
                writer.WriteEndElement();
            }

            // Serialize element lowerLimit
            if (value.LowerLimit != null)
            {
                writer.WriteStartElement("lowerLimit");
                FhirDecimalSerializer.SerializeFhirDecimal(value.LowerLimit, writer);
                writer.WriteEndElement();
            }

            // Serialize element upperLimit
            if (value.UpperLimit != null)
            {
                writer.WriteStartElement("upperLimit");
                FhirDecimalSerializer.SerializeFhirDecimal(value.UpperLimit, writer);
                writer.WriteEndElement();
            }

            // Serialize element dimensions
            if (value.Dimensions != null)
            {
                writer.WriteStartElement("dimensions");
                IntegerSerializer.SerializeInteger(value.Dimensions, writer);
                writer.WriteEndElement();
            }

            // Serialize element data
            if (value.Data != null)
            {
                writer.WriteStartElement("data");
                FhirStringSerializer.SerializeFhirString(value.Data, writer);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeScheduleRepeatComponent(Hl7.Fhir.Model.Schedule.ScheduleRepeatComponent value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

            // Serialize element _id
            if (value.LocalIdElement != null)
            {
                writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
            }

            // Serialize element extension
            if (value.Extension != null && !summary && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element frequency
            if (value.FrequencyElement != null)
            {
                writer.WriteStartElement("frequency");
                IntegerSerializer.SerializeInteger(value.FrequencyElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element when
            if (value.WhenElement != null)
            {
                writer.WriteStartElement("when");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Schedule.EventTiming>(value.WhenElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element duration
            if (value.DurationElement != null)
            {
                writer.WriteStartElement("duration");
                FhirDecimalSerializer.SerializeFhirDecimal(value.DurationElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element units
            if (value.UnitsElement != null)
            {
                writer.WriteStartElement("units");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Schedule.UnitsOfTime>(value.UnitsElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element count
            if (value.CountElement != null)
            {
                writer.WriteStartElement("count");
                IntegerSerializer.SerializeInteger(value.CountElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element end
            if (value.EndElement != null)
            {
                writer.WriteStartElement("end");
                FhirDateTimeSerializer.SerializeFhirDateTime(value.EndElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Exemple #5
0
        public static void SerializeQuantity(Hl7.Fhir.Model.Quantity value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

            // Serialize element _id
            if (value.LocalIdElement != null)
            {
                writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
            }

            // Serialize element extension
            if (value.Extension != null && !summary && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element value
            if (value.ValueElement != null)
            {
                writer.WriteStartElement("value");
                FhirDecimalSerializer.SerializeFhirDecimal(value.ValueElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element comparator
            if (value.ComparatorElement != null)
            {
                writer.WriteStartElement("comparator");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Quantity.QuantityCompararator>(value.ComparatorElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element units
            if (value.UnitsElement != null)
            {
                writer.WriteStartElement("units");
                FhirStringSerializer.SerializeFhirString(value.UnitsElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element system
            if (value.SystemElement != null)
            {
                writer.WriteStartElement("system");
                FhirUriSerializer.SerializeFhirUri(value.SystemElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element code
            if (value.CodeElement != null)
            {
                writer.WriteStartElement("code");
                CodeSerializer.SerializeCode(value.CodeElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeSampledData(Hl7.Fhir.Model.SampledData value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

            // Serialize element _id
            if (value.LocalIdElement != null)
            {
                writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
            }

            // Serialize element extension
            if (value.Extension != null && !summary && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element origin
            if (value.Origin != null)
            {
                writer.WriteStartElement("origin");
                QuantitySerializer.SerializeQuantity(value.Origin, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element period
            if (value.PeriodElement != null)
            {
                writer.WriteStartElement("period");
                FhirDecimalSerializer.SerializeFhirDecimal(value.PeriodElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element factor
            if (value.FactorElement != null)
            {
                writer.WriteStartElement("factor");
                FhirDecimalSerializer.SerializeFhirDecimal(value.FactorElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element lowerLimit
            if (value.LowerLimitElement != null)
            {
                writer.WriteStartElement("lowerLimit");
                FhirDecimalSerializer.SerializeFhirDecimal(value.LowerLimitElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element upperLimit
            if (value.UpperLimitElement != null)
            {
                writer.WriteStartElement("upperLimit");
                FhirDecimalSerializer.SerializeFhirDecimal(value.UpperLimitElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element dimensions
            if (value.DimensionsElement != null)
            {
                writer.WriteStartElement("dimensions");
                IntegerSerializer.SerializeInteger(value.DimensionsElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element data
            if (value.DataElement != null)
            {
                writer.WriteStartElement("data");
                FhirStringSerializer.SerializeFhirString(value.DataElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeTest(Hl7.Fhir.Model.Test value, IFhirWriter writer)
        {
            writer.WriteStartRootObject("Test");
            writer.WriteStartComplexContent();

            // Serialize element extension
            if (value.Extension != null && value.Extension.Count > 0)
            {
                writer.WriteStartArrayElement("extension");
                foreach (var item in value.Extension)
                {
                    writer.WriteStartArrayMember("extension");
                    ExtensionSerializer.SerializeExtension(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element language
            if (value.Language != null)
            {
                writer.WriteStartElement("language");
                CodeSerializer.SerializeCode(value.Language, writer);
                writer.WriteEndElement();
            }

            // Serialize element text
            if (value.Text != null)
            {
                writer.WriteStartElement("text");
                NarrativeSerializer.SerializeNarrative(value.Text, writer);
                writer.WriteEndElement();
            }

            // Serialize element contained
            if (value.Contained != null && value.Contained.Count > 0)
            {
                writer.WriteStartArrayElement("contained");
                foreach (var item in value.Contained)
                {
                    writer.WriteStartArrayMember("contained");
                    FhirSerializer.SerializeResource(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element _id
            if (value.LocalId != null)
            {
                writer.WriteStartElement("_id");
                IdSerializer.SerializeId(value.LocalId, writer);
                writer.WriteEndElement();
            }

            // Serialize element stringErr
            if (value.StringErr != null && value.StringErr.Count > 0)
            {
                writer.WriteStartArrayElement("stringErr");
                foreach (var item in value.StringErr)
                {
                    writer.WriteStartArrayMember("stringErr");
                    FhirStringSerializer.SerializeFhirString(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element stringCorr
            if (value.StringCorr != null && value.StringCorr.Count > 0)
            {
                writer.WriteStartArrayElement("stringCorr");
                foreach (var item in value.StringCorr)
                {
                    writer.WriteStartArrayMember("stringCorr");
                    FhirStringSerializer.SerializeFhirString(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element booleanErr
            if (value.BooleanErr != null && value.BooleanErr.Count > 0)
            {
                writer.WriteStartArrayElement("booleanErr");
                foreach (var item in value.BooleanErr)
                {
                    writer.WriteStartArrayMember("booleanErr");
                    FhirBooleanSerializer.SerializeFhirBoolean(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element booleanCorr
            if (value.BooleanCorr != null && value.BooleanCorr.Count > 0)
            {
                writer.WriteStartArrayElement("booleanCorr");
                foreach (var item in value.BooleanCorr)
                {
                    writer.WriteStartArrayMember("booleanCorr");
                    FhirBooleanSerializer.SerializeFhirBoolean(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element integerErr
            if (value.IntegerErr != null && value.IntegerErr.Count > 0)
            {
                writer.WriteStartArrayElement("integerErr");
                foreach (var item in value.IntegerErr)
                {
                    writer.WriteStartArrayMember("integerErr");
                    IntegerSerializer.SerializeInteger(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element integerCorr
            if (value.IntegerCorr != null && value.IntegerCorr.Count > 0)
            {
                writer.WriteStartArrayElement("integerCorr");
                foreach (var item in value.IntegerCorr)
                {
                    writer.WriteStartArrayMember("integerCorr");
                    IntegerSerializer.SerializeInteger(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element decimalErr
            if (value.DecimalErr != null && value.DecimalErr.Count > 0)
            {
                writer.WriteStartArrayElement("decimalErr");
                foreach (var item in value.DecimalErr)
                {
                    writer.WriteStartArrayMember("decimalErr");
                    FhirDecimalSerializer.SerializeFhirDecimal(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element decimalCorr
            if (value.DecimalCorr != null && value.DecimalCorr.Count > 0)
            {
                writer.WriteStartArrayElement("decimalCorr");
                foreach (var item in value.DecimalCorr)
                {
                    writer.WriteStartArrayMember("decimalCorr");
                    FhirDecimalSerializer.SerializeFhirDecimal(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element b64Err
            if (value.B64Err != null && value.B64Err.Count > 0)
            {
                writer.WriteStartArrayElement("b64Err");
                foreach (var item in value.B64Err)
                {
                    writer.WriteStartArrayMember("b64Err");
                    Base64BinarySerializer.SerializeBase64Binary(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element b64Corr
            if (value.B64Corr != null && value.B64Corr.Count > 0)
            {
                writer.WriteStartArrayElement("b64Corr");
                foreach (var item in value.B64Corr)
                {
                    writer.WriteStartArrayMember("b64Corr");
                    Base64BinarySerializer.SerializeBase64Binary(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element instantErr
            if (value.InstantErr != null && value.InstantErr.Count > 0)
            {
                writer.WriteStartArrayElement("instantErr");
                foreach (var item in value.InstantErr)
                {
                    writer.WriteStartArrayMember("instantErr");
                    InstantSerializer.SerializeInstant(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element instantCorr
            if (value.InstantCorr != null && value.InstantCorr.Count > 0)
            {
                writer.WriteStartArrayElement("instantCorr");
                foreach (var item in value.InstantCorr)
                {
                    writer.WriteStartArrayMember("instantCorr");
                    InstantSerializer.SerializeInstant(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element uriErr
            if (value.UriErr != null && value.UriErr.Count > 0)
            {
                writer.WriteStartArrayElement("uriErr");
                foreach (var item in value.UriErr)
                {
                    writer.WriteStartArrayMember("uriErr");
                    FhirUriSerializer.SerializeFhirUri(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element uriCorr
            if (value.UriCorr != null && value.UriCorr.Count > 0)
            {
                writer.WriteStartArrayElement("uriCorr");
                foreach (var item in value.UriCorr)
                {
                    writer.WriteStartArrayMember("uriCorr");
                    FhirUriSerializer.SerializeFhirUri(item, writer);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element idrefSingle
            if (value.IdrefSingle != null)
            {
                writer.WriteStartElement("idrefSingle");
                IdRefSerializer.SerializeIdRef(value.IdrefSingle, writer);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
            writer.WriteEndRootObject();
        }
 internal static void SerializeElement(Element value, IFhirWriter writer, bool summary)
 {
     if (value.GetType() == typeof(Hl7.Fhir.Model.Address))
     {
         AddressSerializer.SerializeAddress((Hl7.Fhir.Model.Address)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Attachment))
     {
         AttachmentSerializer.SerializeAttachment((Hl7.Fhir.Model.Attachment)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Choice))
     {
         ChoiceSerializer.SerializeChoice((Hl7.Fhir.Model.Choice)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.CodeableConcept))
     {
         CodeableConceptSerializer.SerializeCodeableConcept((Hl7.Fhir.Model.CodeableConcept)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Coding))
     {
         CodingSerializer.SerializeCoding((Hl7.Fhir.Model.Coding)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Contact))
     {
         ContactSerializer.SerializeContact((Hl7.Fhir.Model.Contact)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Extension))
     {
         ExtensionSerializer.SerializeExtension((Hl7.Fhir.Model.Extension)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.HumanName))
     {
         HumanNameSerializer.SerializeHumanName((Hl7.Fhir.Model.HumanName)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Identifier))
     {
         IdentifierSerializer.SerializeIdentifier((Hl7.Fhir.Model.Identifier)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Narrative))
     {
         NarrativeSerializer.SerializeNarrative((Hl7.Fhir.Model.Narrative)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Period))
     {
         PeriodSerializer.SerializePeriod((Hl7.Fhir.Model.Period)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Quantity))
     {
         QuantitySerializer.SerializeQuantity((Hl7.Fhir.Model.Quantity)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Range))
     {
         RangeSerializer.SerializeRange((Hl7.Fhir.Model.Range)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Ratio))
     {
         RatioSerializer.SerializeRatio((Hl7.Fhir.Model.Ratio)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.ResourceReference))
     {
         ResourceReferenceSerializer.SerializeResourceReference((Hl7.Fhir.Model.ResourceReference)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.SampledData))
     {
         SampledDataSerializer.SerializeSampledData((Hl7.Fhir.Model.SampledData)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Schedule))
     {
         ScheduleSerializer.SerializeSchedule((Hl7.Fhir.Model.Schedule)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Base64Binary))
     {
         Base64BinarySerializer.SerializeBase64Binary((Hl7.Fhir.Model.Base64Binary)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.FhirBoolean))
     {
         FhirBooleanSerializer.SerializeFhirBoolean((Hl7.Fhir.Model.FhirBoolean)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Code))
     {
         CodeSerializer.SerializeCode((Hl7.Fhir.Model.Code)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Date))
     {
         DateSerializer.SerializeDate((Hl7.Fhir.Model.Date)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.FhirDateTime))
     {
         FhirDateTimeSerializer.SerializeFhirDateTime((Hl7.Fhir.Model.FhirDateTime)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.FhirDecimal))
     {
         FhirDecimalSerializer.SerializeFhirDecimal((Hl7.Fhir.Model.FhirDecimal)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Id))
     {
         IdSerializer.SerializeId((Hl7.Fhir.Model.Id)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.IdRef))
     {
         IdRefSerializer.SerializeIdRef((Hl7.Fhir.Model.IdRef)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Instant))
     {
         InstantSerializer.SerializeInstant((Hl7.Fhir.Model.Instant)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Integer))
     {
         IntegerSerializer.SerializeInteger((Hl7.Fhir.Model.Integer)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Oid))
     {
         OidSerializer.SerializeOid((Hl7.Fhir.Model.Oid)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.FhirString))
     {
         FhirStringSerializer.SerializeFhirString((Hl7.Fhir.Model.FhirString)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.FhirUri))
     {
         FhirUriSerializer.SerializeFhirUri((Hl7.Fhir.Model.FhirUri)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Uuid))
     {
         UuidSerializer.SerializeUuid((Hl7.Fhir.Model.Uuid)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.XHtml))
     {
         XHtmlSerializer.SerializeXHtml((Hl7.Fhir.Model.XHtml)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Age))
     {
         QuantitySerializer.SerializeQuantity((Hl7.Fhir.Model.Age)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Count))
     {
         QuantitySerializer.SerializeQuantity((Hl7.Fhir.Model.Count)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Distance))
     {
         QuantitySerializer.SerializeQuantity((Hl7.Fhir.Model.Distance)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Duration))
     {
         QuantitySerializer.SerializeQuantity((Hl7.Fhir.Model.Duration)value, writer, summary);
     }
     else if (value.GetType() == typeof(Hl7.Fhir.Model.Money))
     {
         QuantitySerializer.SerializeQuantity((Hl7.Fhir.Model.Money)value, writer, summary);
     }
     else
     {
         throw new Exception("Encountered unknown type " + value.GetType().Name);
     }
 }