예제 #1
0
        /// <summary>
        /// Populates the data from the specified XML.
        /// </summary>
        /// 
        /// <param name="navigator">
        /// The XML containing the baby information.
        /// </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<Name>(navigator, "name");
            _gender = XPathHelper.GetOptNavValue<CodableValue>(navigator, "gender");
            _weight = XPathHelper.GetOptNavValue<WeightValue>(navigator, "weight");
            _length = XPathHelper.GetOptNavValue<Length>(navigator, "length");
            _head = XPathHelper.GetOptNavValue<Length>(navigator, "head-circumference");
            _note = XPathHelper.GetOptNavValue(navigator, "note");
        }
예제 #2
0
        /// <summary>
        /// Populates this <see cref="Personal"/> instance from the data in the XML.
        /// </summary>
        /// 
        /// <param name="typeSpecificXml">
        /// The XML to get the personal data from.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// a personal node.
        /// </exception>
        /// 
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator itemNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("personal");

            Validator.ThrowInvalidIfNull(itemNav, "PersonalUnexpectedNode");

            _name =
                XPathHelper.GetOptNavValue<Name>(itemNav, "name");

            _birthDate =
                XPathHelper.GetOptNavValue<HealthServiceDateTime>(
                    itemNav,
                    "birthdate");

            _bloodtype =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "blood-type");

            _ethnicity =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "ethnicity");

            _ssn =
                XPathHelper.GetOptNavValue(itemNav, "ssn");

            _maritalStatus =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "marital-status");

            _employmentStatus =
                XPathHelper.GetOptNavValue(itemNav, "employment-status");

            // <is-deceased>
            _isDeceased =
                XPathHelper.GetOptNavValueAsBool(
                    itemNav,
                    "is-deceased");

            // <date-of-death>
            _dateOfDeath =
                XPathHelper.GetOptNavValue<ApproximateDateTime>(
                    itemNav,
                    "date-of-death");

            // <religion>
            _religion =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "religion");

            // <is-veteran>
            _isVeteran =
                XPathHelper.GetOptNavValueAsBool(itemNav, "is-veteran");

            // <highest-education-level>
            _highestEducationLevel =
                XPathHelper.GetOptNavValue<CodableValue>(
                    itemNav,
                    "highest-education-level");

            // <is-disabled>
            _isDisabled =
                XPathHelper.GetOptNavValueAsBool(itemNav, "is-disabled");

            // <organ-donor>
            _organDonor =
                XPathHelper.GetOptNavValue(itemNav, "organ-donor");
        }
예제 #3
0
 /// <summary>
 /// Creates a new instance of the <see cref="Person"/> class with the 
 /// specified name and type.
 /// </summary>
 /// 
 /// <param name="name">
 /// The name of the person.
 /// </param>
 /// 
 /// <param name="personType">
 /// The type of the person, such as emergency contact, provider, and 
 /// so on.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="name"/> or <paramref name="personType"/> 
 /// parameter is <b>null</b>.
 /// </exception>
 /// 
 public Person(Name name, CodableValue personType)
     : base(TypeId)
 {
     this.Name = name;
     this.PersonType = personType;
 }
예제 #4
0
 /// <summary>
 /// Creates a new instance of the <see cref="Person"/> class with the 
 /// specified name.
 /// </summary>
 /// 
 /// <param name="name">
 /// The name of the person.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="name"/> parameter 
 /// is <b>null</b>.
 /// </exception>
 /// 
 public Person(Name name)
     : base(TypeId)
 {
     this.Item.Name = name;
 }
 /// <summary>
 /// Creates a new instance of the <see cref="PersonItem"/> class 
 /// with the specified name and type.
 /// </summary>
 /// 
 /// <param name="name">
 /// The name of the person.
 /// </param>
 /// 
 /// <param name="personType">
 /// The type of the person: emergency contact, provider, etc.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// If <paramref name="name"/> or <paramref name="personType"/>
 /// is <b>null</b>.
 /// </exception>
 /// 
 public PersonItem(Name name, CodableValue personType)
 {
     this.Name = name;
     this.PersonType = personType;
 }
 /// <summary>
 /// Creates a new instance of the <see cref="PersonItem"/> class 
 /// with the specified name.
 /// </summary>
 /// 
 /// <param name="name">
 /// The name of the person.
 /// </param>
 /// 
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="name"/> parameter is <b>null</b>.
 /// </exception>
 /// 
 public PersonItem(Name name)
 {
     this.Name = name;
 }
        /// <summary>
        /// Populates this Person instance from the data in the XML.
        /// </summary>
        /// 
        /// <param name="navigator">
        /// The XML containing the goal information.
        /// </param>
        /// 
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="navigator"/> is not
        /// a person node.
        /// </exception>
        /// 
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            // <name>
            _name = new Name();
            _name.ParseXml(navigator.SelectSingleNode("name"));

            // <organization>
            XPathNavigator orgNav =
                navigator.SelectSingleNode("organization");

            if (orgNav != null)
            {
                _organization = orgNav.Value;
            }

            // <professional-training>
            XPathNavigator professionalTrainingNav =
                navigator.SelectSingleNode("professional-training");

            if (professionalTrainingNav != null)
            {
                _professionalTraining = professionalTrainingNav.Value;
            }

            // <id>
            XPathNavigator idNav =
                navigator.SelectSingleNode("id");

            if (idNav != null)
            {
                _id = idNav.Value;
            }

            // <contact>
            XPathNavigator contactNav =
                navigator.SelectSingleNode("contact");

            if (contactNav != null)
            {
                _contactInfo = new ContactInfo();
                _contactInfo.ParseXml(contactNav);
            }

            // <type>
            XPathNavigator typeNav =
                navigator.SelectSingleNode("type");

            if (typeNav != null)
            {
                _personType = new CodableValue();
                _personType.ParseXml(navigator.SelectSingleNode("type"));
            }
        }