public static void SerializeMedicationDispenseSubstitutionComponent(Hl7.Fhir.Model.MedicationDispense.MedicationDispenseSubstitutionComponent 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.Type != null) { writer.WriteStartElement("type"); CodeableConceptSerializer.SerializeCodeableConcept(value.Type, writer, summary); writer.WriteEndElement(); } // Serialize element reason if (value.Reason != null && value.Reason.Count > 0) { writer.WriteStartArrayElement("reason"); foreach (var item in value.Reason) { writer.WriteStartArrayMember("reason"); CodeableConceptSerializer.SerializeCodeableConcept(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element responsibleParty if (value.ResponsibleParty != null && value.ResponsibleParty.Count > 0) { writer.WriteStartArrayElement("responsibleParty"); foreach (var item in value.ResponsibleParty) { writer.WriteStartArrayMember("responsibleParty"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeDocumentInformationEventComponent(DocumentInformation.DocumentInformationEventComponent 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 code if (value.Code != null && value.Code.Count > 0) { writer.WriteStartArrayElement("code"); foreach (var item in value.Code) { writer.WriteStartArrayMember("code"); CodeableConceptSerializer.SerializeCodeableConcept(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element period if (value.Period != null) { writer.WriteStartElement("period"); PeriodSerializer.SerializePeriod(value.Period, writer); writer.WriteEndElement(); } // Serialize element detail if (value.Detail != null && value.Detail.Count > 0) { writer.WriteStartArrayElement("detail"); foreach (var item in value.Detail) { writer.WriteStartArrayMember("detail"); ResourceReferenceSerializer.SerializeResourceReference(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeDocumentEventComponent(Hl7.Fhir.Model.Document.DocumentEventComponent 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 && value.Code.Count > 0) { writer.WriteStartArrayElement("code"); foreach (var item in value.Code) { writer.WriteStartArrayMember("code"); CodeableConceptSerializer.SerializeCodeableConcept(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element period if (value.Period != null) { writer.WriteStartElement("period"); PeriodSerializer.SerializePeriod(value.Period, writer, summary); writer.WriteEndElement(); } // Serialize element detail if (value.Detail != null && value.Detail.Count > 0) { writer.WriteStartArrayElement("detail"); foreach (var item in value.Detail) { writer.WriteStartArrayMember("detail"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeImmunizationProfileRecommendationProtocolComponent(Hl7.Fhir.Model.ImmunizationProfile.ImmunizationProfileRecommendationProtocolComponent 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 doseSequence if (value.DoseSequenceElement != null) { writer.WriteStartElement("doseSequence"); IntegerSerializer.SerializeInteger(value.DoseSequenceElement, writer, summary); writer.WriteEndElement(); } // Serialize element description if (value.DescriptionElement != null) { writer.WriteStartElement("description"); FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary); writer.WriteEndElement(); } // Serialize element authority if (value.Authority != null) { writer.WriteStartElement("authority"); ResourceReferenceSerializer.SerializeResourceReference(value.Authority, writer, summary); writer.WriteEndElement(); } // Serialize element series if (value.SeriesElement != null) { writer.WriteStartElement("series"); FhirStringSerializer.SerializeFhirString(value.SeriesElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
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 SerializeSpecimenTreatmentComponent(Hl7.Fhir.Model.Specimen.SpecimenTreatmentComponent 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 procedure if (value.Procedure != null) { writer.WriteStartElement("procedure"); CodeableConceptSerializer.SerializeCodeableConcept(value.Procedure, writer, summary); writer.WriteEndElement(); } // Serialize element additive if (value.Additive != null && value.Additive.Count > 0) { writer.WriteStartArrayElement("additive"); foreach (var item in value.Additive) { writer.WriteStartArrayMember("additive"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } 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 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 SerializePrescriptionDispenseComponent(Prescription.PrescriptionDispenseComponent 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 repeats if (value.Repeats != null) { writer.WriteStartElement("repeats"); IntegerSerializer.SerializeInteger(value.Repeats, writer); writer.WriteEndElement(); } // Serialize element quantity if (value.Quantity != null) { writer.WriteStartElement("quantity"); QuantitySerializer.SerializeQuantity(value.Quantity, writer); writer.WriteEndElement(); } // Serialize element dispenser if (value.Dispenser != null) { writer.WriteStartElement("dispenser"); ResourceReferenceSerializer.SerializeResourceReference(value.Dispenser, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeImmunizationReactionComponent(Hl7.Fhir.Model.Immunization.ImmunizationReactionComponent 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 date if (value.DateElement != null) { writer.WriteStartElement("date"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateElement, writer, summary); writer.WriteEndElement(); } // Serialize element detail if (value.Detail != null) { writer.WriteStartElement("detail"); ResourceReferenceSerializer.SerializeResourceReference(value.Detail, writer, summary); writer.WriteEndElement(); } // Serialize element reported if (value.ReportedElement != null) { writer.WriteStartElement("reported"); FhirBooleanSerializer.SerializeFhirBoolean(value.ReportedElement, 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 SerializeMessageDestinationComponent(Hl7.Fhir.Model.Message.MessageDestinationComponent 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 name if (value.NameElement != null) { writer.WriteStartElement("name"); FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary); writer.WriteEndElement(); } // Serialize element target if (value.Target != null) { writer.WriteStartElement("target"); ResourceReferenceSerializer.SerializeResourceReference(value.Target, writer, summary); writer.WriteEndElement(); } // Serialize element endpoint if (value.EndpointElement != null) { writer.WriteStartElement("endpoint"); FhirUriSerializer.SerializeFhirUri(value.EndpointElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
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 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(); }
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 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(); }
public static void SerializeProblemStageComponent(Hl7.Fhir.Model.Problem.ProblemStageComponent 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 summary if (value.Summary != null) { writer.WriteStartElement("summary"); CodeableConceptSerializer.SerializeCodeableConcept(value.Summary, writer); writer.WriteEndElement(); } // Serialize element assessment if (value.Assessment != null && value.Assessment.Count > 0) { writer.WriteStartArrayElement("assessment"); foreach (var item in value.Assessment) { writer.WriteStartArrayMember("assessment"); ResourceReferenceSerializer.SerializeResourceReference(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeProblemEvidenceComponent(Hl7.Fhir.Model.Problem.ProblemEvidenceComponent 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 code if (value.Code != null) { writer.WriteStartElement("code"); CodeableConceptSerializer.SerializeCodeableConcept(value.Code, writer); writer.WriteEndElement(); } // Serialize element details if (value.Details != null && value.Details.Count > 0) { writer.WriteStartArrayElement("details"); foreach (var item in value.Details) { writer.WriteStartArrayMember("details"); ResourceReferenceSerializer.SerializeResourceReference(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } 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(); }
public static void SerializeConditionStageComponent(Hl7.Fhir.Model.Condition.ConditionStageComponent 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 summary if (value.Summary != null) { writer.WriteStartElement("summary"); CodeableConceptSerializer.SerializeCodeableConcept(value.Summary, writer, summary); writer.WriteEndElement(); } // Serialize element assessment if (value.Assessment != null && value.Assessment.Count > 0) { writer.WriteStartArrayElement("assessment"); foreach (var item in value.Assessment) { writer.WriteStartArrayMember("assessment"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
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(); }
public static void SerializeVisitParticipantComponent(Hl7.Fhir.Model.Visit.VisitParticipantComponent value, IFhirWriter writer) { writer.WriteStartComplexContent(); // Serialize element _id if (value.LocalId != null) { writer.WritePrimitiveContents("_id", value.LocalId, XmlSerializationHint.Attribute); } // 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 type if (value.Type != null && value.Type.Count > 0) { writer.WriteStartArrayElement("type"); foreach (var item in value.Type) { writer.WriteStartArrayMember("type"); CodeableConceptSerializer.SerializeCodeableConcept(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element practitioner if (value.Practitioner != null) { writer.WriteStartElement("practitioner"); ResourceReferenceSerializer.SerializeResourceReference(value.Practitioner, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeProcedurePerformerComponent(Hl7.Fhir.Model.Procedure.ProcedurePerformerComponent 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 person if (value.Person != null) { writer.WriteStartElement("person"); ResourceReferenceSerializer.SerializeResourceReference(value.Person, writer, summary); writer.WriteEndElement(); } // Serialize element role if (value.Role != null) { writer.WriteStartElement("role"); CodeableConceptSerializer.SerializeCodeableConcept(value.Role, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeMedicationProductIngredientComponent(Hl7.Fhir.Model.Medication.MedicationProductIngredientComponent 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 item if (value.Item != null) { writer.WriteStartElement("item"); ResourceReferenceSerializer.SerializeResourceReference(value.Item, writer, summary); writer.WriteEndElement(); } // Serialize element amount if (value.Amount != null) { writer.WriteStartElement("amount"); RatioSerializer.SerializeRatio(value.Amount, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeVisitHospitalizationAccomodationComponent(Hl7.Fhir.Model.Visit.VisitHospitalizationAccomodationComponent value, IFhirWriter writer) { writer.WriteStartComplexContent(); // Serialize element _id if (value.LocalId != null) { writer.WritePrimitiveContents("_id", value.LocalId, XmlSerializationHint.Attribute); } // 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 bed if (value.Bed != null) { writer.WriteStartElement("bed"); ResourceReferenceSerializer.SerializeResourceReference(value.Bed, writer); writer.WriteEndElement(); } // Serialize element period if (value.Period != null) { writer.WriteStartElement("period"); PeriodSerializer.SerializePeriod(value.Period, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeEncounterLocationComponent(Hl7.Fhir.Model.Encounter.EncounterLocationComponent 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 location if (value.Location != null) { writer.WriteStartElement("location"); ResourceReferenceSerializer.SerializeResourceReference(value.Location, writer, summary); writer.WriteEndElement(); } // Serialize element period if (value.Period != null) { writer.WriteStartElement("period"); PeriodSerializer.SerializePeriod(value.Period, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
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 SerializeDocumentInformation(DocumentInformation 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 id if (value.Id != null) { writer.WriteStartElement("id"); IdentifierSerializer.SerializeIdentifier(value.Id, writer); writer.WriteEndElement(); } // Serialize element versionId if (value.VersionId != null) { writer.WriteStartElement("versionId"); IdentifierSerializer.SerializeIdentifier(value.VersionId, writer); writer.WriteEndElement(); } // Serialize element created if (value.Created != null) { writer.WriteStartElement("created"); InstantSerializer.SerializeInstant(value.Created, writer); writer.WriteEndElement(); } // Serialize element class if (value.Class != null) { writer.WriteStartElement("class"); CodingSerializer.SerializeCoding(value.Class, writer); writer.WriteEndElement(); } // Serialize element type if (value.Type != null) { writer.WriteStartElement("type"); CodeableConceptSerializer.SerializeCodeableConcept(value.Type, writer); writer.WriteEndElement(); } // Serialize element title if (value.Title != null) { writer.WriteStartElement("title"); FhirStringSerializer.SerializeFhirString(value.Title, writer); writer.WriteEndElement(); } // Serialize element confidentiality if (value.Confidentiality != null) { writer.WriteStartElement("confidentiality"); CodingSerializer.SerializeCoding(value.Confidentiality, writer); writer.WriteEndElement(); } // Serialize element subject if (value.Subject != null) { writer.WriteStartElement("subject"); ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer); writer.WriteEndElement(); } // Serialize element author if (value.Author != null && value.Author.Count > 0) { writer.WriteStartArrayElement("author"); foreach (var item in value.Author) { writer.WriteStartArrayMember("author"); ResourceReferenceSerializer.SerializeResourceReference(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element attester if (value.Attester != null && value.Attester.Count > 0) { writer.WriteStartArrayElement("attester"); foreach (var item in value.Attester) { writer.WriteStartArrayMember("attester"); DocumentInformationSerializer.SerializeDocumentInformationAttesterComponent(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element custodian if (value.Custodian != null) { writer.WriteStartElement("custodian"); ResourceReferenceSerializer.SerializeResourceReference(value.Custodian, writer); writer.WriteEndElement(); } // Serialize element event if (value.Event != null) { writer.WriteStartElement("event"); DocumentInformationSerializer.SerializeDocumentInformationEventComponent(value.Event, writer); writer.WriteEndElement(); } // Serialize element encounter if (value.Encounter != null) { writer.WriteStartElement("encounter"); ResourceReferenceSerializer.SerializeResourceReference(value.Encounter, writer); writer.WriteEndElement(); } // Serialize element facilityType if (value.FacilityType != null) { writer.WriteStartElement("facilityType"); CodeableConceptSerializer.SerializeCodeableConcept(value.FacilityType, writer); writer.WriteEndElement(); } // Serialize element practiceSetting if (value.PracticeSetting != null) { writer.WriteStartElement("practiceSetting"); CodeableConceptSerializer.SerializeCodeableConcept(value.PracticeSetting, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeObservation(Hl7.Fhir.Model.Observation value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("Observation"); 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 name if (value.Name != null && !summary) { writer.WriteStartElement("name"); CodeableConceptSerializer.SerializeCodeableConcept(value.Name, writer, summary); writer.WriteEndElement(); } // Serialize element value if (value.Value != null && !summary) { writer.WriteStartElement(SerializationUtil.BuildPolymorphicName("value", value.Value.GetType())); FhirSerializer.SerializeElement(value.Value, writer, summary); writer.WriteEndElement(); } // Serialize element interpretation if (value.Interpretation != null && !summary) { writer.WriteStartElement("interpretation"); CodeableConceptSerializer.SerializeCodeableConcept(value.Interpretation, writer, summary); writer.WriteEndElement(); } // Serialize element comments if (value.CommentsElement != null && !summary) { writer.WriteStartElement("comments"); FhirStringSerializer.SerializeFhirString(value.CommentsElement, writer, summary); writer.WriteEndElement(); } // Serialize element applies if (value.Applies != null && !summary) { writer.WriteStartElement(SerializationUtil.BuildPolymorphicName("applies", value.Applies.GetType())); FhirSerializer.SerializeElement(value.Applies, writer, summary); writer.WriteEndElement(); } // Serialize element issued if (value.IssuedElement != null && !summary) { writer.WriteStartElement("issued"); InstantSerializer.SerializeInstant(value.IssuedElement, writer, summary); writer.WriteEndElement(); } // Serialize element status if (value.StatusElement != null && !summary) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ObservationStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element reliability if (value.ReliabilityElement != null && !summary) { writer.WriteStartElement("reliability"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.Observation.ObservationReliability>(value.ReliabilityElement, writer, summary); writer.WriteEndElement(); } // Serialize element bodySite if (value.BodySite != null && !summary) { writer.WriteStartElement("bodySite"); CodeableConceptSerializer.SerializeCodeableConcept(value.BodySite, writer, summary); writer.WriteEndElement(); } // Serialize element method if (value.Method != null && !summary) { writer.WriteStartElement("method"); CodeableConceptSerializer.SerializeCodeableConcept(value.Method, writer, summary); writer.WriteEndElement(); } // Serialize element identifier if (value.Identifier != null && !summary) { writer.WriteStartElement("identifier"); IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary); writer.WriteEndElement(); } // Serialize element subject if (value.Subject != null && !summary) { writer.WriteStartElement("subject"); ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary); writer.WriteEndElement(); } // Serialize element performer if (value.Performer != null && !summary) { writer.WriteStartElement("performer"); ResourceReferenceSerializer.SerializeResourceReference(value.Performer, writer, summary); writer.WriteEndElement(); } // Serialize element referenceRange if (value.ReferenceRange != null && !summary && value.ReferenceRange.Count > 0) { writer.WriteStartArrayElement("referenceRange"); foreach (var item in value.ReferenceRange) { writer.WriteStartArrayMember("referenceRange"); ObservationSerializer.SerializeObservationReferenceRangeComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element component if (value.Component != null && !summary && value.Component.Count > 0) { writer.WriteStartArrayElement("component"); foreach (var item in value.Component) { writer.WriteStartArrayMember("component"); ObservationSerializer.SerializeObservationComponentComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeActivityDefinition(Hl7.Fhir.Model.ActivityDefinition 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 category if (value.Category != null) { writer.WriteStartElement("category"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ActivityDefinition.ActivityDefinitionCategory>(value.Category, writer); writer.WriteEndElement(); } // Serialize element code if (value.Code != null) { writer.WriteStartElement("code"); CodeableConceptSerializer.SerializeCodeableConcept(value.Code, writer); writer.WriteEndElement(); } // Serialize element timing if (value.Timing != null) { writer.WriteStartElement(SerializationUtil.BuildPolymorphicName("timing", value.Timing.GetType())); FhirSerializer.SerializeElement(value.Timing, writer); writer.WriteEndElement(); } // Serialize element location if (value.Location != null) { writer.WriteStartElement("location"); ResourceReferenceSerializer.SerializeResourceReference(value.Location, writer); writer.WriteEndElement(); } // Serialize element performer if (value.Performer != null && value.Performer.Count > 0) { writer.WriteStartArrayElement("performer"); foreach (var item in value.Performer) { writer.WriteStartArrayMember("performer"); ResourceReferenceSerializer.SerializeResourceReference(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element product if (value.Product != null) { writer.WriteStartElement("product"); ResourceReferenceSerializer.SerializeResourceReference(value.Product, writer); writer.WriteEndElement(); } // Serialize element quantity if (value.Quantity != null) { writer.WriteStartElement("quantity"); QuantitySerializer.SerializeQuantity(value.Quantity, writer); writer.WriteEndElement(); } // Serialize element details if (value.Details != null) { writer.WriteStartElement("details"); FhirStringSerializer.SerializeFhirString(value.Details, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }