/// <summary> /// Information related to a medical encounter. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the medical encounter data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// If the first node in <paramref name="typeSpecificXml"/> is not /// a encounter node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode("encounter"); Validator.ThrowInvalidIfNull(itemNav, Resources.EncounterUnexpectedNode); // when _when = XPathHelper.GetOptNavValue <HealthServiceDateTime>(itemNav, "when"); // type _type = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "type"); // reason _reason = XPathHelper.GetOptNavValue(itemNav, "reason"); // duration _duration = XPathHelper.GetOptNavValue <DurationValue>(itemNav, "duration"); // consent-granted _consentGranted = XPathHelper.GetOptNavValueAsBool(itemNav, "consent-granted"); // facility _facility = XPathHelper.GetOptNavValue <Organization>(itemNav, "facility"); }
/// <summary> /// Populates this <see cref="CardiacProfile"/> instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the cardiac profile data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="typeSpecificXml"/> is not /// a cardiac-profile node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode( "cardiac-profile"); Validator.ThrowInvalidIfNull(itemNav, Resources.CardiacProfileUnexpectedNode); _when = new HealthServiceDateTime(); _when.ParseXml(itemNav.SelectSingleNode("when")); _onHypertensionDiet = XPathHelper.GetOptNavValueAsBool(itemNav, "on-hypertension-diet"); _onHypertensionMedication = XPathHelper.GetOptNavValueAsBool(itemNav, "on-hypertension-medication"); _renalFailureDiagnosed = XPathHelper.GetOptNavValueAsBool(itemNav, "renal-failure-diagnosed"); _diabetesDiagnosed = XPathHelper.GetOptNavValueAsBool(itemNav, "diabetes-diagnosed"); _hasFamilyHeartDiseaseHistory = XPathHelper.GetOptNavValueAsBool(itemNav, "has-family-heart-disease-history"); _hasFamilyStrokeHistory = XPathHelper.GetOptNavValueAsBool(itemNav, "has-family-stroke-history"); _hasPersonalHeartDiseaseHistory = XPathHelper.GetOptNavValueAsBool(itemNav, "has-personal-heart-disease-history"); _hasPersonalStrokeHistory = XPathHelper.GetOptNavValueAsBool(itemNav, "has-person-stroke-history"); }
/// <summary> /// Populates the data for insight attribution from the XML. /// </summary> /// /// <param name="navigator"> /// The XML node representing the insight attribution type. /// </param> /// /// <exception cref="ArgumentNullException"> /// The <paramref name="navigator"/> parameter is <b>null</b>. /// </exception> /// public override void ParseXml(XPathNavigator navigator) { Validator.ThrowIfNavigatorNull(navigator); _name = navigator.SelectSingleNode("name").Value; _attributionRequired = XPathHelper.GetOptNavValueAsBool(navigator, "attribution-required"); }
/// <summary> /// Populates this <see cref="Allergy"/> instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the allergy data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="typeSpecificXml"/> is not /// an allergy node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { _name.Clear(); XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode("allergy"); Validator.ThrowInvalidIfNull(itemNav, Resources.AllergyUnexpectedNode); // <name> _name.ParseXml(itemNav.SelectSingleNode("name")); // <reaction> _reaction = XPathHelper.GetOptNavValue <CodableValue>( itemNav, "reaction"); // <first-observed> _firstObserved = XPathHelper.GetOptNavValue <ApproximateDateTime>( itemNav, "first-observed"); // <allergen-type> _allergen = XPathHelper.GetOptNavValue <CodableValue>( itemNav, "allergen-type"); // <allergen-code> _allergenCode = XPathHelper.GetOptNavValue <CodableValue>( itemNav, "allergen-code"); // <treatment-provider> _treatmentProvider = XPathHelper.GetOptNavValue <PersonItem>( itemNav, "treatment-provider"); // <treatment> _treatment = XPathHelper.GetOptNavValue <CodableValue>( itemNav, "treatment"); // <is-negated> _isNegated = XPathHelper.GetOptNavValueAsBool(itemNav, "is-negated"); }
/// <summary> /// Populates this BloodGlucose instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the blood glucose data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node in <paramref name="typeSpecificXml"/> is not /// a blood-glucose node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator bgNav = typeSpecificXml.CreateNavigator().SelectSingleNode( "blood-glucose"); Validator.ThrowInvalidIfNull(bgNav, Resources.BGUnexpectedNode); _when = new HealthServiceDateTime(); _when.ParseXml(bgNav.SelectSingleNode("when")); _value = new BloodGlucoseMeasurement(); _value.ParseXml(bgNav.SelectSingleNode("value")); _glucoseMeasurementType = new CodableValue(); _glucoseMeasurementType.ParseXml( bgNav.SelectSingleNode("glucose-measurement-type")); _outsideOperatingTemp = XPathHelper.GetOptNavValueAsBool( bgNav, "outside-operating-temp"); _isControlTest = XPathHelper.GetOptNavValueAsBool( bgNav, "is-control-test"); XPathNavigator normalcyNav = bgNav.SelectSingleNode("normalcy"); if (normalcyNav != null) { _normalcyValue = normalcyNav.ValueAsInt; if (_normalcyValue < (int)Normalcy.WellBelowNormal || _normalcyValue > (int)Normalcy.WellAboveNormal) { _normalcy = Normalcy.Unknown; } else { _normalcy = (Normalcy)_normalcyValue; } } _measurementContext = XPathHelper.GetOptNavValue <CodableValue>( bgNav, "measurement-context"); }
/// <summary> /// Populates this <see cref="Menstruation"/> instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the menstrual flow data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// If the first node in <paramref name="typeSpecificXml"/> is not /// an "menstrual-flow" node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode("menstruation"); Validator.ThrowInvalidIfNull(itemNav, Resources.MenstruationUnexpectedNode); // when _when = new HealthServiceDateTime(); _when.ParseXml(itemNav.SelectSingleNode("when")); // isNewCycle _isNewCycle = XPathHelper.GetOptNavValueAsBool(itemNav, "is-new-cycle"); // amount _amount = XPathHelper.GetOptNavValue <CodableValue>(itemNav, "amount"); }
/// <summary> /// Populates this <see cref="Directive"/> instance from the data in the XML. /// </summary> /// /// <param name="typeSpecificXml"> /// The XML to get the directive data from. /// </param> /// /// <exception cref="InvalidOperationException"> /// The first node of the <paramref name="typeSpecificXml"/> /// parameter is not a directive node. /// </exception> /// protected override void ParseXml(IXPathNavigable typeSpecificXml) { XPathNavigator itemNav = typeSpecificXml.CreateNavigator().SelectSingleNode("directive"); Validator.ThrowInvalidIfNull(itemNav, Resources.DirectiveUnexpectedNode); // <start-date> _startDate = new ApproximateDateTime(); _startDate.ParseXml(itemNav.SelectSingleNode("start-date")); // <stop-date> _stopDate = new ApproximateDateTime(); _stopDate.ParseXml(itemNav.SelectSingleNode("stop-date")); // <description> _description = XPathHelper.GetOptNavValue(itemNav, "description"); // <full-resuscitation> _fullResuscitation = XPathHelper.GetOptNavValueAsBool(itemNav, "full-resuscitation"); // <prohibited-interventions> _prohibitedInterventions = XPathHelper.GetOptNavValue <CodableValue>( itemNav, "prohibited-interventions"); // <additional-instructions> _additionalInstructions = XPathHelper.GetOptNavValue(itemNav, "additional-instructions"); // <attending-physician> _attendingPhysician = XPathHelper.GetOptNavValue <PersonItem>( itemNav, "attending-physician"); // <attending-physician-endorsement> _attendingPhysicianEndorsement = XPathHelper.GetOptNavValue <HealthServiceDateTime>( itemNav, "attending-physician-endorsement"); // <attending-nurse> _attendingNurse = XPathHelper.GetOptNavValue <PersonItem>( itemNav, "attending-nurse"); // <attending-nurse-endorsement" type="d:date-time"> _attendingNurseEndorsement = XPathHelper.GetOptNavValue <HealthServiceDateTime>( itemNav, "attending-nurse-endorsement"); // <expiration-date> _expirationDate = XPathHelper.GetOptNavValue <HealthServiceDateTime>( itemNav, "expiration-date"); // <discontinuation-date> _discontinuationDate = XPathHelper.GetOptNavValue <ApproximateDateTime>( itemNav, "discontinuation-date"); // <discontinuation-physician> _discontinuationPhysician = XPathHelper.GetOptNavValue <PersonItem>( itemNav, "discontinuation-physician"); // <discontinuation-physician-endorsement> _discontinuationPhysicianEndorsement = XPathHelper.GetOptNavValue <HealthServiceDateTime>( itemNav, "discontinuation-physician-endorsement"); // <discontinuation-nurse> _discontinuationNurse = XPathHelper.GetOptNavValue <PersonItem>( itemNav, "discontinuation-nurse"); // <discontinuation-nurse-endorsement> _discontinuationNurseEndorsement = XPathHelper.GetOptNavValue <HealthServiceDateTime>( itemNav, "discontinuation-nurse-endorsement"); }
/// <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, Resources.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"); }