/// <summary> /// Populates this <see cref="Contact"/> instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the contact data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="typeSpecificXml"/> is not /// a contact node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator contactNav = typeSpecificXml.CreateNavigator().SelectSingleNode("contact"); Validator.ThrowInvalidIfNull(contactNav, Resources.ContactInformationUnexpectedNode); _contactInfo = new ContactInfo(); _contactInfo.ParseXml(contactNav.SelectSingleNode("contact")); }
/// <summary> /// Populates this Person instance from the data in the XML. /// </summary> /// /// <param name="navigator"> /// The XML containing the goal information. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="navigator"/> is not /// a person node. /// </exception> /// public override void ParseXml(XPathNavigator navigator) { Validator.ThrowIfNavigatorNull(navigator); // <name> _name = new Name(); _name.ParseXml(navigator.SelectSingleNode("name")); // <organization> XPathNavigator orgNav = navigator.SelectSingleNode("organization"); if (orgNav != null) { _organization = orgNav.Value; } // <professional-training> XPathNavigator professionalTrainingNav = navigator.SelectSingleNode("professional-training"); if (professionalTrainingNav != null) { _professionalTraining = professionalTrainingNav.Value; } // <id> XPathNavigator idNav = navigator.SelectSingleNode("id"); if (idNav != null) { _id = idNav.Value; } // <contact> XPathNavigator contactNav = navigator.SelectSingleNode("contact"); if (contactNav != null) { _contactInfo = new ContactInfo(); _contactInfo.ParseXml(contactNav); } // <type> XPathNavigator typeNav = navigator.SelectSingleNode("type"); if (typeNav != null) { _personType = new CodableValue(); _personType.ParseXml(navigator.SelectSingleNode("type")); } }
/// <summary> /// Populates this <see cref="Payer"/> instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the payer data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="typeSpecificXml"/> parameter is not /// a payer node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator payerNav = typeSpecificXml.CreateNavigator().SelectSingleNode("payer"); Validator.ThrowInvalidIfNull(payerNav, Resources.PayerUnexpectedNode); _planName = payerNav.SelectSingleNode("plan-name").Value; _coverageType = XPathHelper.GetOptNavValue <CodableValue>(payerNav, "coverage-type"); XPathNavigator carrierIdNav = payerNav.SelectSingleNode("carrier-id"); if (carrierIdNav != null) { _carrierId = carrierIdNav.Value; } XPathNavigator groupNumNav = payerNav.SelectSingleNode("group-num"); if (groupNumNav != null) { _groupNumber = groupNumNav.Value; } XPathNavigator planCodeNav = payerNav.SelectSingleNode("plan-code"); if (planCodeNav != null) { _planCode = planCodeNav.Value; } XPathNavigator subscriberIdNav = payerNav.SelectSingleNode("subscriber-id"); if (subscriberIdNav != null) { _subscriberId = subscriberIdNav.Value; } XPathNavigator personCodeNav = payerNav.SelectSingleNode("person-code"); if (personCodeNav != null) { _personCode = personCodeNav.Value; } XPathNavigator subscriberNameNav = payerNav.SelectSingleNode("subscriber-name"); if (subscriberNameNav != null) { _subscriberName = subscriberNameNav.Value; } XPathNavigator subscriberDobNav = payerNav.SelectSingleNode("subscriber-dob"); if (subscriberDobNav != null) { _subscriberDateOfBirth = new HealthServiceDateTime(); _subscriberDateOfBirth.ParseXml(subscriberDobNav); } XPathNavigator isPrimaryNav = payerNav.SelectSingleNode("is-primary"); if (isPrimaryNav != null) { _isPrimary = isPrimaryNav.ValueAsBoolean; } XPathNavigator expirationDateNav = payerNav.SelectSingleNode("expiration-date"); if (expirationDateNav != null) { _expirationDate = new HealthServiceDateTime(); _expirationDate.ParseXml(expirationDateNav); } XPathNavigator contactNav = payerNav.SelectSingleNode("contact"); if (contactNav != null) { _contact = new ContactInfo(); _contact.ParseXml(contactNav); } }