Test Data for J4

This test data can be used to try out integration with J4 in Leyr Sandbox.
It is applicable when using Leyr credentials, as described in the EHR configuration guide.

If you'd like to use your own credentials or are going live, please refer to our J4 EHR setup guide.

Environment Overview

When using Leyr credentials, you'll interact with a smart mock environment that fully replicates real J4 data models. All response structures and data formats match your production experience exactly, making this ideal for integration development and testing.

Common Workflows

With J4's smart mock environment, you can test comprehensive patient management and appointment booking workflows with production-accurate responses! Feel free to explore all supported workflows and create your own test scenarios. Check our supported services matrix to see what's available for J4.

Care Units Discovery

This is the typical entry point to the Leyr API. The care unit ID returned here is required for all subsequent API calls.

Call GET /care-units to discover available care units in the J4 system. Use any id from the response in the path parameter for other endpoints.

Patient Management

Create and retrieve patient information using realistic J4 data models.

Create Patient: Use POST /patients to create new patients. All standard patient fields are supported with realistic response data that matches production J4 formats.

Get Patient: Use GET /patients/{patient_id} with any patient ID from patients created via the API.

Availability

Discover available resources, services, and time slots for appointment booking.

Get Services: Call GET /healthcare-services to retrieve all available healthcare services using J4 data models.

Get Resources: Call GET /resources to get available practitioners and resources.

Get Time Slots: Use GET /timeslots with resource_id and/or healthcare_service_id from previous calls to find available appointment times.

Testing Tip: Try your first /timeslots call without filtering parameters to see all available slots, then use resource_id or healthcare_service_id to narrow down results.

Appointment Booking

Complete appointment lifecycle management with production-accurate response structures.

Book Appointment: Use POST /appointments with a patient ID (from Patient Management) and time slot details (from Availability) to create appointments.

Get Appointments: Call GET /appointments to retrieve existing appointments. You can filter by patient, date range, or leave parameters empty to see all appointments.

Update Appointment: Use PATCH /appointments/{appointment_id} to modify existing appointments.

Cancel Appointment: Use PATCH /appointments/{appointment_id} to cancel appointments.

Medical Notes

Create clinical notes associated with patients, with additional functionality in development.

Create Medical Note: This functionality is in progress for J4.
Get Medical Notes: This functionality is not supported for J4.

Documents

Create and upload documents for patient records, with additional functionality in development.

Create Document: This functionality is in progress for J4.
Get Documents: This functionality is not supported for J4.

Happy coding! 🙂

In case of any questions or if you feel stuck - please feel free to reach out at contact@leyr.io.