Metadata-Version: 2.4
Name: ritten-python-sdk
Version: 1.1.0
Summary: Python SDK for connecting applications to the Ritten EMR Platform. Simplifies integration with the Behavioral Health Operations API.
License-File: LICENSE
Keywords: ritten,emr,healthcare,sdk,python
Author: Wesley Gonçalves
Author-email: dev@wesleygoncalves.com
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: pydantic (>=2.13.4,<3.0.0)
Project-URL: Documentation, https://github.com/wesleygoncalves/ritten-python-sdk/blob/main/README.md
Project-URL: Homepage, https://github.com/wesleygoncalves/ritten-python-sdk
Project-URL: changelog, https://github.com/wesleygoncalves/ritten-python-sdk/blob/main/CHANGELOG.md
Project-URL: issues, https://github.com/wesleygoncalves/ritten-python-sdk/issues
Project-URL: source, https://github.com/wesleygoncalves/ritten-python-sdk
Description-Content-Type: text/markdown

# Ritten API Integration

Python SDK for connecting applications to the [Ritten EMR Platform](https://docs.ritten.io/). This library simplifies integration with Ritten's Behavioral Health Operations API, allowing developers to use Ritten API seamlessly from any Python environment.

Ritten API specifications:

- [Documentation](https://docs.ritten.io/)
- Version: 1

## Installation

The SDK requires **Python 3.10 or higher**. Install it directly via `pip`:

```bash
pip install ritten-python-sdk

# Using poetry
poetry add ritten-python-sdk

# Using pipenv
pipenv install ritten-python-sdk
```

## Quickstart Guide

To get started, you must first obtain your integrator `client_id` and `client_secret` from your Ritten administrator portal.

---

## Resources

- Review the official [Ritten API Documentation](https://docs.ritten.io/) for explicit payload schemas.

## API Coverage

Coverage against the [Ritten OpenAPI specification](https://docs.ritten.io/swagger/openapi.yaml) (v1.0.0). Checked items are available in this SDK today; unchecked items are not yet implemented.

### OAuth

- [x] `POST /oauth/token` - Obtain an access token (client_credentials grant) - handled automatically by `Ritten`/`Auth`, no resource method needed

### Patients

- [x] `GET /patients` - List patients in a clinic
- [x] `POST /patients` - Create a new patient
- [x] `GET /patients/{id}` - Retrieve a patient by ID
- [x] `PATCH /patients/{id}` - Update a patient by ID
- [x] `GET /patients/external/{externalId}` - Retrieve a patient by external ID
- [x] `POST /patients/{id}/vitals` - Record patient vitals
- [x] `GET /patients/{id}/relationships` - List a patient's relationships
- [x] `POST /patients/{id}/relationships` - Create a new patient relationship
- [x] `PATCH /patients/{id}/relationships/{relationshipId}` - Update a patient relationship
- [x] `DELETE /patients/{id}/relationships/{relationshipId}` - Delete a patient relationship
- [x] `POST /patients/{id}/attachments` - Attach a document to a patient chart
- [x] `PATCH /patients/{id}/attachments/{attachmentId}` - Update a document on a patient chart

### Contacts

- [x] `GET /contacts` - List contacts in a clinic
- [x] `POST /contacts` - Create a new contact
- [x] `GET /contacts/{id}` - Retrieve a contact by ID
- [x] `PATCH /contacts/{id}` - Update a contact by ID
- [x] `GET /contacts/{id}/relationships` - List a contact's relationships
- [x] `POST /contacts/{id}/relationships` - Create a new contact relationship

### Users

- [x] `GET /staff` - List all clinic staff users
- [x] `POST /users` - Create a new user
- [x] `DELETE /users/{id}` - Delete a user
- [x] `POST /users/{id}/roles` - Assign a role to a user
- [x] `DELETE /users/{id}/roles/{roleID}` - Remove a role from a user
- [x] `POST /users/{id}/security-groups` - Set a user's security groups
- [x] `GET /security-groups` - List all security groups
- [x] `GET /teams` - List all clinic teams

### Calendar

- [x] `POST /calendar/events/list` - Query calendar events
- [x] `POST /calendar/events` - Create a new calendar event

### Insurance

- [x] `GET /insurance/payers` - List insurance payers
- [x] `GET /insurance/payers/{id}` - Retrieve an insurance payer by ID

### Encounters

- [x] `POST /encounters` - Create an encounter
- [x] `GET /encounter-types` - List encounter types

### Forms

- [x] `GET /forms/definitions` - List form definitions
- [x] `POST /patients/{id}/forms` - Create a form on a patient chart and submit field values

### Insights

- [x] `GET /insights/admissions` - Get admissions report
- [x] `GET /insights/discharges` - Get discharges report
- [x] `GET /insights/alos` - Get average length of stay report
- [x] `GET /insights/program-census` - Get program census report
- [x] `GET /insights/census-report` - Get census report
- [x] `GET /insights/dbs` - Get daily billable services report
- [x] `GET /insights/event-audit` - Get event audit report
- [x] `GET /insights/facility-census` - Get facility census report
- [x] `GET /insights/clinic-organizations` - Get clinic organizations
- [x] `GET /insights/organization-notes` - Get organization notes
- [x] `GET /insights/created-cases` - Get created cases report
- [x] `GET /insights/disqualified-cases` - Get disqualified cases report
- [x] `GET /insights/care-teams` - Get care teams report
- [x] `GET /insights/encounter-history` - Get encounter history report
- [x] `GET /insights/client-event-history` - Get client event history report
- [x] `GET /insights/client-attendance-by-status` - Get client attendance by status report
- [x] `GET /insights/all-transactions` - Get the All Transactions report
- [x] `GET /insights/form-outcomes` - Get form outcomes report

### Cases

- [x] `GET /cases` - List cases in a clinic
- [x] `POST /cases` - Create a case
- [x] `GET /cases/{id}` - Retrieve a case by ID
- [x] `PATCH /cases/{id}` - Update a case
- [x] `POST /cases/{id}/notes` - Create a case note
- [x] `POST /cases/{id}/action-items` - Create a case action item

### Facilities

- [x] `GET /facilities` - List active facilities in a clinic
- [x] `POST /facilities` - Create a facility in a clinic
- [x] `PATCH /facilities/{id}` - Update a facility

### Programs

- [x] `GET /programs` - List active programs in a clinic
- [x] `POST /programs` - Create a clinic program
- [x] `GET /programs/{id}` - Get an active program
- [x] `PATCH /programs/{id}` - Update a clinic program

### Organizations

- [x] `GET /organizations` - List active organizations in a clinic
- [x] `POST /organizations` - Create an organization in a clinic
- [x] `GET /organizations/{id}` - Get an active organization
- [x] `PATCH /organizations/{id}` - Update an organization
- [x] `GET /organizations/{id}/members` - List active organization members

### Tasks

- [x] `GET /tasks` - List tasks in a clinic
- [x] `POST /tasks` - Create a task
- [x] `PATCH /tasks/{id}` - Update a task

### Calls

- [x] `POST /calls` - Create or update a call

### Webhooks (inbound events)

These are events *Ritten* sends to a receiver endpoint you host - they aren't operations the SDK calls, so there's nothing for a resource method to implement. Listed here for completeness; the SDK does not currently provide helpers for verifying or parsing incoming webhook payloads.

- `patient.admit`, `patient.transfer`, `patient.discharge`, `patient.created`
- `case.created`, `case.status.update`
- `encounter.created`, `encounter.status.update`
- `appointment.created`
- `contact.created`

## About the Author

This SDK is developed and maintained by [Wesley Gonçalves](https://github.com/wesleygoncalves) under MIT license. Contributions and feedback are welcome!

