/// <summary>
        /// Populates this <see cref="FamilyHistoryCondition"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the family history condition data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a family history condition node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("family-history-condition");

            Validator.ThrowInvalidIfNull(itemNav, Resources.FamilyHistoryConditionUnexpectedNode);

            _relativeCondition = new ConditionEntry();
            _relativeCondition.ParseXml(itemNav.SelectSingleNode("condition"));
        }
예제 #2
0
        /// <summary>
        /// Populates this <see cref="FamilyHistoryV3"/> instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the family history data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a family history node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("family-history");

            Validator.ThrowInvalidIfNull(itemNav, Resources.FamilyHistoryUnexpectedNode);

            _conditions.Clear();
            foreach (XPathNavigator conditionNav in itemNav.Select("condition"))
            {
                ConditionEntry condition = new ConditionEntry();
                condition.ParseXml(conditionNav);
                _conditions.Add(condition);
            }

            _relative =
                XPathHelper.GetOptNavValue <FamilyHistoryRelativeV3>(itemNav, "relative");
        }
 /// <summary>
 /// Initialize a new instance of the <see cref="FamilyHistoryCondition"/>
 /// class with condition.
 /// </summary>
 ///
 /// <param name="relativeCondition">
 /// Relative condition is the condition of a relative.
 /// </param>
 ///
 /// <exception cref="ArgumentNullException">
 /// If <paramref name="relativeCondition"/> is <b>null</b>.
 /// </exception>
 ///
 public FamilyHistoryCondition(ConditionEntry relativeCondition)
     : base(TypeId)
 {
     RelativeCondition = relativeCondition;
 }
예제 #4
0
 /// <summary>
 /// Initialize a new instance of the <see cref="FamilyHistory"/>
 /// class with condition.
 /// </summary>
 ///
 /// <param name="condition">
 /// Relative condition is the condition of a relative.
 /// </param>
 ///
 /// <exception cref="ArgumentNullException">
 /// If <paramref name="condition"/> is <b>null</b>.
 /// </exception>
 ///
 public FamilyHistory(ConditionEntry condition)
     : base(TypeId)
 {
     Condition = condition;
 }