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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EligibilityCheckRequestContent {
    /// Stedi generates a control number for each eligibility check, so you don’t need to include this property in your request.
    #[serde(rename = "controlNumber", skip_serializing_if = "Option::is_none")]
    pub control_number: Option<String>,
    /// A dependent for which you want to retrieve benefits information. - You can only submit one dependent per eligibility check. - Only include the patient's information here when they are listed as a dependent on the subscriber's insurance plan AND the payer cannot uniquely identify them through information outside the subscriber's policy. For example, if the dependent has their own member ID number, you should identify them in the `subscriber` object instead. This includes member IDs that differ only by a suffix, such as `01`, because the patient can still be uniquely identified. - Most Medicaid plans don't support dependents, with a [few exceptions](https://www.stedi.com/docs/healthcare/send-eligibility-checks#medicaid-dependents). Sending this array to payers that don't support dependents will either cause an error, or the payer may ignore the information and return results for the subscriber instead. - Each payer has different requirements, so you should supply the fields necessary for each payer to identify the dependent in their system. However, we **strongly recommend** including the dependent's date of birth in the request when available because many payers return errors without it. - Enter the patient's name exactly as written on their insurance card, if available, including any special or punctuation characters such as apostrophes, hyphens (dashes), or spaces. Visit [patient names](https://www.stedi.com/docs/healthcare/send-eligibility-checks#patient-names) for all best practices to avoid unnecessary failures.
    #[serde(rename = "dependents", skip_serializing_if = "Option::is_none")]
    pub dependents: Option<Vec<models::RequestDependent>>,
    /// An identifier that allows Stedi to group eligibility checks for the same patient into a unified record in the Stedi portal called an [eligibility search](https://www.stedi.com/docs/healthcare/eligibility-searches-view).  This property is for use by Stedi tools only, such as Stedi's MCP server.
    #[serde(rename = "eligibilitySearchId", skip_serializing_if = "Option::is_none")]
    pub eligibility_search_id: Option<String>,
    #[serde(rename = "encounter", skip_serializing_if = "Option::is_none")]
    pub encounter: Option<Box<models::Encounter>>,
    /// A unique identifier for the patient that Stedi uses to identify and correlate historical eligibility checks for the same individual. We recommend including this value in all requests.
    #[serde(rename = "externalPatientId", skip_serializing_if = "Option::is_none")]
    pub external_patient_id: Option<String>,
    /// Use the corresponding properties in the `provider` object instead.
    #[serde(rename = "informationReceiverName", skip_serializing_if = "Option::is_none")]
    pub information_receiver_name: Option<Box<models::InformationReceiverName>>,
    /// The password that the provider uses to log in to the payer's portal. For payers Medicaid California, AltaMed, and Kern Family Health Care, this property is **required** and should be the [provider's PIN](https://www.stedi.com/docs/healthcare/eligibility-troubleshooting#portal-credentials). Otherwise, this is not commonly used.
    #[serde(rename = "portalPassword", skip_serializing_if = "Option::is_none")]
    pub portal_password: Option<String>,
    /// The username that the provider uses to log in to the payer's portal. This is not commonly used.
    #[serde(rename = "portalUsername", skip_serializing_if = "Option::is_none")]
    pub portal_username: Option<String>,
    /// Information about the entity requesting the eligibility check. This may be an individual practitioner, a medical group, a hospital, or another type of healthcare provider.  - You must provide the `organizationName` (if the entity is an organization), or `firstName` and `lastName` (if the provider is an individual).  - You must also provide an identifier - this is typically the provider's [National Provider Identifier](https://www.stedi.com/docs/healthcare/national-provider-identifier) (`npi`). If the provider doesn't have an NPI, you can supply an alternative, such as their `taxId` or `ssn`.  - Don't include additional properties, such as `taxId` or `address`, unless they are specifically required or suggested by the payer.
    #[serde(rename = "provider")]
    pub provider: Box<models::Provider>,
    /// This property is only relevant for asynchronous batch eligibility checks.
    #[serde(rename = "submitterTransactionIdentifier", skip_serializing_if = "Option::is_none")]
    pub submitter_transaction_identifier: Option<String>,
    #[serde(rename = "subscriber")]
    pub subscriber: Box<models::RequestSubscriber>,
    /// The payer's name, such as Cigna or Aetna.
    #[serde(rename = "tradingPartnerName", skip_serializing_if = "Option::is_none")]
    pub trading_partner_name: Option<String>,
    /// The payer ID. Visit the [Payer Network](https://www.stedi.com/healthcare/network) for a complete list.  - You can send requests using the primary payer ID, the Stedi payer ID, or any alias listed in the payer record.  - You must include leading `0` characters - payer IDs are alphanumeric strings and must be treated as complete strings, not integers. For example, use `00540` for SISCO, not `540`.
    #[serde(rename = "tradingPartnerServiceId")]
    pub trading_partner_service_id: String,
}

impl EligibilityCheckRequestContent {
    pub fn new(provider: models::Provider, subscriber: models::RequestSubscriber, trading_partner_service_id: String) -> EligibilityCheckRequestContent {
        EligibilityCheckRequestContent {
            control_number: None,
            dependents: None,
            eligibility_search_id: None,
            encounter: None,
            external_patient_id: None,
            information_receiver_name: None,
            portal_password: None,
            portal_username: None,
            provider: Box::new(provider),
            submitter_transaction_identifier: None,
            subscriber: Box::new(subscriber),
            trading_partner_name: None,
            trading_partner_service_id,
        }
    }
}