/*
* Stedi Enrollment
*
* The Stedi Enrollment Service manages provider enrollments with healthcare payers. It tracks enrollment status, provider details, and supports batch enrollment processing to ensure providers have the necessary credentials before processing healthcare transactions.
*
* The version of the OpenAPI document: 2024-09-01
* Contact: healthcare@stedi.com
* Generated by: https://openapi-generator.tech
*/
use crate::enrollment::models;
use serde::{Deserialize, Serialize};
/// EnrollmentSummary : Summary of an enrollment with essential fields for list operations.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EnrollmentSummary {
/// Preference for how the payer should group 835 Electronic Remittance Advice (ERA) transactions. This property is only returned for 835 ERA enrollments. - If not set, Stedi automatically selects a default based on the payer's supported aggregation types and the available identifiers for the provider. - Stedi attempts to enroll with this preference, but it's not guaranteed. Each payer has its own restrictions and behaviors - This property isn't returned for enrollment records created before Stedi added support for aggregation preferences.
#[serde(rename = "aggregationPreference", skip_serializing_if = "Option::is_none")]
pub aggregation_preference: Option<Box<models::AggregationPreference>>,
/// The date and time when the enrollment was created within Stedi.
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::FixedOffset>,
/// Documents associated with this enrollment, such as signed enrollment forms. This list doesn't include deleted documents. Each document object contains metadata such as the document's name, status, and timestamps for creation and last update.
#[serde(rename = "documents", skip_serializing_if = "Option::is_none")]
pub documents: Option<Vec<models::EnrollmentDocument>>,
/// The history of updates to this enrollment, such as status changes. This property is experimental and may change in the future.
#[serde(rename = "history", skip_serializing_if = "Option::is_none")]
pub history: Option<Vec<models::EnrollmentHistoryEntry>>,
/// The Stedi-assigned identifier for the enrollment.
#[serde(rename = "id")]
pub id: String,
/// The import ID associated with the enrollment if it was created through a CSV bulk import (`source` is set to `IMPORT`). This property is only present for enrollments created through the CSV import process.
#[serde(rename = "importId", skip_serializing_if = "Option::is_none")]
pub import_id: Option<String>,
/// The timestamp of the most recent 835 ERA (Electronic Remittance Advice) Stedi received for this enrollment, based on the enrollment's payer ID, provider NPI, and provider tax ID. Stedi automatically updates this property for each new ERA. - This property is only returned for ERA enrollments in `LIVE` status with at least one matching ERA from the payer. - If this timestamp doesn't match your expected timeline for ERA processing, there may be an upstream issue. Contact Stedi support for assistance.
#[serde(rename = "lastEraReceivedAt", skip_serializing_if = "Option::is_none")]
pub last_era_received_at: Option<chrono::DateTime<chrono::FixedOffset>>,
/// Information about the payer the provider is enrolling with.
#[serde(rename = "payer")]
pub payer: Box<models::EnrolledPayerOutput>,
/// Information about the provider enrolling with the payer.
#[serde(rename = "provider")]
pub provider: Box<models::AllEnrolledProviderFields>,
/// Reasons why the enrollment request is still in `PROVISIONING` status, may take additional time to process, or was rejected by the payer. Only Stedi can set or update this property.
#[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
/// The requested effective date for the enrollment in YYYYMMDD format. This is the date the submitter would like the enrollment to take effect with the payer. If not provided during submission, Stedi defaults to the enrollment's submission date. Not all payers support requested effective dates. Stedi can't guarantee that the enrollment will be effective with the payer on this exact date.
#[serde(rename = "requestedEffectiveDate", skip_serializing_if = "Option::is_none")]
pub requested_effective_date: Option<String>,
/// The source of the enrollment.
#[serde(rename = "source")]
pub source: models::EnrollmentSource,
/// The status of the enrollment. - `DRAFT` - You are still editing the record and it has not been submitted to Stedi. - `STEDI_ACTION_REQUIRED` - You have submitted the enrollment and it is ready for Stedi to begin processing. - `PROVIDER_ACTION_REQUIRED` - The enrollment requires action from the healthcare provider to proceed, such as providing additional documentation. Stedi will add a note to your enrollment request with clear instructions. - `SUBMITTED` - (Deprecated) Legacy status being phased out in favor of the more specific action-required statuses. - `PROVISIONING` - Stedi has begun the process of completing the enrollment with the payer. - `LIVE` - The enrollment process is complete, and the specified provider can begin exchanging the listed transaction types with the payer. - `REJECTED` - The payer rejected the enrollment. Common reasons for rejection include incorrect details in the request and that the provider is not credentialed with the payer. Customer support will contact you with reasons for rejection and next steps. - `CANCELED` - The enrollment has been terminated per customer or provider request.
#[serde(rename = "status")]
pub status: models::EnrollmentStatus,
/// The date and time when the enrollment status was last updated. This timestamp is used to track enrollment processing durations and enables filtering to identify recently changed enrollments. It automatically updates whenever an enrollment's status changes but remains unchanged during other updates.
#[serde(rename = "statusLastUpdatedAt")]
pub status_last_updated_at: chrono::DateTime<chrono::FixedOffset>,
/// The date and time when the enrollment was submitted. If the enrollment is in draft status, `submittedAt` is not present. When the enrollment transitions from draft to submitted, `submittedAt` will be updated to the submission time. If the enrollment was created and submitted immediately, `submittedAt` will be equal or close to `createdAt`.
#[serde(rename = "submittedAt", skip_serializing_if = "Option::is_none")]
pub submitted_at: Option<chrono::DateTime<chrono::FixedOffset>>,
/// Tasks associated with this enrollment, such as reminders or follow-ups.
#[serde(rename = "tasks", skip_serializing_if = "Option::is_none")]
pub tasks: Option<Vec<models::Task>>,
/// The type of transactions included in the enrollment.
#[serde(rename = "transactions")]
pub transactions: Box<models::EnrolledTransactionsList>,
/// The date and time when the enrollment was updated.
#[serde(rename = "updatedAt")]
pub updated_at: chrono::DateTime<chrono::FixedOffset>,
}
impl EnrollmentSummary {
/// Summary of an enrollment with essential fields for list operations.
pub fn new(created_at: chrono::DateTime<chrono::FixedOffset>, id: String, payer: models::EnrolledPayerOutput, provider: models::AllEnrolledProviderFields, source: models::EnrollmentSource, status: models::EnrollmentStatus, status_last_updated_at: chrono::DateTime<chrono::FixedOffset>, transactions: models::EnrolledTransactionsList, updated_at: chrono::DateTime<chrono::FixedOffset>) -> EnrollmentSummary {
EnrollmentSummary {
aggregation_preference: None,
created_at,
documents: None,
history: None,
id,
import_id: None,
last_era_received_at: None,
payer: Box::new(payer),
provider: Box::new(provider),
reason: None,
requested_effective_date: None,
source,
status,
status_last_updated_at,
submitted_at: None,
tasks: None,
transactions: Box::new(transactions),
updated_at,
}
}
}