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

/// Subscriber : The person or entity who is the primary policyholder for the health plan _or_ a dependent with their own member ID. The subscriber can be an individual or a business entity. - When a dependent has a unique, payer-assigned member ID, treat them as the `subscriber` for the claim submission - include their information here and omit the `dependent` object from the request.  Stedi treats the subscriber as an individual when the request doesn't contain a value for the `subscriber.organizationName` property. - You must set the `dateOfBirth` and `gender` properties when the subscriber is the patient. Stedi determines that the subscriber is the patient when the `dependent` object is not included in the request. - If either `dateOfBirth` or `gender` is set, you must include both properties. You can either include both properties or neither within a single request. - You must include `address` in this object when the patient is the subscriber. If the patient is a dependent, include address information in the `dependent` object instead.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Subscriber {
    /// The subscriber'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 subscriber's date of birth. This property is **required** if the subscriber is an individual.
    #[serde(rename = "dateOfBirth", skip_serializing_if = "Option::is_none")]
    pub date_of_birth: Option<String>,
    /// The subscriber's first name. This property is **recommended** when the subscriber is an individual. Omit when the subscriber is an organization. Some payers reject requests without the `firstName` property.
    #[serde(rename = "firstName", skip_serializing_if = "Option::is_none")]
    pub first_name: Option<String>,
    /// Identifies the subscriber's gender. This property is **required** when the subscriber is the patient. 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", skip_serializing_if = "Option::is_none")]
    pub gender: Option<models::SubscriberGender>,
    /// The subscriber's health plan group number.   - Provide this property OR the `policyNumber`, not both.   - Provide this property OR the `subscriberGroupName`, not both. If this property is set, Stedi ignores the `subscriberGroupName` property.
    #[serde(rename = "groupNumber", skip_serializing_if = "Option::is_none")]
    pub group_number: Option<String>,
    /// Identifies the type of insurance policy within a specific insurance program. This property is **required** when sending claims to Medicare and Medicare is not the primary payer (`paymentResponsibilityLevelCode` is not set to `P`). Otherwise, don't include this property in the claim.  Visit [Claims code lists](https://www.stedi.com/docs/healthcare/claims-code-lists#insurance-type-codes) for a complete list of insurance type codes.
    #[serde(rename = "insuranceTypeCode", skip_serializing_if = "Option::is_none")]
    pub insurance_type_code: Option<models::SubscriberInsuranceTypeCode>,
    /// The subscriber's last name. This property is **required** if the subscriber is an individual. Omit when the subscriber is an organization.   **Don't** include the subscriber's name suffix, such as Jr. or III. Use the designated `suffix` property instead.
    #[serde(rename = "lastName", skip_serializing_if = "Option::is_none")]
    pub last_name: Option<String>,
    /// The member ID for the subscriber's insurance policy. This property is **required** if the subscriber is an individual.
    #[serde(rename = "memberId", skip_serializing_if = "Option::is_none")]
    pub member_id: Option<String>,
    /// The subscriber's middle name or initial.
    #[serde(rename = "middleName", skip_serializing_if = "Option::is_none")]
    pub middle_name: Option<String>,
    /// The business name of the entity submitting the claim. This is **required** when the subscriber is an organization.   When the subscriber is an organization, you should identify the patient in the `dependent` object.
    #[serde(rename = "organizationName", skip_serializing_if = "Option::is_none")]
    pub organization_name: Option<String>,
    #[serde(rename = "paymentResponsibilityLevelCode", skip_serializing_if = "Option::is_none")]
    pub payment_responsibility_level_code: Option<models::SubscriberPaymentResponsibilityLevelCode>,
    /// The subscriber's health plan policy number. You should provide either this property OR the `groupNumber`, not both.
    #[serde(rename = "policyNumber", skip_serializing_if = "Option::is_none")]
    pub policy_number: Option<String>,
    /// The subscriber's Social Security Number.
    #[serde(rename = "ssn", skip_serializing_if = "Option::is_none")]
    pub ssn: Option<String>,
    /// The name of the subscriber's health plan. For example, Cigna or Blue Cross Blue Shield.   Provide either this property OR the `groupNumber`, not both. If `groupNumber` is set, Stedi ignores this value and uses the value in `groupNumber`.
    #[serde(rename = "subscriberGroupName", skip_serializing_if = "Option::is_none")]
    pub subscriber_group_name: Option<String>,
    /// The suffix of the subscriber's name, such as Jr. or Sr. Only include the subscriber'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 Subscriber {
    /// The person or entity who is the primary policyholder for the health plan _or_ a dependent with their own member ID. The subscriber can be an individual or a business entity. - When a dependent has a unique, payer-assigned member ID, treat them as the `subscriber` for the claim submission - include their information here and omit the `dependent` object from the request.  Stedi treats the subscriber as an individual when the request doesn't contain a value for the `subscriber.organizationName` property. - You must set the `dateOfBirth` and `gender` properties when the subscriber is the patient. Stedi determines that the subscriber is the patient when the `dependent` object is not included in the request. - If either `dateOfBirth` or `gender` is set, you must include both properties. You can either include both properties or neither within a single request. - You must include `address` in this object when the patient is the subscriber. If the patient is a dependent, include address information in the `dependent` object instead.
    pub fn new() -> Subscriber {
        Subscriber {
            address: None,
            contact_information: None,
            date_of_birth: None,
            first_name: None,
            gender: None,
            group_number: None,
            insurance_type_code: None,
            last_name: None,
            member_id: None,
            middle_name: None,
            organization_name: None,
            payment_responsibility_level_code: None,
            policy_number: None,
            ssn: None,
            subscriber_group_name: None,
            suffix: None,
        }
    }
}