Ttebra_soap_apiAsync Tebra SOAP 2.1
SOAP 2.1
Resources

Documents

Upload patient documents and delete them by ID.

Resource
client.documents
SOAP operations
CreateDocument, DeleteDocument
Flat methods
None — use the resource
Listing / download
Not supported by Tebra SOAP 2.1
API scopeTebra SOAP 2.1 supports CreateDocument and DeleteDocument, but not listing or downloading existing documents. This resource exposes only what the API provides.

Methods

client.documents.create#

write
async create(document=None, *, practice_id=None, patient_id=None, file_path=None, file_content=None, file_name=None, name=None, label='MedicalReport', status='New', document_date=None, document_notes=None) -> dict

Upload a document using CreateDocument. Pass either a raw document dict or structured arguments. File bytes come from file_path (read off the event loop) or file_content (bytes, or a base64 string). Friendly label/status values are normalized to Tebra's SOAP values. Blocked when read_only=True.

Parameters
ParameterTypeDescription
documentMapping[str, Any] | NoneRaw DocumentToCreate payload. When given, everything else is ignored.
practice_idrequiredint | NonePractice ID. Required in structured mode.
patient_idint | NoneOptional patient ID.
file_pathstr | Path | NonePath to a local file. Its name is used when file_name is omitted.
file_contentbytes | str | NoneRaw bytes or a base64-encoded string. Requires file_name.
file_namestr | NoneFile name sent to Tebra.
namestr | NoneDocument display name. Defaults to the file name.
labelstrFriendly label or SOAP value. Default "MedicalReport".
statusstrFriendly status or SOAP value. Default "New".
document_datestr | date | datetime | NoneDocument date.
document_notesstr | NoneFree-form notes.
Returnsdict[str, Any] (the created Document or raw response)
Provide exactly one of file_path, file_content, or a raw document dict. A missing file raises FileNotFoundError; missing required arguments raise ValueError.
Example
doc = await client.documents.create(
    practice_id=7,
    patient_id=119246,
    file_path="referral.pdf",
    label="Patient Authorization/Referral",
    status="New",
    document_notes="Uploaded by integration.",
)

client.documents.delete#

write
async delete(document_id) -> dict

Delete a document by numeric DocumentId using DeleteDocument. Blocked when read_only=True.

Parameters
ParameterTypeDescription
document_idrequiredintDocument ID.
Returnsdict[str, Any]

Document label map

The friendly keys below are normalized to Tebra SOAP values by DOCUMENT_LABEL_MAP. Unknown values pass through unchanged.

Friendly valueSOAP value
Appeals PackageAppealsPackage
A/RAR
ARAR
AuthorizationAuthorization
Claim StatusClaimStatus
Copay LogCopayLog
Diagnostic UltrasoundDiagnosticUltrasound
Document BatchDocumentBatch
EligibilityEligibility
Explanation of Benefits (EOB)ExplanationofBenefits
Explanation of BenefitsExplanationofBenefits
History and PhysicalHistoryandPhysical
Insurance CorrespondenceInsuranceCorrespondence
Letter of Medical NecessityLetterofMedicalNecessity
Lien DocumentLienDocument
Medical Record RequestMedicalRecordRequest
Medical ReportMedicalReport
MedicalReportMedicalReport
Narrative ReportNarrativeReport
Operative ReportOperativeReport
Patient Authorization/ReferralPatientAuthorizationOrReferral
Patient CorrespondencePatientCorrespondence
Patient DemographicsPatientDemographics
Patient Driver's LicensePatientDriversLicense
Patient Driver’s LicensePatientDriversLicense
Patient Insurance CardPatientInsuranceCard
Payment BatchPaymentBatch
PrescriptionsPrescriptions
SuperbillSuperbill
Superbill BatchSuperbillBatch
TestsTests
UltrasoundUltrasound
OtherOther
Continuity of Care ReceivedContinuityOfCareReceived

Document status map

Normalized by DOCUMENT_STATUS_MAP.

Friendly valueSOAP value
NewNew
In-ProcessInProcess
InProcessInProcess
Ready for EntryReadyForEntry
ProcessedProcessed
ErrorError
New-BillingNewBilling
NewBillingNewBilling
UnknownUnknown

Example: upload from bytes

import base64

payload = base64.b64encode(b"%PDF-1.4 ...").decode("ascii")
doc = await client.documents.create(
    practice_id=7,
    patient_id=119246,
    file_content=payload,
    file_name="referral.pdf",
    label="MedicalRecordRequest",
)

Related