autogen-stedi 0.3.2

Auto-generated, strongly-typed Rust client for the Stedi APIs
Documentation
/*
 * Stedi Healthcare
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2024-04-01
 * Contact: healthcare@stedi.com
 * Generated by: https://openapi-generator.tech
 */

use crate::healthcare::models;
use serde::{Deserialize, Serialize};

/// Dependent : Dependent who received the medical care associated with the claim.   - If the dependent has their own member ID for the health plan, you should include the dependent's information in the `subscriber` object instead. To check whether a dependent has a member ID, submit an [Eligibility Check](https://www.stedi.com/docs/healthcare/api-reference/post-healthcare-eligibility) to the payer. The payer returns the dependent's member ID in the `dependents.memberId` property in the response, if present.   - You must include `address` in this object when the patient is a dependent.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Dependent {
    /// The dependent's address. Every claim must include address information in either the `subscriber` (when the patient is the subscriber) or `dependent` (when the patient is a dependent) object. You must include at least the `address1` and `city` properties in this object. The `state` and `postalCode` properties are also required for all United States and Canadian addresses.   - The address should be the patient's correct address at the time of service. Use of outdated values could cause the payer to reject, deny, or delay the claim due to suspected fraud.   - If you don't know the patient's address, first submit a [Real-Time Eligibility Check](https://www.stedi.com/docs/healthcare/api-reference/post-healthcare-eligibility) for the patient and then copy the address from either the `subscriber` or `dependent` object in the response.   - If the patient doesn't have a current address, you can populate the `address1` property with `UNKNOWN` and populate the city, state, and zip code with appropriate values based on your discretion. However, we still recommend running an eligibility check when possible, so you can use the address the payer has on file. Some payers may have explicit rules for how to handle this situation - check the payer's specific requirements before using this approach.
    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
    pub address: Option<Box<models::RequestSubscriberDependentAddress>>,
    #[serde(rename = "contactInformation", skip_serializing_if = "Option::is_none")]
    pub contact_information: Option<Box<models::ContactInformationSubscriberDependent>>,
    /// The patient's date of birth
    #[serde(rename = "dateOfBirth")]
    pub date_of_birth: String,
    /// The patient's first name.
    #[serde(rename = "firstName")]
    pub first_name: String,
    /// Code indiciating the patient's gender. Can be set to `F` - Female, `M` - Male, or `U` - Unknown.  Some payers may reject the claim if the patient's gender doesn't match the gender they have recorded in their member records. If the gender isn't known or the patient declines to answer, use `U` or perform an eligibility check to determine the gender according to the payer's records.
    #[serde(rename = "gender")]
    pub gender: models::DependentGender,
    /// The patient's last name. **Don't** include the patient's name suffix, such as Jr. or III. Use the designated `suffix` property instead.
    #[serde(rename = "lastName")]
    pub last_name: String,
    /// The patient's identification number. Only used in Property and Casualty claims.
    #[serde(rename = "memberId", skip_serializing_if = "Option::is_none")]
    pub member_id: Option<String>,
    /// The patient's middle name or initial.
    #[serde(rename = "middleName", skip_serializing_if = "Option::is_none")]
    pub middle_name: Option<String>,
    #[serde(rename = "relationshipToSubscriberCode")]
    pub relationship_to_subscriber_code: models::RelationshipToSubscriberCode,
    /// The patient's Social Security Number. Only used for Property and Casualty claims.
    #[serde(rename = "ssn", skip_serializing_if = "Option::is_none")]
    pub ssn: Option<String>,
    /// The patient's name suffix, such as Jr. or III. Only include the patient's personal name suffix - **don't** include professional or academic titles, such as M.D. or MBA.
    #[serde(rename = "suffix", skip_serializing_if = "Option::is_none")]
    pub suffix: Option<String>,
}

impl Dependent {
    /// Dependent who received the medical care associated with the claim.   - If the dependent has their own member ID for the health plan, you should include the dependent's information in the `subscriber` object instead. To check whether a dependent has a member ID, submit an [Eligibility Check](https://www.stedi.com/docs/healthcare/api-reference/post-healthcare-eligibility) to the payer. The payer returns the dependent's member ID in the `dependents.memberId` property in the response, if present.   - You must include `address` in this object when the patient is a dependent.
    pub fn new(date_of_birth: String, first_name: String, gender: models::DependentGender, last_name: String, relationship_to_subscriber_code: models::RelationshipToSubscriberCode) -> Dependent {
        Dependent {
            address: None,
            contact_information: None,
            date_of_birth,
            first_name,
            gender,
            last_name,
            member_id: None,
            middle_name: None,
            relationship_to_subscriber_code,
            ssn: None,
            suffix: None,
        }
    }
}