/*
* 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};
/// UpdateEnrollmentRequestContent : Input for UpdateEnrollment.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateEnrollmentRequestContent {
/// Preference for how the payer should group 835 Electronic Remittance Advice (ERA) transactions. Only set this property for 835 ERA enrollments. - If you include this property for a non-ERA enrollment, Stedi rejects the enrollment request with an HTTP `400` error. - If the payer doesn't support the requested aggregation type, Stedi rejects the enrollment request with an HTTP `400` error. - If not set, Stedi automatically selects a default based on the payer's supported aggregation types and the available identifiers for the provider. - Stedi will attempt to enroll with this preference, but it's not guaranteed. Each payer has its own restrictions and behaviors.
#[serde(rename = "aggregationPreference", skip_serializing_if = "Option::is_none")]
pub aggregation_preference: Option<Box<models::AggregationPreference>>,
/// Information about the payer the provider is enrolling with.
#[serde(rename = "payer")]
pub payer: Box<models::EnrolledPayerInput>,
/// The contact information for the provider. This is where the payer will send communications about the enrollment, if needed. - Either `organizationName` _or_ `firstName` and `lastName` are required. - The name and address should match exactly what the payer has on file for the provider. Some payers reject enrollment requests with addresses that don't match their records. - If you're submitting enrollment requests on a provider's behalf, you may want to set the phone number or email to your own contact details. Do this when you want the payer to contact you about the enrollment status instead of the provider directly. - This contact information doesn't need to match existing contacts defined on the provider record. It also doesn't modify or replace contacts on the provider record.
#[serde(rename = "primaryContact")]
pub primary_contact: Box<models::ProviderContact>,
/// Information about the provider enrolling with the payer.
#[serde(rename = "provider")]
pub provider: Box<models::EnrolledProviderInput>,
/// 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>,
/// This shape is deprecated since 2025-10-07: Only Stedi can set or update this property, and it will be removed in a future release.
#[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 you'd like the enrollment to take effect with the payer. For example, setting this to `20260601` for an 835 Electronic Remittance Advice (ERAs) enrollment means you want to start receiving ERAs through Stedi on that date. Stedi processes enrollments accordingly, but can't guarantee that the enrollment will be effective on this exact date. - You can submit today's date or a future date up to 6 months from today. - If not set for draft enrollments, this property remains empty. - If not set for submitted enrollments, Stedi defaults to the enrollment's submission date. - If you include this property for a payer that doesn't support requested effective dates, Stedi rejects the request with an HTTP `400` error.
#[serde(rename = "requestedEffectiveDate", skip_serializing_if = "Option::is_none")]
pub requested_effective_date: Option<String>,
/// This shape is deprecated since 2025-12-23: Stedi ignores this property for API requests, and it will be removed in a future release. The enrollment source is always set to `API`.
#[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. - `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`.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<models::EnrollmentStatus>,
/// The type of transactions included in the enrollment.
#[serde(rename = "transactions")]
pub transactions: Box<models::EnrolledTransactionsList>,
/// 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 UpdateEnrollmentRequestContent {
/// Input for UpdateEnrollment.
pub fn new(payer: models::EnrolledPayerInput, primary_contact: models::ProviderContact, provider: models::EnrolledProviderInput, transactions: models::EnrolledTransactionsList, user_email: String) -> UpdateEnrollmentRequestContent {
UpdateEnrollmentRequestContent {
aggregation_preference: 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,
transactions: Box::new(transactions),
user_email,
}
}
}