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


C# IFhirReader.LeaveElement方法代码示例

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


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

示例1: 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

示例2: 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

示例3: ParseConformanceSoftwareComponent

        /// <summary>
        /// Parse ConformanceSoftwareComponent
        /// </summary>
        public static Hl7.Fhir.Model.Conformance.ConformanceSoftwareComponent ParseConformanceSoftwareComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance.ConformanceSoftwareComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Conformance.ConformanceSoftwareComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance.ConformanceSoftwareComponent();
            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 name
                else if( atName == "name" )
                    result.NameElement = FhirStringParser.ParseFhirString(reader, errors);

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

                // Parse element releaseDate
                else if( atName == "releaseDate" )
                    result.ReleaseDateElement = FhirDateTimeParser.ParseFhirDateTime(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,代码来源:ConformanceParser.cs

示例4: ParseConformanceRestSecurityCertificateComponent

        /// <summary>
        /// Parse ConformanceRestSecurityCertificateComponent
        /// </summary>
        public static Hl7.Fhir.Model.Conformance.ConformanceRestSecurityCertificateComponent ParseConformanceRestSecurityCertificateComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance.ConformanceRestSecurityCertificateComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Conformance.ConformanceRestSecurityCertificateComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance.ConformanceRestSecurityCertificateComponent();
            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 blob
                else if( atName == "blob" )
                    result.BlobElement = Base64BinaryParser.ParseBase64Binary(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,代码来源:ConformanceParser.cs

示例5: ParseConformanceRestResourceComponent

        /// <summary>
        /// Parse ConformanceRestResourceComponent
        /// </summary>
        public static Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent ParseConformanceRestResourceComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent();
            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 profile
                else if( atName == "profile" )
                    result.Profile = ResourceReferenceParser.ParseResourceReference(reader, errors);

                // Parse element operation
                else if( atName == "operation" )
                {
                    result.Operation = new List<Hl7.Fhir.Model.Conformance.ConformanceRestResourceOperationComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "operation") )
                        result.Operation.Add(ConformanceParser.ParseConformanceRestResourceOperationComponent(reader, errors));

                    reader.LeaveArray();
                }

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "searchInclude") )
                        result.SearchIncludeElement.Add(FhirStringParser.ParseFhirString(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element searchParam
                else if( atName == "searchParam" )
                {
                    result.SearchParam = new List<Hl7.Fhir.Model.Conformance.ConformanceRestResourceSearchParamComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "searchParam") )
                        result.SearchParam.Add(ConformanceParser.ParseConformanceRestResourceSearchParamComponent(reader, errors));

                    reader.LeaveArray();
                }

                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,代码行数:87,代码来源:ConformanceParser.cs

示例6: ParseConformanceRestComponent

        /// <summary>
        /// Parse ConformanceRestComponent
        /// </summary>
        public static Hl7.Fhir.Model.Conformance.ConformanceRestComponent ParseConformanceRestComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance.ConformanceRestComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Conformance.ConformanceRestComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance.ConformanceRestComponent();
            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 mode
                else if( atName == "mode" )
                    result.ModeElement = CodeParser.ParseCode<Hl7.Fhir.Model.Conformance.RestfulConformanceMode>(reader, errors);

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

                // Parse element security
                else if( atName == "security" )
                    result.Security = ConformanceParser.ParseConformanceRestSecurityComponent(reader, errors);

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

                    while( ParserUtils.IsAtArrayElement(reader, "resource") )
                        result.Resource.Add(ConformanceParser.ParseConformanceRestResourceComponent(reader, errors));

                    reader.LeaveArray();
                }

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

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

                // Parse element query
                else if( atName == "query" )
                {
                    result.Query = new List<Hl7.Fhir.Model.Conformance.ConformanceRestQueryComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "query") )
                        result.Query.Add(ConformanceParser.ParseConformanceRestQueryComponent(reader, errors));

                    reader.LeaveArray();
                }

                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,代码行数:83,代码来源:ConformanceParser.cs

