/*
* Stedi Manager
*
* 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::manager::models;
use serde::{Deserialize, Serialize};
/// BatchItem : A batch item representing an individual record in a batch.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BatchItem {
/// Additional information about the eligibility check.
#[serde(rename = "additionalInfo", skip_serializing_if = "Option::is_none")]
pub additional_info: Option<Box<models::BatchItemAdditionalInfo>>,
/// The ID for the batch containing this eligibility check.
#[serde(rename = "batchId")]
pub batch_id: String,
/// The date and time when the eligibility check was created.
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::FixedOffset>,
/// Only relevant for batches submitted through the JSON API. This is the index of the item in the batch. It starts at 0.
#[serde(rename = "index", skip_serializing_if = "Option::is_none")]
pub index: Option<i32>,
/// A globally unique identifier for this eligibility check within Stedi. Stedi uses this identifier to construct the URL for the eligibility check's detail pages within the Stedi portal. Don't use this ID to correlate eligibility check requests and responses. Use the `additionalInfo.eligibility.submitterTransactionIdentifier` property for correlation and tracking instead.
#[serde(rename = "requestId", skip_serializing_if = "Option::is_none")]
pub request_id: Option<String>,
/// Only relevant for batches submitted through CSV upload. This is the row number for this eligibility check in the CSV file. It starts at 2 because the first row of the CSV file is the header.
#[serde(rename = "rowNumber", skip_serializing_if = "Option::is_none")]
pub row_number: Option<i32>,
/// The current state of the eligibility check. Can be: - `PENDING`: Stedi hasn't begun processing the eligibility check. - `VALIDATED`: Stedi finished validating the eligibility check and is ready to execute it. - `VALIDATION_FAILED`: Stedi found errors in the eligibility check that you need to fix before processing can continue. This is typically due to malformed CSV data, missing required fields, or invalid values. - `STARTED`: Stedi has begun processing the eligibility check. - `RETRYING`: Stedi is retrying the eligibility check. Stedi retries eligibility checks that fail due to payer connectivity issues for up to 8 hours. - `COMPLETED`: Stedi successfully processed the eligibility check and received a response from the payer. This doesn't indicate that the payer has active coverage, only that Stedi was able to get a response. - `COMPLETED_WITH_ERRORS`: Stedi finished processing the eligibility check, but couldn't get a response from the payer. A common reason for failure is payer connectivity issues.
#[serde(rename = "state")]
pub state: models::BatchItemState,
/// The date and time when the eligibility check was last updated.
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::FixedOffset>,
}
impl BatchItem {
/// A batch item representing an individual record in a batch.
pub fn new(batch_id: String, created_at: chrono::DateTime<chrono::FixedOffset>, state: models::BatchItemState, updated_at: chrono::DateTime<chrono::FixedOffset>) -> BatchItem {
BatchItem {
additional_info: None,
batch_id,
created_at,
index: None,
request_id: None,
row_number: None,
state,
updated_at,
}
}
}