/// <summary>
        /// Writes the allergy data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the allergy data to.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="writer"/> is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="ThingSerializationException">
        /// If <see cref="Name"/> has an <b>null</b> Text property.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfArgumentNull(writer, nameof(writer), Resources.WriteXmlNullWriter);
            Validator.ThrowSerializationIfNull(_name.Text, Resources.AllergyNameMandatory);

            // <allergy>
            writer.WriteStartElement("allergy");

            // <name>
            _name.WriteXml("name", writer);

            // <reaction>
            XmlWriterHelper.WriteOpt(
                writer,
                "reaction",
                Reaction);

            // <first-observed>
            XmlWriterHelper.WriteOpt(
                writer,
                "first-observed",
                FirstObserved);

            // <allergen-type>
            XmlWriterHelper.WriteOpt(
                writer,
                "allergen-type",
                AllergenType);

            // <allergen-code>
            XmlWriterHelper.WriteOpt(
                writer,
                "allergen-code",
                AllergenCode);

            // <treatment-provider>
            XmlWriterHelper.WriteOpt(
                writer,
                "treatment-provider",
                TreatmentProvider);

            // <treatment>
            XmlWriterHelper.WriteOpt(
                writer,
                "treatment",
                Treatment);

            // <is-negated>
            XmlWriterHelper.WriteOptBool(
                writer,
                "is-negated",
                _isNegated);

            // </allergy>
            writer.WriteEndElement();
        }
Beispiel #2
0
        /// <summary>
        /// Writes the cardiac profile data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the cardiac profile data to.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="writer"/> is <b>null</b>.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfWriterNull(writer);

            // <cardiac-profile>
            writer.WriteStartElement("cardiac-profile");

            // <when>
            _when.WriteXml("when", writer);

            XmlWriterHelper.WriteOptBool(
                writer,
                "on-hypertension-diet",
                _onHypertensionDiet);

            XmlWriterHelper.WriteOptBool(
                writer,
                "on-hypertension-medication",
                _onHypertensionMedication);

            XmlWriterHelper.WriteOptBool(
                writer,
                "renal-failure-diagnosed",
                _renalFailureDiagnosed);

            XmlWriterHelper.WriteOptBool(
                writer,
                "diabetes-diagnosed",
                _diabetesDiagnosed);

            XmlWriterHelper.WriteOptBool(
                writer,
                "has-family-heart-disease-history",
                _hasFamilyHeartDiseaseHistory);

            XmlWriterHelper.WriteOptBool(
                writer,
                "has-family-stroke-history",
                _hasFamilyStrokeHistory);

            XmlWriterHelper.WriteOptBool(
                writer,
                "has-personal-heart-disease-history",
                _hasPersonalHeartDiseaseHistory);

            XmlWriterHelper.WriteOptBool(
                writer,
                "has-person-stroke-history",
                _hasPersonalStrokeHistory);

            // </cardiac-profile>
            writer.WriteEndElement();
        }
Beispiel #3
0
        /// <summary>
        /// Writes the insight attribution data to the specified XML writer.
        /// </summary>
        ///
        /// <param name="nodeName">
        /// The name of the outer element for the insight attribution type.
        /// </param>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the insight attribution 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);
            Validator.ThrowSerializationIfNull(_name, Resources.InsightAttributionNameNullValue);

            writer.WriteStartElement(nodeName);

            // <name>
            writer.WriteElementString("name", _name);

            // <attribution-required>
            XmlWriterHelper.WriteOptBool(writer, "attribution-required", _attributionRequired);

            writer.WriteEndElement();
        }
Beispiel #4
0
        /// <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 blood glucose data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the blood glucose data to.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="writer"/> is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="ThingSerializationException">
        /// The <see cref="Value"/> or <see cref="GlucoseMeasurementType"/> parameter has not been set.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfWriterNull(writer);
            Validator.ThrowSerializationIfNull(_value, Resources.BGValueNotSet);
            Validator.ThrowSerializationIfNull(_glucoseMeasurementType, Resources.BGMeasurementTypeNotSet);

            // <blood-glucose>
            writer.WriteStartElement("blood-glucose");

            // <when>
            _when.WriteXml("when", writer);

            _value.WriteXml("value", writer);
            _glucoseMeasurementType.WriteXml(
                "glucose-measurement-type",
                writer);

            XmlWriterHelper.WriteOptBool(
                writer,
                "outside-operating-temp",
                _outsideOperatingTemp);

            XmlWriterHelper.WriteOptBool(
                writer,
                "is-control-test",
                _isControlTest);

            if (_normalcy != null && _normalcy != Normalcy.Unknown)
            {
                writer.WriteElementString(
                    "normalcy",
                    ((int)_normalcy).ToString(CultureInfo.InvariantCulture));
            }

            XmlWriterHelper.WriteOpt(
                writer,
                "measurement-context",
                _measurementContext);

            // </blood-glucose>
            writer.WriteEndElement();
        }
        /// <summary>
        /// Writes the mensrual flow data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the menstrual flow 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>.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfWriterNull(writer);
            Validator.ThrowSerializationIfNull(_when, Resources.WhenNullValue);

            // <menstrual-flow>
            writer.WriteStartElement("menstruation");

            // <when>
            _when.WriteXml("when", writer);

            // <is-new-cycle>
            XmlWriterHelper.WriteOptBool(writer, "is-new-cycle", _isNewCycle);

            // <amount>
            XmlWriterHelper.WriteOpt(writer, "amount", _amount);

            // </menstrual-flow>
            writer.WriteEndElement();
        }
