本文整理汇总了C#中IFhirReader.EnterElement方法的典型用法代码示例。如果您正苦于以下问题:C# IFhirReader.EnterElement方法的具体用法?C# IFhirReader.EnterElement怎么用?C# IFhirReader.EnterElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFhirReader
的用法示例。
在下文中一共展示了IFhirReader.EnterElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseIdentifier
/// <summary>
/// Parse Identifier
/// </summary>
public static Hl7.Fhir.Model.Identifier ParseIdentifier(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Identifier existingInstance = null )
{
Hl7.Fhir.Model.Identifier result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Identifier();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element use
else if( atName == "use" )
result.UseElement = CodeParser.ParseCode<Hl7.Fhir.Model.Identifier.IdentifierUse>(reader, errors);
// Parse element label
else if( atName == "label" )
result.LabelElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element system
else if( atName == "system" )
result.SystemElement = FhirUriParser.ParseFhirUri(reader, errors);
// Parse element key
else if( atName == "key" )
result.KeyElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element period
else if( atName == "period" )
result.Period = PeriodParser.ParsePeriod(reader, errors);
// Parse element assigner
else if( atName == "assigner" )
result.Assigner = ResourceReferenceParser.ParseResourceReference(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例2: ParseInterestOfCare
/// <summary>
/// Parse InterestOfCare
/// </summary>
public static Hl7.Fhir.Model.InterestOfCare ParseInterestOfCare(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.InterestOfCare existingInstance = null )
{
Hl7.Fhir.Model.InterestOfCare result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.InterestOfCare();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element language
else if( atName == "language" )
result.LanguageElement = CodeParser.ParseCode(reader, errors);
// Parse element text
else if( atName == "text" )
result.Text = NarrativeParser.ParseNarrative(reader, errors);
// Parse element contained
else if( atName == "contained" )
{
result.Contained = new List<Hl7.Fhir.Model.Resource>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "contained") )
result.Contained.Add(ParserUtils.ParseContainedResource(reader,errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例3: ParseCodeableConcept
/// <summary>
/// Parse CodeableConcept
/// </summary>
public static Hl7.Fhir.Model.CodeableConcept ParseCodeableConcept(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.CodeableConcept existingInstance = null )
{
Hl7.Fhir.Model.CodeableConcept result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.CodeableConcept();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element coding
else if( atName == "coding" )
{
result.Coding = new List<Hl7.Fhir.Model.Coding>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "coding") )
result.Coding.Add(CodingParser.ParseCoding(reader, errors));
reader.LeaveArray();
}
// Parse element text
else if( atName == "text" )
result.TextElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element primary
else if( atName == "primary" )
result.PrimaryElement = IdRefParser.ParseIdRef(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例4: ParseQuantity
/// <summary>
/// Parse Quantity
/// </summary>
public static Hl7.Fhir.Model.Quantity ParseQuantity(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Quantity existingInstance = null )
{
Hl7.Fhir.Model.Quantity result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Quantity();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element value
else if( atName == "value" )
result.ValueElement = FhirDecimalParser.ParseFhirDecimal(reader, errors);
// Parse element comparator
else if( atName == "comparator" )
result.ComparatorElement = CodeParser.ParseCode<Hl7.Fhir.Model.Quantity.QuantityCompararator>(reader, errors);
// Parse element units
else if( atName == "units" )
result.UnitsElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element system
else if( atName == "system" )
result.SystemElement = FhirUriParser.ParseFhirUri(reader, errors);
// Parse element code
else if( atName == "code" )
result.CodeElement = CodeParser.ParseCode(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例5: 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;
}
示例6: 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();
}
示例7: ParseElementComponent
/// <summary>
/// Parse ElementComponent
/// </summary>
public static Hl7.Fhir.Model.Profile.ElementComponent ParseElementComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Profile.ElementComponent existingInstance = null )
{
Hl7.Fhir.Model.Profile.ElementComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Profile.ElementComponent();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element path
else if( atName == "path" )
result.PathElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element name
else if( atName == "name" )
result.NameElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element slicing
else if( atName == "slicing" )
result.Slicing = ProfileParser.ParseElementSlicingComponent(reader, errors);
// Parse element definition
else if( atName == "definition" )
result.Definition = ProfileParser.ParseElementDefinitionComponent(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例8: ParseSchedule
/// <summary>
/// Parse Schedule
/// </summary>
public static Hl7.Fhir.Model.Schedule ParseSchedule(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Schedule existingInstance = null )
{
Hl7.Fhir.Model.Schedule result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Schedule();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element event
else if( atName == "event" )
{
result.Event = new List<Hl7.Fhir.Model.Period>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "event") )
result.Event.Add(PeriodParser.ParsePeriod(reader, errors));
reader.LeaveArray();
}
// Parse element repeat
else if( atName == "repeat" )
result.Repeat = ScheduleParser.ParseScheduleRepeatComponent(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例9: ParseAnimalComponent
/// <summary>
/// Parse AnimalComponent
/// </summary>
public static Hl7.Fhir.Model.Patient.AnimalComponent ParseAnimalComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Patient.AnimalComponent existingInstance = null )
{
Hl7.Fhir.Model.Patient.AnimalComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Patient.AnimalComponent();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element species
else if( atName == "species" )
result.Species = CodeableConceptParser.ParseCodeableConcept(reader, errors);
// Parse element breed
else if( atName == "breed" )
result.Breed = CodeableConceptParser.ParseCodeableConcept(reader, errors);
// Parse element genderStatus
else if( atName == "genderStatus" )
result.GenderStatus = CodeableConceptParser.ParseCodeableConcept(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例10: ParseResourceReference
/// <summary>
/// Parse ResourceReference
/// </summary>
public static Hl7.Fhir.Model.ResourceReference ParseResourceReference(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.ResourceReference existingInstance = null )
{
Hl7.Fhir.Model.ResourceReference result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.ResourceReference();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element type
else if( atName == "type" )
result.TypeElement = CodeParser.ParseCode(reader, errors);
// Parse element reference
else if( atName == "reference" )
result.ReferenceElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element display
else if( atName == "display" )
result.DisplayElement = FhirStringParser.ParseFhirString(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例11: ParseRange
/// <summary>
/// Parse Range
/// </summary>
public static Hl7.Fhir.Model.Range ParseRange(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Range existingInstance = null )
{
Hl7.Fhir.Model.Range result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Range();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element low
else if( atName == "low" )
result.Low = QuantityParser.ParseQuantity(reader, errors);
// Parse element high
else if( atName == "high" )
result.High = QuantityParser.ParseQuantity(reader, errors);
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例12: ParseNarrative
/// <summary>
/// Parse Narrative
/// </summary>
public static Hl7.Fhir.Model.Narrative ParseNarrative(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Narrative existingInstance = null )
{
Hl7.Fhir.Model.Narrative result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Narrative();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element status
else if( atName == "status" )
result.StatusElement = CodeParser.ParseCode<Hl7.Fhir.Model.Narrative.NarrativeStatus>(reader, errors);
// Parse element div
else if( atName == "div" )
result.DivElement = XHtml.Parse(reader.ReadPrimitiveContents(typeof(XHtml)));
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例13: 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;
}
示例14: ParseConformanceRestResourceComponent
/// <summary>
/// Parse ConformanceRestResourceComponent
/// </summary>
public static Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent ParseConformanceRestResourceComponent(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent existingInstance = null )
{
Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance.ConformanceRestResourceComponent();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element type
else if( atName == "type" )
result.TypeElement = CodeParser.ParseCode(reader, errors);
// Parse element profile
else if( atName == "profile" )
result.Profile = ResourceReferenceParser.ParseResourceReference(reader, errors);
// Parse element operation
else if( atName == "operation" )
{
result.Operation = new List<Hl7.Fhir.Model.Conformance.ConformanceRestResourceOperationComponent>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "operation") )
result.Operation.Add(ConformanceParser.ParseConformanceRestResourceOperationComponent(reader, errors));
reader.LeaveArray();
}
// Parse element readHistory
else if( atName == "readHistory" )
result.ReadHistoryElement = FhirBooleanParser.ParseFhirBoolean(reader, errors);
// Parse element searchInclude
else if( atName == "searchInclude" )
{
result.SearchIncludeElement = new List<Hl7.Fhir.Model.FhirString>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "searchInclude") )
result.SearchIncludeElement.Add(FhirStringParser.ParseFhirString(reader, errors));
reader.LeaveArray();
}
// Parse element searchParam
else if( atName == "searchParam" )
{
result.SearchParam = new List<Hl7.Fhir.Model.Conformance.ConformanceRestResourceSearchParamComponent>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "searchParam") )
result.SearchParam.Add(ConformanceParser.ParseConformanceRestResourceSearchParamComponent(reader, errors));
reader.LeaveArray();
}
else
{
errors.Add(String.Format("Encountered unknown element {0} while parsing {1}", reader.CurrentElementName, currentElementName), reader);
reader.SkipSubElementsFor(currentElementName);
result = null;
}
}
reader.LeaveElement();
return result;
}
示例15: ParseConformance
/// <summary>
/// Parse Conformance
/// </summary>
public static Hl7.Fhir.Model.Conformance ParseConformance(IFhirReader reader, ErrorList errors, Hl7.Fhir.Model.Conformance existingInstance = null )
{
Hl7.Fhir.Model.Conformance result = existingInstance != null ? existingInstance : new Hl7.Fhir.Model.Conformance();
string currentElementName = reader.CurrentElementName;
reader.EnterElement();
while (reader.HasMoreElements())
{
var atName = reader.CurrentElementName;
// Parse element extension
if( atName == "extension" )
{
result.Extension = new List<Hl7.Fhir.Model.Extension>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "extension") )
result.Extension.Add(ExtensionParser.ParseExtension(reader, errors));
reader.LeaveArray();
}
// Parse element language
else if( atName == "language" )
result.LanguageElement = CodeParser.ParseCode(reader, errors);
// Parse element text
else if( atName == "text" )
result.Text = NarrativeParser.ParseNarrative(reader, errors);
// Parse element contained
else if( atName == "contained" )
{
result.Contained = new List<Hl7.Fhir.Model.Resource>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "contained") )
result.Contained.Add(ParserUtils.ParseContainedResource(reader,errors));
reader.LeaveArray();
}
// Parse element _id
else if( atName == "_id" )
result.LocalIdElement = Id.Parse(reader.ReadPrimitiveContents(typeof(Id)));
// Parse element identifier
else if( atName == "identifier" )
result.IdentifierElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element version
else if( atName == "version" )
result.VersionElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element name
else if( atName == "name" )
result.NameElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element publisher
else if( atName == "publisher" )
result.PublisherElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element telecom
else if( atName == "telecom" )
{
result.Telecom = new List<Hl7.Fhir.Model.Contact>();
reader.EnterArray();
while( ParserUtils.IsAtArrayElement(reader, "telecom") )
result.Telecom.Add(ContactParser.ParseContact(reader, errors));
reader.LeaveArray();
}
// Parse element description
else if( atName == "description" )
result.DescriptionElement = FhirStringParser.ParseFhirString(reader, errors);
// Parse element status
else if( atName == "status" )
result.StatusElement = CodeParser.ParseCode<Hl7.Fhir.Model.Conformance.ConformanceStatementStatus>(reader, errors);
// Parse element experimental
else if( atName == "experimental" )
result.ExperimentalElement = FhirBooleanParser.ParseFhirBoolean(reader, errors);
// Parse element date
else if( atName == "date" )
result.DateElement = FhirDateTimeParser.ParseFhirDateTime(reader, errors);
// Parse element software
else if( atName == "software" )
result.Software = ConformanceParser.ParseConformanceSoftwareComponent(reader, errors);
// Parse element implementation
else if( atName == "implementation" )
result.Implementation = ConformanceParser.ParseConformanceImplementationComponent(reader, errors);
//.........这里部分代码省略.........