Download the PHP package drchrono/php-sdk without Composer
On this page you can find all versions of the php package drchrono/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download drchrono/php-sdk
More information about drchrono/php-sdk
Files in drchrono/php-sdk
Package php-sdk
Short Description Official PHP SDK for the DrChrono API - Complete EHR/Practice Management integration
License MIT
Homepage https://github.com/drchrono/DrChrono-PHP
Informations about the package php-sdk
DrChrono PHP SDK
PHP SDK for the DrChrono API - EHR/Practice Management integration for PHP applications.
Features
✨ Complete API Coverage - All DrChrono API endpoints supported 🔐 OAuth2 Authentication - Full OAuth2 flow with automatic token refresh 📄 Pagination Support - Automatic pagination with generators for memory efficiency 🎯 Type-Safe Models - Optional DTOs for common entities (Patient, Appointment, etc.) 🔔 Webhook Handling - Built-in webhook verification and event parsing ⚡ Smart Retry Logic - Automatic retry with exponential backoff for rate limits 🛡️ Error Handling - Granular exceptions for different error types 📦 Framework Agnostic - Works with Laravel, Symfony, or plain PHP
Requirements
- PHP 8.1 or higher
- Composer
- ext-json
Installation
Install via Composer:
Quick Start
Basic Authentication
OAuth2 Flow
Laravel Integration
The package ships with a Laravel service provider and config file for auto-registration. After installing, publish the config if you want to customize defaults:
Laravel users can opt into the HTTP client integration (supports Http::fake() and pools) and
Collections from list endpoints:
Core Concepts
Resources
The SDK organizes API endpoints into resource classes:
Verbose Mode
Some endpoints support verbose mode to include additional related data that requires extra database queries:
Verbose mode includes:
- Patients: Full insurance objects (primary/secondary/tertiary), custom demographics, patient flags, referring doctor
- Appointments: Clinical notes, vitals, custom vitals, status transitions, reminders
- Clinical Notes: Complete section content with all fields
Performance considerations:
- Page size reduced from 250 to 50 records
- Response time 2-5x slower per request
- Additional database queries per record
- Use only when you need the extra fields
📖 See Verbose Mode Guide for comprehensive documentation and examples.
Pagination
All list endpoints return paginated results:
Models
Use type-safe models for better IDE support:
Error Handling
The SDK provides granular exception classes:
Usage Examples
Patient Management
Appointment Management
Clinical Documentation
Document Upload
Laboratory Orders
Tasks
Webhooks
Webhook Verification
See examples/05_webhook_handler.php for a complete webhook handler.
Configuration
Advanced Configuration
Token Management
Testing
Run the test suite:
Examples
Runnable examples are provided in the examples/ directory:
01_auth_basic.php- Basic authentication with access token02_auth_oauth_flow.php- Complete OAuth2 flow03_patients_crud.php- Patient management (CRUD operations)04_appointments_crud.php- Appointment scheduling05_webhook_handler.php- Webhook verification and handling06_clinical_workflow.php- Complete clinical workflow example07_verbose_mode.php- Using verbose mode for additional data
API Reference
Available Resources
| Resource | Description | Example |
|---|---|---|
patients |
Patient demographics and records | $client->patients->list() |
appointments |
Appointment scheduling | $client->appointments->listByDateRange() |
appointmentProfiles |
Appointment types & durations | $client->appointmentProfiles->listByDoctor() |
appointmentTemplates |
Recurring appointment blocks | $client->appointmentTemplates->createTemplate() |
customAppointmentFields |
Custom appointment metadata | $client->customAppointmentFields->listByDoctor() |
clinicalNotes |
Clinical documentation | $client->clinicalNotes->createNote() |
documents |
Document management | $client->documents->upload() |
offices |
Office locations | $client->offices->listAll() |
users |
Doctors and staff | $client->users->getCurrent() |
tasks |
Task management | $client->tasks->createTask() |
prescriptions |
Medications | $client->prescriptions->listByPatient() |
labOrders |
Lab orders | $client->labOrders->createOrder() |
labResults |
Lab results | $client->labResults->listByPatient() |
insurances |
Insurance info | $client->insurances->listByPatient() |
allergies |
Patient allergies | $client->allergies->createAllergy() |
medications |
Patient medications | $client->medications->listByPatient() |
problems |
Problem list | $client->problems->createProblem() |
vitals |
Vital signs | $client->vitals->createVitals() |
immunizations |
Vaccination records | $client->immunizations->listByPatient() |
patientPayments |
Patient payment records | $client->patientPayments->listByPatient() |
patientMessages |
Patient communications | $client->patientMessages->sendMessage() |
patientsSummary |
Bulk patient summaries | $client->patientsSummary->listByDoctor() |
customDemographics |
Custom patient fields | $client->customDemographics->createField() |
patientFlagTypes |
Custom patient flags | $client->patientFlagTypes->createFlagType() |
billing |
Billing/transactions | $client->billing->listLineItems() |
billingProfiles |
Billing configurations | $client->billingProfiles->getByDoctor() |
eligibilityChecks |
Insurance verification | $client->eligibilityChecks->verifyPrimaryInsurance() |
feeSchedules |
Pricing and fee schedules | $client->feeSchedules->getByCode() |
transactions |
Payment transactions | $client->transactions->recordPayment() |
lineItems |
Invoice line items | $client->lineItems->addProcedure() |
patientPaymentLog |
Payment history/audit | $client->patientPaymentLog->getPaymentHistory() |
consentForms |
Patient consent forms | $client->consentForms->markAsSigned() |
customInsurancePlanNames |
Custom insurance naming | $client->customInsurancePlanNames->setCustomName() |
clinicalNoteTemplates |
Note templates | $client->clinicalNoteTemplates->createTemplate() |
clinicalNoteFieldTypes |
Custom note fields | $client->clinicalNoteFieldTypes->createFieldType() |
clinicalNoteFieldValues |
Note field values | $client->clinicalNoteFieldValues->upsertValue() |
procedures |
Medical procedures | $client->procedures->createProcedure() |
amendments |
Record amendments | $client->amendments->approve() |
carePlans |
Patient care plans | $client->carePlans->createCarePlan() |
patientRiskAssessments |
Risk evaluations | $client->patientRiskAssessments->createAssessment() |
patientPhysicalExams |
Physical exam records | $client->patientPhysicalExams->createExam() |
patientInterventions |
Treatment interventions | $client->patientInterventions->createIntervention() |
patientCommunications |
Patient communications | $client->patientCommunications->createCommunication() |
implantableDevices |
Implanted devices | $client->implantableDevices->createDevice() |
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This SDK is open-sourced software licensed under the MIT license.
Support
- Documentation: DrChrono API Docs
- Issues: GitHub Issues
- Email: [email protected]
Changelog
See CHANGELOG.md for version history and updates.
Made with ❤️ for the healthcare community