@oystehr/sdk
Version:
Oystehr SDK
137 lines (133 loc) • 5.48 kB
JavaScript
'use strict';
var client = require('../../client/client.cjs');
// AUTOGENERATED -- DO NOT EDIT
class Erx extends client.SDKResource {
constructor(config) {
super(config);
}
#baseUrlThunk() {
return this.config.services?.['erxApiUrl'] ?? 'https://erx-api.zapehr.com/v3';
}
/**
* Search for allergens.
* Action: `eRx:SearchAllergen`
* Access Policy Resource: `eRx:Allergen`
*/
searchAllergens(params, request) {
return this.request('/allergen', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Search for medications.
* Action: `eRx:SearchMedication`
* Access Policy Resource: `eRx:Medication`
*/
searchMedications(params, request) {
return this.request('/medication', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Get full medication details.
* Action: `eRx:GetMedication`
* Access Policy Resource: `eRx:Medication`
*/
getMedication(params, request) {
return this.request('/medication/details', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Get eRx configuration for project.
* Action: `eRx:GetConfiguration`
* Access Policy Resource: `eRx:Configuration`
*/
getConfiguration(request) {
return this.request('/config', 'get', this.#baseUrlThunk.bind(this))(request);
}
/**
* Check for drug-allergy interactions for a patient. This endpoint requires the patient's allergies to be synced with the upstream eRx provider.
* Action: `eRx:Check`
* Access Policy Resource: `eRx:Interaction`
*/
checkAllergyInteractions(params, request) {
return this.request('/patient/{patientId}/interactions/allergy', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Check for drug-drug interactions for a patient. This endpoint requires the patient's medications to be synced with the upstream eRx provider.
* Action: `eRx:Check`
* Access Policy Resource: `eRx:Interaction`
*/
checkMedicationInteractions(params, request) {
return this.request('/patient/{patientId}/interactions/medication', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Check 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.
* Action: `eRx:Check`
* Access Policy Resource: `eRx:Interaction`
*/
checkPrecheckInteractions(params, request) {
return this.request('/patient/{patientId}/interactions/precheck/{drugId}', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Adds pharmacy for a patient with the upstream eRx provider, setting it as primary if specified.
* Action: `eRx:AddPatientPharmacy`
* Access Policy Resource: `eRx:Patient`
*/
addPatientPharmacy(params, request) {
return this.request('/patient/{patientId}/pharmacies', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Cancel prescription for patient.
* Action: `eRx:CancelPrescription`
* Access Policy Resource: `eRx:Prescription`
*/
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.
* Action: `eRx:SyncPatient`
* Access Policy Resource: `eRx:Patient`
*/
syncPatient(params, request) {
return this.request('/patient/{patientId}/sync', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Search for pharmacies by a variety of criteria.
* Action: `eRx:SearchPharmacy`
* Access Policy Resource: `eRx:Pharmacy`
*/
searchPharmacies(params, request) {
return this.request('/pharmacy', 'get', 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.
* Action: `eRx:Connect`
* Access Policy Resource: `eRx:SSO`
*/
connectPractitioner(params, request) {
return this.request('/practitioner/connect', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Check eRx enrollment for a practitioner.
* Action: `eRx:Read`
* Access Policy Resource: `eRx:Enrollment`
*/
checkPractitionerEnrollment(params, request) {
return this.request('/practitioner/{practitionerId}', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Enroll a practitioner in the eRx service.
* Action: `eRx:Create`
* Access Policy Resource: `eRx:Enrollment`
*/
enrollPractitioner(params, request) {
return this.request('/practitioner/{practitionerId}', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Unenroll a practitioner from the eRx service.
* Action: `eRx:Delete`
* Access Policy Resource: `eRx:Enrollment`
*/
unenrollPractitioner(params, request) {
return this.request('/practitioner/{practitionerId}', 'delete', this.#baseUrlThunk.bind(this))(params, request);
}
}
exports.Erx = Erx;
//# sourceMappingURL=erx.cjs.map