/// <summary> /// Creates a new instance of the <see cref="Service"/> 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="serviceType"> /// The type of the service. /// </param> /// <param name="serviceDates"> /// The dates for this service. /// </param> /// <param name="claimAmounts"> /// The financial information for this service. /// </param> /// <exception cref="ArgumentNullException"> /// If <paramref name="serviceType"/> is <b> null </b>. /// If <paramref name="serviceDates"/> is <b> null </b>. /// If <paramref name="claimAmounts"/> is <b> null </b>. /// </exception> /// public Service( CodableValue serviceType, DurationValue serviceDates, ClaimAmounts claimAmounts) { ServiceType = serviceType; ServiceDates = serviceDates; ClaimAmounts = claimAmounts; }
/// <summary> /// Populates this <see cref="Service"/> instance from the data in the specified XML. /// </summary> /// /// <param name="navigator"> /// The XML to get the Service data from. /// </param> /// /// <exception cref="ArgumentNullException"> /// If <paramref name="navigator"/> parameter is <b>null</b>. /// </exception> /// public override void ParseXml(XPathNavigator navigator) { Validator.ThrowIfNavigatorNull(navigator); _serviceType = XPathHelper.GetOptNavValue <CodableValue>(navigator, "service-type"); _diagnosis = XPathHelper.GetOptNavValue <CodableValue>(navigator, "diagnosis"); _billingCode = XPathHelper.GetOptNavValue <CodableValue>(navigator, "billing-code"); _serviceDates = XPathHelper.GetOptNavValue <DurationValue>(navigator, "service-dates"); _claimAmounts = new ClaimAmounts(); _claimAmounts.ParseXml(navigator.SelectSingleNode("claim-amounts")); _notes.Clear(); foreach (XPathNavigator notesNav in navigator.Select("notes")) { _notes.Add(notesNav.Value); } }
/// <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)); } }