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


C# IFhirReader类代码示例

本文整理汇总了C#中IFhirReader的典型用法代码示例。如果您正苦于以下问题:C# IFhirReader类的具体用法?C# IFhirReader怎么用?C# IFhirReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: IsAtFhirElementEndingWith

        public static bool IsAtFhirElementEndingWith(IFhirReader reader, string suffix)
        {
            if (!IsAtFhirElement(reader))
                return false;

            return reader.CurrentElementName.EndsWith(suffix);
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:7,代码来源:ParserUtils.cs

示例2: ParseIdentifier

        /// <summary>
        /// Parse Identifier
        /// </summary>
        public static Hl7.Fhir.Model.Identifier ParseIdentifier(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Identifier existingInstance = null )
        {
            Hl7.Fhir.Model.Identifier result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Identifier();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element use
                else if( atName == "use" )
                    result.UseElement = CodeParser.ParseCode<Hl7.Fhir.Model.Identifier.IdentifierUse>(reader, errors);

                // Parse element label
                else if( atName == "label" )
                    result.LabelElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element system
                else if( atName == "system" )
                    result.SystemElement = FhirUriParser.ParseFhirUri(reader, errors);

                // Parse element key
                else if( atName == "key" )
                    result.KeyElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element period
                else if( atName == "period" )
                    result.Period = PeriodParser.ParsePeriod(reader, errors);

                // Parse element assigner
                else if( atName == "assigner" )
                    result.Assigner = ResourceReferenceParser.ParseResourceReference(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:63,代码来源:IdentifierParser.cs

示例3: IsAtFhirElement

 public static bool IsAtFhirElement(IFhirReader reader)
 {
     // If the element is from a different namespace than the FHIR ns
     // the name will look like {<ns name>}<local name>
     // NB: the Xhtml <div> element will be treated as a local name
     // by the FHIR reader.
     return !reader.CurrentElementName.StartsWith("{");
 }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:8,代码来源:ParserUtils.cs

示例4: ParseInterestOfCare

        /// <summary>
        /// Parse InterestOfCare
        /// </summary>
        public static Hl7.Fhir.Model.InterestOfCare ParseInterestOfCare(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.InterestOfCare existingInstance = null )
        {
            Hl7.Fhir.Model.InterestOfCare result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.InterestOfCare();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element language
                else if( atName == "language" )
                    result.LanguageElement = CodeParser.ParseCode(reader, errors);

                // Parse element text
                else if( atName == "text" )
                    result.Text = NarrativeParser.ParseNarrative(reader, errors);

                // Parse element contained
                else if( atName == "contained" )
                {
                    result.Contained = new List<Hl7.Fhir.Model.Resource>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "contained") )
                        result.Contained.Add(ParserUtils.ParseContainedResource(reader,errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:59,代码来源:InterestOfCareParser.cs

示例5: ParseCodeableConcept

        /// <summary>
        /// Parse CodeableConcept
        /// </summary>
        public static Hl7.Fhir.Model.CodeableConcept ParseCodeableConcept(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.CodeableConcept existingInstance = null )
        {
            Hl7.Fhir.Model.CodeableConcept result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.CodeableConcept();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element coding
                else if( atName == "coding" )
                {
                    result.Coding = new List<Hl7.Fhir.Model.Coding>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "coding") )
                        result.Coding.Add(CodingParser.ParseCoding(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element text
                else if( atName == "text" )
                    result.TextElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element primary
                else if( atName == "primary" )
                    result.PrimaryElement = IdRefParser.ParseIdRef(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:59,代码来源:CodeableConceptParser.cs

示例6: ParseQuantity

        /// <summary>
        /// Parse Quantity
        /// </summary>
        public static Hl7.Fhir.Model.Quantity ParseQuantity(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Quantity existingInstance = null )
        {
            Hl7.Fhir.Model.Quantity result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Quantity();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element value
                else if( atName == "value" )
                    result.ValueElement = FhirDecimalParser.ParseFhirDecimal(reader, errors);

                // Parse element comparator
                else if( atName == "comparator" )
                    result.ComparatorElement = CodeParser.ParseCode<Hl7.Fhir.Model.Quantity.QuantityCompararator>(reader, errors);

                // Parse element units
                else if( atName == "units" )
                    result.UnitsElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element system
                else if( atName == "system" )
                    result.SystemElement = FhirUriParser.ParseFhirUri(reader, errors);

                // Parse element code
                else if( atName == "code" )
                    result.CodeElement = CodeParser.ParseCode(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:59,代码来源:QuantityParser.cs

示例7: ParseChoice

        /// <summary>
        /// Parse Choice
        /// </summary>
        public static Hl7.Fhir.Model.Choice ParseChoice(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Choice existingInstance = null )
        {
            Hl7.Fhir.Model.Choice result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Choice();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element code
                else if( atName == "code" )
                    result.CodeElement = CodeParser.ParseCode(reader, errors);

                // Parse element option
                else if( atName == "option" )
                {
                    result.Option = new List<Hl7.Fhir.Model.Choice.ChoiceOptionComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "option") )
                        result.Option.Add(ChoiceParser.ParseChoiceOptionComponent(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element isOrdered
                else if( atName == "isOrdered" )
                    result.IsOrderedElement = FhirBooleanParser.ParseFhirBoolean(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:59,代码来源:ChoiceParser.cs

示例8: ParseElementComponent

        /// <summary>
        /// Parse ElementComponent
        /// </summary>
        public static Hl7.Fhir.Model.Profile.ElementComponent ParseElementComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Profile.ElementComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Profile.ElementComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Profile.ElementComponent();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element path
                else if( atName == "path" )
                    result.PathElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element name
                else if( atName == "name" )
                    result.NameElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element slicing
                else if( atName == "slicing" )
                    result.Slicing = ProfileParser.ParseElementSlicingComponent(reader, errors);

                // Parse element definition
                else if( atName == "definition" )
                    result.Definition = ProfileParser.ParseElementDefinitionComponent(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:55,代码来源:ProfileParser.cs

示例9: ParseSchedule

        /// <summary>
        /// Parse Schedule
        /// </summary>
        public static Hl7.Fhir.Model.Schedule ParseSchedule(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Schedule existingInstance = null )
        {
            Hl7.Fhir.Model.Schedule result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Schedule();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element event
                else if( atName == "event" )
                {
                    result.Event = new List<Hl7.Fhir.Model.Period>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "event") )
                        result.Event.Add(PeriodParser.ParsePeriod(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element repeat
                else if( atName == "repeat" )
                    result.Repeat = ScheduleParser.ParseScheduleRepeatComponent(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:55,代码来源:ScheduleParser.cs

示例10: ParseAnimalComponent

        /// <summary>
        /// Parse AnimalComponent
        /// </summary>
        public static Hl7.Fhir.Model.Patient.AnimalComponent ParseAnimalComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Patient.AnimalComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Patient.AnimalComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Patient.AnimalComponent();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element species
                else if( atName == "species" )
                    result.Species = CodeableConceptParser.ParseCodeableConcept(reader, errors);

                // Parse element breed
                else if( atName == "breed" )
                    result.Breed = CodeableConceptParser.ParseCodeableConcept(reader, errors);

                // Parse element genderStatus
                else if( atName == "genderStatus" )
                    result.GenderStatus = CodeableConceptParser.ParseCodeableConcept(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:51,代码来源:PatientParser.cs

示例11: ParseResourceReference

        /// <summary>
        /// Parse ResourceReference
        /// </summary>
        public static Hl7.Fhir.Model.ResourceReference ParseResourceReference(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.ResourceReference existingInstance = null )
        {
            Hl7.Fhir.Model.ResourceReference result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.ResourceReference();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element type
                else if( atName == "type" )
                    result.TypeElement = CodeParser.ParseCode(reader, errors);

                // Parse element reference
                else if( atName == "reference" )
                    result.ReferenceElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element display
                else if( atName == "display" )
                    result.DisplayElement = FhirStringParser.ParseFhirString(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:51,代码来源:ResourceReferenceParser.cs

示例12: ParseRange

        /// <summary>
        /// Parse Range
        /// </summary>
        public static Hl7.Fhir.Model.Range ParseRange(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Range existingInstance = null )
        {
            Hl7.Fhir.Model.Range result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Range();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element low
                else if( atName == "low" )
                    result.Low = QuantityParser.ParseQuantity(reader, errors);

                // Parse element high
                else if( atName == "high" )
                    result.High = QuantityParser.ParseQuantity(reader, errors);

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:47,代码来源:RangeParser.cs

示例13: ParseNarrative

        /// <summary>
        /// Parse Narrative
        /// </summary>
        public static Hl7.Fhir.Model.Narrative ParseNarrative(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Narrative existingInstance = null )
        {
            Hl7.Fhir.Model.Narrative result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Narrative();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element status
                else if( atName == "status" )
                    result.StatusElement = CodeParser.ParseCode<Hl7.Fhir.Model.Narrative.NarrativeStatus>(reader, errors);

                // Parse element div
                else if( atName == "div" )
                    result.DivElement = XHtml.Parse(reader.ReadPrimitiveContents(typeof(XHtml)));

                else
                {
                    errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
                    reader.SkipSubElementsFor(currentElementName);
                    result = null;
                }
            }

            reader.LeaveElement();
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:47,代码来源:NarrativeParser.cs

示例14: verifyContinueOnEmptyElements

        private static void verifyContinueOnEmptyElements(IFhirReader xfr)
        {
            Assert.AreEqual("x", xfr.CurrentElementName);
            xfr.EnterElement();

            Assert.IsTrue(ParserUtils.IsAtFhirElement(xfr));
            Assert.AreEqual("someElem", xfr.CurrentElementName);
            xfr.EnterElement();
            Assert.IsTrue(xfr.HasMoreElements());
            xfr.SkipSubElementsFor("someElem");
            xfr.LeaveElement();

            Assert.IsTrue(ParserUtils.IsAtFhirElement(xfr));
            Assert.AreEqual("someElem2", xfr.CurrentElementName);
            xfr.EnterElement();
            Assert.IsFalse(xfr.HasMoreElements());
            xfr.LeaveElement();

            xfr.LeaveElement();
        }
开发者ID:jamesagnew,项目名称:fhir-net-api,代码行数:20,代码来源:PrimitiveParserTests.cs

示例15: ParseConformance

        /// <summary>
        /// Parse Conformance
        /// </summary>
        public static Hl7.Fhir.Model.Conformance ParseConformance(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance existingInstance = null )
        {
            Hl7.Fhir.Model.Conformance result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance();
            string currentElementName = reader.CurrentElementName;
            reader.EnterElement();

            while (reader.HasMoreElements())
            {
                var atName = reader.CurrentElementName;
                // Parse element extension
                if( atName == "extension" )
                {
                    result.Extension = new List<Hl7.Fhir.Model.Extension>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "extension") )
                        result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element language
                else if( atName == "language" )
                    result.LanguageElement = CodeParser.ParseCode(reader, errors);

                // Parse element text
                else if( atName == "text" )
                    result.Text = NarrativeParser.ParseNarrative(reader, errors);

                // Parse element contained
                else if( atName == "contained" )
                {
                    result.Contained = new List<Hl7.Fhir.Model.Resource>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "contained") )
                        result.Contained.Add(ParserUtils.ParseContainedResource(reader,errors));

                    reader.LeaveArray();
                }

                // Parse element _id
                else if( atName == "_id" )
                    result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));

                // Parse element identifier
                else if( atName == "identifier" )
                    result.IdentifierElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element version
                else if( atName == "version" )
                    result.VersionElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element name
                else if( atName == "name" )
                    result.NameElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element publisher
                else if( atName == "publisher" )
                    result.PublisherElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element telecom
                else if( atName == "telecom" )
                {
                    result.Telecom = new List<Hl7.Fhir.Model.Contact>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "telecom") )
                        result.Telecom.Add(ContactParser.ParseContact(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element description
                else if( atName == "description" )
                    result.DescriptionElement = FhirStringParser.ParseFhirString(reader, errors);

                // Parse element status
                else if( atName == "status" )
                    result.StatusElement = CodeParser.ParseCode<Hl7.Fhir.Model.Conformance.ConformanceStatementStatus>(reader, errors);

                // Parse element experimental
                else if( atName == "experimental" )
                    result.ExperimentalElement = FhirBooleanParser.ParseFhirBoolean(reader, errors);

                // Parse element date
                else if( atName == "date" )
                    result.DateElement = FhirDateTimeParser.ParseFhirDateTime(reader, errors);

                // Parse element software
                else if( atName == "software" )
                    result.Software = ConformanceParser.ParseConformanceSoftwareComponent(reader, errors);

                // Parse element implementation
                else if( atName == "implementation" )
                    result.Implementation = ConformanceParser.ParseConformanceImplementationComponent(reader, errors);

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


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