# Internal APIs intended for internal use by Tidepool. ## Migrate Legacy Clinician Patients - [POST /v1/clinics/{clinicId}/migrations](https://tidepool.redocly.app/reference/clinic.v1/clinics/migratelegacyclinicianpatients.md): Migrate the patients of a legacy clinic account. ## Retrieve Migration Status - [GET /v1/clinics/{clinicId}/migrations](https://tidepool.redocly.app/reference/clinic.v1/clinics/listmigrations.md): ListMigrations ## Enable Clinics - [POST /v1/clinicians/{userId}/migrate](https://tidepool.redocly.app/reference/clinic.v1/clinics/enablenewclinicexperience.md): Internal only endpoint to enable new clinic experience for a legacy clinician account. Patients won't be migrated until the clinic details are populated and migration is explicitly kicked-off by blip. ## Trigger initial migration - [POST /v1/clinics/{clinicId}/migrate](https://tidepool.redocly.app/reference/clinic.v1/clinics/triggerinitialmigration.md): Trigger the initial migration ## Get Migration - [GET /v1/clinics/{clinicId}/migrations/{userId}](https://tidepool.redocly.app/reference/clinic.v1/clinics/getmigration.md): Get a migration by user id ## Update Migration - [PATCH /v1/clinics/{clinicId}/migrations/{userId}](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatemigration.md): Internal endpoint to update the status of a migration ## Remove User from Clinics - [DELETE /v1/users/{userId}/clinics](https://tidepool.redocly.app/reference/clinic.v1/clinics/deleteuserfromclinics.md): Internal endpoint that deletes any user associations with clinics they are a patient or a member of. If the user is a patient of a clinic the service will delete the patient-clinic relationship. If the user is one of many admins of any clinic the service will delete the clinician-clinic relationship. If the user is the only admin of a clinic the service will: - delete the clinician record, leaving the clinic without an admin - delete all non-custodial patient relationships of the clinic - keep all custodian relationships, allowing users to claim custodial accounts with an email - keep all custodian accounts and data even if they can’t be claimed when there isn’t an email address associated with the account ## Update User Details - [POST /v1/users/{userId}/clinics](https://tidepool.redocly.app/reference/clinic.v1/clinics/updateclinicuserdetails.md): Internal endpoint to update clinician details. In the future it may be extended to support patient updates. ## List All Clinicians - [GET /v1/clinicians](https://tidepool.redocly.app/reference/clinic.v1/clinics/listallclinicians.md): Returns list of all clinician/clinic relationships in the system. Internal endpoint used for reporting purposes. ## UpdatePatientSummary - [POST /v1/patients/{patientId}/summary](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatepatientsummary.md): Internal endpoint which updates the summary in all patient records which match the user id. ## DeletePatientSummary - [DELETE /v1/summaries/{summaryId}/clinics](https://tidepool.redocly.app/reference/clinic.v1/clinics/deletepatientsummary.md): Internal endpoint which deletes the summary in all patient records which match the summary id. ## Create or update a data source for a patient - [PUT /v1/patients/{userId}/data_sources](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatepatientdatasources.md): Internal endpoint to upsert patient data source provider details in all their associated clinic records. ## Update Tier - [POST /v1/clinics/{clinicId}/tier](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatetier.md): Internal endpoint to update clinic service tier ## Assign Patient Tag To Clinic Patients - [POST /v1/clinics/{clinicId}/patients/assign_tag/{patientTagId}](https://tidepool.redocly.app/reference/clinic.v1/clinics/assignpatienttagtoclinicpatients.md): Assign a patient tag to a subset of clinic patients ## Delete Patient Tag From Clinic Patients - [POST /v1/clinics/{clinicId}/patients/delete_tag/{patientTagId}](https://tidepool.redocly.app/reference/clinic.v1/clinics/deletepatienttagfromclinicpatients.md): Delete a patient tag from all or a subset of clinic patients ## Update Membership Restrictions - [PUT /v1/clinics/{clinicId}/membership_restrictions](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatemembershiprestrictions.md): An internal endpoint to update clinic membership restrictions ## Redox EHR Endpoint - [POST /v1/redox](https://tidepool.redocly.app/reference/clinic.v1/clinics/processehrmessage.md): An endpoint for incoming Redox messages ## Redox Verify Endpoint - [POST /v1/redox/verify](https://tidepool.redocly.app/reference/clinic.v1/clinics/verifyendpoint.md): Internal endpoint for Redox challenge verification ## Get EHR Settings - [GET /v1/clinics/{clinicId}/settings/ehr](https://tidepool.redocly.app/reference/clinic.v1/clinics/getehrsettings.md): Returns EHR related settings ## Update EHR Settings - [PUT /v1/clinics/{clinicId}/settings/ehr](https://tidepool.redocly.app/reference/clinic.v1/clinics/updateehrsettings.md): Update EHR related settings for a clinic ## Match Clinic and Patient - [POST /v1/redox/match](https://tidepool.redocly.app/reference/clinic.v1/clinics/matchclinicandpatient.md): An internal endpoint used for matching an EHR request (e.g. NewOrder) to a clinic and patient. If a clinic with the provided details cannot be found, the service will return and will not attempt to match patients to the provided details. Due to lack of uniqueness constraints on the MRN and DOB fields it's possible that multiple patient records match the provided attributes. All results will be returned in the response and it's the calling services responsiblity to determine how to handle duplicates records. If a unique match is found, the patient matching criteria will be added to the patient record for future use (e.g. pushing data on a schedule). ## Get MRN Settings - [GET /v1/clinics/{clinicId}/settings/mrn](https://tidepool.redocly.app/reference/clinic.v1/clinics/getmrnsettings.md): Retrieve MRN settings ## Update MRN Settings - [PUT /v1/clinics/{clinicId}/settings/mrn](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatemrnsettings.md): Update MRN Settings ## Update Patient Count Settings - [PUT /v1/clinics/{clinicId}/settings/patient_count](https://tidepool.redocly.app/reference/clinic.v1/clinics/updatepatientcountsettings.md): Update Patient Count Settings ## Sync EHR Data - [POST /v1/clinics/{clinicId}/ehr/sync](https://tidepool.redocly.app/reference/clinic.v1/clinics/syncehrdata.md): An internal endpoint which will push the latest patient summary statistics and PDF reports for all patients who have an active subscription. The actual data is pushed asynchronously. A successful response means that an asynchronous task has been scheduled for each patient of the clinic with an active subscription. Will return 404 Not Found if the clinic does not have an active EHR connection. ## Preorder Form Webhook - [POST /v1/xealth/preorder](https://tidepool.redocly.app/reference/clinic.v1/clinics/xealthpreorder.md): The Preorder endpoint can be invoked when a care provider attempts to place an order manually within the EHR. Subscribers can use Preorder Forms to present additional information to, or receive input from, a care provider before an order can be placed. Preorder Forms can also be implemented so as to prevent an order from being placed entirely. https://sandbox.xealth.io/app/api-docs#tag/Digital-Care/paths/preorder/post ## Get Programs - [PUT /v1/xealth/programs](https://tidepool.redocly.app/reference/clinic.v1/clinics/xealthgetprograms.md) ## Get Program Url - [PUT /v1/xealth/program](https://tidepool.redocly.app/reference/clinic.v1/clinics/xealthgetprogramurl.md) ## Notification Webhook - [POST /v1/xealth/notification](https://tidepool.redocly.app/reference/clinic.v1/clinics/xealthnotification.md) ## View PDF Report - [GET /v1/xealth/report/web/viewer.html](https://tidepool.redocly.app/reference/clinic.v1/clinics/viewpdfreport.md): View PDF report for a given patient of a clinic ## Add Service Account - [POST /v1/clinics/{clinicId}/service_accounts](https://tidepool.redocly.app/reference/clinic.v1/clinics/addserviceaccount.md): Adds authentication client's service account as a new clinician member. ## Sync EHR Data for Patient - [POST /v1/patients/{patientId}/ehr/sync](https://tidepool.redocly.app/reference/clinic.v1/clinics/syncehrdataforpatient.md): An internal endpoint which will push the latest patient summary statistics and PDF reports to all EHR enabled clinics for which the patient has an active subscription. The actual data is pushed asynchronously. A successful response means that an asynchronous task has been scheduled. A 404 response will be returned if no active subscriptions can be found for given patient. ## Merge Clinic - [POST /v1/clinics/{clinicId}/merge](https://tidepool.redocly.app/reference/clinic.v1/clinics/mergeclinic.md): Merges tags, patients, clinicians, invites and share codes of the source clinic ## Connect Provider - [POST /v1/clinics/{clinicId}/patients/{patientId}/connect/{providerId}](https://tidepool.redocly.app/reference/clinic.v1/clinics/connectprovider.md): Send a new request to the patient to connect a data provider ## Migrate Legacy Clinician Patients - [POST /v1/clinics/{clinicId}/migrations](https://tidepool.redocly.app/reference/clinic.v1/internal/migratelegacyclinicianpatients.md): Migrate the patients of a legacy clinic account. ## Retrieve Migration Status - [GET /v1/clinics/{clinicId}/migrations](https://tidepool.redocly.app/reference/clinic.v1/internal/listmigrations.md): ListMigrations ## Enable Clinics - [POST /v1/clinicians/{userId}/migrate](https://tidepool.redocly.app/reference/clinic.v1/internal/enablenewclinicexperience.md): Internal only endpoint to enable new clinic experience for a legacy clinician account. Patients won't be migrated until the clinic details are populated and migration is explicitly kicked-off by blip. ## Trigger initial migration - [POST /v1/clinics/{clinicId}/migrate](https://tidepool.redocly.app/reference/clinic.v1/internal/triggerinitialmigration.md): Trigger the initial migration ## Get Migration - [GET /v1/clinics/{clinicId}/migrations/{userId}](https://tidepool.redocly.app/reference/clinic.v1/internal/getmigration.md): Get a migration by user id ## Update Migration - [PATCH /v1/clinics/{clinicId}/migrations/{userId}](https://tidepool.redocly.app/reference/clinic.v1/internal/updatemigration.md): Internal endpoint to update the status of a migration ## Remove User from Clinics - [DELETE /v1/users/{userId}/clinics](https://tidepool.redocly.app/reference/clinic.v1/internal/deleteuserfromclinics.md): Internal endpoint that deletes any user associations with clinics they are a patient or a member of. If the user is a patient of a clinic the service will delete the patient-clinic relationship. If the user is one of many admins of any clinic the service will delete the clinician-clinic relationship. If the user is the only admin of a clinic the service will: - delete the clinician record, leaving the clinic without an admin - delete all non-custodial patient relationships of the clinic - keep all custodian relationships, allowing users to claim custodial accounts with an email - keep all custodian accounts and data even if they can’t be claimed when there isn’t an email address associated with the account ## Update User Details - [POST /v1/users/{userId}/clinics](https://tidepool.redocly.app/reference/clinic.v1/internal/updateclinicuserdetails.md): Internal endpoint to update clinician details. In the future it may be extended to support patient updates. ## List All Clinicians - [GET /v1/clinicians](https://tidepool.redocly.app/reference/clinic.v1/internal/listallclinicians.md): Returns list of all clinician/clinic relationships in the system. Internal endpoint used for reporting purposes. ## UpdatePatientSummary - [POST /v1/patients/{patientId}/summary](https://tidepool.redocly.app/reference/clinic.v1/internal/updatepatientsummary.md): Internal endpoint which updates the summary in all patient records which match the user id. ## DeletePatientSummary - [DELETE /v1/summaries/{summaryId}/clinics](https://tidepool.redocly.app/reference/clinic.v1/internal/deletepatientsummary.md): Internal endpoint which deletes the summary in all patient records which match the summary id. ## Create or update a data source for a patient - [PUT /v1/patients/{userId}/data_sources](https://tidepool.redocly.app/reference/clinic.v1/internal/updatepatientdatasources.md): Internal endpoint to upsert patient data source provider details in all their associated clinic records. ## Update Tier - [POST /v1/clinics/{clinicId}/tier](https://tidepool.redocly.app/reference/clinic.v1/internal/updatetier.md): Internal endpoint to update clinic service tier ## Assign Patient Tag To Clinic Patients - [POST /v1/clinics/{clinicId}/patients/assign_tag/{patientTagId}](https://tidepool.redocly.app/reference/clinic.v1/internal/assignpatienttagtoclinicpatients.md): Assign a patient tag to a subset of clinic patients ## Delete Patient Tag From Clinic Patients - [POST /v1/clinics/{clinicId}/patients/delete_tag/{patientTagId}](https://tidepool.redocly.app/reference/clinic.v1/internal/deletepatienttagfromclinicpatients.md): Delete a patient tag from all or a subset of clinic patients ## Update Membership Restrictions - [PUT /v1/clinics/{clinicId}/membership_restrictions](https://tidepool.redocly.app/reference/clinic.v1/internal/updatemembershiprestrictions.md): An internal endpoint to update clinic membership restrictions ## Redox EHR Endpoint - [POST /v1/redox](https://tidepool.redocly.app/reference/clinic.v1/internal/processehrmessage.md): An endpoint for incoming Redox messages ## Redox Verify Endpoint - [POST /v1/redox/verify](https://tidepool.redocly.app/reference/clinic.v1/internal/verifyendpoint.md): Internal endpoint for Redox challenge verification ## Get EHR Settings - [GET /v1/clinics/{clinicId}/settings/ehr](https://tidepool.redocly.app/reference/clinic.v1/internal/getehrsettings.md): Returns EHR related settings ## Update EHR Settings - [PUT /v1/clinics/{clinicId}/settings/ehr](https://tidepool.redocly.app/reference/clinic.v1/internal/updateehrsettings.md): Update EHR related settings for a clinic ## Match Clinic and Patient - [POST /v1/redox/match](https://tidepool.redocly.app/reference/clinic.v1/internal/matchclinicandpatient.md): An internal endpoint used for matching an EHR request (e.g. NewOrder) to a clinic and patient. If a clinic with the provided details cannot be found, the service will return and will not attempt to match patients to the provided details. Due to lack of uniqueness constraints on the MRN and DOB fields it's possible that multiple patient records match the provided attributes. All results will be returned in the response and it's the calling services responsiblity to determine how to handle duplicates records. If a unique match is found, the patient matching criteria will be added to the patient record for future use (e.g. pushing data on a schedule). ## Get MRN Settings - [GET /v1/clinics/{clinicId}/settings/mrn](https://tidepool.redocly.app/reference/clinic.v1/internal/getmrnsettings.md): Retrieve MRN settings ## Update MRN Settings - [PUT /v1/clinics/{clinicId}/settings/mrn](https://tidepool.redocly.app/reference/clinic.v1/internal/updatemrnsettings.md): Update MRN Settings ## Update Patient Count Settings - [PUT /v1/clinics/{clinicId}/settings/patient_count](https://tidepool.redocly.app/reference/clinic.v1/internal/updatepatientcountsettings.md): Update Patient Count Settings ## Sync EHR Data - [POST /v1/clinics/{clinicId}/ehr/sync](https://tidepool.redocly.app/reference/clinic.v1/internal/syncehrdata.md): An internal endpoint which will push the latest patient summary statistics and PDF reports for all patients who have an active subscription. The actual data is pushed asynchronously. A successful response means that an asynchronous task has been scheduled for each patient of the clinic with an active subscription. Will return 404 Not Found if the clinic does not have an active EHR connection. ## Preorder Form Webhook - [POST /v1/xealth/preorder](https://tidepool.redocly.app/reference/clinic.v1/internal/xealthpreorder.md): The Preorder endpoint can be invoked when a care provider attempts to place an order manually within the EHR. Subscribers can use Preorder Forms to present additional information to, or receive input from, a care provider before an order can be placed. Preorder Forms can also be implemented so as to prevent an order from being placed entirely. https://sandbox.xealth.io/app/api-docs#tag/Digital-Care/paths/preorder/post ## Get Programs - [PUT /v1/xealth/programs](https://tidepool.redocly.app/reference/clinic.v1/internal/xealthgetprograms.md) ## Get Program Url - [PUT /v1/xealth/program](https://tidepool.redocly.app/reference/clinic.v1/internal/xealthgetprogramurl.md) ## Notification Webhook - [POST /v1/xealth/notification](https://tidepool.redocly.app/reference/clinic.v1/internal/xealthnotification.md) ## View PDF Report - [GET /v1/xealth/report/web/viewer.html](https://tidepool.redocly.app/reference/clinic.v1/internal/viewpdfreport.md): View PDF report for a given patient of a clinic ## Add Service Account - [POST /v1/clinics/{clinicId}/service_accounts](https://tidepool.redocly.app/reference/clinic.v1/internal/addserviceaccount.md): Adds authentication client's service account as a new clinician member. ## Sync EHR Data for Patient - [POST /v1/patients/{patientId}/ehr/sync](https://tidepool.redocly.app/reference/clinic.v1/internal/syncehrdataforpatient.md): An internal endpoint which will push the latest patient summary statistics and PDF reports to all EHR enabled clinics for which the patient has an active subscription. The actual data is pushed asynchronously. A successful response means that an asynchronous task has been scheduled. A 404 response will be returned if no active subscriptions can be found for given patient. ## Merge Clinic - [POST /v1/clinics/{clinicId}/merge](https://tidepool.redocly.app/reference/clinic.v1/internal/mergeclinic.md): Merges tags, patients, clinicians, invites and share codes of the source clinic ## Connect Provider - [POST /v1/clinics/{clinicId}/patients/{patientId}/connect/{providerId}](https://tidepool.redocly.app/reference/clinic.v1/internal/connectprovider.md): Send a new request to the patient to connect a data provider ## Redox EHR Endpoint - [POST /v1/redox](https://tidepool.redocly.app/reference/clinic.v1/redox/processehrmessage.md): An endpoint for incoming Redox messages ## Redox Verify Endpoint - [POST /v1/redox/verify](https://tidepool.redocly.app/reference/clinic.v1/redox/verifyendpoint.md): Internal endpoint for Redox challenge verification