当前位置: 首页>>代码示例>>C#>>正文


C# IFhirWriter.WritePrimitiveContents方法代码示例

本文整理汇总了C#中IFhirWriter.WritePrimitiveContents方法的典型用法代码示例。如果您正苦于以下问题:C# IFhirWriter.WritePrimitiveContents方法的具体用法?C# IFhirWriter.WritePrimitiveContents怎么用?C# IFhirWriter.WritePrimitiveContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IFhirWriter的用法示例。


在下文中一共展示了IFhirWriter.WritePrimitiveContents方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SerializeNarrative

        public static void SerializeNarrative(Hl7.Fhir.Model.Narrative value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

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

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

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

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:35,代码来源:NarrativeSerializer.cs

示例2: SerializeFhirDecimal

        public static void SerializeFhirDecimal(Hl7.Fhir.Model.FhirDecimal value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

            // Serialize element value
            if(value.Value != null)
                writer.WritePrimitiveContents("value", value, XmlSerializationHint.Attribute);

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:27,代码来源:FhirDecimalSerializer.cs

示例3: SerializeInterestOfCare

        public static void SerializeInterestOfCare(Hl7.Fhir.Model.InterestOfCare value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartRootObject("InterestOfCare");
            writer.WriteStartComplexContent();

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

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

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

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

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

            writer.WriteEndComplexContent();
            writer.WriteEndRootObject();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:54,代码来源:InterestOfCareSerializer.cs

示例4: SerializeChoice

        public static void SerializeChoice(Hl7.Fhir.Model.Choice value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

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

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

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

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

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:52,代码来源:ChoiceSerializer.cs

示例5: SerializeCodeableConcept

        public static void SerializeCodeableConcept(Hl7.Fhir.Model.CodeableConcept 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 coding
            if(value.Coding != null && value.Coding.Count > 0)
            {
                writer.WriteStartArrayElement("coding");
                foreach(var item in value.Coding)
                {
                    writer.WriteStartArrayMember("coding");
                    CodingSerializer.SerializeCoding(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

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

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:52,代码来源:CodeableConceptSerializer.cs

示例6: SerializeAnimalComponent

        public static void SerializeAnimalComponent(Hl7.Fhir.Model.Patient.AnimalComponent 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 species
            if(value.Species != null)
            {
                writer.WriteStartElement("species");
                CodeableConceptSerializer.SerializeCodeableConcept(value.Species, writer, summary);
                writer.WriteEndElement();
            }

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

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:47,代码来源:PatientSerializer.cs

示例7: SerializeExtension

        public static void SerializeExtension(Hl7.Fhir.Model.Extension 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 url
            if(value.UrlElement != null)
            {
                writer.WriteStartElement("url");
                FhirUriSerializer.SerializeFhirUri(value.UrlElement, writer, summary);
                writer.WriteEndElement();
            }

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

            // Serialize element value
            if(value.Value != null)
            {
                writer.WriteStartElement( SerializationUtil.BuildPolymorphicName("value", value.Value.GetType()) );
                FhirSerializer.SerializeElement(value.Value, writer, summary);
                writer.WriteEndElement();
            }

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:47,代码来源:ExtensionSerializer.cs

示例8: SerializeCoding

        public static void SerializeCoding(Hl7.Fhir.Model.Coding value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartComplexContent();

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

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

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

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

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:47,代码来源:CodingSerializer.cs

示例9: SerializeSchedule

        public static void SerializeSchedule(Hl7.Fhir.Model.Schedule 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 event
            if(value.Event != null && value.Event.Count > 0)
            {
                writer.WriteStartArrayElement("event");
                foreach(var item in value.Event)
                {
                    writer.WriteStartArrayMember("event");
                    PeriodSerializer.SerializePeriod(item, writer, summary);
                    writer.WriteEndArrayMember();
                }
                writer.WriteEndArrayElement();
            }

            // Serialize element repeat
            if(value.Repeat != null)
            {
                writer.WriteStartElement("repeat");
                ScheduleSerializer.SerializeScheduleRepeatComponent(value.Repeat, writer, summary);
                writer.WriteEndElement();
            }

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:44,代码来源:ScheduleSerializer.cs

示例10: SerializeRange

        public static void SerializeRange(Hl7.Fhir.Model.Range 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 low
            if(value.Low != null)
            {
                writer.WriteStartElement("low");
                QuantitySerializer.SerializeQuantity(value.Low, writer, summary);
                writer.WriteEndElement();
            }

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:39,代码来源:RangeSerializer.cs

示例11: SerializeRatio

        public static void SerializeRatio(Hl7.Fhir.Model.Ratio 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 numerator
            if(value.Numerator != null)
            {
                writer.WriteStartElement("numerator");
                QuantitySerializer.SerializeQuantity(value.Numerator, writer, summary);
                writer.WriteEndElement();
            }

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:39,代码来源:RatioSerializer.cs

示例12: SerializeImagingStudy

        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");
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:ImagingStudySerializer.cs

示例13: SerializeImagingStudySeriesInstanceComponent

        public static void SerializeImagingStudySeriesInstanceComponent(Hl7.Fhir.Model.ImagingStudy.ImagingStudySeriesInstanceComponent 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 uid
            if(value.UidElement != null)
            {
                writer.WriteStartElement("uid");
                OidSerializer.SerializeOid(value.UidElement, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element sopclass
            if(value.SopclassElement != null)
            {
                writer.WriteStartElement("sopclass");
                OidSerializer.SerializeOid(value.SopclassElement, writer, summary);
                writer.WriteEndElement();
            }

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

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

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

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

            writer.WriteEndComplexContent();
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:79,代码来源:ImagingStudySerializer.cs

示例14: SerializeImagingStudySeriesComponent

        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");
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:ImagingStudySerializer.cs

示例15: SerializePicture

        public static void SerializePicture(Hl7.Fhir.Model.Picture value, IFhirWriter writer, bool summary)
        {
            writer.WriteStartRootObject("Picture");
            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 subject
            if(value.Subject != null)
            {
                writer.WriteStartElement("subject");
                ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary);
                writer.WriteEndElement();
            }

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

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

            // Serialize element identifier
            if(value.Identifier != null)
            {
                writer.WriteStartElement("identifier");
                IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element accessionNo
            if(value.AccessionNo != null)
            {
                writer.WriteStartElement("accessionNo");
                IdentifierSerializer.SerializeIdentifier(value.AccessionNo, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element studyId
            if(value.StudyId != null)
            {
                writer.WriteStartElement("studyId");
                IdentifierSerializer.SerializeIdentifier(value.StudyId, writer, summary);
                writer.WriteEndElement();
            }

            // Serialize element seriesId
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:PictureSerializer.cs


注:本文中的IFhirWriter.WritePrimitiveContents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。