### GET /procedures Source: https://docs.nexhealth.com/reference/getprocedures Retrieves a list of procedures. This endpoint is part of the Procedures API. ```APIDOC ## GET /procedures ### Description Retrieves a list of procedures. This endpoint is part of the Procedures API. ### Method GET ### Endpoint /procedures ### Parameters #### Query Parameters - **context** (string) - Optional - Additional context about the request to help with debugging. ### Request Example ```json { "context": "some debugging info" } ``` ### Response #### Success Response (200) - **data** (object) - The data returned by the request. - **error** (array) - Any errors that occurred during the execution of the request. #### Response Example ```json { "data": {}, "error": [ "Error message 1", "Error message 2" ] } ``` ``` -------------------------------- ### GET /operatories Source: https://docs.nexhealth.com/reference/getoperatories Retrieves a list of operatories, which are chairs or rooms that can be booked. Supports filtering and pagination. ```APIDOC ## GET /operatories ### Description Retrieves a list of operatories. This endpoint allows you to view available chairs or rooms that can be booked. It supports various query parameters for filtering and pagination to refine your search results. ### Method GET ### Endpoint /operatories ### Parameters #### Query Parameters - **subdomain** (string) - Required - Used to scope the request to the specified institution - **location_id** (integer) - Required - Used to scope the request to the specified location - **page** (integer) - Optional - Page number. Starts with page 1. Defaults to 1. - **per_page** (integer) - Optional - Number of results to return per page. Defaults to 5 per page and Max 300 per page. - **search_name** (string) - Optional - Optional name search filter - **foreign_id** (string) - Optional - Query by EMR Id - **updated_since** (string) - Optional - Query operatories whose records have updated since the specified datetime in ISO8601 format. Must be a parseable Date, recommended formats are YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+0000 - **include[]** (array) - Optional - Resources to be included in the response. Allowed values: "appointment_types", "appt_categories". Defaults to ["appt_categories"]. ### Request Example ```json { "query": { "subdomain": "example-domain", "location_id": 123, "page": 1, "per_page": 10, "search_name": "Example Operatory", "foreign_id": "EMR-XYZ", "updated_since": "2023-10-27T10:00:00Z", "include[]": ["appointment_types", "appt_categories"] } } ``` ### Response #### Success Response (200) - **code** (boolean) - Indicates the success or failure of the request - **description** (string) - Additional context on the request to help with debugging. - **error** (array) - Any errors that occur during the execution of the request. - **data** (array) - An array of operatory objects. #### Response Example ```json { "code": true, "description": "Successful retrieval of operatory data.", "error": [], "data": [ { "id": 1, "name": "Operatory 1", "location_id": 123, "created_at": "2023-10-26T12:00:00Z", "updated_at": "2023-10-26T12:00:00Z" } ] } ``` ``` -------------------------------- ### GET /availabilities Source: https://docs.nexhealth.com/reference/getavailabilities Retrieves a list of availabilities for providers, with options to filter by location, provider, operatory, and other criteria. ```APIDOC ## GET /availabilities ### Description Retrieves a list of availabilities for providers. This endpoint allows for filtering by various criteria to scope the results effectively. ### Method GET ### Endpoint /availabilities ### Parameters #### Query Parameters - **subdomain** (string) - Required - Used to scope the request to the specified institution - **location_id** (integer) - Required - Used to scope the request to the specified location - **page** (integer) - Optional - Page number. Starts with page 1. Defaults to 1. - **per_page** (integer) - Optional - Number of results to return per page. Defaults is 5 per page and Max 300 per page. Defaults to 5. - **include[]** (array of strings) - Optional - Resources to be included in the response. Allowed values: `appointment_types`. - **provider_id** (integer) - Optional - Filter for specific provider. - **operatory_id** (integer) - Optional - Filter for specific operatory. - **active** (boolean) - Optional - Filter active/not active. Defaults to true. - **ignore_past_dates** (boolean) - Optional - Filter out availabilities configured for specific dates in the past. Defaults to false. ### Response #### Success Response (200) - **code** (boolean) - Indicates the success or failure of the request - **description** (string) - Additional context on the request to help with debugging. - **error** (array of strings) - Any errors that occur during the execution of the request. #### Response Example ```json { "code": true, "description": "Successfully retrieved availabilities.", "error": [] } ``` ``` -------------------------------- ### GET /websites/nexhealth_reference/operatories Source: https://docs.nexhealth.com/reference/getoperatories Retrieves a collection of operatory resources, including details about appointment types. ```APIDOC ## GET /websites/nexhealth_reference/operatories ### Description Retrieves a collection of operatory resources. Each operatory resource includes details about associated appointment types, such as their default duration and whether they are bookable online. ### Method GET ### Endpoint /websites/nexhealth_reference/operatories ### Parameters #### Query Parameters - **id** (integer) - Optional - The unique identifier for the operatory. - **name** (string) - Optional - The name of the operatory. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **operatories** (array) - A list of operatory objects. - **id** (integer) - Unique identifier for the operatory. - **name** (string) - Name of the operatory. - **appointment_types** (array) - A list of appointment type objects associated with the operatory. - **id** (integer) - Unique identifier for the appointment type. - **name** (string) - Name of the appointment type. - **duration** (integer) - Default duration of appointments for this type in minutes. - **bookable_online** (boolean) - True if this appointment type is bookable online. - **count** (integer) - The total number of operatory objects returned. #### Response Example ```json { "operatories": [ { "id": 1, "name": "Operatory 1", "appointment_types": [ { "id": 101, "name": "Check-up", "duration": 30, "bookable_online": true }, { "id": 102, "name": "Cleaning", "duration": 45, "bookable_online": false } ] } ], "count": 1 } ``` #### Error Responses - **400 Bad Request**: Returned when the request parameters are invalid. - **401 Unauthorized**: Returned when the API key is missing or invalid. - **403 Forbidden**: Returned when the user does not have permission to access the requested resource. ``` -------------------------------- ### Procedures API Response Example (JSON) Source: https://docs.nexhealth.com/reference/procedures Example JSON structure for a Procedures API response. This includes patient and provider IDs, appointment details, procedure code and name, status, body site information (like tooth and surface), fee details, and dates. The 'code' field indicates if the response contains actual procedure codes. ```json { "code": false, "description": "Description", "error": [ "Error" ], "data": [ { "id": 11, "patient_id": 162, "provider_id": 84, "appointment_id": 283, "code": "D6100", "name": "Implant Removal", "status": "inactive", "body_site": { "tooth": "14", "surface": "MOD" }, "fee": { "amount": "62.00", "currency": "USD" }, "start_date": "2022-06-24", "end_date": "2022-06-24" } ], "count": 2 } ``` -------------------------------- ### API Request Example with Error Parameters Source: https://docs.nexhealth.com/reference/response-body This example demonstrates a GET request to the '/operatories' endpoint with extraneous 'patient_id' and 'provider_id' parameters. Although these parameters are not accepted by the endpoint, the request is still successful, as indicated by the 'code' field in the response. ```curl curl --request GET 'https://nexhealth.info/operatories/2?subdomain=test&location_id=148&patient_id=15215&provider_id=531' \ --header 'Authorization: ********' \ --header 'Accept: application/vnd.Nexhealth+json;version=2' ``` -------------------------------- ### Example Appointment Data Structure Source: https://docs.nexhealth.com/reference/patients-1 This snippet illustrates the structure of an appointment record, including the associated patient and provider information. It shows how chart ID and preferred language are linked to a patient, and detailed provider information such as name, contact, and bio. ```json { "chart_id": "017407", "preferred_language": "es" }, "provider": { "id": 415, "email": "Amy.Ramos@nexhealth.com", "first_name": "John", "middle_name": "Anthony", "last_name": "Smith", "name": "John Smith", "created_at": "2020-06-05T20:16:57.007Z", "updated_at": "2020-06-05T20:16:57.007Z", "institution_id": 0, "foreign_id": "string", "foreign_id_type": "--DataSource-", "bio": { "city": "New York", "state": "NY", "gender": "Female", "zip_code": "20814", "new_patient": false, "non_patient": true, "phone_number": "5163042196", "date_of_birth": "1964-05-03", "address_line_1": "", "address_line_2": "", "street_address": "", "cell_phone_number": "", "home_phone_number": "", "work_phone_number": "" }, "inactive": false, "last_sync_time": "2025-03-17T21:21:25.644Z", "authz": { "permissions": {} }, "display_name": "John Smith", "npi": "1912507500", "tin": "078051120", "state_license": "R219935", "specialty_code": "363L00000X" } ``` -------------------------------- ### POST /websites/nexhealth_reference/availability Source: https://docs.nexhealth.com/reference/postavailabilities Manually create provider availabilities for appointment slot retrieval. Ensure operatories are included if `map_by_operatory` is enabled. ```APIDOC ## POST /websites/nexhealth_reference/availability ### Description This endpoint allows you to manually create provider availabilities. These resources will not get inserted into health record systems. They will just be used to power get appointment_slots. ### Method POST ### Endpoint /websites/nexhealth_reference/availability ### Parameters #### Query Parameters - **include_operatory** (boolean) - Optional - If true, operatories will be included in the availability creation. This is required if the location setting `map_by_operatory` is true. #### Request Body - **provider_id** (string) - Required - The ID of the provider. - **start_time** (string) - Required - The start time of the availability in ISO 8601 format. - **end_time** (string) - Required - The end time of the availability in ISO 8601 format. - **operatory_ids** (array of strings) - Optional - A list of operatory IDs to associate with this availability. Required if `include_operatory` is true or `map_by_operatory` is true. ### Request Example ```json { "provider_id": "provider_123", "start_time": "2023-10-27T09:00:00Z", "end_time": "2023-10-27T10:00:00Z", "operatory_ids": ["operatory_abc", "operatory_xyz"] } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier of the created availability. - **provider_id** (string) - The ID of the provider. - **start_time** (string) - The start time of the availability. - **end_time** (string) - The end time of the availability. - **operatory_ids** (array of strings) - The list of associated operatory IDs. #### Response Example ```json { "id": "availability_456", "provider_id": "provider_123", "start_time": "2023-10-27T09:00:00Z", "end_time": "2023-10-27T10:00:00Z", "operatory_ids": ["operatory_abc", "operatory_xyz"] } ``` ``` -------------------------------- ### Appointment Webhook Payload Example (JSON) Source: https://docs.nexhealth.com/reference/webhook-subscriptions This snippet shows an example JSON payload for an 'appointment_insertion.complete' event. It includes details about the institution, subscription, event, and the appointment data itself. ```json { "institution_id": 1, "subdomain": "test-subdomain", "webhook_subscription_id": 2, "resource_type": "Appointment", "event_name": "appointment_insertion.complete", "event_time": "2024-03-21T17:52:47.824Z", "data": { "appointment": { "id": 1822, "patient_id": 2897, "provider_id": 104, "provider_name": "Dr. John Smith", "start_time": "2020-06-05T20:16:57.007Z", "confirmed": true, "patient_missed": false, "created_at": "2020-06-05T20:16:57.007Z", "updated_at": "2020-06-05T20:16:57.007Z", "note": "Patient has been having a cough for 3 days", "end_time": "2020-06-05T20:16:57.007Z", "unavailable": false, "cancelled": false, "timezone": "America/New_York", "institution_id": 1, "appointment_type_id": 0, "checkin_at": null, "location_id": 1, "foreign_id": "94", "foreign_id_type": "msg-dentrix-DataSource-100", "misc": { "is_booked_on_nexhealth": true }, "last_sync_time": "2020-06-05T20:16:57.007Z", "patient_confirmed": 0, "created_by_user_id": 197, "is_guardian": false, "patient_confirmed_at": null, "cancelled_at": null, "is_new_clients_patient": false, "confirmed_at": null, "sooner_if_possible": null, "operatory_id": 181, "deleted": false, "checked_out": false, "checked_out_at": null, "referrer": "http://mypractice.com/book", "is_past_patient": true, "timezone_offset": "-4:00" } } } ``` -------------------------------- ### Reactivate Webhook Endpoint (Example) Source: https://docs.nexhealth.com/reference/webhook-endpoints This example shows how to reactivate a webhook endpoint that has been deactivated due to persistent errors. It involves making a PATCH request to the endpoint and setting the 'active' field to 'true'. ```json { "active": true } ``` -------------------------------- ### Example Payment Data Structure Source: https://docs.nexhealth.com/reference/patients-1 This snippet details a payment transaction, including the payment amount, currency, date, and associated patient and provider. It also includes patient details such as balance and billing type. ```json { "id": 113, "value": { "amount": "62.00", "currency": "USD" }, "patient_id": 3, "provider_id": 15, "procedure_id": 42, "date": "2020-06-05", "notes": "string", "patient": { "id": 415, "email": "Amy.Ramos@nexhealth.com", "first_name": "John", "middle_name": "Anthony", "last_name": "Smith", "name": "John Smith", "created_at": "2020-06-05T20:16:57.007Z", "updated_at": "2020-06-05T20:16:57.007Z", "institution_id": 0, "foreign_id": "string", "foreign_id_type": "--DataSource-", "bio": { "city": "New York", "state": "NY", "gender": "Female", "zip_code": "20814", "new_patient": false, "non_patient": true, "phone_number": "5163042196", "date_of_birth": "1964-05-03", "address_line_1": "", "address_line_2": "", "street_address": "", "cell_phone_number": "", "home_phone_number": "", "work_phone_number": "" }, "inactive": false, "last_sync_time": "2025-03-17T21:21:25.644Z", "authz": { "permissions": {} }, "guarantor_id": 0, "unsubscribe_sms": true, "balance": { "amount": "62.00", "currency": "USD" }, "billing_type": "Standard Billing - finance charges", "chart_id": "017407", "preferred_language": "es" }, "provider": { "id": 415, "email": "Amy.Ramos@nexhealth.com", "first_name": "John", "middle_name": "Anthony", "last_name": "Smith", "name": "John Smith", "created_at": "2020-06-05T20:16:57.007Z", "updated_at": "2020-06-05T20:16:57.007Z", "institution_id": 0, "foreign_id": "string", "foreign_id_type": "--DataSource-", "bio": { "city": "New York", "state": "NY", "gender": "Female", "zip_code": "20814", "new_patient": false, "non_patient": true, "phone_number": "5163042196", "date_of_birth": "1964-05-03", "address_line_1": "", "address_line_2": "", "street_address": "", "cell_phone_number": "", "home_phone_number": "", "work_phone_number": "" }, "inactive": false, "last_sync_time": "2025-03-17T21:21:25.644Z", "authz": { "permissions": {} } } } ``` -------------------------------- ### Appointment Created Webhook Payload Example (JSON) Source: https://docs.nexhealth.com/reference/webhook-subscriptions This snippet illustrates an example JSON payload for an 'appointment_created' event. It contains similar top-level information as other appointment events but structures the appointment data within an array. ```json { "institution_id": 1, "subdomain": "test-subdomain", "webhook_subscription_id": 2, "resource_type": "Appointment", "event_name": "appointment_created", "event_time": "2024-03-21T17:52:47.824Z", "data": { "appointments": [ { "id": 1822, "patient_id": 2897, "provider_id": 104, "provider_name": "Dr. John Smith", "start_time": "2020-06-05T20:16:57.007Z", "confirmed": true, "patient_missed": false, "created_at": "2020-06-05T20:16:57.007Z", "updated_at": "2020-06-05T20:16:57.007Z", "note": "Patient has been having a cough for 3 days", "end_time": "2020-06-05T20:16:57.007Z", "unavailable": false, "cancelled": false, "timezone": "America/New_York", "institution_id": 1, "appointment_type_id": 0, "checkin_at": null, "location_id": 1, "foreign_id": "94", "foreign_id_type": "msg-dentrix-DataSource-100", "misc": { "is_booked_on_nexhealth": true }, "last_sync_time": "2020-06-05T20:16:57.007Z", "patient_confirmed": 0, "created_by_user_id": 197, "is_guardian": false, "patient_confirmed_at": null, "cancelled_at": null, "is_new_clients_patient": false, "confirmed_at": null, "sooner_if_possible": null, "operatory_id": 181, "deleted": false, "checked_out": false, "checked_out_at": null, "referrer": "http://mypractice.com/book", "is_past_patient": true, "timezone_offset": "-4:00" } ] } } ``` -------------------------------- ### Register Webhook Endpoint (Example) Source: https://docs.nexhealth.com/reference/webhook-endpoints This example demonstrates how to register a new webhook endpoint by sending a POST request. It requires a secure HTTPS URL to receive webhook messages. The response includes an ID and a secret key for verification. ```json { "data": { "target_url": "https://your-secure-url.com/webhook" } } ``` -------------------------------- ### POST /availabilities Source: https://docs.nexhealth.com/reference/postavailabilities Creates a new availability for a provider. This endpoint allows for configuring recurring availabilities by days of the week, specific dates, or custom recurrence patterns. It requires subdomain and location_id for scoping. ```APIDOC ## POST /availabilities ### Description Creates a new availability for a provider. This endpoint allows for configuring recurring availabilities by days of the week, specific dates, or custom recurrence patterns. It requires subdomain and location_id for scoping. ### Method POST ### Endpoint /availabilities ### Parameters #### Query Parameters - **subdomain** (string) - Required - Used to scope the request to the specified institution - **location_id** (integer) - Required - Used to scope the request to the specified location #### Request Body - **availability** (object) - Required - Configure only one of days, specific_date or custom_recurrence - **provider_id** (integer) - Required - Id of the provider - **begin_time** (string) - Required - At what time availability starts. Recommended format is HH:MM - **end_time** (string) - Required - At what time availability ends. Recommended format is HH:MM - **operatory_id** (integer) - Optional - Id of the operatory - **appointment_type_ids** (array) - Optional - Associate appointment types with this availability - items (integer) - Description: Id of the appointment type - **days** (array) - Optional - Configure days of the week for this availability - items (string) - Enum: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] - **specific_date** (string) - Optional - Configure a specific date for this availability - **custom_recurrence** (object) - Optional - Configure custom reccurence - **num** (integer) - Required - Unit count - **ref** (string) - Required - Starting date - **unit** (string) - Required - Unit of recurrence ### Request Example ```json { "availability": { "provider_id": 1, "begin_time": "09:00", "end_time": "16:00", "appointment_type_ids": [1, 2], "days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] } } ``` ### Response #### Success Response (200) - **message** (string) - Description: Success message #### Response Example ```json { "message": "Availability created successfully" } ``` ``` -------------------------------- ### Example Procedure Data Structure Source: https://docs.nexhealth.com/reference/patients-1 This snippet shows the details of a medical procedure, including its association with a patient, provider, and appointment. It highlights the procedure code, name, status, and associated fee. ```json { "id": 11, "location_id": 21, "patient_id": 162, "provider_id": 84, "appointment_id": 283, "code": "D6100", "name": "Implant Removal", "status": "referred", "body_site": {}, "fee": { "amount": "62.00", "currency": "USD" }, "start_date": "2022-06-24", "end_date": "2022-06-24" } ``` -------------------------------- ### GET /websites/nexhealth_reference/adjustments/{id} Source: https://docs.nexhealth.com/reference/getadjustmentsid Retrieves a specific adjustment by its ID. ```APIDOC ## GET /websites/nexhealth_reference/adjustments/{id} ### Description Retrieves a specific adjustment by its unique identifier. ### Method GET ### Endpoint /websites/nexhealth_reference/adjustments/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the adjustment. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **adjustment** (object) - Details of the requested adjustment. - **id** (string) - The unique identifier of the adjustment. - **type** (string) - The type of adjustment. - **amount** (number) - The amount of the adjustment. - **date** (string) - The date the adjustment was made. - **notes** (string) - Additional notes about the adjustment. #### Response Example ```json { "adjustment": { "id": "adj_12345", "type": "discount", "amount": 50.00, "date": "2023-10-27T10:00:00Z", "notes": "Customer loyalty discount" } } ``` ``` -------------------------------- ### GET /websites/nexhealth_reference/patients Source: https://docs.nexhealth.com/reference/getpatients Retrieves a list of patients. This endpoint is part of the Patients API. ```APIDOC ## GET /websites/nexhealth_reference/patients ### Description Retrieves a list of patients. This endpoint is part of the Patients API. ### Method GET ### Endpoint /websites/nexhealth_reference/patients ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context about the request to help with debugging. - **data** (object) - The payload of the response, containing patient data. - **error** (array) - Any errors that occurred during the execution of the request. #### Response Example ```json { "code": true, "description": "Successfully retrieved patients.", "data": {}, "error": [] } ``` #### Error Responses - **400 Bad Request**: Returned when the request is malformed or invalid. - **401 Unauthorized**: Returned when the request lacks valid authentication credentials. - **403 Forbidden**: Returned when the authenticated user does not have permission to perform the request. - **404 Not Found**: Returned when the requested resource does not exist. - **500 Internal Server Error**: Returned when the server encounters an unexpected condition. ``` -------------------------------- ### POST /availabilities Source: https://docs.nexhealth.com/reference/postavailabilities This endpoint is used to retrieve availability information. It allows for filtering and specific queries related to availabilities. ```APIDOC ## POST /availabilities ### Description Retrieves availability information with options for filtering and specific queries. ### Method POST ### Endpoint /availabilities ### Parameters #### Query Parameters - **Authorization** (string) - Required - API key for authentication. ### Request Body This endpoint accepts a JSON object to specify the query parameters for availabilities. Example: ```json { "query": { "resourceType": "Availability", "filter": { "date": { "$gte": "2023-10-27T00:00:00.000Z", "$lte": "2023-10-27T23:59:59.999Z" }, "location": "634e1d2c46331a0012766f55" } } } ``` ### Response #### Success Response (200) Returns a list of available slots based on the query parameters. - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context about the request to help with debugging. - **data** (object) - The payload containing the availability information. - **error** (array) - Any errors that occured during the execution of the request. #### Response Example ```json { "code": true, "description": "", "data": [ { "_id": "653b46c31900880011f8c56d", "providerId": "634e1d2c46331a0012766f55", "start": "2023-10-27T09:00:00.000Z", "end": "2023-10-27T09:30:00.000Z", "availableSeats": 5, "createdAt": "2023-10-27T13:06:43.337Z", "updatedAt": "2023-10-27T13:06:43.337Z", "__v": 0 } ], "error": [] } ``` #### Error Response (404) - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context about the request to help with debugging. - **data** (object) - An empty object when an error occurs. - **error** (array) - Any errors that occured during the execution of the request. #### Error Response Example (404) ```json { "code": false, "description": "Not Found", "data": {}, "error": [ "Some error occurred" ] } ``` #### Error Response (500) - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context about the request to help with debugging. - **data** (object) - An empty object when an error occurs. - **error** (array) - Any errors that occured during the execution of the request. #### Error Response Example (500) ```json { "code": false, "description": "Internal Server Error", "data": {}, "error": [ "An unexpected error occurred" ] } ``` ``` -------------------------------- ### GET /websites/nexhealth_reference/patients/{id}/insurance-coverages Source: https://docs.nexhealth.com/reference/getpatientsidinsurancecoverages Retrieves the insurance coverages for a specific patient. ```APIDOC ## GET /websites/nexhealth_reference/patients/{id}/insurance-coverages ### Description Retrieves the insurance coverages for a specific patient identified by their ID. ### Method GET ### Endpoint /websites/nexhealth_reference/patients/{id}/insurance-coverages ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the patient. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context about the request to help with debugging. - **data** (object) - The insurance coverage details for the patient. - **error** (array) - Any errors that occured during the execution of the request. #### Response Example ```json { "code": true, "description": "", "data": {}, "error": [] } ``` #### Error Responses - **403 Forbidden**: Returned if the request is forbidden. - **404 Not Found**: Returned if the patient or their insurance coverages are not found. - **500 Internal Server Error**: Returned if there is a server-side error. ``` -------------------------------- ### Get Patient Basic Information Source: https://docs.nexhealth.com/reference/getadjustments Retrieve the basic information for a specific patient. ```APIDOC ## GET /patients/{id} ### Description Retrieves the basic information for a specific patient using their unique identifier. ### Method GET ### Endpoint /patients/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the patient. ### Response #### Success Response (200) - **id** (integer) - User id - **email** (string) - User email - **first_name** (string) - First name - **middle_name** (string) - Middle name - **last_name** (string) - Last name - **name** (string) - Full name - **created_at** (string) - User creation date in UTC - **updated_at** (string) - User last updation date in UTC - **institution_id** (integer) - The institution this user belongs to - **foreign_id** (string) - Foreign Id is a unique identifier from the integrated system - **foreign_id_type** (string) - Foreign Id type is a unique string identifier for the integrated system - **bio** (object) - Patient biographical data. Contains fields like city, state, gender, zip_code, new_patient, non_patient, phone_number, date_of_birth, address_line_1, address_line_2, street_address, cell_phone_number, home_phone_number, work_phone_number. - **inactive** (boolean) - Is the user inactivated? - **last_sync_time** (string) - Timestamp of the last synchronization. #### Response Example ```json { "id": 415, "email": "Amy.Ramos@nexhealth.com", "first_name": "John", "middle_name": "Anthony", "last_name": "Smith", "name": "John Smith", "created_at": "2020-06-05T20:16:57.007Z", "updated_at": "2020-06-05T20:16:57.007Z", "institution_id": 1, "foreign_id": "some_foreign_id", "foreign_id_type": "--DataSource-", "bio": { "city": "New York", "state": "NY", "gender": "Female", "zip_code": "20814", "new_patient": false, "non_patient": true, "phone_number": "5163042196", "date_of_birth": "1964-05-03", "address_line_1": "", "address_line_2": "", "street_address": "", "cell_phone_number": "", "home_phone_number": "", "work_phone_number": "" }, "inactive": false, "last_sync_time": "2020-06-05T20:16:57.007Z" } ``` ``` -------------------------------- ### Error Handling (404 and 500) Source: https://docs.nexhealth.com/reference/patchpatientsidalertsalertid This section describes the standard error response structures for 'Not Found' (404) and 'Internal Server Error' (500) scenarios. Both responses include a boolean 'code' indicating success/failure, a 'description' for context, a 'data' object, and an 'error' array for specific error messages. ```APIDOC ## Error Responses ### Not Found (404) #### Description This response is returned when a requested resource is not found. #### Response Example (404) ```json { "code": false, "description": "Resource not found.", "data": {}, "error": [ "The requested item could not be located." ] } ``` ### Internal Server Error (500) #### Description This response is returned when an unexpected error occurs on the server. #### Response Example (500) ```json { "code": false, "description": "An internal server error occurred.", "data": {}, "error": [ "Please try again later or contact support." ] } ``` #### Response Body Schema (Common for 404 and 500) - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context about the request to help with debugging. - **data** (object) - An object that may contain data related to the request, often empty in error responses. - **error** (array[string]) - Any errors that occurred during the execution of the request. ``` -------------------------------- ### NexHealth SyncStatus Write Change Webhook Event Example Source: https://docs.nexhealth.com/reference/webhook-subscriptions This JSON payload indicates a change in the write status of a synchronization process, for example, a 'red' status. It provides context on the sync source, EMR, and timestamps for status changes, enabling monitoring of data export to external systems. ```json { "institution_id": 1, "subdomain": "test-subdomain", "webhook_subscription_id": 2, "resource_type": "SyncStatus", "event_name": "sync_status_write_change.red", "event_time": "2024-03-21T17:52:47.824Z", "data": { "syncstatus": { "institution_id": 1, "sync_source_type": "DataSource", "sync_source_name": "My Source", "emr": { "id": 11, "name": "dentrix", "display_name": "Dentrix", "type": [ "cloud", "onprem" ] }, "read_status": "green", "read_status_at": "2020-06-05T20:16:57.007Z", "write_status": "red", "write_status_at": "2020-06-05T20:16:57.007Z", "locations": null } } } ``` -------------------------------- ### POST /webhook_endpoints/{id}/webhook_subscriptions Source: https://docs.nexhealth.com/reference/postwebhookendpointsidwebhooksubscriptions Creates a webhook subscription to receive event-based notifications for a specific resource type and event. Requires endpoint ID and subdomain. ```APIDOC ## POST /webhook_endpoints/{id}/webhook_subscriptions ### Description Creates a webhook subscription to receive event-based notifications for a specific resource type and event. This endpoint allows developers to subscribe to various events occurring within NexHealth, such as appointment creations or patient updates. ### Method POST ### Endpoint `/webhook_endpoints/{id}/webhook_subscriptions` ### Parameters #### Path Parameters - **id** (integer) - Required - Webhook Endpoint id #### Query Parameters - **subdomain** (string) - Required - Used to scope the request to the specified institution #### Request Body - **resource_type** (string) - Required - The resource to subscribe to (e.g., "Appointment", "Patient") - **event** (string) - Required - A valid event type to listen to for the defined resource (e.g., "appointment_insertion", "patient_created") - **active** (boolean) - Optional - Defaults to true. Indicates if the subscription is active. ### Request Example ```json { "resource_type": "Appointment", "event": "appointment_insertion", "active": true } ``` ### Response #### Success Response (201) - **code** (boolean) - Indicates the success or failure of the request. - **description** (string) - Additional context on the request to help with debugging. - **error** (array of strings) - Any errors that occur during the execution of the request. #### Response Example ```json { "code": false, "description": "Description", "error": [ "Error" ] } ``` ``` -------------------------------- ### HTTP Request Methods Source: https://docs.nexhealth.com/reference/response-codes The NexHealth Synchronizer API supports standard HTTP request methods for interacting with resources. ```APIDOC ## HTTP Request Methods The NexHealth Synchronizer API supports the following HTTP request methods: ### GET **Description:** Used for retrieving a collection or single resource. * *e.g.* Retrieve patient information, get appointment details, etc. ### POST **Description:** Used to create a new record. * *e.g.* New patient, new appointment, etc. ### PATCH **Description:** Used to update an existing record. * *e.g.* Updating patient details, updating appointment, etc. ### DELETE **Description:** Used to delete a specified record. * *e.g.* Delete an appointment category, delete a subscription, etc. **Note:** The API's HTTP request support is a subset of [RFC 2616](https://tools.ietf.org/html/rfc2616). ``` -------------------------------- ### GET /providers/{id} Source: https://docs.nexhealth.com/reference/getprovidersid Retrieves detailed information about a specific provider using their unique ID. ```APIDOC ## GET /providers/{id} ### Description Retrieves detailed information about a specific provider using their unique ID. ### Method GET ### Endpoint /providers/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the provider. ### Response #### Success Response (200) - **data** (object) - Contains the provider's information. - **error** (array) - An array of strings, any errors that occurred during the execution of the request. #### Response Example ```json { "data": {}, "error": [] } ``` ```