示例7: ParseConformanceMessagingComponent

        /// <summary>
        /// Parse ConformanceMessagingComponent
        /// </summary>
        public static Hl7.Fhir.Model.Conformance.ConformanceMessagingComponent ParseConformanceMessagingComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance.ConformanceMessagingComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Conformance.ConformanceMessagingComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance.ConformanceMessagingComponent();
            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 endpoint
                else if( atName == "endpoint" )
                    result.EndpointElement = FhirUriParser.ParseFhirUri(reader, errors);

                // Parse element reliableCache
                else if( atName == "reliableCache" )
                    result.ReliableCacheElement = IntegerParser.ParseInteger(reader, errors);

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "event") )
                        result.Event.Add(ConformanceParser.ParseConformanceMessagingEventComponent(reader, errors));

                    reader.LeaveArray();
                }

                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,代码来源:ConformanceParser.cs

示例8: ParseOperationOutcome

        /// <summary>
        /// Parse OperationOutcome
        /// </summary>
        public static Hl7.Fhir.Model.OperationOutcome ParseOperationOutcome(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.OperationOutcome existingInstance = null )
        {
            Hl7.Fhir.Model.OperationOutcome result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.OperationOutcome();
            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 issue
                else if( atName == "issue" )
                {
                    result.Issue = new List<Hl7.Fhir.Model.OperationOutcome.OperationOutcomeIssueComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "issue") )
                        result.Issue.Add(OperationOutcomeParser.ParseOperationOutcomeIssueComponent(reader, errors));

                    reader.LeaveArray();
                }

                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,代码行数:71,代码来源:OperationOutcomeParser.cs

