/// <summary>
        /// Populates this <see cref="InsulinInjectionUse"/> instance from the 
        /// data in the XML.
        /// </summary>
        /// 
        /// <param name="typeSpecificXml">
        /// The XML to get the insulin injection use data from.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// an insulin-injection-use node.
        /// </exception>
        /// 
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode(
                    "diabetes-insulin-injection-use");

            Validator.ThrowInvalidIfNull(itemNav, "InsulinInjectionUseUnexpectedNode");

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

            _insulinType = new CodableValue();
            _insulinType.ParseXml(itemNav.SelectSingleNode("type"));

            _amount = new InsulinInjectionMeasurement();
            _amount.ParseXml(itemNav.SelectSingleNode("amount"));

            XPathNavigator deviceIdNav =
                itemNav.SelectSingleNode("device-id");

            if (deviceIdNav != null)
            {
                _deviceId = deviceIdNav.Value;
            }
        }
 /// <summary>
 /// Creates a new instance of the <see cref="InsulinInjectionUse"/> class 
 /// with the specified date/time, insulin type, and amount.
 /// </summary>
 /// 
 /// <param name="when">
 /// The date/time when the injection was administrated.
 /// </param>
 /// 
 /// <param name="insulinType">
 /// The type of insulin being used.
 /// </param>
 /// 
 /// <param name="amount">
 /// The amount of insulin.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="when"/>,
 /// <paramref name="amount"/>, or <paramref name="insulinType"/> parameter 
 /// is <b>null</b>.
 /// </exception>
 /// 
 public InsulinInjectionUse(
     HealthServiceDateTime when,
     CodableValue insulinType,
     InsulinInjectionMeasurement amount)
     : base(TypeId)
 {
     this.When = when;
     this.InsulinType = insulinType;
     this.Amount = amount;
 }
 /// <summary>
 /// Creates a new instance of the <see cref="InsulinInjection"/> class 
 /// with the specified insulin type and amount.
 /// </summary>
 /// 
 /// <param name="insulinType">
 /// The type of insulin being used.
 /// </param>
 /// 
 /// <param name="amount">
 /// The amount of insulin.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="amount"/> or <paramref name="insulinType"/> parameter 
 /// is <b>null</b>.
 /// </exception>
 /// 
 public InsulinInjection(
     CodableValue insulinType,
     InsulinInjectionMeasurement amount)
     : base(TypeId)
 {
     this.InsulinType = insulinType;
     this.Amount = amount;
 }