/// <summary> /// Populates this <see cref="DefibrillatorEpisode"/> instance from the data in the specified XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the DefibrillatorEpisode 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 DefibrillatorEpisode node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode( "defibrillator-episode"); Validator.ThrowInvalidIfNull(itemNav, Resources.DefibrillatorEpisodeFieldUnexpectedNode); _when = new HealthServiceDateTime(); _when.ParseXml(itemNav.SelectSingleNode("when")); _episodeTypeGroup = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "episode-type-group"); _episodeType = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "episode-type"); _dataSource = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "data-source"); _durationInSeconds = XPathHelper.GetOptNavValueAsUInt(itemNav, "duration-in-seconds"); _episodeFields = XPathHelper.ParseXmlCollection <DefibrillatorEpisodeField>(itemNav, "episode-fields/episode-field"); }