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


C# IFhirReader.ReadRefIdContents方法代码示例

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


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

示例1: ParseDocumentInformation

        /// <summary>
        /// Parse DocumentInformation
        /// </summary>
        public static DocumentInformation ParseDocumentInformation(IFhirReader reader, ErrorList errors, DocumentInformation existingInstance = null )
        {
            DocumentInformation result = existingInstance != null ? existingInstance : new DocumentInformation();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element id
                    else if( ParserUtils.IsAtFhirElement(reader, "id") )
                        result.Id = IdentifierParser.ParseIdentifier(reader, errors);

                    // Parse element versionId
                    else if( ParserUtils.IsAtFhirElement(reader, "versionId") )
                        result.VersionId = IdentifierParser.ParseIdentifier(reader, errors);

                    // Parse element created
                    else if( ParserUtils.IsAtFhirElement(reader, "created") )
                        result.Created = InstantParser.ParseInstant(reader, errors);

                    // Parse element class
                    else if( ParserUtils.IsAtFhirElement(reader, "class") )
                        result.Class = CodingParser.ParseCoding(reader, errors);

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

                    // Parse element title
                    else if( ParserUtils.IsAtFhirElement(reader, "title") )
                        result.Title = FhirStringParser.ParseFhirString(reader, errors);

                    // Parse element confidentiality
                    else if( ParserUtils.IsAtFhirElement(reader, "confidentiality") )
                        result.Confidentiality = CodingParser.ParseCoding(reader, errors);

                    // Parse element subject
                    else if( ParserUtils.IsAtFhirElement(reader, "subject") )
                        result.Subject = ResourceReferenceParser.ParseResourceReference(reader, errors);

                    // Parse element author
                    else if( ParserUtils.IsAtFhirElement(reader, "author") )
                    {
                        result.Author = new List<ResourceReference>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "author") )
                            result.Author.Add(ResourceReferenceParser.ParseResourceReference(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element attester
                    else if( ParserUtils.IsAtFhirElement(reader, "attester") )
                    {
                        result.Attester = new List<DocumentInformation.DocumentInformationAttesterComponent>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "attester") )
                            result.Attester.Add(DocumentInformationParser.ParseDocumentInformationAttesterComponent(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element custodian
                    else if( ParserUtils.IsAtFhirElement(reader, "custodian") )
                        result.Custodian = ResourceReferenceParser.ParseResourceReference(reader, errors);

                    // Parse element event
                    else if( ParserUtils.IsAtFhirElement(reader, "event") )
                        result.Event = DocumentInformationParser.ParseDocumentInformationEventComponent(reader, errors);

                    // Parse element encounter
                    else if( ParserUtils.IsAtFhirElement(reader, "encounter") )
                        result.Encounter = ResourceReferenceParser.ParseResourceReference(reader, errors);

                    // Parse element facilityType
                    else if( ParserUtils.IsAtFhirElement(reader, "facilityType") )
                        result.FacilityType = CodeableConceptParser.ParseCodeableConcept(reader, errors);
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:DocumentInformationParser.cs

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

示例3: ParseDocumentInformationAttesterComponent

        /// <summary>
        /// Parse DocumentInformationAttesterComponent
        /// </summary>
        public static DocumentInformation.DocumentInformationAttesterComponent ParseDocumentInformationAttesterComponent(IFhirReader reader, ErrorList errors, DocumentInformation.DocumentInformationAttesterComponent existingInstance = null )
        {
            DocumentInformation.DocumentInformationAttesterComponent result = existingInstance != null ? existingInstance : new DocumentInformation.DocumentInformationAttesterComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element mode
                    else if( ParserUtils.IsAtFhirElement(reader, "mode") )
                        result.Mode = CodeParser.ParseCode<DocumentInformation.DocumentAttestationMode>(reader, errors);

                    // Parse element time
                    else if( ParserUtils.IsAtFhirElement(reader, "time") )
                        result.Time = FhirDateTimeParser.ParseFhirDateTime(reader, errors);

                    // Parse element party
                    else if( ParserUtils.IsAtFhirElement(reader, "party") )
                        result.Party = ResourceReferenceParser.ParseResourceReference(reader, errors);

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

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

示例4: ParseDocumentInformationEventComponent

        /// <summary>
        /// Parse DocumentInformationEventComponent
        /// </summary>
        public static DocumentInformation.DocumentInformationEventComponent ParseDocumentInformationEventComponent(IFhirReader reader, ErrorList errors, DocumentInformation.DocumentInformationEventComponent existingInstance = null )
        {
            DocumentInformation.DocumentInformationEventComponent result = existingInstance != null ? existingInstance : new DocumentInformation.DocumentInformationEventComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element code
                    else if( ParserUtils.IsAtFhirElement(reader, "code") )
                    {
                        result.Code = new List<CodeableConcept>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "code") )
                            result.Code.Add(CodeableConceptParser.ParseCodeableConcept(reader, errors));

                        reader.LeaveArray();
                    }

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

                    // Parse element detail
                    else if( ParserUtils.IsAtFhirElement(reader, "detail") )
                    {
                        result.Detail = new List<ResourceReference>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "detail") )
                            result.Detail.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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:73,代码来源:DocumentInformationParser.cs

示例5: ParsePrescription

        /// <summary>
        /// Parse Prescription
        /// </summary>
        public static Prescription ParsePrescription(IFhirReader reader, ErrorList errors, Prescription existingInstance = null )
        {
            Prescription result = existingInstance != null ? existingInstance : new Prescription();
            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());

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

                        while( ParserUtils.IsAtArrayElement(reader, "identifier") )
                            result.Identifier.Add(IdentifierParser.ParseIdentifier(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element status
                    else if( ParserUtils.IsAtFhirElement(reader, "status") )
                        result.Status = CodeParser.ParseCode<Prescription.PrescriptionStatus>(reader, errors);

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

                    // Parse element prescriber
                    else if( ParserUtils.IsAtFhirElement(reader, "prescriber") )
                        result.Prescriber = ResourceReferenceParser.ParseResourceReference(reader, errors);

                    // Parse element prescribed
                    else if( ParserUtils.IsAtFhirElement(reader, "prescribed") )
                        result.Prescribed = FhirDateTimeParser.ParseFhirDateTime(reader, errors);

                    // Parse element dispense
                    else if( ParserUtils.IsAtFhirElement(reader, "dispense") )
                        result.Dispense = PrescriptionParser.ParsePrescriptionDispenseComponent(reader, errors);

                    // Parse element medicine
                    else if( ParserUtils.IsAtFhirElement(reader, "medicine") )
                        result.Medicine = PrescriptionParser.ParsePrescriptionMedicineComponent(reader, errors);

                    // Parse element administrationRequest
                    else if( ParserUtils.IsAtFhirElement(reader, "administrationRequest") )
                        result.AdministrationRequest = PrescriptionParser.ParsePrescriptionAdministrationRequestComponent(reader, errors);

                    // Parse element reason
                    else if( ParserUtils.IsAtFhirElement(reader, "reason") )
                        result.Reason = 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,代码来源:PrescriptionParser.cs

示例6: ParsePrescriptionMedicineInactiveIngredientComponent

        /// <summary>
        /// Parse PrescriptionMedicineInactiveIngredientComponent
        /// </summary>
        public static Prescription.PrescriptionMedicineInactiveIngredientComponent ParsePrescriptionMedicineInactiveIngredientComponent(IFhirReader reader, ErrorList errors, Prescription.PrescriptionMedicineInactiveIngredientComponent existingInstance = null )
        {
            Prescription.PrescriptionMedicineInactiveIngredientComponent result = existingInstance != null ? existingInstance : new Prescription.PrescriptionMedicineInactiveIngredientComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element identification
                    else if( ParserUtils.IsAtFhirElement(reader, "identification") )
                        result.Identification = CodeableConceptParser.ParseCodeableConcept(reader, errors);

                    // Parse element quantity
                    else if( ParserUtils.IsAtFhirElement(reader, "quantity", true) )
                        result.Quantity = FhirParser.ParseElement(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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:53,代码来源:PrescriptionParser.cs

示例7: ParsePrescriptionAdministrationRequestDosageInstructionComponent

        /// <summary>
        /// Parse PrescriptionAdministrationRequestDosageInstructionComponent
        /// </summary>
        public static Prescription.PrescriptionAdministrationRequestDosageInstructionComponent ParsePrescriptionAdministrationRequestDosageInstructionComponent(IFhirReader reader, ErrorList errors, Prescription.PrescriptionAdministrationRequestDosageInstructionComponent existingInstance = null )
        {
            Prescription.PrescriptionAdministrationRequestDosageInstructionComponent result = existingInstance != null ? existingInstance : new Prescription.PrescriptionAdministrationRequestDosageInstructionComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element precondition
                    else if( ParserUtils.IsAtFhirElement(reader, "precondition") )
                    {
                        result.Precondition = new List<CodeableConcept>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "precondition") )
                            result.Precondition.Add(CodeableConceptParser.ParseCodeableConcept(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element prn
                    else if( ParserUtils.IsAtFhirElement(reader, "prn") )
                        result.Prn = FhirBooleanParser.ParseFhirBoolean(reader, errors);

                    // Parse element additionalInstruction
                    else if( ParserUtils.IsAtFhirElement(reader, "additionalInstruction") )
                    {
                        result.AdditionalInstruction = new List<CodeableConcept>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "additionalInstruction") )
                            result.AdditionalInstruction.Add(CodeableConceptParser.ParseCodeableConcept(reader, errors));

                        reader.LeaveArray();
                    }

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

                    // Parse element dose
                    else if( ParserUtils.IsAtFhirElement(reader, "dose", true) )
                        result.Dose = FhirParser.ParseElement(reader, errors);

                    // Parse element rate
                    else if( ParserUtils.IsAtFhirElement(reader, "rate") )
                        result.Rate = QuantityParser.ParseQuantity(reader, errors);

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

                        while( ParserUtils.IsAtArrayElement(reader, "schedule") )
                            result.Schedule.Add(ScheduleParser.ParseSchedule(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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:97,代码来源:PrescriptionParser.cs

示例8: ParsePrescriptionDispenseComponent

        /// <summary>
        /// Parse PrescriptionDispenseComponent
        /// </summary>
        public static Prescription.PrescriptionDispenseComponent ParsePrescriptionDispenseComponent(IFhirReader reader, ErrorList errors, Prescription.PrescriptionDispenseComponent existingInstance = null )
        {
            Prescription.PrescriptionDispenseComponent result = existingInstance != null ? existingInstance : new Prescription.PrescriptionDispenseComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element repeats
                    else if( ParserUtils.IsAtFhirElement(reader, "repeats") )
                        result.Repeats = IntegerParser.ParseInteger(reader, errors);

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

                    // Parse element dispenser
                    else if( ParserUtils.IsAtFhirElement(reader, "dispenser") )
                        result.Dispenser = ResourceReferenceParser.ParseResourceReference(reader, errors);

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

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

示例9: ParseXdsEntry2

        /// <summary>
        /// Parse XdsEntry2
        /// </summary>
        public static XdsEntry2 ParseXdsEntry2(IFhirReader reader, ErrorList errors, XdsEntry2 existingInstance = null )
        {
            XdsEntry2 result = existingInstance != null ? existingInstance : new XdsEntry2();
            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());

                    // Parse element id
                    else if( ParserUtils.IsAtFhirElement(reader, "id") )
                        result.Id = IdentifierParser.ParseIdentifier(reader, errors);

                    // Parse element information
                    else if( ParserUtils.IsAtFhirElement(reader, "information") )
                        result.Information = DocumentInformationParser.ParseDocumentInformation(reader, errors);

                    // Parse element format
                    else if( ParserUtils.IsAtFhirElement(reader, "format") )
                        result.Format = CodingParser.ParseCoding(reader, errors);

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

                    // Parse element folder
                    else if( ParserUtils.IsAtFhirElement(reader, "folder") )
                    {
                        result.Folder = new List<ResourceReference>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "folder") )
                            result.Folder.Add(ResourceReferenceParser.ParseResourceReference(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element subject
                    else if( ParserUtils.IsAtFhirElement(reader, "subject") )
                        result.Subject = ResourceReferenceParser.ParseResourceReference(reader, errors);

                    // Parse element content
                    else if( ParserUtils.IsAtFhirElement(reader, "content") )
                        result.Content = AttachmentParser.ParseAttachment(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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:XdsEntry2Parser.cs

示例10: ParsePrescriptionAdministrationRequestComponent

        /// <summary>
        /// Parse PrescriptionAdministrationRequestComponent
        /// </summary>
        public static Prescription.PrescriptionAdministrationRequestComponent ParsePrescriptionAdministrationRequestComponent(IFhirReader reader, ErrorList errors, Prescription.PrescriptionAdministrationRequestComponent existingInstance = null )
        {
            Prescription.PrescriptionAdministrationRequestComponent result = existingInstance != null ? existingInstance : new Prescription.PrescriptionAdministrationRequestComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element description
                    else if( ParserUtils.IsAtFhirElement(reader, "description") )
                        result.Description = FhirStringParser.ParseFhirString(reader, errors);

                    // Parse element totalPeriodicDose
                    else if( ParserUtils.IsAtFhirElement(reader, "totalPeriodicDose") )
                        result.TotalPeriodicDose = RatioParser.ParseRatio(reader, errors);

                    // Parse element start
                    else if( ParserUtils.IsAtFhirElement(reader, "start") )
                        result.Start = FhirDateTimeParser.ParseFhirDateTime(reader, errors);

                    // Parse element end
                    else if( ParserUtils.IsAtFhirElement(reader, "end") )
                        result.End = FhirDateTimeParser.ParseFhirDateTime(reader, errors);

                    // Parse element duration
                    else if( ParserUtils.IsAtFhirElement(reader, "duration") )
                        result.Duration = QuantityParser.ParseQuantity(reader, errors);

                    // Parse element numberOfAdministrations
                    else if( ParserUtils.IsAtFhirElement(reader, "numberOfAdministrations") )
                        result.NumberOfAdministrations = IntegerParser.ParseInteger(reader, errors);

                    // Parse element dosageInstruction
                    else if( ParserUtils.IsAtFhirElement(reader, "dosageInstruction") )
                    {
                        result.DosageInstruction = new List<Prescription.PrescriptionAdministrationRequestDosageInstructionComponent>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "dosageInstruction") )
                            result.DosageInstruction.Add(PrescriptionParser.ParsePrescriptionAdministrationRequestDosageInstructionComponent(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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:81,代码来源:PrescriptionParser.cs

示例11: ParseProvider

        /// <summary>
        /// Parse Provider
        /// </summary>
        public static Provider ParseProvider(IFhirReader reader, ErrorList errors, Provider existingInstance = null )
        {
            Provider result = existingInstance != null ? existingInstance : new Provider();
            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());

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

                        while( ParserUtils.IsAtArrayElement(reader, "identifier") )
                            result.Identifier.Add(IdentifierParser.ParseIdentifier(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element details
                    else if( ParserUtils.IsAtFhirElement(reader, "details") )
                        result.Details = DemographicsParser.ParseDemographics(reader, errors);

                    // Parse element organization
                    else if( ParserUtils.IsAtFhirElement(reader, "organization") )
                        result.Organization = ResourceReferenceParser.ParseResourceReference(reader, errors);

                    // Parse element role
                    else if( ParserUtils.IsAtFhirElement(reader, "role") )
                    {
                        result.Role = new List<CodeableConcept>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "role") )
                            result.Role.Add(CodeableConceptParser.ParseCodeableConcept(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element specialty
                    else if( ParserUtils.IsAtFhirElement(reader, "specialty") )
                    {
                        result.Specialty = new List<CodeableConcept>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "specialty") )
                            result.Specialty.Add(CodeableConceptParser.ParseCodeableConcept(reader, errors));

                        reader.LeaveArray();
                    }

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

                    else
                    {
                        errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:ProviderParser.cs

示例12: ParseIssueReportIssueComponent

        /// <summary>
        /// Parse IssueReportIssueComponent
        /// </summary>
        public static IssueReport.IssueReportIssueComponent ParseIssueReportIssueComponent(IFhirReader reader, ErrorList errors, IssueReport.IssueReportIssueComponent existingInstance = null )
        {
            IssueReport.IssueReportIssueComponent result = existingInstance != null ? existingInstance : new IssueReport.IssueReportIssueComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element severity
                    else if( ParserUtils.IsAtFhirElement(reader, "severity") )
                        result.Severity = CodeParser.ParseCode<IssueReport.IssueSeverity>(reader, errors);

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

                    // Parse element details
                    else if( ParserUtils.IsAtFhirElement(reader, "details") )
                        result.Details = FhirStringParser.ParseFhirString(reader, errors);

                    // Parse element location
                    else if( ParserUtils.IsAtFhirElement(reader, "location") )
                    {
                        result.Location = new List<FhirString>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "location") )
                            result.Location.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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:69,代码来源:IssueReportParser.cs

示例13: ParseXdsEntry

        /// <summary>
        /// Parse XdsEntry
        /// </summary>
        public static XdsEntry ParseXdsEntry(IFhirReader reader, ErrorList errors, XdsEntry existingInstance = null )
        {
            XdsEntry result = existingInstance != null ? existingInstance : new XdsEntry();
            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());

                    // Parse element url
                    else if( ParserUtils.IsAtFhirElement(reader, "url") )
                        result.Url = FhirUriParser.ParseFhirUri(reader, errors);

                    // Parse element repositoryId
                    else if( ParserUtils.IsAtFhirElement(reader, "repositoryId") )
                        result.RepositoryId = FhirUriParser.ParseFhirUri(reader, errors);

                    // Parse element mimeType
                    else if( ParserUtils.IsAtFhirElement(reader, "mimeType") )
                        result.MimeType = FhirStringParser.ParseFhirString(reader, errors);

                    // Parse element format
                    else if( ParserUtils.IsAtFhirElement(reader, "format") )
                        result.Format = CodingParser.ParseCoding(reader, errors);

                    // Parse element class
                    else if( ParserUtils.IsAtFhirElement(reader, "class") )
                        result.Class = CodingParser.ParseCoding(reader, errors);

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

                    // Parse element title
                    else if( ParserUtils.IsAtFhirElement(reader, "title") )
                        result.Title = FhirStringParser.ParseFhirString(reader, errors);

                    // Parse element documentId
                    else if( ParserUtils.IsAtFhirElement(reader, "documentId") )
                        result.DocumentId = FhirUriParser.ParseFhirUri(reader, errors);

                    // Parse element availability
                    else if( ParserUtils.IsAtFhirElement(reader, "availability") )
                        result.Availability = CodeParser.ParseCode<XdsEntry.XdsEntryAvailability>(reader, errors);

                    // Parse element confidentialityCode
                    else if( ParserUtils.IsAtFhirElement(reader, "confidentialityCode") )
                        result.ConfidentialityCode = CodingParser.ParseCoding(reader, errors);

                    // Parse element created
                    else if( ParserUtils.IsAtFhirElement(reader, "created") )
                        result.Created = InstantParser.ParseInstant(reader, errors);

                    // Parse element event
                    else if( ParserUtils.IsAtFhirElement(reader, "event") )
                    {
                        result.Event = new List<Coding>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "event") )
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:XdsEntryParser.cs

示例14: ParseXdsEntryServiceComponent

        /// <summary>
        /// Parse XdsEntryServiceComponent
        /// </summary>
        public static XdsEntry.XdsEntryServiceComponent ParseXdsEntryServiceComponent(IFhirReader reader, ErrorList errors, XdsEntry.XdsEntryServiceComponent existingInstance = null )
        {
            XdsEntry.XdsEntryServiceComponent result = existingInstance != null ? existingInstance : new XdsEntry.XdsEntryServiceComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element start
                    else if( ParserUtils.IsAtFhirElement(reader, "start") )
                        result.Start = FhirDateTimeParser.ParseFhirDateTime(reader, errors);

                    // Parse element stop
                    else if( ParserUtils.IsAtFhirElement(reader, "stop") )
                        result.Stop = 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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
        }
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:53,代码来源:XdsEntryParser.cs

示例15: ParseXdsEntryAuthorComponent

        /// <summary>
        /// Parse XdsEntryAuthorComponent
        /// </summary>
        public static XdsEntry.XdsEntryAuthorComponent ParseXdsEntryAuthorComponent(IFhirReader reader, ErrorList errors, XdsEntry.XdsEntryAuthorComponent existingInstance = null )
        {
            XdsEntry.XdsEntryAuthorComponent result = existingInstance != null ? existingInstance : new XdsEntry.XdsEntryAuthorComponent();
            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 internalId
                    else if( reader.IsAtRefIdElement() )
                        result.InternalId = Id.Parse(reader.ReadRefIdContents());

                    // Parse element name
                    else if( ParserUtils.IsAtFhirElement(reader, "name") )
                        result.Name = HumanNameParser.ParseHumanName(reader, errors);

                    // Parse element id
                    else if( ParserUtils.IsAtFhirElement(reader, "id") )
                        result.Id = IdentifierParser.ParseIdentifier(reader, errors);

                    // Parse element role
                    else if( ParserUtils.IsAtFhirElement(reader, "role") )
                    {
                        result.Role = new List<FhirString>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "role") )
                            result.Role.Add(FhirStringParser.ParseFhirString(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element specialty
                    else if( ParserUtils.IsAtFhirElement(reader, "specialty") )
                    {
                        result.Specialty = new List<FhirString>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "specialty") )
                            result.Specialty.Add(FhirStringParser.ParseFhirString(reader, errors));

                        reader.LeaveArray();
                    }

                    // Parse element institution
                    else if( ParserUtils.IsAtFhirElement(reader, "institution") )
                    {
                        result.Institution = new List<XdsEntry.XdsEntryAuthorInstitutionComponent>();
                        reader.EnterArray();

                        while( ParserUtils.IsAtArrayElement(reader, "institution") )
                            result.Institution.Add(XdsEntryParser.ParseXdsEntryAuthorInstitutionComponent(reader, errors));

                        reader.LeaveArray();
                    }

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

                        while( ParserUtils.IsAtArrayElement(reader, "contact") )
                            result.Contact.Add(ContactParser.ParseContact(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();
            }
            catch (Exception ex)
            {
                errors.Add(ex.Message, reader);
            }
            return result;
//.........这里部分代码省略.........
开发者ID:avontd2868,项目名称:vista-novo-fhir,代码行数:101,代码来源:XdsEntryParser.cs


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