/// <summary> /// Creates a new instance of the <see cref="Service"/> class specifying mandatory values. /// </summary> /// /// <remarks> /// This item is not added to the health record until the <see cref="IThingClient.CreateNewThingsAsync{ThingBase}(Guid, ICollection{ThingBase})"/> method is called. /// </remarks> /// /// <param name="serviceType"> /// The type of the service. /// </param> /// <param name="serviceDates"> /// The dates for this service. /// </param> /// <param name="claimAmounts"> /// The financial information for this service. /// </param> /// <exception cref="ArgumentNullException"> /// If <paramref name="serviceType"/> is <b> null </b>. /// If <paramref name="serviceDates"/> is <b> null </b>. /// If <paramref name="claimAmounts"/> is <b> null </b>. /// </exception> /// public Service( CodableValue serviceType, DurationValue serviceDates, ClaimAmounts claimAmounts) { ServiceType = serviceType; ServiceDates = serviceDates; ClaimAmounts = claimAmounts; }
/// <summary> /// Populates this health problem instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the health problem data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="typeSpecificXml"/> is not /// a health problem node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode("problem"); Validator.ThrowInvalidIfNull(itemNav, Resources.ProblemUnexpectedNode); _when = new HealthServiceDateTime(); _when.ParseXml(itemNav.SelectSingleNode("when")); // <diagnosis> XPathNodeIterator diagnosisIterator = itemNav.Select("diagnosis"); _diagnosis.Clear(); foreach (XPathNavigator diagnosisNav in diagnosisIterator) { CodableValue value = new CodableValue(); value.ParseXml(diagnosisNav); _diagnosis.Add(value); } // <duration> XPathNodeIterator durationIterator = itemNav.Select("duration"); _duration.Clear(); foreach (XPathNavigator durationNav in durationIterator) { DurationValue value = new DurationValue(); value.ParseXml(durationNav); _duration.Add(value); } // <importance> _importance = XPathHelper.GetOptNavValueAsInt( itemNav, "importance"); }