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};

/// RequestSubscriberDependentAddress : The patient's address. Every claim must include this 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.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequestSubscriberDependentAddress {
    /// The first line of the street address. This typically contains the building number and street name.
    #[serde(rename = "address1")]
    pub address1: String,
    /// The second line of the street address. This typically contains the apartment or suite number.
    #[serde(rename = "address2", skip_serializing_if = "Option::is_none")]
    pub address2: Option<String>,
    /// The city name.
    #[serde(rename = "city")]
    pub city: String,
    /// Use the alpha-2 country codes from Part 1 of ISO 3166.
    #[serde(rename = "countryCode", skip_serializing_if = "Option::is_none")]
    pub country_code: Option<String>,
    /// Use the country subdivision codes from Part 2 of ISO 3166.
    #[serde(rename = "countrySubDivisionCode", skip_serializing_if = "Option::is_none")]
    pub country_sub_division_code: Option<String>,
    /// The postal zone or zip code. For United States addresses, you must include the full nine-digit zip code with no separators, such as `100031502`. If you don't know the full zip code, you can find it using the [USPS ZIP Code Lookup](https://tools.usps.com/zip-code-lookup.htm) tool. Exclude punctuation and spaces.
    #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
    /// The state or province code. Only required when the city is in the United States and Canada.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<String>,
}

impl RequestSubscriberDependentAddress {
    /// The patient's address. Every claim must include this 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.
    pub fn new(address1: String, city: String) -> RequestSubscriberDependentAddress {
        RequestSubscriberDependentAddress {
            address1,
            address2: None,
            city,
            country_code: None,
            country_sub_division_code: None,
            postal_code: None,
            state: None,
        }
    }
}