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.On this page
Methods
client.documents.create#
writeasync 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) -> dictUpload 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
| Parameter | Type | Description |
|---|---|---|
document | Mapping[str, Any] | None | Raw DocumentToCreate payload. When given, everything else is ignored. |
practice_idrequired | int | None | Practice ID. Required in structured mode. |
patient_id | int | None | Optional patient ID. |
file_path | str | Path | None | Path to a local file. Its name is used when file_name is omitted. |
file_content | bytes | str | None | Raw bytes or a base64-encoded string. Requires file_name. |
file_name | str | None | File name sent to Tebra. |
name | str | None | Document display name. Defaults to the file name. |
label | str | Friendly label or SOAP value. Default "MedicalReport". |
status | str | Friendly status or SOAP value. Default "New". |
document_date | str | date | datetime | None | Document date. |
document_notes | str | None | Free-form notes. |
Returns
dict[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#
writeasync delete(document_id) -> dictDelete a document by numeric DocumentId using DeleteDocument. Blocked when read_only=True.
Parameters
| Parameter | Type | Description |
|---|---|---|
document_idrequired | int | Document ID. |
Returns
dict[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 value | SOAP value |
|---|---|
| Appeals Package | AppealsPackage |
| A/R | AR |
| AR | AR |
| Authorization | Authorization |
| Claim Status | ClaimStatus |
| Copay Log | CopayLog |
| Diagnostic Ultrasound | DiagnosticUltrasound |
| Document Batch | DocumentBatch |
| Eligibility | Eligibility |
| Explanation of Benefits (EOB) | ExplanationofBenefits |
| Explanation of Benefits | ExplanationofBenefits |
| History and Physical | HistoryandPhysical |
| Insurance Correspondence | InsuranceCorrespondence |
| Letter of Medical Necessity | LetterofMedicalNecessity |
| Lien Document | LienDocument |
| Medical Record Request | MedicalRecordRequest |
| Medical Report | MedicalReport |
| MedicalReport | MedicalReport |
| Narrative Report | NarrativeReport |
| Operative Report | OperativeReport |
| Patient Authorization/Referral | PatientAuthorizationOrReferral |
| Patient Correspondence | PatientCorrespondence |
| Patient Demographics | PatientDemographics |
| Patient Driver's License | PatientDriversLicense |
| Patient Driver’s License | PatientDriversLicense |
| Patient Insurance Card | PatientInsuranceCard |
| Payment Batch | PaymentBatch |
| Prescriptions | Prescriptions |
| Superbill | Superbill |
| Superbill Batch | SuperbillBatch |
| Tests | Tests |
| Ultrasound | Ultrasound |
| Other | Other |
| Continuity of Care Received | ContinuityOfCareReceived |
Document status map
Normalized by DOCUMENT_STATUS_MAP.
| Friendly value | SOAP value |
|---|---|
| New | New |
| In-Process | InProcess |
| InProcess | InProcess |
| Ready for Entry | ReadyForEntry |
| Processed | Processed |
| Error | Error |
| New-Billing | NewBilling |
| NewBilling | NewBilling |
| Unknown | Unknown |
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",
)