示例9: ParseMedicationAdministrationDosageComponent

        /// <summary>
        /// Parse MedicationAdministrationDosageComponent
        /// </summary>
        public static Hl7.Fhir.Model.MedicationAdministration.MedicationAdministrationDosageComponent ParseMedicationAdministrationDosageComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.MedicationAdministration.MedicationAdministrationDosageComponent existingInstance = null )
        {
            Hl7.Fhir.Model.MedicationAdministration.MedicationAdministrationDosageComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.MedicationAdministration.MedicationAdministrationDosageComponent();
            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 timing
                else if( atName == "timing" )
                    result.Timing = ScheduleParser.ParseSchedule(reader, errors);

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

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

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

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

                // Parse element rate
                else if( atName == "rate" )
                    result.Rate = RatioParser.ParseRatio(reader, errors);

                // Parse element maxDosePerPeriod
                else if( atName == "maxDosePerPeriod" )
                    result.MaxDosePerPeriod = RatioParser.ParseRatio(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,代码行数:67,代码来源:MedicationAdministrationParser.cs

示例10: ParseFamilyHistory

        /// <summary>
        /// Parse FamilyHistory
        /// </summary>
        public static Hl7.Fhir.Model.FamilyHistory ParseFamilyHistory(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.FamilyHistory existingInstance = null )
        {
            Hl7.Fhir.Model.FamilyHistory result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.FamilyHistory();
            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 subject
                else if( atName == "subject" )
                    result.Subject = ResourceReferenceParser.ParseResourceReference(reader, errors);

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

                // Parse element relation
                else if( atName == "relation" )
                {
                    result.Relation = new List<Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "relation") )
                        result.Relation.Add(FamilyHistoryParser.ParseFamilyHistoryRelationComponent(reader, errors));

                    reader.LeaveArray();
                }

                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,代码行数:79,代码来源:FamilyHistoryParser.cs

示例11: ParseFamilyHistoryRelationConditionComponent

        /// <summary>
        /// Parse FamilyHistoryRelationConditionComponent
        /// </summary>
        public static Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationConditionComponent ParseFamilyHistoryRelationConditionComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationConditionComponent existingInstance = null )
        {
            Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationConditionComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationConditionComponent();
            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.Type = CodeableConceptParser.ParseCodeableConcept(reader, errors);

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

                // Parse element onset
                else if( atName.StartsWith("onset") )
                    result.Onset = FhirParser.ParseElement(reader, errors);

                // Parse element note
                else if( atName == "note" )
                    result.NoteElement = 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,代码行数:55,代码来源:FamilyHistoryParser.cs

示例12: ParseSupply

        /// <summary>
        /// Parse Supply
        /// </summary>
        public static Hl7.Fhir.Model.Supply ParseSupply(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Supply existingInstance = null )
        {
            Hl7.Fhir.Model.Supply result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Supply();
            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 name
                else if( atName == "name" )
                    result.Name = CodeableConceptParser.ParseCodeableConcept(reader, errors);

                // Parse element identifier
                else if( atName == "identifier" )
                    result.Identifier = IdentifierParser.ParseIdentifier(reader, errors);

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

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

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

                // Parse element dispense
                else if( atName == "dispense" )
                {
                    result.Dispense = new List<Hl7.Fhir.Model.Supply.SupplyDispenseComponent>();
                    reader.EnterArray();

                    while( ParserUtils.IsAtArrayElement(reader, "dispense") )
                        result.Dispense.Add(SupplyParser.ParseSupplyDispenseComponent(reader, errors));

                    reader.LeaveArray();
                }

                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,代码行数:91,代码来源:SupplyParser.cs

示例13: ParseSupplyDispenseComponent

        /// <summary>
        /// Parse SupplyDispenseComponent
        /// </summary>
        public static Hl7.Fhir.Model.Supply.SupplyDispenseComponent ParseSupplyDispenseComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Supply.SupplyDispenseComponent existingInstance = null )
        {
            Hl7.Fhir.Model.Supply.SupplyDispenseComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Supply.SupplyDispenseComponent();
            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 identifier
                else if( atName == "identifier" )
                    result.Identifier = IdentifierParser.ParseIdentifier(reader, errors);

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

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

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

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

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

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

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

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "receiver") )
                        result.Receiver.Add(ResourceReferenceParser.ParseResourceReference(reader, errors));

                    reader.LeaveArray();
                }

                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,代码行数:87,代码来源:SupplyParser.cs

示例14: ParseSubstance


//.........这里部分代码省略.........
        public static Hl7.Fhir.Model.Substance ParseSubstance(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Substance existingInstance = null )
        {
            Hl7.Fhir.Model.Substance result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Substance();
            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.Identifier = IdentifierParser.ParseIdentifier(reader, errors);

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

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

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

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

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

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "ingredient") )
                        result.Ingredient.Add(ResourceReferenceParser.ParseResourceReference(reader, errors));

                    reader.LeaveArray();
                }

                // Parse element quantityMode
                else if( atName == "quantityMode" )
                    result.QuantityMode = 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,代码行数:101,代码来源:SubstanceParser.cs

示例15: ParseAttachment

        /// <summary>
        /// Parse Attachment
        /// </summary>
        public static Hl7.Fhir.Model.Attachment ParseAttachment(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Attachment existingInstance = null )
        {
            Hl7.Fhir.Model.Attachment result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Attachment();
            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 contentType
                else if( atName == "contentType" )
                    result.ContentTypeElement = CodeParser.ParseCode(reader, errors);

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

                // Parse element data
                else if( atName == "data" )
                    result.DataElement = Base64BinaryParser.ParseBase64Binary(reader, errors);

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

                // Parse element size
                else if( atName == "size" )
                    result.SizeElement = IntegerParser.ParseInteger(reader, errors);

                // Parse element hash
                else if( atName == "hash" )
                    result.HashElement = Base64BinaryParser.ParseBase64Binary(reader, errors);

                // Parse element title
                else if( atName == "title" )
                    result.TitleElement = 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,代码行数:67,代码来源:AttachmentParser.cs


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