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 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 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 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 SerializeConformanceSoftwareComponent(Hl7.Fhir.Model.Conformance.ConformanceSoftwareComponent 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 version if (value.VersionElement != null) { writer.WriteStartElement("version"); FhirStringSerializer.SerializeFhirString(value.VersionElement, writer, summary); writer.WriteEndElement(); } // Serialize element releaseDate if (value.ReleaseDateElement != null) { writer.WriteStartElement("releaseDate"); FhirDateTimeSerializer.SerializeFhirDateTime(value.ReleaseDateElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeImmunizationProfileRecommendationDateCriterionComponent(Hl7.Fhir.Model.ImmunizationProfile.ImmunizationProfileRecommendationDateCriterionComponent 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 value if (value.ValueElement != null) { writer.WriteStartElement("value"); FhirDateTimeSerializer.SerializeFhirDateTime(value.ValueElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializePeriod(Hl7.Fhir.Model.Period 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 start if (value.StartElement != null) { writer.WriteStartElement("start"); FhirDateTimeSerializer.SerializeFhirDateTime(value.StartElement, writer, summary); writer.WriteEndElement(); } // Serialize element end if (value.EndElement != null) { writer.WriteStartElement("end"); FhirDateTimeSerializer.SerializeFhirDateTime(value.EndElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeXdsEntryServiceComponent(XdsEntry.XdsEntryServiceComponent 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 start if (value.Start != null) { writer.WriteStartElement("start"); FhirDateTimeSerializer.SerializeFhirDateTime(value.Start, writer); writer.WriteEndElement(); } // Serialize element stop if (value.Stop != null) { writer.WriteStartElement("stop"); FhirDateTimeSerializer.SerializeFhirDateTime(value.Stop, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeQuestionnaire(Hl7.Fhir.Model.Questionnaire value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("Questionnaire"); 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 status if (value.StatusElement != null) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ObservationStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element authored if (value.AuthoredElement != null) { writer.WriteStartElement("authored"); FhirDateTimeSerializer.SerializeFhirDateTime(value.AuthoredElement, writer, summary); writer.WriteEndElement(); } // Serialize element subject if (value.Subject != null) { writer.WriteStartElement("subject"); ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary); writer.WriteEndElement(); } // Serialize element author if (value.Author != null) { writer.WriteStartElement("author"); ResourceReferenceSerializer.SerializeResourceReference(value.Author, writer, summary); writer.WriteEndElement(); } // Serialize element source if (value.Source != null) { writer.WriteStartElement("source"); ResourceReferenceSerializer.SerializeResourceReference(value.Source, writer, summary); writer.WriteEndElement(); } // Serialize element name if (value.Name != null) { writer.WriteStartElement("name"); CodeableConceptSerializer.SerializeCodeableConcept(value.Name, writer, summary); writer.WriteEndElement(); } // Serialize element identifier if (value.Identifier != null) { writer.WriteStartElement("identifier"); IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary); writer.WriteEndElement(); } // Serialize element encounter if (value.Encounter != null) { writer.WriteStartElement("encounter"); ResourceReferenceSerializer.SerializeResourceReference(value.Encounter, writer, summary); writer.WriteEndElement(); } // Serialize element question if (value.Question != null && !summary && value.Question.Count > 0) { writer.WriteStartArrayElement("question"); foreach (var item in value.Question) { writer.WriteStartArrayMember("question"); QuestionnaireSerializer.SerializeQuestionComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element group if (value.Group != null && !summary && value.Group.Count > 0) { writer.WriteStartArrayElement("group"); foreach (var item in value.Group) { writer.WriteStartArrayMember("group"); QuestionnaireSerializer.SerializeGroupComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeAdverseReaction(Hl7.Fhir.Model.AdverseReaction value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("AdverseReaction"); 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 reactionDate if (value.ReactionDateElement != null && !summary) { writer.WriteStartElement("reactionDate"); FhirDateTimeSerializer.SerializeFhirDateTime(value.ReactionDateElement, 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 didNotOccurFlag if (value.DidNotOccurFlagElement != null && !summary) { writer.WriteStartElement("didNotOccurFlag"); FhirBooleanSerializer.SerializeFhirBoolean(value.DidNotOccurFlagElement, writer, summary); writer.WriteEndElement(); } // Serialize element recorder if (value.Recorder != null && !summary) { writer.WriteStartElement("recorder"); ResourceReferenceSerializer.SerializeResourceReference(value.Recorder, writer, summary); writer.WriteEndElement(); } // Serialize element symptom if (value.Symptom != null && !summary && value.Symptom.Count > 0) { writer.WriteStartArrayElement("symptom"); foreach (var item in value.Symptom) { writer.WriteStartArrayMember("symptom"); AdverseReactionSerializer.SerializeAdverseReactionSymptomComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element exposure if (value.Exposure != null && !summary && value.Exposure.Count > 0) { writer.WriteStartArrayElement("exposure"); foreach (var item in value.Exposure) { writer.WriteStartArrayMember("exposure"); AdverseReactionSerializer.SerializeAdverseReactionExposureComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializePrescription(Prescription value, IFhirWriter writer) { writer.WriteStartRootObject("Prescription"); 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(); } // 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); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element status if (value.Status != null) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Prescription.PrescriptionStatus>(value.Status, writer); writer.WriteEndElement(); } // Serialize element patient if (value.Patient != null) { writer.WriteStartElement("patient"); ResourceReferenceSerializer.SerializeResourceReference(value.Patient, writer); writer.WriteEndElement(); } // Serialize element prescriber if (value.Prescriber != null) { writer.WriteStartElement("prescriber"); ResourceReferenceSerializer.SerializeResourceReference(value.Prescriber, writer); writer.WriteEndElement(); } // Serialize element prescribed if (value.Prescribed != null) { writer.WriteStartElement("prescribed"); FhirDateTimeSerializer.SerializeFhirDateTime(value.Prescribed, writer); writer.WriteEndElement(); } // Serialize element dispense if (value.Dispense != null) { writer.WriteStartElement("dispense"); PrescriptionSerializer.SerializePrescriptionDispenseComponent(value.Dispense, writer); writer.WriteEndElement(); } // Serialize element medicine if (value.Medicine != null) { writer.WriteStartElement("medicine"); PrescriptionSerializer.SerializePrescriptionMedicineComponent(value.Medicine, writer); writer.WriteEndElement(); } // Serialize element administrationRequest if (value.AdministrationRequest != null) { writer.WriteStartElement("administrationRequest"); PrescriptionSerializer.SerializePrescriptionAdministrationRequestComponent(value.AdministrationRequest, writer); writer.WriteEndElement(); } // Serialize element reason if (value.Reason != null) { writer.WriteStartElement("reason"); CodeableConceptSerializer.SerializeCodeableConcept(value.Reason, writer); writer.WriteEndElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeDocumentReference(Hl7.Fhir.Model.DocumentReference value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("DocumentReference"); 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 masterIdentifier if (value.MasterIdentifier != null && !summary) { writer.WriteStartElement("masterIdentifier"); IdentifierSerializer.SerializeIdentifier(value.MasterIdentifier, writer, summary); writer.WriteEndElement(); } // Serialize element identifier if (value.Identifier != null && !summary && 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 subject if (value.Subject != null && !summary) { writer.WriteStartElement("subject"); ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary); writer.WriteEndElement(); } // Serialize element type if (value.Type != null && !summary) { writer.WriteStartElement("type"); CodeableConceptSerializer.SerializeCodeableConcept(value.Type, writer, summary); writer.WriteEndElement(); } // Serialize element subtype if (value.Subtype != null && !summary) { writer.WriteStartElement("subtype"); CodeableConceptSerializer.SerializeCodeableConcept(value.Subtype, writer, summary); writer.WriteEndElement(); } // Serialize element author if (value.Author != null && !summary && value.Author.Count > 0) { writer.WriteStartArrayElement("author"); foreach (var item in value.Author) { writer.WriteStartArrayMember("author"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element custodian if (value.Custodian != null && !summary) { writer.WriteStartElement("custodian"); ResourceReferenceSerializer.SerializeResourceReference(value.Custodian, writer, summary); writer.WriteEndElement(); } // Serialize element authenticator if (value.Authenticator != null && !summary) { writer.WriteStartElement("authenticator"); ResourceReferenceSerializer.SerializeResourceReference(value.Authenticator, writer, summary); writer.WriteEndElement(); } // Serialize element created if (value.CreatedElement != null && !summary) { writer.WriteStartElement("created"); FhirDateTimeSerializer.SerializeFhirDateTime(value.CreatedElement, writer, summary); writer.WriteEndElement(); } // Serialize element indexed if (value.IndexedElement != null && !summary) { writer.WriteStartElement("indexed"); InstantSerializer.SerializeInstant(value.IndexedElement, writer, summary); writer.WriteEndElement(); } // Serialize element status if (value.StatusElement != null && !summary) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.DocumentReference.DocumentReferenceStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element docStatus if (value.DocStatus != null && !summary) { writer.WriteStartElement("docStatus"); CodeableConceptSerializer.SerializeCodeableConcept(value.DocStatus, writer, summary); writer.WriteEndElement(); } // Serialize element supercedes if (value.Supercedes != null && !summary) { writer.WriteStartElement("supercedes"); ResourceReferenceSerializer.SerializeResourceReference(value.Supercedes, writer, summary); writer.WriteEndElement(); } // Serialize element description if (value.DescriptionElement != null && !summary) { writer.WriteStartElement("description"); FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary); writer.WriteEndElement(); } // Serialize element confidentiality if (value.Confidentiality != null && !summary) { writer.WriteStartElement("confidentiality"); CodeableConceptSerializer.SerializeCodeableConcept(value.Confidentiality, writer, summary); writer.WriteEndElement(); } // Serialize element primaryLanguage if (value.PrimaryLanguageElement != null && !summary) { writer.WriteStartElement("primaryLanguage"); CodeSerializer.SerializeCode(value.PrimaryLanguageElement, writer, summary); writer.WriteEndElement(); } // Serialize element mimeType if (value.MimeTypeElement != null && !summary) { writer.WriteStartElement("mimeType"); CodeSerializer.SerializeCode(value.MimeTypeElement, writer, summary); writer.WriteEndElement(); } // Serialize element format if (value.Format != null && !summary) { writer.WriteStartElement("format"); CodeableConceptSerializer.SerializeCodeableConcept(value.Format, writer, summary); writer.WriteEndElement(); } // Serialize element size if (value.SizeElement != null && !summary) { writer.WriteStartElement("size"); IntegerSerializer.SerializeInteger(value.SizeElement, writer, summary); writer.WriteEndElement(); } // Serialize element hash if (value.HashElement != null && !summary) { writer.WriteStartElement("hash"); FhirStringSerializer.SerializeFhirString(value.HashElement, writer, summary); writer.WriteEndElement(); } // Serialize element location if (value.LocationElement != null && !summary) { writer.WriteStartElement("location"); FhirUriSerializer.SerializeFhirUri(value.LocationElement, writer, summary); writer.WriteEndElement(); } // Serialize element service if (value.Service != null && !summary) { writer.WriteStartElement("service"); DocumentReferenceSerializer.SerializeDocumentReferenceServiceComponent(value.Service, writer, summary); writer.WriteEndElement(); } // Serialize element context if (value.Context != null && !summary) { writer.WriteStartElement("context"); DocumentReferenceSerializer.SerializeDocumentReferenceContextComponent(value.Context, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeProfile(Hl7.Fhir.Model.Profile value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("Profile"); 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 identifier if (value.IdentifierElement != null) { writer.WriteStartElement("identifier"); FhirStringSerializer.SerializeFhirString(value.IdentifierElement, writer, summary); writer.WriteEndElement(); } // Serialize element version if (value.VersionElement != null) { writer.WriteStartElement("version"); FhirStringSerializer.SerializeFhirString(value.VersionElement, writer, summary); writer.WriteEndElement(); } // Serialize element name if (value.NameElement != null) { writer.WriteStartElement("name"); FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary); writer.WriteEndElement(); } // Serialize element publisher if (value.PublisherElement != null) { writer.WriteStartElement("publisher"); FhirStringSerializer.SerializeFhirString(value.PublisherElement, writer, summary); writer.WriteEndElement(); } // Serialize element telecom if (value.Telecom != null && value.Telecom.Count > 0) { writer.WriteStartArrayElement("telecom"); foreach (var item in value.Telecom) { writer.WriteStartArrayMember("telecom"); ContactSerializer.SerializeContact(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 code if (value.Code != null && value.Code.Count > 0) { writer.WriteStartArrayElement("code"); foreach (var item in value.Code) { writer.WriteStartArrayMember("code"); CodingSerializer.SerializeCoding(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element status if (value.StatusElement != null) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.Profile.ResourceProfileStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element experimental if (value.ExperimentalElement != null) { writer.WriteStartElement("experimental"); FhirBooleanSerializer.SerializeFhirBoolean(value.ExperimentalElement, writer, summary); writer.WriteEndElement(); } // Serialize element date if (value.DateElement != null) { writer.WriteStartElement("date"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateElement, writer, summary); writer.WriteEndElement(); } // Serialize element fhirVersion if (value.FhirVersionElement != null) { writer.WriteStartElement("fhirVersion"); IdSerializer.SerializeId(value.FhirVersionElement, writer, summary); writer.WriteEndElement(); } // Serialize element structure if (value.Structure != null && !summary && value.Structure.Count > 0) { writer.WriteStartArrayElement("structure"); foreach (var item in value.Structure) { writer.WriteStartArrayMember("structure"); ProfileSerializer.SerializeProfileStructureComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element extensionDefn if (value.ExtensionDefn != null && !summary && value.ExtensionDefn.Count > 0) { writer.WriteStartArrayElement("extensionDefn"); foreach (var item in value.ExtensionDefn) { writer.WriteStartArrayMember("extensionDefn"); ProfileSerializer.SerializeProfileExtensionDefnComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element binding if (value.Binding != null && !summary && value.Binding.Count > 0) { writer.WriteStartArrayElement("binding"); foreach (var item in value.Binding) { writer.WriteStartArrayMember("binding"); ProfileSerializer.SerializeProfileBindingComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeImmunization(Hl7.Fhir.Model.Immunization value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("Immunization"); 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 date if (value.DateElement != null && !summary) { writer.WriteStartElement("date"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateElement, writer, summary); writer.WriteEndElement(); } // Serialize element vaccineType if (value.VaccineType != null && !summary) { writer.WriteStartElement("vaccineType"); CodeableConceptSerializer.SerializeCodeableConcept(value.VaccineType, 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 refusedIndicator if (value.RefusedIndicatorElement != null && !summary) { writer.WriteStartElement("refusedIndicator"); FhirBooleanSerializer.SerializeFhirBoolean(value.RefusedIndicatorElement, writer, summary); writer.WriteEndElement(); } // Serialize element reported if (value.ReportedElement != null && !summary) { writer.WriteStartElement("reported"); FhirBooleanSerializer.SerializeFhirBoolean(value.ReportedElement, 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 requester if (value.Requester != null && !summary) { writer.WriteStartElement("requester"); ResourceReferenceSerializer.SerializeResourceReference(value.Requester, writer, summary); writer.WriteEndElement(); } // Serialize element manufacturer if (value.Manufacturer != null && !summary) { writer.WriteStartElement("manufacturer"); ResourceReferenceSerializer.SerializeResourceReference(value.Manufacturer, writer, summary); writer.WriteEndElement(); } // Serialize element location if (value.Location != null && !summary) { writer.WriteStartElement("location"); ResourceReferenceSerializer.SerializeResourceReference(value.Location, writer, summary); writer.WriteEndElement(); } // Serialize element lotNumber if (value.LotNumberElement != null && !summary) { writer.WriteStartElement("lotNumber"); FhirStringSerializer.SerializeFhirString(value.LotNumberElement, writer, summary); writer.WriteEndElement(); } // Serialize element expirationDate if (value.ExpirationDateElement != null && !summary) { writer.WriteStartElement("expirationDate"); DateSerializer.SerializeDate(value.ExpirationDateElement, writer, summary); writer.WriteEndElement(); } // Serialize element site if (value.Site != null && !summary) { writer.WriteStartElement("site"); CodeableConceptSerializer.SerializeCodeableConcept(value.Site, writer, summary); writer.WriteEndElement(); } // Serialize element route if (value.Route != null && !summary) { writer.WriteStartElement("route"); CodeableConceptSerializer.SerializeCodeableConcept(value.Route, writer, summary); writer.WriteEndElement(); } // Serialize element doseQuantity if (value.DoseQuantity != null && !summary) { writer.WriteStartElement("doseQuantity"); QuantitySerializer.SerializeQuantity(value.DoseQuantity, writer, summary); writer.WriteEndElement(); } // Serialize element explanation if (value.Explanation != null && !summary) { writer.WriteStartElement("explanation"); ImmunizationSerializer.SerializeImmunizationExplanationComponent(value.Explanation, writer, summary); writer.WriteEndElement(); } // Serialize element reaction if (value.Reaction != null && !summary && value.Reaction.Count > 0) { writer.WriteStartArrayElement("reaction"); foreach (var item in value.Reaction) { writer.WriteStartArrayMember("reaction"); ImmunizationSerializer.SerializeImmunizationReactionComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element vaccinationProtocol if (value.VaccinationProtocol != null && !summary) { writer.WriteStartElement("vaccinationProtocol"); ImmunizationSerializer.SerializeImmunizationVaccinationProtocolComponent(value.VaccinationProtocol, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializePrescriptionAdministrationRequestComponent(Prescription.PrescriptionAdministrationRequestComponent 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 description if (value.Description != null) { writer.WriteStartElement("description"); FhirStringSerializer.SerializeFhirString(value.Description, writer); writer.WriteEndElement(); } // Serialize element totalPeriodicDose if (value.TotalPeriodicDose != null) { writer.WriteStartElement("totalPeriodicDose"); RatioSerializer.SerializeRatio(value.TotalPeriodicDose, writer); writer.WriteEndElement(); } // Serialize element start if (value.Start != null) { writer.WriteStartElement("start"); FhirDateTimeSerializer.SerializeFhirDateTime(value.Start, writer); writer.WriteEndElement(); } // Serialize element end if (value.End != null) { writer.WriteStartElement("end"); FhirDateTimeSerializer.SerializeFhirDateTime(value.End, writer); writer.WriteEndElement(); } // Serialize element duration if (value.Duration != null) { writer.WriteStartElement("duration"); QuantitySerializer.SerializeQuantity(value.Duration, writer); writer.WriteEndElement(); } // Serialize element numberOfAdministrations if (value.NumberOfAdministrations != null) { writer.WriteStartElement("numberOfAdministrations"); IntegerSerializer.SerializeInteger(value.NumberOfAdministrations, writer); writer.WriteEndElement(); } // Serialize element dosageInstruction if (value.DosageInstruction != null && value.DosageInstruction.Count > 0) { writer.WriteStartArrayElement("dosageInstruction"); foreach (var item in value.DosageInstruction) { writer.WriteStartArrayMember("dosageInstruction"); PrescriptionSerializer.SerializePrescriptionAdministrationRequestDosageInstructionComponent(item, writer); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializePatient(Hl7.Fhir.Model.Patient value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("Patient"); 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 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 name if (value.Name != null && value.Name.Count > 0) { writer.WriteStartArrayElement("name"); foreach (var item in value.Name) { writer.WriteStartArrayMember("name"); HumanNameSerializer.SerializeHumanName(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element telecom if (value.Telecom != null && value.Telecom.Count > 0) { writer.WriteStartArrayElement("telecom"); foreach (var item in value.Telecom) { writer.WriteStartArrayMember("telecom"); ContactSerializer.SerializeContact(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element gender if (value.Gender != null) { writer.WriteStartElement("gender"); CodeableConceptSerializer.SerializeCodeableConcept(value.Gender, writer, summary); writer.WriteEndElement(); } // Serialize element birthDate if (value.BirthDateElement != null) { writer.WriteStartElement("birthDate"); FhirDateTimeSerializer.SerializeFhirDateTime(value.BirthDateElement, writer, summary); writer.WriteEndElement(); } // Serialize element deceased if (value.Deceased != null) { writer.WriteStartElement(SerializationUtil.BuildPolymorphicName("deceased", value.Deceased.GetType())); FhirSerializer.SerializeElement(value.Deceased, writer, summary); writer.WriteEndElement(); } // Serialize element address if (value.Address != null && value.Address.Count > 0) { writer.WriteStartArrayElement("address"); foreach (var item in value.Address) { writer.WriteStartArrayMember("address"); AddressSerializer.SerializeAddress(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element maritalStatus if (value.MaritalStatus != null) { writer.WriteStartElement("maritalStatus"); CodeableConceptSerializer.SerializeCodeableConcept(value.MaritalStatus, writer, summary); writer.WriteEndElement(); } // Serialize element multipleBirth if (value.MultipleBirth != null) { writer.WriteStartElement(SerializationUtil.BuildPolymorphicName("multipleBirth", value.MultipleBirth.GetType())); FhirSerializer.SerializeElement(value.MultipleBirth, writer, summary); writer.WriteEndElement(); } // Serialize element photo if (value.Photo != null && !summary && value.Photo.Count > 0) { writer.WriteStartArrayElement("photo"); foreach (var item in value.Photo) { writer.WriteStartArrayMember("photo"); AttachmentSerializer.SerializeAttachment(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element contact if (value.Contact != null && !summary && value.Contact.Count > 0) { writer.WriteStartArrayElement("contact"); foreach (var item in value.Contact) { writer.WriteStartArrayMember("contact"); PatientSerializer.SerializeContactComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element animal if (value.Animal != null) { writer.WriteStartElement("animal"); PatientSerializer.SerializeAnimalComponent(value.Animal, writer, summary); writer.WriteEndElement(); } // Serialize element communication if (value.Communication != null && !summary && value.Communication.Count > 0) { writer.WriteStartArrayElement("communication"); foreach (var item in value.Communication) { writer.WriteStartArrayMember("communication"); CodeableConceptSerializer.SerializeCodeableConcept(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element provider if (value.Provider != null) { writer.WriteStartElement("provider"); ResourceReferenceSerializer.SerializeResourceReference(value.Provider, writer, summary); writer.WriteEndElement(); } // Serialize element link if (value.Link != null && value.Link.Count > 0) { writer.WriteStartArrayElement("link"); foreach (var item in value.Link) { writer.WriteStartArrayMember("link"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element active if (value.ActiveElement != null) { writer.WriteStartElement("active"); FhirBooleanSerializer.SerializeFhirBoolean(value.ActiveElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeValueSet(Hl7.Fhir.Model.ValueSet value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("ValueSet"); 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 identifier if (value.IdentifierElement != null) { writer.WriteStartElement("identifier"); FhirStringSerializer.SerializeFhirString(value.IdentifierElement, writer, summary); writer.WriteEndElement(); } // Serialize element version if (value.VersionElement != null) { writer.WriteStartElement("version"); FhirStringSerializer.SerializeFhirString(value.VersionElement, writer, summary); writer.WriteEndElement(); } // Serialize element name if (value.NameElement != null) { writer.WriteStartElement("name"); FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary); writer.WriteEndElement(); } // Serialize element publisher if (value.PublisherElement != null) { writer.WriteStartElement("publisher"); FhirStringSerializer.SerializeFhirString(value.PublisherElement, writer, summary); writer.WriteEndElement(); } // Serialize element telecom if (value.Telecom != null && value.Telecom.Count > 0) { writer.WriteStartArrayElement("telecom"); foreach (var item in value.Telecom) { writer.WriteStartArrayMember("telecom"); ContactSerializer.SerializeContact(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 copyright if (value.CopyrightElement != null && !summary) { writer.WriteStartElement("copyright"); FhirStringSerializer.SerializeFhirString(value.CopyrightElement, writer, summary); writer.WriteEndElement(); } // Serialize element status if (value.StatusElement != null) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ValueSet.ValueSetStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element experimental if (value.ExperimentalElement != null) { writer.WriteStartElement("experimental"); FhirBooleanSerializer.SerializeFhirBoolean(value.ExperimentalElement, writer, summary); writer.WriteEndElement(); } // Serialize element date if (value.DateElement != null) { writer.WriteStartElement("date"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateElement, writer, summary); writer.WriteEndElement(); } // Serialize element define if (value.Define != null && !summary) { writer.WriteStartElement("define"); ValueSetSerializer.SerializeValueSetDefineComponent(value.Define, writer, summary); writer.WriteEndElement(); } // Serialize element compose if (value.Compose != null && !summary) { writer.WriteStartElement("compose"); ValueSetSerializer.SerializeValueSetComposeComponent(value.Compose, writer, summary); writer.WriteEndElement(); } // Serialize element expansion if (value.Expansion != null && !summary) { writer.WriteStartElement("expansion"); ValueSetSerializer.SerializeValueSetExpansionComponent(value.Expansion, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeAllergyIntolerance(Hl7.Fhir.Model.AllergyIntolerance value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("AllergyIntolerance"); 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 identifier if (value.Identifier != null && !summary) { writer.WriteStartElement("identifier"); IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary); writer.WriteEndElement(); } // Serialize element criticality if (value.Criticality_Element != null && !summary) { writer.WriteStartElement("criticality"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.AllergyIntolerance.Criticality>(value.Criticality_Element, writer, summary); writer.WriteEndElement(); } // Serialize element sensitivityType if (value.SensitivityType_Element != null && !summary) { writer.WriteStartElement("sensitivityType"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.AllergyIntolerance.SensitivityType>(value.SensitivityType_Element, writer, summary); writer.WriteEndElement(); } // Serialize element recordedDate if (value.RecordedDateElement != null && !summary) { writer.WriteStartElement("recordedDate"); FhirDateTimeSerializer.SerializeFhirDateTime(value.RecordedDateElement, writer, summary); writer.WriteEndElement(); } // Serialize element status if (value.StatusElement != null && !summary) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.AllergyIntolerance.SensitivityStatus>(value.StatusElement, 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 recorder if (value.Recorder != null && !summary) { writer.WriteStartElement("recorder"); ResourceReferenceSerializer.SerializeResourceReference(value.Recorder, writer, summary); writer.WriteEndElement(); } // Serialize element substance if (value.Substance != null && !summary) { writer.WriteStartElement("substance"); ResourceReferenceSerializer.SerializeResourceReference(value.Substance, writer, summary); writer.WriteEndElement(); } // Serialize element reaction if (value.Reaction != null && !summary && value.Reaction.Count > 0) { writer.WriteStartArrayElement("reaction"); foreach (var item in value.Reaction) { writer.WriteStartArrayMember("reaction"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element sensitivityTest if (value.SensitivityTest != null && !summary && value.SensitivityTest.Count > 0) { writer.WriteStartArrayElement("sensitivityTest"); foreach (var item in value.SensitivityTest) { writer.WriteStartArrayMember("sensitivityTest"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeImagingStudy(Hl7.Fhir.Model.ImagingStudy value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("ImagingStudy"); 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 dateTime if (value.DateTimeElement != null && !summary) { writer.WriteStartElement("dateTime"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateTimeElement, 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 uid if (value.UidElement != null && !summary) { writer.WriteStartElement("uid"); OidSerializer.SerializeOid(value.UidElement, writer, summary); writer.WriteEndElement(); } // Serialize element accessionNo if (value.AccessionNo != null && !summary) { writer.WriteStartElement("accessionNo"); IdentifierSerializer.SerializeIdentifier(value.AccessionNo, writer, summary); writer.WriteEndElement(); } // Serialize element identifier if (value.Identifier != null && !summary && 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 modality if (value.Modality_Element != null && !summary && value.Modality_Element.Count > 0) { writer.WriteStartArrayElement("modality"); foreach (var item in value.Modality_Element) { writer.WriteStartArrayMember("modality"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ImagingStudy.ImagingModality>(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element referrer if (value.Referrer != null && !summary) { writer.WriteStartElement("referrer"); ResourceReferenceSerializer.SerializeResourceReference(value.Referrer, writer, summary); writer.WriteEndElement(); } // Serialize element availability if (value.AvailabilityElement != null && !summary) { writer.WriteStartElement("availability"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ImagingStudy.InstanceAvailability>(value.AvailabilityElement, writer, summary); writer.WriteEndElement(); } // Serialize element url if (value.UrlElement != null && !summary) { writer.WriteStartElement("url"); FhirUriSerializer.SerializeFhirUri(value.UrlElement, writer, summary); writer.WriteEndElement(); } // Serialize element numberOfSeries if (value.NumberOfSeriesElement != null && !summary) { writer.WriteStartElement("numberOfSeries"); IntegerSerializer.SerializeInteger(value.NumberOfSeriesElement, writer, summary); writer.WriteEndElement(); } // Serialize element numberOfInstances if (value.NumberOfInstancesElement != null && !summary) { writer.WriteStartElement("numberOfInstances"); IntegerSerializer.SerializeInteger(value.NumberOfInstancesElement, writer, summary); writer.WriteEndElement(); } // Serialize element clinicalInformation if (value.ClinicalInformationElement != null && !summary) { writer.WriteStartElement("clinicalInformation"); FhirStringSerializer.SerializeFhirString(value.ClinicalInformationElement, writer, summary); writer.WriteEndElement(); } // Serialize element procedure if (value.Procedure != null && !summary && value.Procedure.Count > 0) { writer.WriteStartArrayElement("procedure"); foreach (var item in value.Procedure) { writer.WriteStartArrayMember("procedure"); CodingSerializer.SerializeCoding(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element interpreter if (value.Interpreter != null && !summary) { writer.WriteStartElement("interpreter"); ResourceReferenceSerializer.SerializeResourceReference(value.Interpreter, writer, summary); writer.WriteEndElement(); } // Serialize element description if (value.DescriptionElement != null && !summary) { writer.WriteStartElement("description"); FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary); writer.WriteEndElement(); } // Serialize element series if (value.Series != null && !summary && value.Series.Count > 0) { writer.WriteStartArrayElement("series"); foreach (var item in value.Series) { writer.WriteStartArrayMember("series"); ImagingStudySerializer.SerializeImagingStudySeriesComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeImagingStudySeriesComponent(Hl7.Fhir.Model.ImagingStudy.ImagingStudySeriesComponent 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 number if (value.NumberElement != null) { writer.WriteStartElement("number"); IntegerSerializer.SerializeInteger(value.NumberElement, writer, summary); writer.WriteEndElement(); } // Serialize element modality if (value.ModalityElement != null) { writer.WriteStartElement("modality"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ImagingStudy.Modality>(value.ModalityElement, writer, summary); writer.WriteEndElement(); } // Serialize element uid if (value.UidElement != null) { writer.WriteStartElement("uid"); OidSerializer.SerializeOid(value.UidElement, writer, summary); writer.WriteEndElement(); } // Serialize element description if (value.DescriptionElement != null) { writer.WriteStartElement("description"); FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary); writer.WriteEndElement(); } // Serialize element numberOfInstances if (value.NumberOfInstancesElement != null) { writer.WriteStartElement("numberOfInstances"); IntegerSerializer.SerializeInteger(value.NumberOfInstancesElement, writer, summary); writer.WriteEndElement(); } // Serialize element availability if (value.AvailabilityElement != null) { writer.WriteStartElement("availability"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ImagingStudy.InstanceAvailability>(value.AvailabilityElement, writer, summary); writer.WriteEndElement(); } // Serialize element url if (value.UrlElement != null) { writer.WriteStartElement("url"); FhirUriSerializer.SerializeFhirUri(value.UrlElement, writer, summary); writer.WriteEndElement(); } // Serialize element bodySite if (value.BodySite != null) { writer.WriteStartElement("bodySite"); CodingSerializer.SerializeCoding(value.BodySite, writer, summary); writer.WriteEndElement(); } // Serialize element dateTime if (value.DateTimeElement != null) { writer.WriteStartElement("dateTime"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateTimeElement, writer, summary); writer.WriteEndElement(); } // Serialize element instance if (value.Instance != null && value.Instance.Count > 0) { writer.WriteStartArrayElement("instance"); foreach (var item in value.Instance) { writer.WriteStartArrayMember("instance"); ImagingStudySerializer.SerializeImagingStudySeriesInstanceComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeSpecimenCollectionComponent(Hl7.Fhir.Model.Specimen.SpecimenCollectionComponent 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 collector if (value.Collector != null) { writer.WriteStartElement("collector"); ResourceReferenceSerializer.SerializeResourceReference(value.Collector, writer, summary); writer.WriteEndElement(); } // Serialize element comment if (value.CommentElement != null && value.CommentElement.Count > 0) { writer.WriteStartArrayElement("comment"); foreach (var item in value.CommentElement) { writer.WriteStartArrayMember("comment"); FhirStringSerializer.SerializeFhirString(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element collectedTime if (value.CollectedTimeElement != null) { writer.WriteStartElement("collectedTime"); FhirDateTimeSerializer.SerializeFhirDateTime(value.CollectedTimeElement, writer, summary); writer.WriteEndElement(); } // Serialize element quantity if (value.Quantity != null) { writer.WriteStartElement("quantity"); QuantitySerializer.SerializeQuantity(value.Quantity, writer, summary); writer.WriteEndElement(); } // Serialize element method if (value.Method != null) { writer.WriteStartElement("method"); CodeableConceptSerializer.SerializeCodeableConcept(value.Method, writer, summary); writer.WriteEndElement(); } // Serialize element sourceSite if (value.SourceSite != null) { writer.WriteStartElement("sourceSite"); CodeableConceptSerializer.SerializeCodeableConcept(value.SourceSite, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeSpecimen(Hl7.Fhir.Model.Specimen value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("Specimen"); 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 identifier if (value.Identifier != null && !summary) { writer.WriteStartElement("identifier"); IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary); writer.WriteEndElement(); } // Serialize element type if (value.Type != null && !summary) { writer.WriteStartElement("type"); CodeableConceptSerializer.SerializeCodeableConcept(value.Type, writer, summary); writer.WriteEndElement(); } // Serialize element source if (value.Source != null && !summary && value.Source.Count > 0) { writer.WriteStartArrayElement("source"); foreach (var item in value.Source) { writer.WriteStartArrayMember("source"); SpecimenSerializer.SerializeSpecimenSourceComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element subject if (value.Subject != null && !summary) { writer.WriteStartElement("subject"); ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary); writer.WriteEndElement(); } // Serialize element accessionIdentifier if (value.AccessionIdentifier != null && !summary && value.AccessionIdentifier.Count > 0) { writer.WriteStartArrayElement("accessionIdentifier"); foreach (var item in value.AccessionIdentifier) { writer.WriteStartArrayMember("accessionIdentifier"); IdentifierSerializer.SerializeIdentifier(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element receivedTime if (value.ReceivedTimeElement != null && !summary) { writer.WriteStartElement("receivedTime"); FhirDateTimeSerializer.SerializeFhirDateTime(value.ReceivedTimeElement, writer, summary); writer.WriteEndElement(); } // Serialize element collection if (value.Collection != null && !summary) { writer.WriteStartElement("collection"); SpecimenSerializer.SerializeSpecimenCollectionComponent(value.Collection, writer, summary); writer.WriteEndElement(); } // Serialize element treatment if (value.Treatment != null && !summary && value.Treatment.Count > 0) { writer.WriteStartArrayElement("treatment"); foreach (var item in value.Treatment) { writer.WriteStartArrayMember("treatment"); SpecimenSerializer.SerializeSpecimenTreatmentComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element container if (value.Container != null && !summary && value.Container.Count > 0) { writer.WriteStartArrayElement("container"); foreach (var item in value.Container) { writer.WriteStartArrayMember("container"); SpecimenSerializer.SerializeSpecimenContainerComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeImmunizationProfileRecommendationSupportingAdverseEventReportComponent(Hl7.Fhir.Model.ImmunizationProfile.ImmunizationProfileRecommendationSupportingAdverseEventReportComponent 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 && value.IdentifierElement.Count > 0) { writer.WriteStartArrayElement("identifier"); foreach (var item in value.IdentifierElement) { writer.WriteStartArrayMember("identifier"); IdSerializer.SerializeId(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element reportType if (value.ReportType != null) { writer.WriteStartElement("reportType"); CodeableConceptSerializer.SerializeCodeableConcept(value.ReportType, writer, summary); writer.WriteEndElement(); } // Serialize element reportDate if (value.ReportDateElement != null) { writer.WriteStartElement("reportDate"); FhirDateTimeSerializer.SerializeFhirDateTime(value.ReportDateElement, writer, summary); writer.WriteEndElement(); } // Serialize element text if (value.TextElement != null) { writer.WriteStartElement("text"); FhirStringSerializer.SerializeFhirString(value.TextElement, writer, summary); writer.WriteEndElement(); } // Serialize element reaction if (value.Reaction != null && value.Reaction.Count > 0) { writer.WriteStartArrayElement("reaction"); foreach (var item in value.Reaction) { writer.WriteStartArrayMember("reaction"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeScheduleRepeatComponent(Hl7.Fhir.Model.Schedule.ScheduleRepeatComponent value, IFhirWriter writer, bool summary) { writer.WriteStartComplexContent(); // Serialize element _id if (value.LocalIdElement != null) { writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute); } // Serialize element extension if (value.Extension != null && !summary && value.Extension.Count > 0) { writer.WriteStartArrayElement("extension"); foreach (var item in value.Extension) { writer.WriteStartArrayMember("extension"); ExtensionSerializer.SerializeExtension(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element frequency if (value.FrequencyElement != null) { writer.WriteStartElement("frequency"); IntegerSerializer.SerializeInteger(value.FrequencyElement, writer, summary); writer.WriteEndElement(); } // Serialize element when if (value.WhenElement != null) { writer.WriteStartElement("when"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.Schedule.EventTiming>(value.WhenElement, writer, summary); writer.WriteEndElement(); } // Serialize element duration if (value.DurationElement != null) { writer.WriteStartElement("duration"); FhirDecimalSerializer.SerializeFhirDecimal(value.DurationElement, writer, summary); writer.WriteEndElement(); } // Serialize element units if (value.UnitsElement != null) { writer.WriteStartElement("units"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.Schedule.UnitsOfTime>(value.UnitsElement, writer, summary); writer.WriteEndElement(); } // Serialize element count if (value.CountElement != null) { writer.WriteStartElement("count"); IntegerSerializer.SerializeInteger(value.CountElement, writer, summary); writer.WriteEndElement(); } // Serialize element end if (value.EndElement != null) { writer.WriteStartElement("end"); FhirDateTimeSerializer.SerializeFhirDateTime(value.EndElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); }
public static void SerializeImmunizationProfileRecommendationComponent(Hl7.Fhir.Model.ImmunizationProfile.ImmunizationProfileRecommendationComponent 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 recommendationDate if (value.RecommendationDateElement != null) { writer.WriteStartElement("recommendationDate"); FhirDateTimeSerializer.SerializeFhirDateTime(value.RecommendationDateElement, writer, summary); writer.WriteEndElement(); } // Serialize element vaccineType if (value.VaccineType != null) { writer.WriteStartElement("vaccineType"); CodeableConceptSerializer.SerializeCodeableConcept(value.VaccineType, writer, summary); writer.WriteEndElement(); } // Serialize element doseNumber if (value.DoseNumberElement != null) { writer.WriteStartElement("doseNumber"); IntegerSerializer.SerializeInteger(value.DoseNumberElement, writer, summary); writer.WriteEndElement(); } // Serialize element forecastStatus if (value.ForecastStatusElement != null) { writer.WriteStartElement("forecastStatus"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ImmunizationProfile.ImmunizationForecastStatus>(value.ForecastStatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element dateCriterion if (value.DateCriterion != null && value.DateCriterion.Count > 0) { writer.WriteStartArrayElement("dateCriterion"); foreach (var item in value.DateCriterion) { writer.WriteStartArrayMember("dateCriterion"); ImmunizationProfileSerializer.SerializeImmunizationProfileRecommendationDateCriterionComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element protocol if (value.Protocol != null) { writer.WriteStartElement("protocol"); ImmunizationProfileSerializer.SerializeImmunizationProfileRecommendationProtocolComponent(value.Protocol, writer, summary); writer.WriteEndElement(); } // Serialize element supportingImmunization if (value.SupportingImmunization != null && value.SupportingImmunization.Count > 0) { writer.WriteStartArrayElement("supportingImmunization"); foreach (var item in value.SupportingImmunization) { writer.WriteStartArrayMember("supportingImmunization"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element supportingAdverseEventReport if (value.SupportingAdverseEventReport != null && value.SupportingAdverseEventReport.Count > 0) { writer.WriteStartArrayElement("supportingAdverseEventReport"); foreach (var item in value.SupportingAdverseEventReport) { writer.WriteStartArrayMember("supportingAdverseEventReport"); ImmunizationProfileSerializer.SerializeImmunizationProfileRecommendationSupportingAdverseEventReportComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element supportingPatientObservation if (value.SupportingPatientObservation != null && value.SupportingPatientObservation.Count > 0) { writer.WriteStartArrayElement("supportingPatientObservation"); foreach (var item in value.SupportingPatientObservation) { writer.WriteStartArrayMember("supportingPatientObservation"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); }
public static void SerializeCarePlan(Hl7.Fhir.Model.CarePlan value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("CarePlan"); 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 identifier if (value.Identifier != null && !summary) { writer.WriteStartElement("identifier"); IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary); writer.WriteEndElement(); } // Serialize element patient if (value.Patient != null && !summary) { writer.WriteStartElement("patient"); ResourceReferenceSerializer.SerializeResourceReference(value.Patient, writer, summary); writer.WriteEndElement(); } // Serialize element status if (value.StatusElement != null && !summary) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.CarePlan.CarePlanStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element period if (value.Period != null && !summary) { writer.WriteStartElement("period"); PeriodSerializer.SerializePeriod(value.Period, writer, summary); writer.WriteEndElement(); } // Serialize element modified if (value.ModifiedElement != null && !summary) { writer.WriteStartElement("modified"); FhirDateTimeSerializer.SerializeFhirDateTime(value.ModifiedElement, writer, summary); writer.WriteEndElement(); } // Serialize element concern if (value.Concern != null && !summary && value.Concern.Count > 0) { writer.WriteStartArrayElement("concern"); foreach (var item in value.Concern) { writer.WriteStartArrayMember("concern"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element participant if (value.Participant != null && !summary && value.Participant.Count > 0) { writer.WriteStartArrayElement("participant"); foreach (var item in value.Participant) { writer.WriteStartArrayMember("participant"); CarePlanSerializer.SerializeCarePlanParticipantComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element goal if (value.Goal != null && !summary && value.Goal.Count > 0) { writer.WriteStartArrayElement("goal"); foreach (var item in value.Goal) { writer.WriteStartArrayMember("goal"); CarePlanSerializer.SerializeCarePlanGoalComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element activity if (value.Activity != null && !summary && value.Activity.Count > 0) { writer.WriteStartArrayElement("activity"); foreach (var item in value.Activity) { writer.WriteStartArrayMember("activity"); CarePlanSerializer.SerializeCarePlanActivityComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element notes if (value.NotesElement != null && !summary) { writer.WriteStartElement("notes"); FhirStringSerializer.SerializeFhirString(value.NotesElement, writer, summary); writer.WriteEndElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
public static void SerializeDiagnosticReport(Hl7.Fhir.Model.DiagnosticReport value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("DiagnosticReport"); 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 status if (value.StatusElement != null) { writer.WriteStartElement("status"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.ObservationStatus>(value.StatusElement, writer, summary); writer.WriteEndElement(); } // Serialize element issued if (value.IssuedElement != null) { writer.WriteStartElement("issued"); FhirDateTimeSerializer.SerializeFhirDateTime(value.IssuedElement, writer, summary); writer.WriteEndElement(); } // Serialize element subject if (value.Subject != null) { writer.WriteStartElement("subject"); ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary); writer.WriteEndElement(); } // Serialize element performer if (value.Performer != null) { writer.WriteStartElement("performer"); ResourceReferenceSerializer.SerializeResourceReference(value.Performer, writer, summary); writer.WriteEndElement(); } // Serialize element reportId if (value.ReportId != null) { writer.WriteStartElement("reportId"); IdentifierSerializer.SerializeIdentifier(value.ReportId, writer, summary); writer.WriteEndElement(); } // Serialize element requestDetail if (value.RequestDetail != null && !summary && value.RequestDetail.Count > 0) { writer.WriteStartArrayElement("requestDetail"); foreach (var item in value.RequestDetail) { writer.WriteStartArrayMember("requestDetail"); DiagnosticReportSerializer.SerializeDiagnosticReportRequestDetailComponent(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element serviceCategory if (value.ServiceCategory != null) { writer.WriteStartElement("serviceCategory"); CodeableConceptSerializer.SerializeCodeableConcept(value.ServiceCategory, writer, summary); writer.WriteEndElement(); } // Serialize element diagnosticTime if (value.DiagnosticTimeElement != null) { writer.WriteStartElement("diagnosticTime"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DiagnosticTimeElement, writer, summary); writer.WriteEndElement(); } // Serialize element results if (value.Results != null && !summary) { writer.WriteStartElement("results"); DiagnosticReportSerializer.SerializeResultGroupComponent(value.Results, writer, summary); writer.WriteEndElement(); } // Serialize element image if (value.Image != null && !summary && value.Image.Count > 0) { writer.WriteStartArrayElement("image"); foreach (var item in value.Image) { writer.WriteStartArrayMember("image"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element conclusion if (value.ConclusionElement != null && !summary) { writer.WriteStartElement("conclusion"); FhirStringSerializer.SerializeFhirString(value.ConclusionElement, writer, summary); writer.WriteEndElement(); } // Serialize element codedDiagnosis if (value.CodedDiagnosis != null && !summary && value.CodedDiagnosis.Count > 0) { writer.WriteStartArrayElement("codedDiagnosis"); foreach (var item in value.CodedDiagnosis) { writer.WriteStartArrayMember("codedDiagnosis"); CodeableConceptSerializer.SerializeCodeableConcept(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } // Serialize element representation if (value.Representation != null && !summary && value.Representation.Count > 0) { writer.WriteStartArrayElement("representation"); foreach (var item in value.Representation) { writer.WriteStartArrayMember("representation"); AttachmentSerializer.SerializeAttachment(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }
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 SerializeOrderResponse(Hl7.Fhir.Model.OrderResponse value, IFhirWriter writer, bool summary) { writer.WriteStartRootObject("OrderResponse"); 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 request if (value.Request != null && !summary) { writer.WriteStartElement("request"); ResourceReferenceSerializer.SerializeResourceReference(value.Request, writer, summary); writer.WriteEndElement(); } // Serialize element date if (value.DateElement != null && !summary) { writer.WriteStartElement("date"); FhirDateTimeSerializer.SerializeFhirDateTime(value.DateElement, writer, summary); writer.WriteEndElement(); } // Serialize element who if (value.Who != null && !summary) { writer.WriteStartElement("who"); ResourceReferenceSerializer.SerializeResourceReference(value.Who, writer, summary); writer.WriteEndElement(); } // Serialize element authority if (value.Authority != null && !summary) { writer.WriteStartElement("authority"); ResourceReferenceSerializer.SerializeResourceReference(value.Authority, writer, summary); writer.WriteEndElement(); } // Serialize element cost if (value.Cost != null && !summary) { writer.WriteStartElement("cost"); QuantitySerializer.SerializeQuantity(value.Cost, writer, summary); writer.WriteEndElement(); } // Serialize element code if (value.CodeElement != null && !summary) { writer.WriteStartElement("code"); CodeSerializer.SerializeCode <Hl7.Fhir.Model.OrderResponse.OrderOutcomeCode>(value.CodeElement, writer, summary); writer.WriteEndElement(); } // Serialize element description if (value.DescriptionElement != null && !summary) { writer.WriteStartElement("description"); FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary); writer.WriteEndElement(); } // Serialize element fulfillment if (value.Fulfillment != null && !summary && value.Fulfillment.Count > 0) { writer.WriteStartArrayElement("fulfillment"); foreach (var item in value.Fulfillment) { writer.WriteStartArrayMember("fulfillment"); ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary); writer.WriteEndArrayMember(); } writer.WriteEndArrayElement(); } writer.WriteEndComplexContent(); writer.WriteEndRootObject(); }