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

            Validator.ThrowInvalidIfNull(itemNav, Resources.FamilyHistoryPersonUnexpectedNode);

            // relative-name
            _relativeName = new PersonItem();
            _relativeName.ParseXml(itemNav.SelectSingleNode("relative-name"));

            // relationship
            _relationship =
                XPathHelper.GetOptNavValue <CodableValue>(itemNav, "relationship");

            // date-of-birth
            _dateOfBirth =
                XPathHelper.GetOptNavValue <ApproximateDate>(itemNav, "date-of-birth");

            // date-of-death
            _dateOfDeath =
                XPathHelper.GetOptNavValue <ApproximateDate>(itemNav, "date-of-death");
        }
示例#2
0
        /// <summary>
        /// Creates a new instance of the <see cref="ExplanationOfBenefits"/> class specifying mandatory values.
        /// </summary>
        ///
        /// <remarks>
        /// This item is not added to the health record until the <see cref="IThingClient.CreateNewThingsAsync{ThingBase}(Guid, ICollection{ThingBase})"/> method is called.
        /// </remarks>
        ///
        /// <param name="dateSubmitted">
        /// The date when the claim was submitted.
        /// </param>
        /// <param name="patient">
        /// The name of the patient.
        /// </param>
        /// <param name="plan">
        /// The plan covering this claim.
        /// </param>
        /// <param name="memberId">
        /// The member id of the plan member.
        /// </param>
        /// <param name="claimType">
        /// The type of the claim (medical, dental, etc.)
        /// </param>
        /// <param name="claimId">
        /// The claim id.
        /// </param>
        /// <param name="submittedBy">
        /// The organization that submitted this claim.
        /// </param>
        /// <param name="provider">
        /// The provider that performed the services.
        /// </param>
        /// <param name="currency">
        /// The currency used.
        /// </param>
        /// <param name="claimTotals">
        /// A summary of the financial information about this claim.
        /// </param>
        /// <param name="services">
        /// The service included in this claim.
        /// </param>
        ///
        /// <exception cref="ArgumentException">
        /// If <paramref name="memberId"/> is empty or contains only whitespace.
        /// If <paramref name="claimId"/> is empty or contains only whitespace.
        /// If <paramref name="services"/> is <b>null</b> or doesn't contain any values.
        /// </exception>
        ///
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="memberId"/> is <b>null</b>.
        /// If <paramref name="claimId"/> is <b>null</b>.
        /// If <paramref name="dateSubmitted"/> is <b>null</b>.
        /// If <paramref name="patient"/> is <b>null</b>.
        /// If <paramref name="plan"/> is <b>null</b>.
        /// If <paramref name="claimType"/> is <b>null</b>.
        /// If <paramref name="submittedBy"/> is <b>null</b>.
        /// If <paramref name="provider"/> is <b>null</b>.
        /// If <paramref name="currency"/> is <b>null</b>.
        /// If <paramref name="claimTotals"/> is <b>null</b>.
        /// </exception>
        ///
        public ExplanationOfBenefits(
            HealthServiceDateTime dateSubmitted,
            PersonItem patient,
            Organization plan,
            string memberId,
            CodableValue claimType,
            string claimId,
            Organization submittedBy,
            Organization provider,
            CodableValue currency,
            ClaimAmounts claimTotals,
            IEnumerable <Service> services)
            : base(TypeId)
        {
            DateSubmitted = dateSubmitted;
            Patient       = patient;
            Plan          = plan;
            MemberId      = memberId;
            ClaimType     = claimType;
            ClaimId       = claimId;
            SubmittedBy   = submittedBy;
            Provider      = provider;
            Currency      = currency;
            ClaimTotals   = claimTotals;

            Validator.ThrowIfArgumentNull(services, nameof(services), Resources.ServicesMandatory);

            foreach (Service val in services)
            {
                Services.Add(val);
            }

            if (Services.Count == 0)
            {
                throw new ArgumentException(Resources.ServicesMandatory, nameof(services));
            }
        }
