本文整理汇总了C#中IFhirWriter.WriteStartRootObject方法的典型用法代码示例。如果您正苦于以下问题:C# IFhirWriter.WriteStartRootObject方法的具体用法?C# IFhirWriter.WriteStartRootObject怎么用?C# IFhirWriter.WriteStartRootObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFhirWriter
的用法示例。
在下文中一共展示了IFhirWriter.WriteStartRootObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: SerializePatient
public static void SerializePatient(Hl7.Fhir.Model.Patient value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Patient");
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();
}
// Serialize element identifier
if(value.Identifier != null && value.Identifier.Count > 0)
{
writer.WriteStartArrayElement("identifier");
foreach(var item in value.Identifier)
{
writer.WriteStartArrayMember("identifier");
IdentifierSerializer.SerializeIdentifier(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element name
if(value.Name != null && value.Name.Count > 0)
{
writer.WriteStartArrayElement("name");
foreach(var item in value.Name)
{
writer.WriteStartArrayMember("name");
HumanNameSerializer.SerializeHumanName(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element telecom
if(value.Telecom != null && value.Telecom.Count > 0)
{
writer.WriteStartArrayElement("telecom");
foreach(var item in value.Telecom)
{
writer.WriteStartArrayMember("telecom");
ContactSerializer.SerializeContact(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element gender
if(value.Gender != null)
{
writer.WriteStartElement("gender");
CodeableConceptSerializer.SerializeCodeableConcept(value.Gender, writer, summary);
writer.WriteEndElement();
}
// Serialize element birthDate
if(value.BirthDateElement != null)
//.........这里部分代码省略.........
示例4: SerializeCoverage
public static void SerializeCoverage(Hl7.Fhir.Model.Coverage value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Coverage");
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();
}
// Serialize element issuer
if(value.Issuer != null && !summary)
{
writer.WriteStartElement("issuer");
ResourceReferenceSerializer.SerializeResourceReference(value.Issuer, writer, summary);
writer.WriteEndElement();
}
// Serialize element period
if(value.Period != null && !summary)
{
writer.WriteStartElement("period");
PeriodSerializer.SerializePeriod(value.Period, writer, summary);
writer.WriteEndElement();
}
// Serialize element type
if(value.Type != null && !summary)
{
writer.WriteStartElement("type");
CodingSerializer.SerializeCoding(value.Type, writer, summary);
writer.WriteEndElement();
}
// Serialize element identifier
if(value.Identifier != null && !summary)
{
writer.WriteStartElement("identifier");
IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary);
writer.WriteEndElement();
}
// Serialize element group
if(value.Group != null && !summary)
{
writer.WriteStartElement("group");
IdentifierSerializer.SerializeIdentifier(value.Group, writer, summary);
writer.WriteEndElement();
}
// Serialize element plan
if(value.Plan != null && !summary)
{
writer.WriteStartElement("plan");
IdentifierSerializer.SerializeIdentifier(value.Plan, writer, summary);
writer.WriteEndElement();
}
// Serialize element subplan
//.........这里部分代码省略.........
示例5: SerializeImagingStudy
public static void SerializeImagingStudy(Hl7.Fhir.Model.ImagingStudy value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("ImagingStudy");
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();
}
// Serialize element dateTime
if(value.DateTimeElement != null && !summary)
{
writer.WriteStartElement("dateTime");
FhirDateTimeSerializer.SerializeFhirDateTime(value.DateTimeElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element subject
if(value.Subject != null && !summary)
{
writer.WriteStartElement("subject");
ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary);
writer.WriteEndElement();
}
// Serialize element uid
if(value.UidElement != null && !summary)
{
writer.WriteStartElement("uid");
OidSerializer.SerializeOid(value.UidElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element accessionNo
if(value.AccessionNo != null && !summary)
{
writer.WriteStartElement("accessionNo");
IdentifierSerializer.SerializeIdentifier(value.AccessionNo, writer, summary);
writer.WriteEndElement();
}
// Serialize element identifier
if(value.Identifier != null && !summary && value.Identifier.Count > 0)
{
writer.WriteStartArrayElement("identifier");
foreach(var item in value.Identifier)
{
writer.WriteStartArrayMember("identifier");
IdentifierSerializer.SerializeIdentifier(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element modality
if(value.Modality_Element != null && !summary && value.Modality_Element.Count > 0)
{
writer.WriteStartArrayElement("modality");
//.........这里部分代码省略.........
示例6: SerializeFamilyHistory
public static void SerializeFamilyHistory(Hl7.Fhir.Model.FamilyHistory value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("FamilyHistory");
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();
}
// Serialize element subject
if(value.Subject != null)
{
writer.WriteStartElement("subject");
ResourceReferenceSerializer.SerializeResourceReference(value.Subject, writer, summary);
writer.WriteEndElement();
}
// Serialize element note
if(value.NoteElement != null && !summary)
{
writer.WriteStartElement("note");
FhirStringSerializer.SerializeFhirString(value.NoteElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element relation
if(value.Relation != null && !summary && value.Relation.Count > 0)
{
writer.WriteStartArrayElement("relation");
foreach(var item in value.Relation)
{
writer.WriteStartArrayMember("relation");
FamilyHistorySerializer.SerializeFamilyHistoryRelationComponent(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
writer.WriteEndComplexContent();
writer.WriteEndRootObject();
}
示例7: SerializeGroup
public static void SerializeGroup(Hl7.Fhir.Model.Group value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Group");
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();
}
// Serialize element identifier
if(value.Identifier != null)
{
writer.WriteStartElement("identifier");
IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary);
writer.WriteEndElement();
}
// Serialize element type
if(value.TypeElement != null)
{
writer.WriteStartElement("type");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.Group.GroupType>(value.TypeElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element actual
if(value.ActualElement != null)
{
writer.WriteStartElement("actual");
FhirBooleanSerializer.SerializeFhirBoolean(value.ActualElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element code
if(value.Code != null)
{
writer.WriteStartElement("code");
CodeableConceptSerializer.SerializeCodeableConcept(value.Code, writer, summary);
writer.WriteEndElement();
}
// Serialize element name
if(value.NameElement != null)
{
writer.WriteStartElement("name");
FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element quantity
if(value.QuantityElement != null)
{
writer.WriteStartElement("quantity");
IntegerSerializer.SerializeInteger(value.QuantityElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element characteristic
//.........这里部分代码省略.........
示例8: SerializeObservation
public static void SerializeObservation(Hl7.Fhir.Model.Observation value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Observation");
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();
}
// Serialize element name
if(value.Name != null && !summary)
{
writer.WriteStartElement("name");
CodeableConceptSerializer.SerializeCodeableConcept(value.Name, writer, summary);
writer.WriteEndElement();
}
// Serialize element value
if(value.Value != null && !summary)
{
writer.WriteStartElement( SerializationUtil.BuildPolymorphicName("value", value.Value.GetType()) );
FhirSerializer.SerializeElement(value.Value, writer, summary);
writer.WriteEndElement();
}
// Serialize element interpretation
if(value.Interpretation != null && !summary)
{
writer.WriteStartElement("interpretation");
CodeableConceptSerializer.SerializeCodeableConcept(value.Interpretation, writer, summary);
writer.WriteEndElement();
}
// Serialize element comments
if(value.CommentsElement != null && !summary)
{
writer.WriteStartElement("comments");
FhirStringSerializer.SerializeFhirString(value.CommentsElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element applies
if(value.Applies != null && !summary)
{
writer.WriteStartElement( SerializationUtil.BuildPolymorphicName("applies", value.Applies.GetType()) );
FhirSerializer.SerializeElement(value.Applies, writer, summary);
writer.WriteEndElement();
}
// Serialize element issued
if(value.IssuedElement != null && !summary)
{
writer.WriteStartElement("issued");
InstantSerializer.SerializeInstant(value.IssuedElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element status
//.........这里部分代码省略.........
示例9: SerializeQuery
public static void SerializeQuery(Hl7.Fhir.Model.Query value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Query");
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();
}
// Serialize element identifier
if(value.IdentifierElement != null && !summary)
{
writer.WriteStartElement("identifier");
FhirUriSerializer.SerializeFhirUri(value.IdentifierElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element parameter
if(value.Parameter != null && !summary && value.Parameter.Count > 0)
{
writer.WriteStartArrayElement("parameter");
foreach(var item in value.Parameter)
{
writer.WriteStartArrayMember("parameter");
ExtensionSerializer.SerializeExtension(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element response
if(value.Response != null && !summary)
{
writer.WriteStartElement("response");
QuerySerializer.SerializeQueryResponseComponent(value.Response, writer, summary);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
writer.WriteEndRootObject();
}
示例10: SerializeProvenance
public static void SerializeProvenance(Hl7.Fhir.Model.Provenance value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Provenance");
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();
}
// Serialize element target
if(value.Target != null && !summary && value.Target.Count > 0)
{
writer.WriteStartArrayElement("target");
foreach(var item in value.Target)
{
writer.WriteStartArrayMember("target");
ResourceReferenceSerializer.SerializeResourceReference(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element period
if(value.Period != null && !summary)
{
writer.WriteStartElement("period");
PeriodSerializer.SerializePeriod(value.Period, writer, summary);
writer.WriteEndElement();
}
// Serialize element recorded
if(value.RecordedElement != null && !summary)
{
writer.WriteStartElement("recorded");
InstantSerializer.SerializeInstant(value.RecordedElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element reason
if(value.Reason != null && !summary)
{
writer.WriteStartElement("reason");
CodeableConceptSerializer.SerializeCodeableConcept(value.Reason, writer, summary);
writer.WriteEndElement();
}
// Serialize element location
if(value.Location != null && !summary)
{
writer.WriteStartElement("location");
ResourceReferenceSerializer.SerializeResourceReference(value.Location, writer, summary);
writer.WriteEndElement();
}
// Serialize element policy
if(value.PolicyElement != null && !summary && value.PolicyElement.Count > 0)
{
writer.WriteStartArrayElement("policy");
//.........这里部分代码省略.........
示例11: SerializeMedication
public static void SerializeMedication(Hl7.Fhir.Model.Medication value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Medication");
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();
}
// Serialize element name
if(value.NameElement != null)
{
writer.WriteStartElement("name");
FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element code
if(value.Code != null)
{
writer.WriteStartElement("code");
CodeableConceptSerializer.SerializeCodeableConcept(value.Code, writer, summary);
writer.WriteEndElement();
}
// Serialize element isBrand
if(value.IsBrandElement != null)
{
writer.WriteStartElement("isBrand");
FhirBooleanSerializer.SerializeFhirBoolean(value.IsBrandElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element manufacturer
if(value.Manufacturer != null)
{
writer.WriteStartElement("manufacturer");
ResourceReferenceSerializer.SerializeResourceReference(value.Manufacturer, writer, summary);
writer.WriteEndElement();
}
// Serialize element kind
if(value.KindElement != null)
{
writer.WriteStartElement("kind");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.Medication.MedicationKind>(value.KindElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element product
if(value.Product != null && !summary)
{
writer.WriteStartElement("product");
MedicationSerializer.SerializeMedicationProductComponent(value.Product, writer, summary);
writer.WriteEndElement();
}
// Serialize element package
//.........这里部分代码省略.........
示例12: SerializeOrderResponse
public static void SerializeOrderResponse(Hl7.Fhir.Model.OrderResponse value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("OrderResponse");
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();
}
// Serialize element request
if(value.Request != null && !summary)
{
writer.WriteStartElement("request");
ResourceReferenceSerializer.SerializeResourceReference(value.Request, writer, summary);
writer.WriteEndElement();
}
// Serialize element date
if(value.DateElement != null && !summary)
{
writer.WriteStartElement("date");
FhirDateTimeSerializer.SerializeFhirDateTime(value.DateElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element who
if(value.Who != null && !summary)
{
writer.WriteStartElement("who");
ResourceReferenceSerializer.SerializeResourceReference(value.Who, writer, summary);
writer.WriteEndElement();
}
// Serialize element authority
if(value.Authority != null && !summary)
{
writer.WriteStartElement("authority");
ResourceReferenceSerializer.SerializeResourceReference(value.Authority, writer, summary);
writer.WriteEndElement();
}
// Serialize element cost
if(value.Cost != null && !summary)
{
writer.WriteStartElement("cost");
QuantitySerializer.SerializeQuantity(value.Cost, writer, summary);
writer.WriteEndElement();
}
// Serialize element code
if(value.CodeElement != null && !summary)
{
writer.WriteStartElement("code");
CodeSerializer.SerializeCode<Hl7.Fhir.Model.OrderResponse.OrderOutcomeCode>(value.CodeElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element description
//.........这里部分代码省略.........
示例13: SerializeValueSet
public static void SerializeValueSet(Hl7.Fhir.Model.ValueSet value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("ValueSet");
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();
}
// Serialize element identifier
if(value.IdentifierElement != null)
{
writer.WriteStartElement("identifier");
FhirStringSerializer.SerializeFhirString(value.IdentifierElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element version
if(value.VersionElement != null)
{
writer.WriteStartElement("version");
FhirStringSerializer.SerializeFhirString(value.VersionElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element name
if(value.NameElement != null)
{
writer.WriteStartElement("name");
FhirStringSerializer.SerializeFhirString(value.NameElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element publisher
if(value.PublisherElement != null)
{
writer.WriteStartElement("publisher");
FhirStringSerializer.SerializeFhirString(value.PublisherElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element telecom
if(value.Telecom != null && value.Telecom.Count > 0)
{
writer.WriteStartArrayElement("telecom");
foreach(var item in value.Telecom)
{
writer.WriteStartArrayMember("telecom");
ContactSerializer.SerializeContact(item, writer, summary);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element description
if(value.DescriptionElement != null)
{
writer.WriteStartElement("description");
//.........这里部分代码省略.........
示例14: SerializeDocument
public static void SerializeDocument(Hl7.Fhir.Model.Document value, IFhirWriter writer, bool summary)
{
writer.WriteStartRootObject("Document");
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();
}
// Serialize element identifier
if(value.Identifier != null)
{
writer.WriteStartElement("identifier");
IdentifierSerializer.SerializeIdentifier(value.Identifier, writer, summary);
writer.WriteEndElement();
}
// Serialize element versionIdentifier
if(value.VersionIdentifier != null)
{
writer.WriteStartElement("versionIdentifier");
IdentifierSerializer.SerializeIdentifier(value.VersionIdentifier, writer, summary);
writer.WriteEndElement();
}
// Serialize element created
if(value.CreatedElement != null)
{
writer.WriteStartElement("created");
InstantSerializer.SerializeInstant(value.CreatedElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element type
if(value.Type != null)
{
writer.WriteStartElement("type");
CodeableConceptSerializer.SerializeCodeableConcept(value.Type, writer, summary);
writer.WriteEndElement();
}
// Serialize element subtype
if(value.Subtype != null)
{
writer.WriteStartElement("subtype");
CodeableConceptSerializer.SerializeCodeableConcept(value.Subtype, writer, summary);
writer.WriteEndElement();
}
// Serialize element title
if(value.TitleElement != null)
{
writer.WriteStartElement("title");
FhirStringSerializer.SerializeFhirString(value.TitleElement, writer, summary);
writer.WriteEndElement();
}
// Serialize element status
//.........这里部分代码省略.........
示例15: SerializeXdsFolder
public static void SerializeXdsFolder(XdsFolder value, IFhirWriter writer)
{
writer.WriteStartRootObject("XdsFolder");
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();
}
// Serialize element code
if(value.Code != null && value.Code.Count > 0)
{
writer.WriteStartArrayElement("code");
foreach(var item in value.Code)
{
writer.WriteStartArrayMember("code");
CodingSerializer.SerializeCoding(item, writer);
writer.WriteEndArrayMember();
}
writer.WriteEndArrayElement();
}
// Serialize element title
if(value.Title != null)
{
writer.WriteStartElement("title");
FhirStringSerializer.SerializeFhirString(value.Title, writer);
writer.WriteEndElement();
}
// Serialize element patientId
if(value.PatientId != null)
{
writer.WriteStartElement("patientId");
IdentifierSerializer.SerializeIdentifier(value.PatientId, writer);
writer.WriteEndElement();
}
// Serialize element homeCommunity
if(value.HomeCommunity != null)
{
writer.WriteStartElement("homeCommunity");
FhirStringSerializer.SerializeFhirString(value.HomeCommunity, writer);
writer.WriteEndElement();
}
// Serialize element comments
if(value.Comments != null)
{
writer.WriteStartElement("comments");
FhirStringSerializer.SerializeFhirString(value.Comments, writer);
writer.WriteEndElement();
}
writer.WriteEndComplexContent();
writer.WriteEndRootObject();
}