/// <summary> /// Writes the radiology laboratory results data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the radiology laboratory results data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The <see cref="When"/> property has not been set. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.RadiologyLabResultsWhenNotSet); // <radiology-lab-results> writer.WriteStartElement("radiology-lab-results"); // <when> _when.WriteXml("when", writer); // <title> XmlWriterHelper.WriteOptString( writer, "title", _title); // <anatomic-site> XmlWriterHelper.WriteOptString( writer, "anatomic-site", _anatomicSite); // <result-text> XmlWriterHelper.WriteOptString( writer, "result-text", _resultText); // </radiology-lab-result> writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the medical image study into /// the specified XML writer. /// </summary> /// /// <param name="writer"> /// The XML writer into which the medical image study series should be /// written. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="When"/> is <b>null</b>. /// If <see cref="Series"/> collection is <b>null</b> or empty. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.WhenNullValue); if (_series == null || _series.Count == 0) { throw new ThingSerializationException(Resources.MedicalImageStudySeriesMandatory); } writer.WriteStartElement("medical-image-study"); _when.WriteXml("when", writer); XmlWriterHelper.WriteOptString(writer, "patient-name", _patientName); XmlWriterHelper.WriteOptString(writer, "description", _description); foreach (MedicalImageStudySeries imageStudySeries in _series) { imageStudySeries.WriteXml("series", writer); } XmlWriterHelper.WriteOpt(writer, "reason", _reason); XmlWriterHelper.WriteOptString(writer, "preview-blob-name", _previewBlobName); foreach (MedicalImageStudySeriesImage image in _keyImages) { image.WriteXml("key-images", writer); } XmlWriterHelper.WriteOptString(writer, "study-instance-uid", _studyInstanceUID); writer.WriteEndElement(); }
internal void WriteXml(string nodeName, XmlWriter writer) { if (ItemKey == null && string.IsNullOrEmpty(ClientId)) { throw new ThingSerializationException(Resources.RelationshipItemKeyOrClientIdNotSpecified); } writer.WriteStartElement(nodeName); if (ItemKey != null) { writer.WriteElementString("thing-id", ItemKey.Id.ToString()); if (ItemKey.VersionStamp != Guid.Empty) { writer.WriteElementString("version-stamp", ItemKey.VersionStamp.ToString()); } } else { writer.WriteElementString("client-thing-id", ClientId); } XmlWriterHelper.WriteOptString(writer, "relationship-type", RelationshipType); writer.WriteEndElement(); }
/// <summary> /// Writes the vocabulary item to the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer element for the code value. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the code description to. /// </param> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The Value or VocabularyName property /// is <b>null</b> or empty. /// </exception> /// internal void WriteXmlInternal(string nodeName, XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowIfStringNullOrEmpty(Value, "Value"); if (nodeName != null) { writer.WriteStartElement(nodeName); } writer.WriteElementString("code-value", Value); XmlWriterHelper.WriteOptString(writer, "display-text", DisplayText); XmlWriterHelper.WriteOptString(writer, "abbreviation-text", AbbreviationText); if (_infoXml != null) { writer.WriteStartElement("info-xml"); { writer.WriteRaw(_infoXml.CreateNavigator().InnerXml); } writer.WriteEndElement(); } if (nodeName != null) { writer.WriteEndElement(); } }
/// <summary> /// Writes the XML representation of the medical image study series into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the medical image study series. /// </param> /// /// <param name="writer"> /// The XML writer into which the medical image study series should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="AcquisitionDateTime"/> is <b>null</b>. /// If <see cref="Images"/> is <b>null</b> or doesn't contain any image. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); if (_images == null || _images.Count == 0) { throw new ThingSerializationException(Resources.ImagesMandatory); } writer.WriteStartElement(nodeName); XmlWriterHelper.WriteOpt(writer, "acquisition-datetime", _acquisitionDateTime); XmlWriterHelper.WriteOptString(writer, "description", _description); foreach (MedicalImageStudySeriesImage image in _images) { XmlWriterHelper.WriteOpt(writer, "images", image); } XmlWriterHelper.WriteOpt(writer, "institution-name", _institutionName); XmlWriterHelper.WriteOpt(writer, "modality", _modality); XmlWriterHelper.WriteOpt(writer, "body-part", _bodyPart); XmlWriterHelper.WriteOptString(writer, "preview-blob-name", _previewBlobName); XmlWriterHelper.WriteOptString(writer, "series-instance-uid", _seriesInstanceUID); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the HealthGoal into /// the specified XML writer. /// </summary> /// /// <param name="writer"> /// The XML writer into which the HealthGoal should be /// written. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="Name"/> is <b>null</b>. /// </exception> /// public override void WriteXml(XmlWriter writer) { if (writer == null) { throw new ArgumentNullException( nameof(writer), Resources.WriteXmlNullWriter); } if (_name == null) { throw new ThingSerializationException( Resources.GoalNameNullValue); } writer.WriteStartElement("health-goal"); _name.WriteXml("name", writer); XmlWriterHelper.WriteOptString(writer, "description", _description); XmlWriterHelper.WriteOpt(writer, "start-date", _startDate); XmlWriterHelper.WriteOpt(writer, "end-date", _endDate); XmlWriterHelper.WriteOpt(writer, "associated-type-info", _associatedTypeInfo); XmlWriterHelper.WriteOpt(writer, "target-range", _targetRange); if (_goalAdditionalRanges != null && _goalAdditionalRanges.Count != 0) { foreach (GoalRange goalRange in _goalAdditionalRanges) { goalRange.WriteXml("goal-additional-ranges", writer); } } XmlWriterHelper.WriteOpt(writer, "recurrence", _recurrence); writer.WriteEndElement(); }
/// <summary> /// Writes the vital signs data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the vital signs data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The <see cref="When"/> property has not been set. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.VitalSignsWhenNotSet); // <vital-signs> writer.WriteStartElement("vital-signs"); // <when> _when.WriteXml("when", writer); foreach (VitalSignsResultType vitalSignResult in _vitalSignsResults) { vitalSignResult.WriteXml("vital-signs-results", writer); } // <site> XmlWriterHelper.WriteOptString( writer, "site", _site); // <position> XmlWriterHelper.WriteOptString( writer, "position", _position); // </vital-signs> writer.WriteEndElement(); }
/// <summary> /// Writes the lab test type data to the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer element for the lab test type. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the lab test type to. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); writer.WriteStartElement(nodeName); _when = new HealthServiceDateTime(); _when.WriteXml("when", writer); XmlWriterHelper.WriteOptString(writer, "name", _name); XmlWriterHelper.WriteOpt(writer, "substance", _substance); XmlWriterHelper.WriteOpt(writer, "collection-method", _collectionMethod); XmlWriterHelper.WriteOptString(writer, "abbreviation", _abbreviation); XmlWriterHelper.WriteOptString(writer, "description", _description); foreach (CodableValue codeValue in _code) { codeValue.WriteXml("code", writer); } XmlWriterHelper.WriteOpt(writer, "result", _result); XmlWriterHelper.WriteOpt(writer, "status", _status); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the delivery into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the delivery. /// </param> /// /// <param name="writer"> /// The XML writer into which the delivery should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); writer.WriteStartElement(nodeName); XmlWriterHelper.WriteOpt(writer, "location", _location); XmlWriterHelper.WriteOpt(writer, "time-of-delivery", _timeOfDelivery); XmlWriterHelper.WriteOptDouble(writer, "labor-duration", _laborDuration); foreach (CodableValue complication in _complications) { complication.WriteXml("complications", writer); } foreach (CodableValue anesthesia in _anesthesia) { anesthesia.WriteXml("anesthesia", writer); } XmlWriterHelper.WriteOpt(writer, "delivery-method", _deliveryMethod); XmlWriterHelper.WriteOpt(writer, "outcome", _outcome); XmlWriterHelper.WriteOpt(writer, "baby", _baby); XmlWriterHelper.WriteOptString(writer, "note", _note); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the GoalRange into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the medical image study series. /// </param> /// /// <param name="writer"> /// The XML writer into which the GoalRange should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="Name"/> is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { if (string.IsNullOrEmpty(nodeName)) { throw new ArgumentException( Resources.WriteXmlEmptyNodeName, nameof(nodeName)); } if (writer == null) { throw new ArgumentNullException( nameof(writer), Resources.WriteXmlNullWriter); } if (_name == null) { throw new ThingSerializationException( Resources.GoalRangeNameNullValue); } writer.WriteStartElement(nodeName); _name.WriteXml("name", writer); XmlWriterHelper.WriteOptString(writer, "description", _description); XmlWriterHelper.WriteOpt(writer, "minimum", _minimum); XmlWriterHelper.WriteOpt(writer, "maximum", _maximum); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the CarePlanGoal into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the medical image study series. /// </param> /// /// <param name="writer"> /// The XML writer into which the CarePlanGoal should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="Name"/> is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfArgumentNull(writer, nameof(writer), Resources.WriteXmlNullWriter); Validator.ThrowSerializationIfNull(_name, Resources.CarePlanGoalNameNull); writer.WriteStartElement("goal"); { _name.WriteXml("name", writer); XmlWriterHelper.WriteOptString(writer, "description", _description); XmlWriterHelper.WriteOpt(writer, "start-date", _startDate); XmlWriterHelper.WriteOpt(writer, "end-date", _endDate); XmlWriterHelper.WriteOpt(writer, "target-completion-date", _targetCompletionDate); XmlWriterHelper.WriteOpt(writer, "associated-type-info", _goalAssociatedTypeInfo); XmlWriterHelper.WriteOpt(writer, "target-range", _targetRange); if (_goalAdditionalRanges != null && _goalAdditionalRanges.Count != 0) { foreach (GoalRange goalRange in _goalAdditionalRanges) { goalRange.WriteXml("goal-additional-ranges", writer); } } XmlWriterHelper.WriteOpt(writer, "recurrence", _recurrence); XmlWriterHelper.WriteOptString(writer, "reference-id", _referenceId); } writer.WriteEndElement(); }
/// <summary> /// Write the serialized version of the data to the specified writer. /// </summary> /// <param name="writer">The writer</param> public void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); if (string.IsNullOrEmpty(Name)) { throw new InvalidOperationException(Resources.VocabularyNameNullOrEmpty); } writer.WriteElementString("vocabulary-format-version", "1"); writer.WriteElementString("name", Name); XmlWriterHelper.WriteOptString(writer, "family", Family); XmlWriterHelper.WriteOptString(writer, "version", Version); if (Count == 0) { return; } writer.WriteStartElement("items"); { foreach (KeyValuePair <string, VocabularyItem> item in this) { item.Value.WriteXmlInternal("item", writer); } } writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the AssociatedTypeInfo into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the associated type info. /// </param> /// /// <param name="writer"> /// The XML writer into which the AssociatedTypeInfo should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { if (string.IsNullOrEmpty(nodeName)) { throw new ArgumentException( Resources.WriteXmlEmptyNodeName, nameof(nodeName)); } if (writer == null) { throw new ArgumentNullException( nameof(writer), Resources.WriteXmlNullWriter); } writer.WriteStartElement(nodeName); if (_thingTypeVersionId.Equals(Guid.Empty)) { throw new InvalidOperationException(Resources.AssociatedThingTypeVersionIdNullorEmpty); } XmlWriterHelper.WriteOptGuid(writer, "thing-type-version-id", _thingTypeVersionId); XmlWriterHelper.WriteOptString(writer, "thing-type-value-xpath", _thingTypeValueXPath); XmlWriterHelper.WriteOptString(writer, "thing-type-display-xpath", _thingTypeDisplayXPath); writer.WriteEndElement(); }
/// <summary> /// Writes the dose to the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer element for the dose. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the dose to. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is null or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is null. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); writer.WriteStartElement(nodeName); XmlWriterHelper.WriteOptString( writer, "description", _description); XmlWriterHelper.WriteOptDouble( writer, "exact-dose", _exactDose); XmlWriterHelper.WriteOptDouble( writer, "min-dose", _minDose); XmlWriterHelper.WriteOptDouble( writer, "max-dose", _maxDose); writer.WriteEndElement(); }
/// <summary> /// Writes the lab test result type data to the specified XmlWriter. /// </summary> /// /// <param name="nodeName"> /// The name of the node to write XML output. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the lab test result type data to. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="nodeName"/> is <b> null </b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b> null </b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); // <lab-test-result-type> writer.WriteStartElement(nodeName); // when XmlWriterHelper.WriteOpt( writer, "when", _when); // name XmlWriterHelper.WriteOptString( writer, "name", _name); // substance XmlWriterHelper.WriteOpt( writer, "substance", _substance); // collection-method XmlWriterHelper.WriteOpt( writer, "collection-method", _collectionMethod); // clinical-code XmlWriterHelper.WriteOpt( writer, "clinical-code", _clinicalCode); // value XmlWriterHelper.WriteOpt( writer, "value", _value); // status XmlWriterHelper.WriteOpt( writer, "status", _status); // note XmlWriterHelper.WriteOptString( writer, "note", _note); // </lab-test-result-type> writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the MealDefinition into /// the specified XML writer. /// </summary> /// /// <param name="writer"> /// The XML writer into which the MealDefinition should be /// written. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="Name"/> is <b>null</b>. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_name, Resources.MealDefinitionNameNullValue); writer.WriteStartElement("meal-definition"); _name.WriteXml("name", writer); XmlWriterHelper.WriteOpt(writer, "meal-type", _mealType); XmlWriterHelper.WriteOptString(writer, "description", _description); XmlWriterHelper.WriteXmlCollection(writer, "dietary-items", _dietaryIntakeItems, "dietary-item"); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the vital sign result into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the vital sign result. /// </param> /// /// <param name="writer"> /// The XML writer into which the vital sign result should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="Title"/> is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_title, Resources.VitalSignResultTitleNotSet); Validator.ThrowSerializationIfNull(_title.Text, Resources.CodableValueNullText); writer.WriteStartElement(nodeName); // <title> _title.WriteXml("title", writer); // <value> XmlWriterHelper.WriteOptDouble( writer, "value", _value); // <unit> XmlWriterHelper.WriteOpt( writer, "unit", _unit); // <reference-minimum> XmlWriterHelper.WriteOptDouble( writer, "reference-minimum", _referenceMinimum); // <reference-maximum> XmlWriterHelper.WriteOptDouble( writer, "reference-maximum", _referenceMaximum); // <text-value> XmlWriterHelper.WriteOptString( writer, "text-value", _textValue); // <flag> XmlWriterHelper.WriteOpt( writer, "flag", _flag); writer.WriteEndElement(); }
/// <summary> /// Writes the medical device data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the medical device data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="When"/> has not been set. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.DeviceWhenNotSet); // <device> writer.WriteStartElement("device"); // <when> _when.WriteXml("when", writer); // <device-name> XmlWriterHelper.WriteOptString( writer, "device-name", _deviceName); // <vendor> XmlWriterHelper.WriteOpt( writer, "vendor", _vendor); // <model> XmlWriterHelper.WriteOptString( writer, "model", _model); // <serial-number> XmlWriterHelper.WriteOptString( writer, "serial-number", _serialNumber); // <anatomic-site> XmlWriterHelper.WriteOptString( writer, "anatomic-site", _anatomicSite); // <description> XmlWriterHelper.WriteOptString( writer, "description", _description); // </device> writer.WriteEndElement(); }
/// <summary> /// Writes the microbiology laboratory results data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the microbiology laboratory results data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The <see cref="When"/> property has not been set. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.LabResultsWhenNotSet); // <microbiology-lab-results> writer.WriteStartElement("microbiology-lab-results"); // <when> _when.WriteXml("when", writer); for (int index = 0; index < _labTests.Count; ++index) { _labTests[index].WriteXml("lab-tests", writer); } XmlWriterHelper.WriteOpt( writer, "sensitivity-agent", _sensitivityAgent); XmlWriterHelper.WriteOpt( writer, "sensitivity-value", _sensitivityValue); XmlWriterHelper.WriteOptString( writer, "sensitivity-interpretation", _sensitivityInterpretation); XmlWriterHelper.WriteOpt( writer, "specimen-type", _specimenType); XmlWriterHelper.WriteOpt( writer, "organism-name", _organismName); XmlWriterHelper.WriteOptString( writer, "organism-comment", _organismComment); // </microbiology-lab-result> writer.WriteEndElement(); }
/// <summary> /// Writes the insight messages data to the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer element for the insight messages type. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the insight messages type to. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); writer.WriteStartElement(nodeName); // <regular> XmlWriterHelper.WriteOptString(writer, "regular", _regular); // <short> XmlWriterHelper.WriteOptString(writer, "short", _short); writer.WriteEndElement(); }
/// <summary> /// Writes the exercise data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the exercise data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="When"/> is <b>null</b>. /// If <see cref="Activity"/> is <b>null</b>. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.WhenNullValue); Validator.ThrowSerializationIfNull(_activity, Resources.ExerciseActivityNotSet); // <exercise> writer.WriteStartElement("exercise"); // <when> _when.WriteXml("when", writer); // <activity> _activity.WriteXml("activity", writer); // <title> XmlWriterHelper.WriteOptString( writer, "title", _title); // <distance> if (_distance != null) { XmlWriterHelper.WriteOpt(writer, "distance", _distance); } // <duration> if (_duration != null) { XmlWriterHelper.WriteOptDouble(writer, "duration", _duration); } // <detail> foreach (ExerciseDetail exerciseDetail in _details.Values) { exerciseDetail.WriteXml("detail", writer); } // <segment> foreach (ExerciseSegment exerciseSegment in _segments) { exerciseSegment.WriteXml("segment", writer); } // </exercise> writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the baby information into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the baby information. /// </param> /// /// <param name="writer"> /// The XML writer into which the baby information should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); writer.WriteStartElement(nodeName); XmlWriterHelper.WriteOpt(writer, "name", _name); XmlWriterHelper.WriteOpt(writer, "gender", _gender); XmlWriterHelper.WriteOpt(writer, "weight", _weight); XmlWriterHelper.WriteOpt(writer, "length", _length); XmlWriterHelper.WriteOpt(writer, "head-circumference", _head); XmlWriterHelper.WriteOptString(writer, "note", _note); writer.WriteEndElement(); }
/// <summary> /// Writes the status data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the status data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="StatusType"/> is <b>null</b> or empty. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_statusType, Resources.StatusTypeNotSet); Validator.ThrowSerializationIfNull(_statusType.Text, Resources.CodableValueNullText); writer.WriteStartElement("status"); _statusType.WriteXml("status-type", writer); XmlWriterHelper.WriteOptString( writer, "text", _text); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the address into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the address. /// </param> /// /// <param name="writer"> /// The XML writer into which the address should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The <see cref="Street"/> property is empty or <see cref="City"/>, /// <see cref="Country"/>, or <see cref="PostalCode"/> property has not been set. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, nameof(nodeName)); Validator.ThrowIfArgumentNull(writer, nameof(writer), Resources.WriteXmlNullWriter); if (_street.Count == 0) { throw new ThingSerializationException(Resources.AddressStreetNotSet); } Validator.ThrowSerializationIfNull(_city, Resources.AddressCityNotSet); Validator.ThrowSerializationIfNull(_country, Resources.AddressCountryNotSet); Validator.ThrowSerializationIfNull(_postalCode, Resources.AddressPostalCodeNotSet); writer.WriteStartElement(nodeName); if (!string.IsNullOrEmpty(_description)) { writer.WriteElementString("description", _description); } if (_isPrimary != null) { writer.WriteElementString( "is-primary", SDKHelper.XmlFromBool((bool)_isPrimary)); } foreach (string street in _street) { writer.WriteElementString("street", street); } writer.WriteElementString("city", _city); if (!string.IsNullOrEmpty(_state)) { writer.WriteElementString("state", _state); } writer.WriteElementString("postcode", _postalCode); writer.WriteElementString("country", _country); XmlWriterHelper.WriteOptString(writer, "county", _county); writer.WriteEndElement(); }
/// <summary> /// Writes the XML representation of the medical image study series image into /// the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the medical image study series image. /// </param> /// Name of the BLOB holding the image. /// <param name="writer"> /// The XML writer into which the medical image study series image should be /// written. /// </param> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="ImageBlobName"/> is <b>null</b> or empty or contains only whitespace. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, nameof(nodeName)); Validator.ThrowIfWriterNull(writer); if (string.IsNullOrEmpty(_imageBlobName) || string.IsNullOrEmpty(_imageBlobName.Trim())) { throw new ThingSerializationException(Resources.ImageBlobNameMandatory); } writer.WriteStartElement(nodeName); writer.WriteElementString("image-blob-name", _imageBlobName); XmlWriterHelper.WriteOptString(writer, "image-preview-blob-name", _imagePreviewBlobName); writer.WriteEndElement(); }
/// <summary> /// Writes the lap to the specified XML writer. /// </summary> /// /// <param name="nodeName"> /// The name of the outer element for the lap. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the lap data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="writer"/> parameter is <b>null</b>. /// </exception> /// /// <exception cref="ArgumentException"> /// The <paramref name="nodeName"/> parameter is <b>null</b> or empty. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The Activity property is <b>null</b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_activity, Resources.ExerciseSegmentActivityNotSet); writer.WriteStartElement(nodeName); // <activity> XmlWriterHelper.WriteOpt( writer, "activity", _activity); // <title> XmlWriterHelper.WriteOptString( writer, "title", _title); // <distance> if (_distance != null) { _distance.WriteXml("distance", writer); } // <duration> if (_duration != null) { XmlWriterHelper.WriteOptDouble(writer, "duration", _duration); } // <offset> if (_offset != null) { XmlWriterHelper.WriteOptDouble(writer, "offset", _offset); } // <details> foreach (ExerciseDetail exerciseDetail in _details.Values) { exerciseDetail.WriteXml("detail", writer); } writer.WriteEndElement(); }
/// <summary> /// Writes the medical encounter data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the medical encounter data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); // <encounter> writer.WriteStartElement("encounter"); // <when> XmlWriterHelper.WriteOpt( writer, "when", _when); // <type> XmlWriterHelper.WriteOpt( writer, "type", _type); // <reason> XmlWriterHelper.WriteOptString( writer, "reason", _reason); // <duration> XmlWriterHelper.WriteOpt( writer, "duration", _duration); // <consent-granted> XmlWriterHelper.WriteOptBool( writer, "consent-granted", _consentGranted); // <facility> XmlWriterHelper.WriteOpt( writer, "facility", _facility); // </encounter> writer.WriteEndElement(); }
/// <summary> /// Writes the condition data to the specified XmlWriter. /// </summary> /// /// <param name="nodeName"> /// The name of the outer node for the condition item. /// </param> /// /// <param name="writer"> /// The XmlWriter to write the condition data to. /// </param> /// /// <exception cref="ArgumentException"> /// If <paramref name="nodeName"/> is <b> null </b> or empty. /// </exception> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b> null </b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// If <see cref="Name"/> is <b> null </b>. /// </exception> /// public override void WriteXml(string nodeName, XmlWriter writer) { Validator.ThrowIfStringNullOrEmpty(nodeName, "nodeName"); Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_name, Resources.ConditionEntryNameNotSet); // <condition> writer.WriteStartElement(nodeName); // name _name.WriteXml("name", writer); // onset-date XmlWriterHelper.WriteOpt( writer, "onset-date", _onsetDate); // resolution-date XmlWriterHelper.WriteOpt( writer, "resolution-date", _resolutionDate); // resolution XmlWriterHelper.WriteOptString( writer, "resolution", _resolution); // occurrence XmlWriterHelper.WriteOpt( writer, "occurrence", _occurrence); // severity XmlWriterHelper.WriteOpt( writer, "severity", _severity); // </conditon> writer.WriteEndElement(); }
/// <summary> /// Writes the healthcare proxy data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the healthcare proxy data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// The <see cref="When"/> property has not been set. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfWriterNull(writer); Validator.ThrowSerializationIfNull(_when, Resources.HealthcareProxyWhenNotSet); // <healthcare-proxy> writer.WriteStartElement("healthcare-proxy"); // <when> _when.WriteXml("when", writer); // <proxy> XmlWriterHelper.WriteOpt( writer, "proxy", _proxy); // <alternate> XmlWriterHelper.WriteOpt( writer, "alternate", _alternate); // <primary-witness> XmlWriterHelper.WriteOpt( writer, "primary-witness", _primaryWitness); // <secondary-witness> XmlWriterHelper.WriteOpt( writer, "secondary-witness", _secondaryWitness); // <content> XmlWriterHelper.WriteOptString( writer, "content", _content); // </healthcare-proxy> writer.WriteEndElement(); }
/// <summary> /// Writes the annotation data to the specified XmlWriter. /// </summary> /// /// <param name="writer"> /// The XmlWriter to write the annotation data to. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="writer"/> is <b>null</b>. /// </exception> /// /// <exception cref="ThingSerializationException"> /// A mandatory property is <b>null</b>. /// </exception> /// public override void WriteXml(XmlWriter writer) { Validator.ThrowIfArgumentNull(writer, nameof(writer), Resources.WriteXmlNullWriter); Validator.ThrowSerializationIfNull(_when, Resources.AnnotationWhenNotSet); // <annotation> writer.WriteStartElement("annotation"); // <when> _when.WriteXml("when", writer); // <content> XmlWriterHelper.WriteOptString( writer, "content", _content); // <author> XmlWriterHelper.WriteOpt( writer, "author", Author); // <classification> XmlWriterHelper.WriteOptString( writer, "classification", _classification); // <index> XmlWriterHelper.WriteOptString( writer, "index", _index); // <version> XmlWriterHelper.WriteOptString( writer, "version", _version); // </annotation> writer.WriteEndElement(); }