本文整理汇总了C#中IFhirWriter类的典型用法代码示例。如果您正苦于以下问题:C# IFhirWriter类的具体用法?C# IFhirWriter怎么用?C# IFhirWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFhirWriter类属于命名空间,在下文中一共展示了IFhirWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeFhirDecimal
public static void SerializeFhirDecimal(Hl7.Fhir.Model.FhirDecimal value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element value
if(value.Value != null)
writer.WritePrimitiveContents("value", value, XmlSerializationHint.Attribute);
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
writer.WriteEndComplexContent();
}
示例2: SerializeNarrative
public static void SerializeNarrative(Hl7.Fhir.Model.Narrative value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element status
if(value.StatusElement != null)
{
writer.WriteStartElement("status");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.Narrative.NarrativeStatus>(value.StatusElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element div
if(value.DivElement != null)
writer.WritePrimitiveContents("div", value.DivElement, XmlSerializationHint.XhtmlElement);
writer.WriteEndComplexContent();
}
示例3: SerializeInterestOfCare
public static void SerializeInterestOfCare(Hl7.Fhir.Model.InterestOfCare value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("InterestOfCare");
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element language
if(value.LanguageElement != null && !summary)
{
writer.WriteStartElement("language");
CodeSerializer.SerializeCode(value.LanguageElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element text
if(value.Text != null && !summary)
{
writer.WriteStartElement("text");
NarrativeSerializer.SerializeNarrative(value.Text, writer, summary);
writer.WriteEndElement();
}
// Serialize element contained
if(value.Contained != null && !summary && value.Contained.Count > 0)
{
writer.WriteStartArrayElement("contained");
foreach(var item in value.Contained)
{
writer.WriteStartArrayMember("contained");
FhirSerializer.SerializeResource(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
writer.WriteEndComplexContent();
writer.WriteEndRootObject();
}
示例4: SerializeProduct
public static void SerializeProduct(Product value, IFhirWriter writer)
{
writer.WriteStartRootObject("Product");
writer.WriteStartComplexContent();
// Serialize element's localId attribute
if( value.InternalId != null && !String.IsNullOrEmpty(value.InternalId.Contents) )
writer.WriteRefIdContents(value.InternalId.Contents);
// Serialize element extension
if(value.Extension != null && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element language
if(value.Language != null)
{
writer.WriteStartElement("language");
CodeSerializer.SerializeCode(value.Language, writer);
writer.WriteEndElement();
}
// Serialize element text
if(value.Text != null)
{
writer.WriteStartElement("text");
NarrativeSerializer.SerializeNarrative(value.Text, writer);
writer.WriteEndElement();
}
// Serialize element contained
if(value.Contained != null && value.Contained.Count > 0)
{
writer.WriteStartArrayElement("contained");
foreach(var item in value.Contained)
{
writer.WriteStartArrayMember("contained");
FhirSerializer.SerializeResource(item, writer);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
writer.WriteEndComplexContent();
writer.WriteEndRootObject();
}
示例5: SerializeChoice
public static void SerializeChoice(Hl7.Fhir.Model.Choice value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element code
if(value.CodeElement != null)
{
writer.WriteStartElement("code");
CodeSerializer.SerializeCode(value.CodeElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element option
if(value.Option != null && value.Option.Count > 0)
{
writer.WriteStartArrayElement("option");
foreach(var item in value.Option)
{
writer.WriteStartArrayMember("option");
ChoiceSerializer.SerializeChoiceOptionComponent(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element isOrdered
if(value.IsOrderedElement != null)
{
writer.WriteStartElement("isOrdered");
FhirBooleanSerializer.SerializeFhirBoolean(value.IsOrderedElement, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例6: SerializeCodeableConcept
public static void SerializeCodeableConcept(Hl7.Fhir.Model.CodeableConcept value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element coding
if(value.Coding != null && value.Coding.Count > 0)
{
writer.WriteStartArrayElement("coding");
foreach(var item in value.Coding)
{
writer.WriteStartArrayMember("coding");
CodingSerializer.SerializeCoding(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element text
if(value.TextElement != null)
{
writer.WriteStartElement("text");
FhirStringSerializer.SerializeFhirString(value.TextElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element primary
if(value.PrimaryElement != null)
{
writer.WriteStartElement("primary");
IdRefSerializer.SerializeIdRef(value.PrimaryElement, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例7: SerializeAnimalComponent
public static void SerializeAnimalComponent(Hl7.Fhir.Model.Patient.AnimalComponent value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element species
if(value.Species != null)
{
writer.WriteStartElement("species");
CodeableConceptSerializer.SerializeCodeableConcept(value.Species, writer, summary);
writer.WriteEndElement();
}
// Serialize element breed
if(value.Breed != null)
{
writer.WriteStartElement("breed");
CodeableConceptSerializer.SerializeCodeableConcept(value.Breed, writer, summary);
writer.WriteEndElement();
}
// Serialize element genderStatus
if(value.GenderStatus != null)
{
writer.WriteStartElement("genderStatus");
CodeableConceptSerializer.SerializeCodeableConcept(value.GenderStatus, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例8: SerializeExtension
public static void SerializeExtension(Hl7.Fhir.Model.Extension value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element url
if(value.UrlElement != null)
{
writer.WriteStartElement("url");
FhirUriSerializer.SerializeFhirUri(value.UrlElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element isModifier
if(value.IsModifierElement != null)
{
writer.WriteStartElement("isModifier");
FhirBooleanSerializer.SerializeFhirBoolean(value.IsModifierElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element value
if(value.Value != null)
{
writer.WriteStartElement( SerializationUtil.BuildPolymorphicName("value", value.Value.GetType()) );
FhirSerializer.SerializeElement(value.Value, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例9: SerializeCoding
public static void SerializeCoding(Hl7.Fhir.Model.Coding value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element system
if(value.SystemElement != null)
{
writer.WriteStartElement("system");
FhirUriSerializer.SerializeFhirUri(value.SystemElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element code
if(value.CodeElement != null)
{
writer.WriteStartElement("code");
CodeSerializer.SerializeCode(value.CodeElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element display
if(value.DisplayElement != null)
{
writer.WriteStartElement("display");
FhirStringSerializer.SerializeFhirString(value.DisplayElement, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例10: SerializeSchedule
public static void SerializeSchedule(Hl7.Fhir.Model.Schedule value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element event
if(value.Event != null && value.Event.Count > 0)
{
writer.WriteStartArrayElement("event");
foreach(var item in value.Event)
{
writer.WriteStartArrayMember("event");
PeriodSerializer.SerializePeriod(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element repeat
if(value.Repeat != null)
{
writer.WriteStartElement("repeat");
ScheduleSerializer.SerializeScheduleRepeatComponent(value.Repeat, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例11: SerializeRange
public static void SerializeRange(Hl7.Fhir.Model.Range value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element low
if(value.Low != null)
{
writer.WriteStartElement("low");
QuantitySerializer.SerializeQuantity(value.Low, writer, summary);
writer.WriteEndElement();
}
// Serialize element high
if(value.High != null)
{
writer.WriteStartElement("high");
QuantitySerializer.SerializeQuantity(value.High, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例12: SerializeRatio
public static void SerializeRatio(Hl7.Fhir.Model.Ratio value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element numerator
if(value.Numerator != null)
{
writer.WriteStartElement("numerator");
QuantitySerializer.SerializeQuantity(value.Numerator, writer, summary);
writer.WriteEndElement();
}
// Serialize element denominator
if(value.Denominator != null)
{
writer.WriteStartElement("denominator");
QuantitySerializer.SerializeQuantity(value.Denominator, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例13: SerializeCarePlanGoalComponent
public static void SerializeCarePlanGoalComponent(Hl7.Fhir.Model.CarePlan.CarePlanGoalComponent value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element description
if(value.DescriptionElement != null)
{
writer.WriteStartElement("description");
FhirStringSerializer.SerializeFhirString(value.DescriptionElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element status
if(value.StatusElement != null)
{
writer.WriteStartElement("status");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.CarePlan.CarePlanGoalStatus>(value.StatusElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element notes
if(value.NotesElement != null)
{
writer.WriteStartElement("notes");
FhirStringSerializer.SerializeFhirString(value.NotesElement, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
}
示例14: SerializeCarePlanActivityComponent
public static void SerializeCarePlanActivityComponent(Hl7.Fhir.Model.CarePlan.CarePlanActivityComponent value, IFhirWriter writer, bool summary)
{
writer.WriteStartComplexContent();
// Serialize element _id
if(value.LocalIdElement != null)
writer.WritePrimitiveContents("_id", value.LocalIdElement, XmlSerializationHint.Attribute);
// Serialize element extension
if(value.Extension != null && !summary && value.Extension.Count > 0)
{
writer.WriteStartArrayElement("extension");
foreach(var item in value.Extension)
{
writer.WriteStartArrayMember("extension");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element category
if(value.CategoryElement != null)
{
writer.WriteStartElement("category");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.CarePlan.CarePlanActivityCategory>(value.CategoryElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element code
if(value.Code != null)
{
writer.WriteStartElement("code");
CodeableConceptSerializer.SerializeCodeableConcept(value.Code, writer, summary);
writer.WriteEndElement();
}
// Serialize element status
if(value.StatusElement != null)
{
writer.WriteStartElement("status");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.CarePlan.CarePlanActivityStatus>(value.StatusElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element prohibited
if(value.ProhibitedElement != null)
{
writer.WriteStartElement("prohibited");
FhirBooleanSerializer.SerializeFhirBoolean(value.ProhibitedElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element timing
if(value.Timing != null)
{
writer.WriteStartElement( SerializationUtil.BuildPolymorphicName("timing", value.Timing.GetType()) );
FhirSerializer.SerializeElement(value.Timing, writer, summary);
writer.WriteEndElement();
}
// Serialize element location
if(value.Location != null)
{
writer.WriteStartElement("location");
ResourceReferenceSerializer.SerializeResourceReference(value.Location, writer, summary);
writer.WriteEndElement();
}
// Serialize element performer
if(value.Performer != null && value.Performer.Count > 0)
{
writer.WriteStartArrayElement("performer");
foreach(var item in value.Performer)
{
writer.WriteStartArrayMember("performer");
ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element product
if(value.Product != null)
{
writer.WriteStartElement("product");
ResourceReferenceSerializer.SerializeResourceReference(value.Product, writer, summary);
writer.WriteEndElement();
}
// Serialize element dailyAmount
if(value.DailyAmount != null)
{
writer.WriteStartElement("dailyAmount");
QuantitySerializer.SerializeQuantity(value.DailyAmount, writer, summary);
writer.WriteEndElement();
}
// Serialize element quantity
if(value.Quantity != null)
//.........这里部分代码省略.........
示例15: Serialize
internal static void Serialize(object instance, IFhirWriter writer, bool summary=false)
{
new ResourceWriter(writer).Serialize(instance, summary);
}