Beispiel #7
0
        /// <summary>
        /// Writes the directive data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the directive data to.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="writer"/> is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="ThingSerializationException">
        /// If <see cref="StartDate"/> or <see cref="StopDate"/> is <b>null</b>.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfWriterNull(writer);
            Validator.ThrowSerializationIfNull(_startDate, Resources.DirectiveStartDateNotSet);
            Validator.ThrowSerializationIfNull(_stopDate, Resources.DirectiveStopDateNotSet);

            // <directive>
            writer.WriteStartElement("directive");

            XmlWriterHelper.WriteOpt(
                writer,
                "start-date",
                _startDate);

            XmlWriterHelper.WriteOpt(
                writer,
                "stop-date",
                _stopDate);

            XmlWriterHelper.WriteOptString(
                writer,
                "description",
                _description);

            // <full-resuscitation>
            XmlWriterHelper.WriteOptBool(
                writer,
                "full-resuscitation",
                _fullResuscitation);

            // <prohibited-interventions>
            XmlWriterHelper.WriteOpt(
                writer,
                "prohibited-interventions",
                _prohibitedInterventions);

            // <additional-instructions>
            XmlWriterHelper.WriteOptString(
                writer,
                "additional-instructions",
                _additionalInstructions);

            // <attending-physician>
            XmlWriterHelper.WriteOpt(
                writer,
                "attending-physician",
                _attendingPhysician);

            // <attending-physician-endorsement>
            XmlWriterHelper.WriteOpt(
                writer,
                "attending-physician-endorsement",
                _attendingPhysicianEndorsement);

            // <attending-nurse>
            XmlWriterHelper.WriteOpt(
                writer,
                "attending-nurse",
                _attendingNurse);

            // <attending-nurse-endorsement>
            XmlWriterHelper.WriteOpt(
                writer,
                "attending-nurse-endorsement",
                _attendingNurseEndorsement);

            // <expiration-date>
            XmlWriterHelper.WriteOpt(
                writer,
                "expiration-date",
                _expirationDate);

            // <discontinuation-date>
            XmlWriterHelper.WriteOpt(
                writer,
                "discontinuation-date",
                _discontinuationDate);

            // <discontinuation-physician>
            XmlWriterHelper.WriteOpt(
                writer,
                "discontinuation-physician",
                _discontinuationPhysician);

            // <discontinuation-physician-endorsement>
            XmlWriterHelper.WriteOpt(
                writer,
                "discontinuation-physician-endorsement",
                _discontinuationPhysicianEndorsement);

            // <discontinuation-nurse>
            XmlWriterHelper.WriteOpt(
                writer,
                "discontinuation-nurse",
                _discontinuationNurse);

            // <discontinuation-nurse-endorsement>
            XmlWriterHelper.WriteOpt(
                writer,
                "discontinuation-nurse-endorsement",
                _discontinuationNurseEndorsement);

            // </directive>
            writer.WriteEndElement();
        }
Beispiel #8
0
        /// <summary>
        /// Writes the personal data to the specified XmlWriter.
        /// </summary>
        ///
        /// <param name="writer">
        /// The XmlWriter to write the personal data to.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="writer"/> is <b>null</b>.
        /// </exception>
        ///
        public override void WriteXml(XmlWriter writer)
        {
            Validator.ThrowIfWriterNull(writer);

            // <personal>
            writer.WriteStartElement("personal");

            XmlWriterHelper.WriteOpt(
                writer,
                "name",
                _name);

            XmlWriterHelper.WriteOpt(
                writer,
                "birthdate",
                _birthDate);

            XmlWriterHelper.WriteOpt(
                writer,
                "blood-type",
                _bloodtype);

            XmlWriterHelper.WriteOpt(
                writer,
                "ethnicity",
                _ethnicity);

            XmlWriterHelper.WriteOptString(
                writer,
                "ssn",
                _ssn);

            XmlWriterHelper.WriteOpt(
                writer,
                "marital-status",
                _maritalStatus);

            XmlWriterHelper.WriteOptString(
                writer,
                "employment-status",
                _employmentStatus);

            // <is-deceased>
            XmlWriterHelper.WriteOptBool(
                writer,
                "is-deceased",
                _isDeceased);

            // <date-of-death>
            XmlWriterHelper.WriteOpt(
                writer,
                "date-of-death",
                _dateOfDeath);

            // <religion>
            XmlWriterHelper.WriteOpt(
                writer,
                "religion",
                _religion);

            // <is-veteran>
            XmlWriterHelper.WriteOptBool(
                writer,
                "is-veteran",
                _isVeteran);

            // <highest-education-level>
            XmlWriterHelper.WriteOpt(
                writer,
                "highest-education-level",
                _highestEducationLevel);

            // <is-disabled>
            XmlWriterHelper.WriteOptBool(
                writer,
                "is-disabled",
                _isDisabled);

            // <organ-donor>
            XmlWriterHelper.WriteOptString(
                writer,
                "organ-donor",
                _organDonor);

            // </personal>
            writer.WriteEndElement();
        }