@oystehr/sdk
Version:
Oystehr SDK
74 lines (71 loc) • 2.63 kB
text/typescript
// AUTOGENERATED -- DO NOT EDIT
import {
ErxV1AllergySearchParams,
ErxV1AllergySearchResponse,
ErxV1CancelOrderParams,
ErxV1CancelOrderResponse,
ErxV1CancelPrescriptionParams,
ErxV1CancelPrescriptionResponse,
ErxV1MedicationSearchParams,
ErxV1MedicationSearchResponse,
ErxV1SyncPatientParams,
ErxV1SyncPatientResponse,
OystehrClientRequest,
} from '../..';
import { SDKResource } from '../../client/client';
import { OystehrConfig } from '../../config';
export class ErxV1 extends SDKResource {
constructor(config: OystehrConfig) {
super(config);
}
#baseUrlThunk(): string {
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
}
/**
* Retrieve patient properties from FHIR service and sync them with eRx service
*/
syncPatient(params: ErxV1SyncPatientParams, request?: OystehrClientRequest): Promise<ErxV1SyncPatientResponse> {
return this.request('/erx/sync-patient/{patientId}', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Search for allergies
*/
allergySearch(params: ErxV1AllergySearchParams, request?: OystehrClientRequest): Promise<ErxV1AllergySearchResponse> {
return this.request('/erx/allergy/search', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Cancel photon order
*/
cancelOrder(params: ErxV1CancelOrderParams, request?: OystehrClientRequest): Promise<ErxV1CancelOrderResponse> {
return this.request('/erx/cancel-order', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Cancel photon prescription
*/
cancelPrescription(
params: ErxV1CancelPrescriptionParams,
request?: OystehrClientRequest
): Promise<ErxV1CancelPrescriptionResponse> {
return this.request('/erx/cancel-prescription', 'post', this.#baseUrlThunk.bind(this))(params, request);
}
/**
* Search for medications. Provide at least one of code or name filters
*/
medicationSearch(
params: ErxV1MedicationSearchParams,
request?: OystehrClientRequest
): Promise<ErxV1MedicationSearchResponse>;
/**
* Search for medications. Provide at least one of code or name filters
*/
medicationSearch(request?: OystehrClientRequest): Promise<ErxV1MedicationSearchResponse>;
/**
* Search for medications. Provide at least one of code or name filters
*/
medicationSearch(
params?: ErxV1MedicationSearchParams | OystehrClientRequest,
request?: OystehrClientRequest
): Promise<ErxV1MedicationSearchResponse> {
return this.request('/erx/medication/search', 'get', this.#baseUrlThunk.bind(this))(params, request);
}
}