Example #1
0
        public static void SerializeContact(Hl7.Fhir.Model.Contact 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 system
            if (value.SystemElement != null)
            {
                writer.WriteStartElement("system");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Contact.ContactSystem>(value.SystemElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element use
            if (value.UseElement != null)
            {
                writer.WriteStartElement("use");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Contact.ContactUse>(value.UseElement, writer, summary);
                writer.WriteEndElement();
            }

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


            writer.WriteEndComplexContent();
        }
Example #2
0
        public static void SerializeAdverseReactionExposureComponent(Hl7.Fhir.Model.AdverseReaction.AdverseReactionExposureComponent 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 exposureDate
            if (value.ExposureDateElement != null)
            {
                writer.WriteStartElement("exposureDate");
                FhirDateTimeSerializer.SerializeFhirDateTime(value.ExposureDateElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element exposureType
            if (value.ExposureTypeElement != null)
            {
                writer.WriteStartElement("exposureType");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.AdverseReaction.ExposureType>(value.ExposureTypeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element causalityExpectation
            if (value.CausalityExpectationElement != null)
            {
                writer.WriteStartElement("causalityExpectation");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.AdverseReaction.CausalityExpectation>(value.CausalityExpectationElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element substance
            if (value.Substance != null)
            {
                writer.WriteStartElement("substance");
                ResourceReferenceSerializer.SerializeResourceReference(value.Substance, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeFood(Food value, IFhirWriter writer)
        {
            writer.WriteStartRootObject("Food");
            writer.WriteStartComplexContent();

            // Serialize element's localId attribute
            if (value.InternalId != null && !String.IsNullOrEmpty(value.InternalId.Contents))
            {
                writer.WriteRefIdContents(value.InternalId.Contents);
            }

            // 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();
            }


            writer.WriteEndComplexContent();
            writer.WriteEndRootObject();
        }
        public static void SerializeCode <T>(Code <T> value, IFhirWriter writer, bool summary) where T : struct
        {
            Code c = new Code(value.ToString());

            c.Extension = value.Extension;
            c.LocalId   = value.LocalId;

            CodeSerializer.SerializeCode(c, writer, summary);
        }
Example #5
0
        public static void SerializeInterestOfCare(Hl7.Fhir.Model.InterestOfCare value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartRootObject("InterestOfCare");
            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 language
            if (value.LanguageElement != null && !summary)
            {
                writer.WriteStartElement("language");
                CodeSerializer.SerializeCode(value.LanguageElement, writer, summary);
                writer.WriteEndElement();
            }

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

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


            writer.WriteEndComplexContent();
            writer.WriteEndRootObject();
        }
Example #6
0
        public static void SerializeDeviceLogItemComponent(Hl7.Fhir.Model.DeviceLog.DeviceLogItemComponent 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 key
            if (value.KeyElement != null)
            {
                writer.WriteStartElement("key");
                FhirStringSerializer.SerializeFhirString(value.KeyElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element flag
            if (value.FlagElement != null && value.FlagElement.Count > 0)
            {
                writer.WriteStartArrayElement("flag");
                foreach (var item in value.FlagElement)
                {
                    writer.WriteStartArrayMember("flag");
                    CodeSerializer.SerializeCode <Hl7.Fhir.Model.DeviceLog.DeviceValueFlag>(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }


            writer.WriteEndComplexContent();
        }
Example #7
0
        public static void SerializeChoice(Hl7.Fhir.Model.Choice 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.CodeElement != null)
            {
                writer.WriteStartElement("code");
                CodeSerializer.SerializeCode(value.CodeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element option
            if (value.Option != null && value.Option.Count > 0)
            {
                writer.WriteStartArrayElement("option");
                foreach (var item in value.Option)
                {
                    writer.WriteStartArrayMember("option");
                    ChoiceSerializer.SerializeChoiceOptionComponent(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element isOrdered
            if (value.IsOrderedElement != null)
            {
                writer.WriteStartElement("isOrdered");
                FhirBooleanSerializer.SerializeFhirBoolean(value.IsOrderedElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeProblemRelatedItemComponent(Hl7.Fhir.Model.Problem.ProblemRelatedItemComponent 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 type
            if (value.Type != null)
            {
                writer.WriteStartElement("type");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Problem.ProblemRelationshipType>(value.Type, writer);
                writer.WriteEndElement();
            }

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

            // Serialize element target
            if (value.Target != null)
            {
                writer.WriteStartElement("target");
                ResourceReferenceSerializer.SerializeResourceReference(value.Target, writer);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeConceptSetFilterComponent(Hl7.Fhir.Model.ValueSet.ConceptSetFilterComponent 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 property
            if (value.PropertyElement != null)
            {
                writer.WriteStartElement("property");
                CodeSerializer.SerializeCode(value.PropertyElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element op
            if (value.OpElement != null)
            {
                writer.WriteStartElement("op");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.ValueSet.FilterOperator>(value.OpElement, writer, summary);
                writer.WriteEndElement();
            }

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


            writer.WriteEndComplexContent();
        }
        public static void SerializeMessageResponseComponent(Hl7.Fhir.Model.Message.MessageResponseComponent 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 identifier
            if (value.IdentifierElement != null)
            {
                writer.WriteStartElement("identifier");
                IdSerializer.SerializeId(value.IdentifierElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element code
            if (value.CodeElement != null)
            {
                writer.WriteStartElement("code");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Message.ResponseCode>(value.CodeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element details
            if (value.Details != null)
            {
                writer.WriteStartElement("details");
                ResourceReferenceSerializer.SerializeResourceReference(value.Details, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeCarePlanGoalComponent(Hl7.Fhir.Model.CarePlan.CarePlanGoalComponent 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 description
            if (value.DescriptionElement != null)
            {
                writer.WriteStartElement("description");
                FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element status
            if (value.StatusElement != null)
            {
                writer.WriteStartElement("status");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.CarePlan.CarePlanGoalStatus>(value.StatusElement, writer, summary);
                writer.WriteEndElement();
            }

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


            writer.WriteEndComplexContent();
        }
Example #12
0
        public static void SerializeResourceReference(Hl7.Fhir.Model.ResourceReference 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 type
            if (value.TypeElement != null)
            {
                writer.WriteStartElement("type");
                CodeSerializer.SerializeCode(value.TypeElement, writer, summary);
                writer.WriteEndElement();
            }

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

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


            writer.WriteEndComplexContent();
        }
        public static void SerializeConformanceDocumentComponent(Hl7.Fhir.Model.Conformance.ConformanceDocumentComponent 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 mode
            if (value.ModeElement != null)
            {
                writer.WriteStartElement("mode");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Conformance.DocumentMode>(value.ModeElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element profile
            if (value.Profile != null)
            {
                writer.WriteStartElement("profile");
                ResourceReferenceSerializer.SerializeResourceReference(value.Profile, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeDocumentInformationAttesterComponent(DocumentInformation.DocumentInformationAttesterComponent value, IFhirWriter writer)
        {
            writer.WriteStartComplexContent();

            // Serialize element's localId attribute
            if (value.InternalId != null && !String.IsNullOrEmpty(value.InternalId.Contents))
            {
                writer.WriteRefIdContents(value.InternalId.Contents);
            }

            // 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 mode
            if (value.Mode != null)
            {
                writer.WriteStartElement("mode");
                CodeSerializer.SerializeCode <DocumentInformation.DocumentAttestationMode>(value.Mode, writer);
                writer.WriteEndElement();
            }

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

            // Serialize element party
            if (value.Party != null)
            {
                writer.WriteStartElement("party");
                ResourceReferenceSerializer.SerializeResourceReference(value.Party, writer);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeElementSlicingComponent(Hl7.Fhir.Model.Profile.ElementSlicingComponent 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 discriminator
            if (value.DiscriminatorElement != null)
            {
                writer.WriteStartElement("discriminator");
                IdSerializer.SerializeId(value.DiscriminatorElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element ordered
            if (value.OrderedElement != null)
            {
                writer.WriteStartElement("ordered");
                FhirBooleanSerializer.SerializeFhirBoolean(value.OrderedElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element rules
            if (value.RulesElement != null)
            {
                writer.WriteStartElement("rules");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Profile.SlicingRules>(value.RulesElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Example #16
0
        public static void SerializeDiagnosticOrderEventComponent(Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderEventComponent 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 status
            if (value.StatusElement != null)
            {
                writer.WriteStartElement("status");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.DiagnosticOrder.DiagnosticOrderStatus>(value.StatusElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element actor
            if (value.Actor != null)
            {
                writer.WriteStartElement("actor");
                ResourceReferenceSerializer.SerializeResourceReference(value.Actor, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Example #17
0
        public static void SerializeDocumentAttesterComponent(Hl7.Fhir.Model.Document.DocumentAttesterComponent 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 mode
            if (value.ModeElement != null)
            {
                writer.WriteStartElement("mode");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Document.DocumentAttestationMode>(value.ModeElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element party
            if (value.Party != null)
            {
                writer.WriteStartElement("party");
                ResourceReferenceSerializer.SerializeResourceReference(value.Party, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Example #18
0
        public static void SerializeConditionRelatedItemComponent(Hl7.Fhir.Model.Condition.ConditionRelatedItemComponent 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 type
            if (value.TypeElement != null)
            {
                writer.WriteStartElement("type");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Condition.ConditionRelationshipType>(value.TypeElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element target
            if (value.Target != null)
            {
                writer.WriteStartElement("target");
                ResourceReferenceSerializer.SerializeResourceReference(value.Target, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeTypeRefComponent(Hl7.Fhir.Model.Profile.TypeRefComponent 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.CodeElement != null)
            {
                writer.WriteStartElement("code");
                CodeSerializer.SerializeCode(value.CodeElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element bundled
            if (value.BundledElement != null)
            {
                writer.WriteStartElement("bundled");
                FhirBooleanSerializer.SerializeFhirBoolean(value.BundledElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeEncounterParticipantComponent(Hl7.Fhir.Model.Encounter.EncounterParticipantComponent 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 type
            if (value.TypeElement != null && value.TypeElement.Count > 0)
            {
                writer.WriteStartArrayElement("type");
                foreach (var item in value.TypeElement)
                {
                    writer.WriteStartArrayMember("type");
                    CodeSerializer.SerializeCode <Hl7.Fhir.Model.Encounter.ParticipantType>(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element practitioner
            if (value.Practitioner != null)
            {
                writer.WriteStartElement("practitioner");
                ResourceReferenceSerializer.SerializeResourceReference(value.Practitioner, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Example #21
0
        public static void SerializeSpecimenSourceComponent(Hl7.Fhir.Model.Specimen.SpecimenSourceComponent 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 relationship
            if (value.RelationshipElement != null)
            {
                writer.WriteStartElement("relationship");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Specimen.HierarchicalRelationshipType>(value.RelationshipElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element target
            if (value.Target != null && value.Target.Count > 0)
            {
                writer.WriteStartArrayElement("target");
                foreach (var item in value.Target)
                {
                    writer.WriteStartArrayMember("target");
                    ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }


            writer.WriteEndComplexContent();
        }
Example #22
0
        public static void SerializeStudyTreatmentComponent(Hl7.Fhir.Model.Study.StudyTreatmentComponent 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 role
            if (value.Role != null)
            {
                writer.WriteStartElement("role");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Study.StudyTreatmentRole>(value.Role, writer);
                writer.WriteEndElement();
            }

            // Serialize element detail
            if (value.Detail != null)
            {
                writer.WriteStartElement("detail");
                ActivityDefinitionSerializer.SerializeActivityDefinition(value.Detail, writer);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Example #23
0
        public static void SerializeAdverseReactionSymptomComponent(Hl7.Fhir.Model.AdverseReaction.AdverseReactionSymptomComponent 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 severity
            if (value.SeverityElement != null)
            {
                writer.WriteStartElement("severity");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.AdverseReaction.ReactionSeverity>(value.SeverityElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeConformanceRestSecurityCertificateComponent(Hl7.Fhir.Model.Conformance.ConformanceRestSecurityCertificateComponent 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 type
            if (value.TypeElement != null)
            {
                writer.WriteStartElement("type");
                CodeSerializer.SerializeCode(value.TypeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element blob
            if (value.BlobElement != null)
            {
                writer.WriteStartElement("blob");
                Base64BinarySerializer.SerializeBase64Binary(value.BlobElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeSecurityEventParticipantNetworkComponent(Hl7.Fhir.Model.SecurityEvent.SecurityEventParticipantNetworkComponent 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 identifier
            if (value.IdentifierElement != null)
            {
                writer.WriteStartElement("identifier");
                FhirStringSerializer.SerializeFhirString(value.IdentifierElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element type
            if (value.TypeElement != null)
            {
                writer.WriteStartElement("type");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.SecurityEvent.SecurityEventParticipantNetworkType>(value.TypeElement, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeNarrative(Hl7.Fhir.Model.Narrative 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 status
            if (value.StatusElement != null)
            {
                writer.WriteStartElement("status");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Narrative.NarrativeStatus>(value.StatusElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element div
            if (value.DivElement != null)
            {
                writer.WritePrimitiveContents("div", value.DivElement, XmlSerializationHint.XhtmlElement);
            }


            writer.WriteEndComplexContent();
        }
        public static void SerializeOperationOutcomeIssueComponent(Hl7.Fhir.Model.OperationOutcome.OperationOutcomeIssueComponent 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 severity
            if (value.SeverityElement != null)
            {
                writer.WriteStartElement("severity");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.OperationOutcome.IssueSeverity>(value.SeverityElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element type
            if (value.Type != null)
            {
                writer.WriteStartElement("type");
                CodingSerializer.SerializeCoding(value.Type, writer, summary);
                writer.WriteEndElement();
            }

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

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


            writer.WriteEndComplexContent();
        }
        public static void SerializeProfileExtensionDefnComponent(Hl7.Fhir.Model.Profile.ProfileExtensionDefnComponent 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.CodeElement != null)
            {
                writer.WriteStartElement("code");
                CodeSerializer.SerializeCode(value.CodeElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element contextType
            if (value.ContextTypeElement != null)
            {
                writer.WriteStartElement("contextType");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Profile.ExtensionContext>(value.ContextTypeElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element definition
            if (value.Definition != null)
            {
                writer.WriteStartElement("definition");
                ProfileSerializer.SerializeElementDefinitionComponent(value.Definition, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
        }
Example #29
0
        public static void SerializeMedia(Hl7.Fhir.Model.Media value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartRootObject("Media");
            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 language
            if (value.LanguageElement != null && !summary)
            {
                writer.WriteStartElement("language");
                CodeSerializer.SerializeCode(value.LanguageElement, writer, summary);
                writer.WriteEndElement();
            }

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

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

            // Serialize element type
            if (value.TypeElement != null)
            {
                writer.WriteStartElement("type");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Media.MediaType>(value.TypeElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element identifier
            if (value.Identifier != null && value.Identifier.Count > 0)
            {
                writer.WriteStartArrayElement("identifier");
                foreach (var item in value.Identifier)
                {
                    writer.WriteStartArrayMember("identifier");
                    IdentifierSerializer.SerializeIdentifier(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

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

            // Serialize element subject
            if (value.Subject != null)
            {
                writer.WriteStartElement("subject");
                ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element requester
            if (value.Requester != null)
            {
                writer.WriteStartElement("requester");
                ResourceReferenceSerializer.SerializeResourceReference(value.Requester, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element operator
            if (value.Operator != null)
            {
                writer.WriteStartElement("operator");
                ResourceReferenceSerializer.SerializeResourceReference(value.Operator, writer, summary);
                writer.WriteEndElement();
            }

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

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

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

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

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

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

            // Serialize element content
            if (value.Content != null && !summary)
            {
                writer.WriteStartElement("content");
                AttachmentSerializer.SerializeAttachment(value.Content, writer, summary);
                writer.WriteEndElement();
            }


            writer.WriteEndComplexContent();
            writer.WriteEndRootObject();
        }
        public static void SerializeElementDefinitionConstraintComponent(Hl7.Fhir.Model.Profile.ElementDefinitionConstraintComponent 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 key
            if (value.KeyElement != null)
            {
                writer.WriteStartElement("key");
                IdSerializer.SerializeId(value.KeyElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element severity
            if (value.SeverityElement != null)
            {
                writer.WriteStartElement("severity");
                CodeSerializer.SerializeCode <Hl7.Fhir.Model.Profile.ConstraintSeverity>(value.SeverityElement, writer, summary);
                writer.WriteEndElement();
            }

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

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

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


            writer.WriteEndComplexContent();
        }