/*
* 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};
/// CreateEnrollmentResponseContent : Output containing the created enrollment details.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateEnrollmentResponseContent {
/// 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, excluding deleted documents.
#[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 request.
#[serde(rename = "id")]
pub id: 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>,
/// The contact information for the provider. This is where the payer will send communications about the enrollment, if needed.
#[serde(rename = "primaryContact")]
pub primary_contact: Box<models::ProviderContact>,
/// Information about the provider enrolling with the payer.
#[serde(rename = "provider")]
pub provider: Box<models::AllEnrolledProviderFields>,
/// This property is required for payers that require a Provider Transaction Access Number (PTAN). The PTAN is a Medicare-issued number given to providers upon enrollment with Medicare. This number is usually six digits and is assigned based on the type of service and the location of the provider. Upon enrollment, Medicare Administrating Contracting (MAC) providers should receive their assigned PTAN number in their approval letter.
#[serde(rename = "providerTransactionAccessNumber", skip_serializing_if = "Option::is_none")]
pub provider_transaction_access_number: Option<String>,
/// 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 this enrollment.
#[serde(rename = "source", skip_serializing_if = "Option::is_none")]
pub source: Option<models::EnrollmentSource>,
/// The status of the enrollment. You can submit enrollments with either `DRAFT` or `STEDI_ACTION_REQUIRED` status. The default status is `DRAFT` if not specified. When you're ready for Stedi to begin processing the enrollment, set the status to `STEDI_ACTION_REQUIRED`. Once an enrollment is `STEDI_ACTION_REQUIRED`, only Stedi can set or update its status. - `DRAFT` - You're still editing the enrollment and haven't submitted it 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. If you set an enrollment request to `SUBMITTED`, Stedi treats it as `STEDI_ACTION_REQUIRED`. - `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", skip_serializing_if = "Option::is_none")]
pub status: Option<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 `STEDI_ACTION_REQUIRED`, `submittedAt` is updated to the submission time. If the enrollment was created and submitted immediately, the `submittedAt` time will be equal or close to the `createdAt` time.
#[serde(rename = "submittedAt", skip_serializing_if = "Option::is_none")]
pub submitted_at: Option<chrono::DateTime<chrono::FixedOffset>>,
/// Tasks associated with this enrollment representing work that needs to be completed. Each task has a responsible party and specific definition.
#[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>,
/// The email address where Stedi should send updates about the enrollment. We'll use it to notify you when there are next steps and send updates on the enrollment's status. - This email address can be different from the `primaryContact.email` where the payer sends communications about the enrollment. - For [automatic enrollment requests](https://www.stedi.com/docs/healthcare/create-manage-transaction-enrollments#automatic-enrollment-requests), Stedi sets this to the oldest account member with the Admin role.
#[serde(rename = "userEmail")]
pub user_email: String,
}
impl CreateEnrollmentResponseContent {
/// Output containing the created enrollment details.
pub fn new(created_at: chrono::DateTime<chrono::FixedOffset>, id: String, payer: models::EnrolledPayerOutput, primary_contact: models::ProviderContact, provider: models::AllEnrolledProviderFields, status_last_updated_at: chrono::DateTime<chrono::FixedOffset>, transactions: models::EnrolledTransactionsList, updated_at: chrono::DateTime<chrono::FixedOffset>, user_email: String) -> CreateEnrollmentResponseContent {
CreateEnrollmentResponseContent {
aggregation_preference: None,
created_at,
documents: None,
history: None,
id,
last_era_received_at: None,
payer: Box::new(payer),
primary_contact: Box::new(primary_contact),
provider: Box::new(provider),
provider_transaction_access_number: None,
reason: None,
requested_effective_date: None,
source: None,
status: None,
status_last_updated_at,
submitted_at: None,
tasks: None,
transactions: Box::new(transactions),
updated_at,
user_email,
}
}
}