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


C# IFhirReader.SkipSubElementsFor方法代码示例

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


在下文中一共展示了IFhirReader.SkipSubElementsFor方法的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: ParseBase64Binary

        /// <summary>
        /// Parse base64Binary
        /// </summary>
        public static Hl7.Fhir.Model.Base64Binary ParseBase64Binary(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Base64Binary existingInstance = null )
        {
            Hl7.Fhir.Model.Base64Binary result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Base64Binary();
            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.Value = Base64Binary.Parse(reader.ReadPrimitiveContents(typeof(Base64Binary))).Value;

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

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

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

示例5: ParseConformanceRestResourceSearchParamComponent

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

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

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

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "target") )
                        result.TargetElement.Add(CodeParser.ParseCode(reader, errors));

                    reader.LeaveArray();
                }

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

                    while( ParserUtils.IsAtArrayElement(reader, "chain") )
                        result.ChainElement.Add(FhirStringParser.ParseFhirString(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

示例6: ParseConformance


//.........这里部分代码省略.........
                    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);

                // Parse element fhirVersion
                else if( atName == "fhirVersion" )
                    result.FhirVersionElement = IdParser.ParseId(reader, errors);

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "format") )
                        result.FormatElement.Add(CodeParser.ParseCode(reader, errors));

                    reader.LeaveArray();
                }

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

                    while( ParserUtils.IsAtArrayElement(reader, "rest") )
                        result.Rest.Add(ConformanceParser.ParseConformanceRestComponent(reader, errors));

                    reader.LeaveArray();
                }

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

                    while( ParserUtils.IsAtArrayElement(reader, "messaging") )
                        result.Messaging.Add(ConformanceParser.ParseConformanceMessagingComponent(reader, errors));

                    reader.LeaveArray();
                }

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

                    while( ParserUtils.IsAtArrayElement(reader, "document") )
                        result.Document.Add(ConformanceParser.ParseConformanceDocumentComponent(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,代码行数:101,代码来源:ConformanceParser.cs

示例7: ParseConformanceMessagingEventComponent

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "protocol") )
                        result.Protocol.Add(CodingParser.ParseCoding(reader, errors));

                    reader.LeaveArray();
                }

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

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

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

                // Parse element documentation
                else if( atName == "documentation" )
                    result.DocumentationElement = 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,代码行数:75,代码来源:ConformanceParser.cs

示例8: ParseAnatomicalLocation

        /// <summary>
        /// Parse AnatomicalLocation
        /// </summary>
        public static AnatomicalLocation ParseAnatomicalLocation(IFhirReader reader, ErrorList errors, AnatomicalLocation existingInstance = null )
        {
            AnatomicalLocation result = existingInstance != null ? existingInstance : new AnatomicalLocation();
            try
            {
                string currentElementName = reader.CurrentElementName;
                reader.EnterElement();

                while (reader.HasMoreElements())
                {
                    // Parse element extension
                    if( ParserUtils.IsAtFhirElement(reader, "extension") )
                    {
                        result.Extension = new List<Extension>();
                        reader.EnterArray();

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

                        reader.LeaveArray();
                    }

                    // Parse element language
                    else if( ParserUtils.IsAtFhirElement(reader, "language") )
                        result.Language = CodeParser.ParseCode(reader, errors);

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

                    // Parse element contained
                    else if( ParserUtils.IsAtFhirElement(reader, "contained") )
                    {
                        result.Contained = new List<Resource>();
                        reader.EnterArray();

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

                        reader.LeaveArray();
                    }

                    // Parse element internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

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

                reader.LeaveElement();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:65,代码来源:AnatomicalLocationParser.cs

示例9: ParseOperationOutcomeIssueComponent

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

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

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

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

                    while( ParserUtils.IsAtArrayElement(reader, "location") )
                        result.LocationElement.Add(FhirStringParser.ParseFhirString(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,代码来源:OperationOutcomeParser.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

        /// <summary>
        /// Parse Substance
        /// </summary>
        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;
                }
            }

//.........这里部分代码省略.........
开发者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.SkipSubElementsFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。