Ejemplo n.º 1
0
        /// <summary>
        /// Populates this <see cref="PapSession"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the PAP session data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="typeSpecificXml"/> parameter is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a PAP session node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            Validator.ThrowIfArgumentNull(typeSpecificXml, nameof(typeSpecificXml), Resources.ParseXmlNavNull);

            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("pap-session");

            Validator.ThrowInvalidIfNull(itemNav, Resources.PapSessionUnexpectedNode);

            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            _durationMinutes    = itemNav.SelectSingleNode("duration-minutes").ValueAsDouble;
            _apneaHypopneaIndex = itemNav.SelectSingleNode("apnea-hypopnea-index").ValueAsDouble;

            _apneaIndex              = XPathHelper.GetOptNavValueAsDouble(itemNav, "apnea-index");
            _hypopneaIndex           = XPathHelper.GetOptNavValueAsDouble(itemNav, "hypopnea-index");
            _oxygenDesaturationIndex = XPathHelper.GetOptNavValueAsDouble(itemNav, "oxygen-desaturation-index");

            _pressure          = XPathHelper.GetOptNavValue <PapSessionMeasurements <PressureMeasurement> >(itemNav, "pressure");
            _leakRate          = XPathHelper.GetOptNavValue <PapSessionMeasurements <FlowMeasurement> >(itemNav, "leak-rate");
            _tidalVolume       = XPathHelper.GetOptNavValue <PapSessionMeasurements <VolumeMeasurement> >(itemNav, "tidal-volume");
            _minuteVentilation = XPathHelper.GetOptNavValue <PapSessionMeasurements <VolumeMeasurement> >(itemNav, "minute-ventilation");
            _respiratoryRate   = XPathHelper.GetOptNavValue <PapSessionMeasurements <RespiratoryRateMeasurement> >(itemNav, "respiratory-rate");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Populates the data from the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML containing the medical image study series image.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _imageBlobName        = navigator.SelectSingleNode("image-blob-name").Value;
            _imagePreviewBlobName = XPathHelper.GetOptNavValue(navigator, "image-preview-blob-name");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Populates this <see cref="RespiratoryProfile"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the respiratory profile data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a respiratory-profile node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode(
                    "respiratory-profile");

            Validator.ThrowInvalidIfNull(itemNav, Resources.RespiratoryProfileUnexpectedNode);

            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            _expiratoryFlowRedZoneUpperBoundary =
                XPathHelper.GetOptNavValue <FlowMeasurement>(
                    itemNav,
                    "expiratory-flow-red-zone-upper-boundary");

            _expiratoryFlowOrangeZoneUpperBoundary =
                XPathHelper.GetOptNavValue <FlowMeasurement>(
                    itemNav,
                    "expiratory-flow-orange-zone-upper-boundary");

            _expiratoryFlowYellowZoneUpperBoundary =
                XPathHelper.GetOptNavValue <FlowMeasurement>(
                    itemNav,
                    "expiratory-flow-yellow-zone-upper-boundary");
        }
        internal void ParseXml(XPathNavigator relationshipNav)
        {
            XPathNavigator thingIdNav = relationshipNav.SelectSingleNode("thing-id");

            if (thingIdNav != null)
            {
                Guid itemId = new Guid(thingIdNav.Value);

                XPathNavigator versionStampNav = relationshipNav.SelectSingleNode("version-stamp");
                if (versionStampNav != null)
                {
                    Guid versionStamp = new Guid(versionStampNav.Value);

                    ItemKey = new ThingKey(itemId, versionStamp);
                }
                else
                {
                    ItemKey = new ThingKey(itemId);
                }
            }
            else
            {
                XPathNavigator clientIdNav = relationshipNav.SelectSingleNode("client-thing-id");

                if (clientIdNav != null)
                {
                    ClientId = clientIdNav.Value;
                }
            }

            RelationshipType = XPathHelper.GetOptNavValue(relationshipNav, "relationship-type");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Populates this <see cref="DietaryIntake"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the DietaryIntake data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="typeSpecificXml"/> parameter is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a MealDefinition node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            if (typeSpecificXml == null)
            {
                throw new ArgumentNullException(
                          "typeSpecificXml",
                          Resources.ParseXmlNavNull);
            }

            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("meal-definition");

            if (itemNav == null)
            {
                throw new InvalidOperationException(
                          Resources.MealDefinitionUnexpectedNode);
            }

            _name = new CodableValue();
            _name.ParseXml(itemNav.SelectSingleNode("name"));

            _mealType = new CodableValue();
            _mealType = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "meal-type");

            XPathNavigator descriptionValueNav = itemNav.SelectSingleNode("description");

            if (descriptionValueNav != null)
            {
                _description = descriptionValueNav.Value;
            }

            _dietaryIntakeItems = XPathHelper.ParseXmlCollection <DietaryIntakeItem>(itemNav, "dietary-items/dietary-item");
        }
        /// <summary>
        /// Populates this <see cref="Condition"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML to get the condition data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> is <b> null </b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            // name
            _name = new CodableValue();
            _name.ParseXml(navigator.SelectSingleNode("name"));

            // onset-date
            _onsetDate =
                XPathHelper.GetOptNavValue <ApproximateDate>(navigator, "onset-date");

            // resolution-date
            _resolutionDate =
                XPathHelper.GetOptNavValue <ApproximateDate>(navigator, "resolution-date");

            // resolution
            if (navigator.SelectSingleNode("resolution") != null)
            {
                _resolution = navigator.SelectSingleNode("resolution").Value;
            }

            // occurrence
            _occurrence =
                XPathHelper.GetOptNavValue <CodableValue>(navigator, "occurrence");

            // severity
            _severity =
                XPathHelper.GetOptNavValue <CodableValue>(navigator, "severity");
        }
        /// <summary>
        /// Populates this <see cref="LabTestResults"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the lab test results data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a lab test results node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("lab-test-results");

            Validator.ThrowInvalidIfNull(itemNav, Resources.LabTestResultsUnexpectedNode);

            // when
            _when =
                XPathHelper.GetOptNavValue <ApproximateDateTime>(itemNav, "when");

            // lab-group
            XPathNodeIterator labGroupIterator =
                itemNav.Select("lab-group");

            _labGroup = new Collection <LabTestResultGroup>();
            foreach (XPathNavigator labGroupNav in labGroupIterator)
            {
                LabTestResultGroup labTestResultGroup = new LabTestResultGroup();
                labTestResultGroup.ParseXml(labGroupNav);
                _labGroup.Add(labTestResultGroup);
            }

            // ordered-by
            _orderedBy =
                XPathHelper.GetOptNavValue <Organization>(itemNav, "ordered-by");
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Populates this procedure instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the procedure data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a procedure node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("procedure");

            Validator.ThrowInvalidIfNull(itemNav, Resources.ProcedureUnexpectedNode);

            _when = XPathHelper.GetOptNavValue <ApproximateDateTime>(itemNav, "when");

            _name =
                XPathHelper.GetOptNavValue <CodableValue>(
                    itemNav,
                    "name");

            _primaryProvider =
                XPathHelper.GetOptNavValue <PersonItem>(
                    itemNav,
                    "primary-provider");

            _anatomicLocation =
                XPathHelper.GetOptNavValue <CodableValue>(
                    itemNav,
                    "anatomic-location");

            _secondaryProvider =
                XPathHelper.GetOptNavValue <PersonItem>(
                    itemNav,
                    "secondary-provider");
        }
        /// <summary>
        /// Populates this <see cref="HeartRate"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the heart rate data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a "heart-rate" node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("heart-rate");

            Validator.ThrowInvalidIfNull(itemNav, Resources.HeartRateUnexpectedNode);

            // when
            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            // value
            _value = itemNav.SelectSingleNode("value").ValueAsInt;

            // measurement-method
            _measurementMethod =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "measurement-method");

            // measurement-condition
            _measurementConditions =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "measurement-conditions");

            // measurement-flags
            _measurementFlags =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "measurement-flags");
        }
        /// <summary>
        /// Populates this <see cref="BodyComposition"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the body composition data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a "body-composition" node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("body-composition");

            Validator.ThrowInvalidIfNull(itemNav, Resources.BodyCompositionUnexpectedNode);

            // when (approxi-date-time, mandatory)
            _when = new ApproximateDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            // measurement-name (codable-value, mandatory)
            _measurementName = new CodableValue();
            _measurementName.ParseXml(itemNav.SelectSingleNode("measurement-name"));

            // value (BodyCompositionValue, mandatory)
            _value = new BodyCompositionValue();
            _value.ParseXml(itemNav.SelectSingleNode("value"));

            // measurement-method (codable value )
            _measurementMethod =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "measurement-method");

            // site
            _site =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "site");
        }
        /// <summary>
        /// Populates the data for insight messages from the XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML node representing the insight messages type.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _regular = XPathHelper.GetOptNavValue(navigator, "regular");
            _short   = XPathHelper.GetOptNavValue(navigator, "short");
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Populates this medical device instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the medical device data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a medical device node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("device");

            Validator.ThrowInvalidIfNull(itemNav, Resources.DeviceUnexpectedNode);

            // <when>
            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            // <device-name>
            _deviceName = XPathHelper.GetOptNavValue(itemNav, "device-name");

            // <vendor>
            _vendor = XPathHelper.GetOptNavValue <PersonItem>(itemNav, "vendor");

            // <model>
            _model = XPathHelper.GetOptNavValue(itemNav, "model");

            // <serial-number>
            _serialNumber =
                XPathHelper.GetOptNavValue(itemNav, "serial-number");

            // <anatomic-site>
            _anatomicSite =
                XPathHelper.GetOptNavValue(itemNav, "anatomic-site");

            // <description>
            _description =
                XPathHelper.GetOptNavValue(itemNav, "description");
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Populates the data from the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML containing the medical image study series.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            if (_acquisitionDateTime == null)
            {
                _acquisitionDateTime = new HealthServiceDateTime();
            }

            _acquisitionDateTime.ParseXml(navigator.SelectSingleNode("acquisition-datetime"));

            _description = XPathHelper.GetOptNavValue(navigator, "description");

            _images.Clear();

            XPathNodeIterator imageIterator = navigator.Select("images");

            foreach (XPathNavigator imageNav in imageIterator)
            {
                MedicalImageStudySeriesImage image = new MedicalImageStudySeriesImage();
                image.ParseXml(imageNav);
                _images.Add(image);
            }

            _institutionName    = XPathHelper.GetOptNavValue <Organization>(navigator, "institution-name");
            _referringPhysician = XPathHelper.GetOptNavValue <PersonItem>(navigator, "referring-physician");
            _modality           = XPathHelper.GetOptNavValue <CodableValue>(navigator, "modality");
            _bodyPart           = XPathHelper.GetOptNavValue <CodableValue>(navigator, "body-part");
            _previewBlobName    = XPathHelper.GetOptNavValue(navigator, "preview-blob-name");
            _seriesInstanceUID  = XPathHelper.GetOptNavValue(navigator, "series-instance-uid");
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Populates this vital signs instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the vital signs data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a vital signs node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("vital-signs");

            Validator.ThrowInvalidIfNull(itemNav, Resources.VitalSignsUnexpectedNode);

            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            XPathNodeIterator vitalSignsResultsIterator =
                itemNav.Select("vital-signs-results");

            foreach (XPathNavigator vitalSignsResultsNav in vitalSignsResultsIterator)
            {
                VitalSignsResultType vitalSignResult = new VitalSignsResultType();
                vitalSignResult.ParseXml(vitalSignsResultsNav);
                _vitalSignsResults.Add(vitalSignResult);
            }

            // <site>
            _site =
                XPathHelper.GetOptNavValue(itemNav, "site");

            // <position>
            _position =
                XPathHelper.GetOptNavValue(itemNav, "position");
        }
        /// <summary>
        /// Populates the data from the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML containing the delivery.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _location       = XPathHelper.GetOptNavValue <Organization>(navigator, "location");
            _timeOfDelivery = XPathHelper.GetOptNavValue <ApproximateDateTime>(navigator, "time-of-delivery");
            _laborDuration  = XPathHelper.GetOptNavValueAsDouble(navigator, "labor-duration");

            _complications.Clear();
            foreach (XPathNavigator complicationNav in navigator.Select("complications"))
            {
                CodableValue complication = new CodableValue();
                complication.ParseXml(complicationNav);
                _complications.Add(complication);
            }

            _anesthesia.Clear();
            foreach (XPathNavigator anesthesiaNav in navigator.Select("anesthesia"))
            {
                CodableValue anesthesia = new CodableValue();
                anesthesia.ParseXml(anesthesiaNav);
                _anesthesia.Add(anesthesia);
            }

            _deliveryMethod = XPathHelper.GetOptNavValue <CodableValue>(navigator, "delivery-method");
            _outcome        = XPathHelper.GetOptNavValue <CodableValue>(navigator, "outcome");
            _baby           = XPathHelper.GetOptNavValue <Baby>(navigator, "baby");
            _note           = XPathHelper.GetOptNavValue(navigator, "note");
        }
        /// <summary>
        /// Populates the data for the lab test type from the XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML node representing the lab test type.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _when = new HealthServiceDateTime();
            _when.ParseXml(navigator.SelectSingleNode("when"));

            _name      = XPathHelper.GetOptNavValue(navigator, "name");
            _substance = XPathHelper.GetOptNavValue <CodableValue>(navigator, "substance");

            _collectionMethod =
                XPathHelper.GetOptNavValue <CodableValue>(
                    navigator,
                    "collection-method");

            _abbreviation = XPathHelper.GetOptNavValue(navigator, "abbreviation");
            _description  = XPathHelper.GetOptNavValue(navigator, "description");

            _code.Clear();
            XPathNodeIterator codeIterator = navigator.Select("code");

            foreach (XPathNavigator codeNav in codeIterator)
            {
                CodableValue codeValue = new CodableValue();
                codeValue.ParseXml(codeNav);
                _code.Add(codeValue);
            }

            _result = XPathHelper.GetOptNavValue <LabResultType>(navigator, "result");
            _status = XPathHelper.GetOptNavValue <CodableValue>(navigator, "status");
        }
        /// <summary>
        /// Populates this <see cref="Annotation"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the annotation data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// an annotation node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("annotation");

            Validator.ThrowInvalidIfNull(itemNav, Resources.AnnotationUnexpectedNode);

            _when = new HealthServiceDateTime();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            _content =
                XPathHelper.GetOptNavValue(itemNav, "content");

            _author =
                XPathHelper.GetOptNavValue <PersonItem>(itemNav, "author");

            _classification =
                XPathHelper.GetOptNavValue(itemNav, "classification");

            _index =
                XPathHelper.GetOptNavValue(itemNav, "index");

            _version =
                XPathHelper.GetOptNavValue(itemNav, "version");
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Populates this <see cref="ExplanationOfBenefits"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the ExplanationOfBenefits data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="typeSpecificXml"/> parameter is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a ExplanationOfBenefits node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            Validator.ThrowIfArgumentNull(typeSpecificXml, nameof(typeSpecificXml), Resources.ParseXmlNavNull);

            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("explanation-of-benefits");

            Validator.ThrowInvalidIfNull(itemNav, Resources.ExplanationOfBenefitsUnexpectedNode);

            _dateSubmitted        = XPathHelper.GetOptNavValue <HealthServiceDateTime>(itemNav, "date-submitted");
            _patient              = XPathHelper.GetOptNavValue <PersonItem>(itemNav, "patient");
            _relationshipToMember = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "relationship-to-member");
            _plan        = XPathHelper.GetOptNavValue <Organization>(itemNav, "plan");
            _groupId     = XPathHelper.GetOptNavValue(itemNav, "group-id");
            _memberId    = itemNav.SelectSingleNode("member-id").Value;
            _claimType   = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "claim-type");
            _claimId     = itemNav.SelectSingleNode("claim-id").Value;
            _submittedBy = XPathHelper.GetOptNavValue <Organization>(itemNav, "submitted-by");
            _provider    = XPathHelper.GetOptNavValue <Organization>(itemNav, "provider");
            _currency    = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "currency");
            _claimTotals = XPathHelper.GetOptNavValue <ClaimAmounts>(itemNav, "claim-totals");

            _services.Clear();
            foreach (XPathNavigator servicesNav in itemNav.Select("services"))
            {
                Service service = new Service();
                service.ParseXml(servicesNav);
                _services.Add(service);
            }
        }
        /// <summary>
        /// Populates this <see cref="Immunization"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the immunization data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// an immunization node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode(
                    "immunization");

            Validator.ThrowInvalidIfNull(itemNav, Resources.ImmunizationUnexpectedNode);

            // <name>
            _name.ParseXml(itemNav.SelectSingleNode("name"));

            // <administration-date>
            _dateAdministrated =
                XPathHelper.GetOptNavValue <ApproximateDateTime>(
                    itemNav,
                    "administration-date");

            // <administrator>
            _administrator =
                XPathHelper.GetOptNavValue <PersonItem>(
                    itemNav,
                    "administrator");

            // <manufacturer>
            _manufacturer =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "manufacturer");

            // <lot>
            _lot = XPathHelper.GetOptNavValue(itemNav, "lot");

            // <route>
            _route =
                XPathHelper.GetOptNavValue <CodableValue>(
                    itemNav,
                    "route");

            // <expiration-date> approx-date-time
            _expirationDate =
                XPathHelper.GetOptNavValue <ApproximateDate>(
                    itemNav,
                    "expiration-date");

            // <sequence>
            _sequence =
                XPathHelper.GetOptNavValue(itemNav, "sequence");

            // <anatomic-surface>
            _anatomicSurface =
                XPathHelper.GetOptNavValue <CodableValue>(
                    itemNav,
                    "anatomic-surface");

            // <adverse-event> string
            _adverseEvent =
                XPathHelper.GetOptNavValue(itemNav, "adverse-event");

            // <consent>
            _consent =
                XPathHelper.GetOptNavValue(itemNav, "consent");
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Populates the data for the lap from the XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML node representing the lap.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            // activity
            _activity = XPathHelper.GetOptNavValue <CodableValue>(navigator, "activity");

            // title
            _title =
                XPathHelper.GetOptNavValue(navigator, "title");

            // distance
            _distance = XPathHelper.GetOptNavValue <Length>(navigator, "distance");

            // duration
            _duration =
                XPathHelper.GetOptNavValueAsDouble(navigator, "duration");

            // offset
            _offset =
                XPathHelper.GetOptNavValueAsDouble(navigator, "offset");

            // details
            XPathNodeIterator detailsIterator = navigator.Select("detail");

            _details.Clear();
            foreach (XPathNavigator detailsNavigator in detailsIterator)
            {
                ExerciseDetail exerciseDetail = new ExerciseDetail();
                exerciseDetail.ParseXml(detailsNavigator);

                _details.Add(exerciseDetail.Name.Value, exerciseDetail);
            }
        }
        /// <summary>
        /// Populates this <see cref="DailyMedicationUsage"/> instance from the
        /// data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the medication usage data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a <see cref="DailyMedicationUsage"/> node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode(
                    "daily-medication-usage");

            Validator.ThrowInvalidIfNull(itemNav, Resources.DailyMedicationUsageUnexpectedNode);

            _when = new HealthServiceDate();
            _when.ParseXml(itemNav.SelectSingleNode("when"));

            _drugName = new CodableValue();
            _drugName.ParseXml(itemNav.SelectSingleNode("drug-name"));

            _dosesConsumed =
                itemNav.SelectSingleNode("number-doses-consumed-in-day").ValueAsInt;

            _purposeOfUse =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "purpose-of-use");

            _intendedDoses =
                XPathHelper.GetOptNavValueAsInt(itemNav, "number-doses-intended-in-day");

            _usageSchedule =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "medication-usage-schedule");

            _drugForm =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "drug-form");

            _prescriptionType =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "prescription-type");

            _singleDoseDescription =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "single-dose-description");
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Information related to a medical encounter.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the medical encounter data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a encounter node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("encounter");

            Validator.ThrowInvalidIfNull(itemNav, Resources.EncounterUnexpectedNode);

            // when
            _when =
                XPathHelper.GetOptNavValue <HealthServiceDateTime>(itemNav, "when");

            // type
            _type =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "type");

            // reason
            _reason =
                XPathHelper.GetOptNavValue(itemNav, "reason");

            // duration
            _duration =
                XPathHelper.GetOptNavValue <DurationValue>(itemNav, "duration");

            // consent-granted
            _consentGranted =
                XPathHelper.GetOptNavValueAsBool(itemNav, "consent-granted");

            // facility
            _facility =
                XPathHelper.GetOptNavValue <Organization>(itemNav, "facility");
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Populates this medication fill instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the medication fill data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a medication-fill node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("medication-fill");

            Validator.ThrowInvalidIfNull(itemNav, Resources.MedicationFillUnexpectedNode);

            _name = new CodableValue();
            _name.ParseXml(itemNav.SelectSingleNode("name"));

            _dateFilled =
                XPathHelper.GetOptNavValue <ApproximateDateTime>(itemNav, "date-filled");

            _daysSupply =
                XPathHelper.GetOptNavValueAsInt(itemNav, "days-supply");

            _nextRefillDate =
                XPathHelper.GetOptNavValue <HealthServiceDate>(itemNav, "next-refill-date");

            _refillsLeft =
                XPathHelper.GetOptNavValueAsInt(itemNav, "refills-left");

            _pharmacy =
                XPathHelper.GetOptNavValue <Organization>(itemNav, "pharmacy");

            _prescriptionNumber =
                XPathHelper.GetOptNavValue(itemNav, "prescription-number");

            _lotNumber =
                XPathHelper.GetOptNavValue(itemNav, "lot-number");
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Populates this <see cref="CarePlanTaskRecurrence"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML to get the CarePlanTaskRecurrence data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _icalRecurrence  = XPathHelper.GetOptNavValue(navigator, "ical-recurrence");
            _interval        = XPathHelper.GetOptNavValue <CodableValue>(navigator, "interval");
            _timesInInterval = XPathHelper.GetOptNavValueAsInt(navigator, "times-in-interval");
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Populates this <see cref="CarePlanGoalGroup"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML to get the CarePlanGoalGroup data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _name = new CodableValue();
            _name.ParseXml(navigator.SelectSingleNode("name"));
            _description = XPathHelper.GetOptNavValue(navigator, "description");
            _goals       = XPathHelper.ParseXmlCollection <CarePlanGoal>(navigator, "goals/goal");
        }
        /// <summary>
        /// Populates this <see cref="MessageAttachment"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML to get the MessageAttachment data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfArgumentNull(navigator, nameof(navigator), Resources.ParseXmlNavNull);

            _name          = navigator.SelectSingleNode("name").Value;
            _blobName      = navigator.SelectSingleNode("blob-name").Value;
            _inlineDisplay = navigator.SelectSingleNode("inline-display").ValueAsBoolean;
            _contentId     = XPathHelper.GetOptNavValue(navigator, "content-id");
        }
        /// <summary>
        /// Populates this <see cref="PapSessionMeasurements{T}"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML to get the PAP session measurements data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _mean           = XPathHelper.GetOptNavValue <T>(navigator, "mean");
            _median         = XPathHelper.GetOptNavValue <T>(navigator, "median");
            _maximum        = XPathHelper.GetOptNavValue <T>(navigator, "maximum");
            _percentile95th = XPathHelper.GetOptNavValue <T>(navigator, "percentile-95th");
            _percentile90th = XPathHelper.GetOptNavValue <T>(navigator, "percentile-90th");
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Populates the data for the exercise detail from the XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML node representing the exercise detail.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _name =
                XPathHelper.GetOptNavValue <CodedValue>(navigator, "name");

            _value =
                XPathHelper.GetOptNavValue <StructuredMeasurement>(navigator, "value");
        }
        /// <summary>
        /// Populates this <see cref="DietaryIntakeItem"/> instance from the data in the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML to get the DietaryIntake data from.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the node identified by the <paramref name="navigator"/> is not a DietaryIntake node.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _foodItem = new CodableValue();
            _foodItem.ParseXml(navigator.SelectSingleNode("food-item"));
            _servingSize        = XPathHelper.GetOptNavValue <CodableValue>(navigator, "serving-size");
            _servingsConsumed   = XPathHelper.GetOptNavValueAsDouble(navigator, "servings-consumed");
            _meal               = XPathHelper.GetOptNavValue <CodableValue>(navigator, "meal");
            _when               = XPathHelper.GetOptNavValue <HealthServiceDateTime>(navigator, "when");
            _energy             = XPathHelper.GetOptNavValue <FoodEnergyValue>(navigator, "energy");
            _energyFromFat      = XPathHelper.GetOptNavValue <FoodEnergyValue>(navigator, "energy-from-fat");
            _totalFat           = XPathHelper.GetOptNavValue <WeightValue>(navigator, "total-fat");
            _saturatedFat       = XPathHelper.GetOptNavValue <WeightValue>(navigator, "saturated-fat");
            _transFat           = XPathHelper.GetOptNavValue <WeightValue>(navigator, "trans-fat");
            _monounsaturatedFat = XPathHelper.GetOptNavValue <WeightValue>(navigator, "monounsaturated-fat");
            _polyunsaturatedFat = XPathHelper.GetOptNavValue <WeightValue>(navigator, "polyunsaturated-fat");
            _protein            = XPathHelper.GetOptNavValue <WeightValue>(navigator, "protein");
            _carbohydrates      = XPathHelper.GetOptNavValue <WeightValue>(navigator, "carbohydrates");
            _dietaryFiber       = XPathHelper.GetOptNavValue <WeightValue>(navigator, "dietary-fiber");
            _sugars             = XPathHelper.GetOptNavValue <WeightValue>(navigator, "sugars");
            _sodium             = XPathHelper.GetOptNavValue <WeightValue>(navigator, "sodium");
            _cholesterol        = XPathHelper.GetOptNavValue <WeightValue>(navigator, "cholesterol");
            _calcium            = XPathHelper.GetOptNavValue <WeightValue>(navigator, "calcium");
            _iron               = XPathHelper.GetOptNavValue <WeightValue>(navigator, "iron");
            _magnesium          = XPathHelper.GetOptNavValue <WeightValue>(navigator, "magnesium");
            _phosphorus         = XPathHelper.GetOptNavValue <WeightValue>(navigator, "phosphorus");
            _potassium          = XPathHelper.GetOptNavValue <WeightValue>(navigator, "potassium");
            _zinc               = XPathHelper.GetOptNavValue <WeightValue>(navigator, "zinc");
            _vitaminARAE        = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-A-RAE");
            _vitaminE           = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-E");
            _vitaminD           = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-D");
            _vitaminC           = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-C");
            _thiamin            = XPathHelper.GetOptNavValue <WeightValue>(navigator, "thiamin");
            _riboflavin         = XPathHelper.GetOptNavValue <WeightValue>(navigator, "riboflavin");
            _niacin             = XPathHelper.GetOptNavValue <WeightValue>(navigator, "niacin");
            _vitaminB6          = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-B-6");
            _folateDFE          = XPathHelper.GetOptNavValue <WeightValue>(navigator, "folate-DFE");
            _vitaminB12         = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-B-12");
            _vitaminK           = XPathHelper.GetOptNavValue <WeightValue>(navigator, "vitamin-K");

            _additionalNutritionFacts.Clear();
            XPathNavigator additionalFactsNav = navigator.SelectSingleNode("additional-nutrition-facts");

            if (additionalFactsNav != null)
            {
                foreach (XPathNavigator nav in additionalFactsNav.Select("nutrition-fact"))
                {
                    NutritionFact nutritionFact = new NutritionFact();
                    nutritionFact.ParseXml(nav);
                    _additionalNutritionFacts.Add(nutritionFact);
                }
            }
        }
        /// <summary>
        /// Populates the data from the specified XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML containing the baby information.
        /// </param>
        ///
        /// <exception cref="ArgumentNullException">
        /// The <paramref name="navigator"/> parameter is <b>null</b>.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            _name   = XPathHelper.GetOptNavValue <Name>(navigator, "name");
            _gender = XPathHelper.GetOptNavValue <CodableValue>(navigator, "gender");
            _weight = XPathHelper.GetOptNavValue <WeightValue>(navigator, "weight");
            _length = XPathHelper.GetOptNavValue <Length>(navigator, "length");
            _head   = XPathHelper.GetOptNavValue <Length>(navigator, "head-circumference");
            _note   = XPathHelper.GetOptNavValue(navigator, "note");
        }