示例#3
0
        /// <summary>
        /// Populates this Prescription instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="navigator">
        /// The XML containing the prescription information.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node indicated by <paramref name="navigator"/> is not a prescription node.
        /// </exception>
        ///
        public override void ParseXml(XPathNavigator navigator)
        {
            Validator.ThrowIfNavigatorNull(navigator);

            // <prescribed-by>
            _prescribedBy = new PersonItem();
            _prescribedBy.ParseXml(navigator.SelectSingleNode("prescribed-by"));

            // <date-prescribed>
            _datePrescribed =
                XPathHelper.GetOptNavValue <ApproximateDateTime>(navigator, "date-prescribed");

            // <amount-prescribed>
            _amountPrescribed =
                XPathHelper.GetOptNavValue <GeneralMeasurement>(navigator, "amount-prescribed");

            // <substitution>
            _substitution =
                XPathHelper.GetOptNavValue <CodableValue>(navigator, "substitution");

            // <refills>
            _refills =
                XPathHelper.GetOptNavValueAsInt(navigator, "refills");

            // <days-supply>
            _daysSupply =
                XPathHelper.GetOptNavValueAsInt(navigator, "days-supply");

            // <prescription-expiration>
            _expiration =
                XPathHelper.GetOptNavValue <HealthServiceDate>(navigator, "prescription-expiration");

            // <instructions>
            _instructions =
                XPathHelper.GetOptNavValue <CodableValue>(navigator, "instructions");
        }
示例#4
0
 /// <summary>
 /// Creates a new instance of the <see cref="Prescription"/> class
 /// with the specified prescriber.
 /// </summary>
 ///
 /// <param name="prescribedBy">
 /// The person that prescribed the medication.
 /// </param>
 ///
 /// <exception cref="ArgumentNullException">
 /// The <paramref name="prescribedBy"/> parameter is <b>null</b>.
 /// </exception>
 ///
 public Prescription(PersonItem prescribedBy)
 {
     PrescribedBy = prescribedBy;
 }
示例#5
0
        /// <summary>
        /// Populates this appointment instance from the data in the XML.
        /// </summary>
        ///
        /// <param name="typeSpecificXml">
        /// The XML to get the appointment data from.
        /// </param>
        ///
        /// <exception cref="InvalidOperationException">
        /// The first node in <paramref name="typeSpecificXml"/> is not
        /// an appointment node.
        /// </exception>
        ///
        protected override void ParseXml(IXPathNavigable typeSpecificXml)
        {
            XPathNavigator appointmentNav =
                typeSpecificXml.CreateNavigator().SelectSingleNode("appointment");

            Validator.ThrowInvalidIfNull(appointmentNav, Resources.AppointmentUnexpectedNode);

            // <when>
            _when = new HealthServiceDateTime();
            _when.ParseXml(appointmentNav.SelectSingleNode("when"));

            // <duration>
            _duration =
                XPathHelper.GetOptNavValue <DurationValue>(
                    appointmentNav,
                    "duration");

            // <service>
            XPathNavigator serviceNav =
                appointmentNav.SelectSingleNode("service");

            if (serviceNav != null)
            {
                _service = new CodableValue();
                _service.ParseXml(serviceNav);
            }

            // <clinic>
            XPathNavigator clinicNav =
                appointmentNav.SelectSingleNode("clinic");

            if (clinicNav != null)
            {
                _clinic = new PersonItem();
                _clinic.ParseXml(clinicNav);
            }

            // <specialty>
            XPathNavigator specialtyNav =
                appointmentNav.SelectSingleNode("specialty");

            if (specialtyNav != null)
            {
                _specialty = new CodableValue();
                _specialty.ParseXml(specialtyNav);
            }

            // <status>
            XPathNavigator statusNav =
                appointmentNav.SelectSingleNode("status");

            if (statusNav != null)
            {
                _status = new CodableValue();
                _status.ParseXml(statusNav);
            }

            // <care-class>
            XPathNavigator careClassNav =
                appointmentNav.SelectSingleNode("care-class");

            if (careClassNav != null)
            {
                _careClass = new CodableValue();
                _careClass.ParseXml(careClassNav);
            }
        }
 /// <summary>
 /// Initialize a new instance of the <see cref="FamilyHistoryPerson"/>
 /// class with mandatory parameters.
 /// </summary>
 ///
 /// <param name="name">The name of a relative. </param>
 ///
 /// <exception cref="ArgumentNullException">
 /// If <paramref name="name"/> is <b> null </b>.
 /// </exception>
 ///
 public FamilyHistoryPerson(PersonItem name)
     : base(TypeId)
 {
     RelativeName = name;
 }