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

/// InstitutionalSubscriber : The person or entity who is the primary policyholder for the health plan _or_ a dependent with their own member ID. - 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. - 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 InstitutionalSubscriber {
    /// 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::InstitutionalAddress>>,
    /// The subscriber's date of birth, formatted as `YYYYMMDD`.
    #[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>,
    /// Code identifying the 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", skip_serializing_if = "Option::is_none")]
    pub gender: Option<models::GenderWithUnknown>,
    /// The subscriber's health plan group number.
    #[serde(rename = "groupNumber", skip_serializing_if = "Option::is_none")]
    pub group_number: Option<String>,
    /// 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.
    #[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>,
    /// Code identifying the payer's level of responsibility for paying this claim. Visit [Claims code lists](https://www.stedi.com/docs/healthcare/claims-code-lists#payment-responsibility-sequence-number-codes) for a complete list of possible codes.   - Stedi sets this property to `P` - Primary by default. You only need to include it when you need to submit codes other than `P`. This can happen when the patient has multiple insurance policies. For example, if a patient is covered by both Medicare and an employer-sponsored commercial plan, you could bill the commercial plan first as `P` and then bill the Medicare payer second as `S`.   - Either this property or `otherSubscriberInformation.paymentResponsibilityLevelCode` must be set to `P`. Stedi rejects claims - including secondary and tertiary claims - that don't include information for the primary payer.
    #[serde(rename = "paymentResponsibilityLevelCode")]
    pub payment_responsibility_level_code: models::InstitutionalSubscriberPaymentResponsibilityLevelCode,
    /// Deprecated.
    #[serde(rename = "policyNumber", skip_serializing_if = "Option::is_none")]
    pub policy_number: Option<String>,
    /// The subscriber's Social Security Number. This must be a string of exactly nine numbers with no separators. For example, `123456789`.
    #[serde(rename = "ssn", skip_serializing_if = "Option::is_none")]
    pub ssn: Option<String>,
    /// Deprecated. Use the `memberId` property instead.
    #[serde(rename = "standardHealthId", skip_serializing_if = "Option::is_none")]
    pub standard_health_id: Option<String>,
    /// The subscriber's name suffix, such as Jr. or III. 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 InstitutionalSubscriber {
    /// The person or entity who is the primary policyholder for the health plan _or_ a dependent with their own member ID. - 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. - 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(payment_responsibility_level_code: models::InstitutionalSubscriberPaymentResponsibilityLevelCode) -> InstitutionalSubscriber {
        InstitutionalSubscriber {
            address: None,
            date_of_birth: None,
            first_name: None,
            gender: None,
            group_number: None,
            last_name: None,
            member_id: None,
            middle_name: None,
            organization_name: None,
            payment_responsibility_level_code,
            policy_number: None,
            ssn: None,
            standard_health_id: None,
            suffix: None,
        }
    }
}