@oystehr/sdk
Version:
Oystehr SDK
87 lines (84 loc) • 3.56 kB
JavaScript
import { SDKResource } from '../../client/client.js';
// AUTOGENERATED -- DO NOT EDIT
class Erx extends SDKResource {
constructor(config) {
super(config);
}
#baseUrlThunk() {
return this.config.services?.['erxApiUrl'] ?? 'https://erx-api.zapehr.com/v3';
}
/**
* Search for allergens.
*/
searchAllergens(params, request) {
return this.request('/allergen', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Search for medications.
*/
searchMedications(params, request) {
return this.request('/medication', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Get eRx configuration for project.
*/
getConfiguration(request) {
return this.request('/config', 'get', this.#baseUrlThunk.bind(this))(request);
}
/**
* Checks for drug-allergy interactions for a patient. This endpoint requires the patient's allergies to be synced with the upstream eRx provider.
*/
checkAllergyInteractions(params, request) {
return this.request('/patient/{patientId}/interactions/allergy', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Checks for drug-drug interactions for a patient. This endpoint requires the patient's medications to be synced with the upstream eRx provider.
*/
checkMedicationInteractions(params, request) {
return this.request('/patient/{patientId}/interactions/medication', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Checks for drug-allergy and drug-drug interactions with a specific drug for a patient. This endpoint requires the patient's allergies and medications to be synced with the upstream eRx provider.
*/
checkPrecheckInteractions(params, request) {
return this.request('/patient/{patientId}/interactions/precheck/{drugId}', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Cancel prescription for patient.
*/
cancelPrescription(params, request) {
return this.request('/patient/{patientId}/prescriptions/{medicationRequestId}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Syncs demographic, allergy, and medication data for a patient with the upstream eRx provider.
*/
syncPatient(params, request) {
return this.request('/patient/{patientId}/sync', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Create an SSO link for a practitioner. This link can be used to log in to the eRx service as the specified practitioner.
*/
connectPractitioner(params, request) {
return this.request('/practitioner/connect', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Check eRx enrollment for a practitioner.
*/
checkPractitionerEnrollment(params, request) {
return this.request('/practitioner/{practitionerId}', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Enroll a practitioner in the eRx service.
*/
enrollPractitioner(params, request) {
return this.request('/practitioner/{practitionerId}', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Unenroll a practitioner from the eRx service.
*/
unenrollPractitioner(params, request) {
return this.request('/practitioner/{practitionerId}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
}
}
export { Erx };
//# sourceMappingURL=erx.js.map