/// <summary>
 /// Creates a new instance of the <see cref="GroupMembershipActivity"/> class with the 
 /// specified date/time and activity.
 /// </summary>
 /// 
 /// <param name="when">
 /// The date/time when the activity occurred.
 /// </param>
 /// 
 /// <param name="activity">
 /// The activity that occurred.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// If <paramref name="when"/> or <paramref name="activity"/> parameter is <b>null</b>.
 /// </exception>
 /// 
 public GroupMembershipActivity(HealthServiceDateTime when, CodedValue activity)
     : base(TypeId)
 {
     this.When = when;
     this.Activity = activity;
 }
        /// <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="GroupMembershipActivity"/> instance from the data in the XML.
        /// </summary>
        /// 
        /// <param name="typeSpecificXml">
        /// The XML to get the group membership activity data from.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// If the first node in <paramref name="typeSpecificXml"/> is not
        /// a group-membership-activity node.
        /// </exception>
        /// 
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("group-membership-activity");

            Validator.ThrowInvalidIfNull(itemNav, "GroupMembershipActivityUnexpectedNode");

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

            _activity = new CodedValue();
            _activity.ParseXml(itemNav.SelectSingleNode("activity"));

            _activityInfo = XPathHelper.GetOptNavValue(itemNav, "activity-info");
        }
 /// <summary>
 /// Creates a new instance of the <see cref="ExerciseDetail"/> class 
 /// with specified values
 /// </summary>
 /// <param name="name">The name of the information stored in this exercise detail. </param>
 /// <param name="value">The value of the exercise detail</param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="name"/> or <paramref name="value"/> is <b>null</b>.
 /// </exception>
 public ExerciseDetail(CodedValue name, StructuredMeasurement value)
     : base()
 {
     Name = name;
     Value = value;
 }