ONC
Documentation per 45 CFR § 170.315(g)(7)
4D EMR Version 6.0 — 4th Dimension EMR, Inc.
The 4D EMR Public API provides programmatic access for third-party applications to search for and select patients within the system. A requesting application submits patient identifying information (such as name, date of birth, or account number) and receives a unique PatientId that can be used in subsequent API calls to retrieve that patient's clinical and demographic data.
This API fulfills the requirements of 45 CFR § 170.315(g)(7) — Application Access: Patient Selection.
All API requests must be made over HTTPS (TLS 1.2 or higher). Unencrypted HTTP requests will be rejected.
Base URL: https://{your-practice-domain}/api/public
All responses are returned in JSON format (application/json).
Every API request must include two authentication headers. These credentials are specific to each practice and can be obtained from the Practice > Integrations section within the 4D EMR application.
| Header | Required | Description |
|---|---|---|
client-id |
Yes | Practice-specific client identifier assigned during integration setup |
client-secret |
Yes | Practice-specific secret key assigned during integration setup |
If credentials are missing or invalid, the API returns a 401 Unauthorized response with one of the following messages:
"Missing credentials" — Required authentication headers were not provided"Invalid credentials" — One or both headers are empty"Invalid client-id or client-secret" — The credentials do not match any registered integration"Invalid client-id" — The client ID is not associated with an active external programGET /api/public/patientsSearches for patients matching the provided criteria and returns a paged list of results. Each result includes a PatientId that uniquely identifies the patient and can be used in subsequent API calls.
| Parameter | Type | Required | Description |
|---|---|---|---|
firstname |
string | No | Patient's first name |
lastname |
string | No | Patient's last name |
birthdate |
string | No | Date of birth in YYYY-MM-DD format (e.g., 1985-03-15) |
phone |
string | No | Patient's phone number |
email |
string | No | Patient's email address |
zipcode |
string | No | Patient's ZIP code |
accountNumber |
string | No | Legacy patient account number |
fromModifiedDate |
string | No | Minimum modified date filter (YYYY-MM-DDTHH:mm:ss) |
toModifiedDate |
string | No | Maximum modified date filter (YYYY-MM-DDTHH:mm:ss) |
page.skip |
integer | No | Number of records to skip for pagination |
page.count |
integer | No | Maximum records to return (default: 20, max: 1000) |
page.needTotalCount |
boolean | No | If true, includes total matching record count in response |
GET /api/public/patients?lastname=Smith&birthdate=1985-03-15&page.count=10 HTTP/1.1 Host: your-practice-domain.com client-id: your-client-id client-secret: your-client-secret Accept: application/json
200 OKReturns a PagedResponse object containing an array of PatientModel items:
{
"TotalCount": 1,
"Items": [
{
"PatientId": 12345,
"FirstName": "John",
"LastName": "Smith",
"MiddleInitial": "A",
"Gender": "M",
"DOB": "1985-03-15T00:00:00",
"Address1": "123 Main St",
"Address2": "",
"City": "Las Vegas",
"State": "NV",
"ZipCode": "89135",
"Country": "US",
"PhonePrimary": "7025551234",
"Email": "john.smith@email.com",
"NickName": "",
"OtherLastName": "",
"AccountNumber": "ACCT-001",
"Custom1": "",
"Custom2": "",
"Custom3": "",
"ReferralCategory": "",
"MarketingSource": "",
"ProfilePhotoId": 0,
"CoordinatorId": 0,
"Providers": [],
"Status": "Active",
"CreatedDate": "2020-01-15T09:30:00",
"ModifiedDate": "2025-06-01T14:22:00"
}
]
}
GET /api/public/patients/{patientId}Retrieves the full demographic record for a single patient using the PatientId returned from the search endpoint.
| Parameter | Type | Required | Description |
|---|---|---|---|
patientId |
integer | Yes | The unique patient identifier obtained from a search result |
GET /api/public/patients/12345 HTTP/1.1 Host: your-practice-domain.com client-id: your-client-id client-secret: your-client-secret Accept: application/json
200 OKReturns a single PatientModel object (same structure as items in the search response above).
The following fields are returned for each patient record:
| Field | Type | Description |
|---|---|---|
PatientId |
integer | Unique patient identifier (primary key) |
FirstName |
string | Patient's first name |
LastName |
string | Patient's last name |
MiddleInitial |
string | Patient's middle initial |
NickName |
string | Patient's preferred name |
OtherLastName |
string | Alternate / maiden last name |
Gender |
string | Patient gender (M or F) |
DOB |
datetime | Date of birth (ISO 8601 format) |
Address1 |
string | Street address line 1 |
Address2 |
string | Street address line 2 |
City |
string | City |
State |
string | Two-letter state abbreviation (e.g., NV) |
ZipCode |
string | 5-digit ZIP code |
Country |
string | Country code |
PhonePrimary |
string | Primary phone number |
Email |
string | Email address |
AccountNumber |
string | Legacy patient account number |
Custom1 |
string | Practice-defined custom field 1 |
Custom2 |
string | Practice-defined custom field 2 |
Custom3 |
string | Practice-defined custom field 3 |
ProfilePhotoId |
integer | ID of the patient's profile photo (0 if none) |
CoordinatorId |
integer | Assigned coordinator (provider or staff) ID |
Providers |
array | Array of associated provider references |
ReferralCategory |
string | Referral category name |
MarketingSource |
string | Marketing/referral source name |
Status |
string | Patient status (e.g., Active) |
CreatedDate |
datetime | Date/time the patient record was created (ISO 8601) |
ModifiedDate |
datetime | Date/time the patient record was last modified (ISO 8601) |
Once a PatientId has been obtained, the following endpoints are available to retrieve additional patient data:
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/public/patients/{patientId}/medicalHistory |
Returns the patient's medical history including conditions, surgeries, allergies, and medications |
GET |
/api/public/patients/added |
Returns patients added within a date range (beginDate, endDate required) |
GET |
/api/public/patients/modified |
Returns patients modified within a date range (beginDate, endDate required) |
GET |
/api/public/patients/lastseen |
Returns patients last seen within a date range (beginDate, endDate required) |
POST |
/api/public/patients/create |
Creates a new patient record and returns the assigned PatientId |
POST |
/api/public/patients/edit |
Updates an existing patient record (requires PatientId in request body) |
Returned by GET /api/public/patients/{patientId}/medicalHistory:
| Field | Type | Description |
|---|---|---|
PatientId |
integer | Unique patient identifier |
Conditions |
array | List of the patient's medical conditions |
Surgeries |
array | List of the patient's surgical history |
Allergies |
array | List of the patient's known allergies |
Medications |
array | List of the patient's current medications |
The API uses standard HTTP status codes to indicate success or failure:
| Status Code | Meaning | Description |
|---|---|---|
200 OK |
Success | The request completed successfully and data is returned in the response body |
400 Bad Request |
Validation Error | The request contains invalid parameters (e.g., malformed date format) |
401 Unauthorized |
Authentication Failure | Missing, empty, or invalid client-id / client-secret headers |
403 Forbidden |
Permission Denied | The authenticated client does not have permission to access the requested resource |
404 Not Found |
Resource Not Found | The specified patientId does not exist |
500 Internal Server Error |
Server Error | An unexpected error occurred on the server |
To integrate with the 4D EMR Patient Selection API, a third-party application must:
client-id and client-secret from the Practice > Integrations section of 4D EMR.client-id and client-secret headers.GET /api/public/patients with at least one search parameter to locate a patient.PatientId from the search response to make subsequent requests for that patient's data.page.skip and page.count parameters to iterate through results.application/json. Set the Accept header accordingly.Use of the 4D EMR Public API is subject to the following terms:
4th Dimension EMR, Inc.
10300 W Charleston Blvd, Suite 13-146, Las Vegas, NV 89135
Phone: (844) 878-2434
Email: support@4d-emr.com
Website: https://4d-emr.com
Get the latest news from 4D EMR

This Health IT Module is compliant with the ONC Certification Criteria for Health IT and has been certified by an ONC–ACB in accordance with the applicable certification criteria adopted by the Secretary of Health and Human Services. This certification does not represent an endorsement by the U.S. Department of Health and Human Services
© 2022-2026 4th Dimension EMR Inc