Important: The JavaScript SDK is a working example of how to wrap and use the DexCare API. The SDK is not currently among the supported products of DexCare - but can be used as a toolkit to gain understanding of the DexCare API and accelerate development.

Low-level SDK Reference

You can find detailed information on using the low-level SDK methods here. For a basic overview of the complete SDK functionality, see our Getting Started section.

General syntax

The functions that access retail scheduling and other functions are accessible through the DexCareSDK class. An example - retrieving information about a particular retail department - is shown below.

// Define the SDK configuration
const sdkConfiguration: DexCareConfiguration = {
    apiEndpoint: "api.care.my-healthcare-system.com",
    ecvEndpoint: "ecvcare.my-healthcare-system.com",
    schedulingEndpoint: "scheduling.care.my-healthcare-system.com",
    practiceId: "12345",
    brand: "MyGreatBrand",
    domain: "MyDexCareDomain"
}

// Create an instance of the DexCare SDK
const sdk = DexCareSDKFactory.newInstance(SDKVersion.V1, sdkConfiguration);

try {
    const department: RetailDepartment =
                await sdk.getRetailDepartment('myDeptName', false);

    // process the department info.
} catch (error) {
    // perform error processing
}

Retail functions

The retail functions allow customers to work with retail-oriented functionality, such as:

  • Identifying physical care locations (departments)
  • Finding providers that are available to provide care, both in provider-specific and provider-agnostic scenarios
  • Determining the correct visit type required
  • Finding available time slots for care

Retrieving information about all departments

const departments: Department[] =
            await sdk.getAllDepartments(clinicType?: ClinicTypes, onlyActive?: boolean, includeApptSlots? : boolean,
                                brand?: BrandType, filter?: DepartmentFilterBase,
                                filterParams?: DepartmentFilterParameterBase) : Promise<Department[]>;

This method returns an array of DexCare Department objects that match the specified criteria.

Parameter name Data type Meaning Required? Default
clinicType A member of the ClinicTypes enum Determines which department types are to be returned. No ClinicTypes.retail
onlyActive boolean Indicates whether only active departments should be returned. No true
includeApptSlots boolean Indicates whether the returned departments should include appointment time slot info No false
brand BrandType The healthcare organization’s brand No Value from the SDK configuration
filter DepartmentFilterBase Represents a special class used to filter the returned department info No None
filterParams DepartmentFilterParameterBase A class used to pass parameters to a DepartmentFilterBase No None

Retrieve information about a particular retail department

 const department: RetailDepartment = await sdk.getRetailDepartment(urlName: string, includeApptSlots?: boolean) : Promise<RetailDepartment>;

Get information about a particular retail department. A RetailDepartment object describing the specified department is returned.

Parameter name Data type Meaning Required? Default
urlName string The URL name of the department (defined when the department is created in the DexCare system) Yes  
includeApptSlots boolean Indicates whether the returned departments should include appointment time slot info. Specifying ‘true’ returns appointment slots for all visit types applicable to the specified department. No false

Get retail appointment time slots for a department

    const slots: RetailAppointmentTimeSlot[] =
            await sdk.getRetailDepartmentTimeSlots(department: RetailDepartment, visitType: VisitType, startingDate?: string,
                                          daysForward?: number) : Promise<RetailAppointmentTimeSlot[]>;

Retrieves appointment time slots matching the specified criteria for a single department.

Parameter name Data type Meaning Required? Default
department RetailDepartment The department for which time slots are to be returned Yes  
visitType VisitType A VisitType instance for the visit types to be returned. Yes  
startingDate Javascript Date object The start of the desired date range for which slots are to be returned Yes  
daysForward Javascript number The number of days from the starting date for which slots are to be returned No 3 days

Get National Provider Identifiers (NPIs) for all providers

const pleList: ProviderListEntry[] = await sdk.getAllProviders() : Promise<ProviderListEntry[]>;

This method returns a list of all provider NPIs in the system, along with EMR identifiers for the systems the providers are defined in.

Get complete provider details for all providers

const providers: Provider[] = await sdk.getAllProviderDetails() : Promise<Provider[]>;

This method returns complete provider details for all provider NPIs in the system.

Get provider information by National Provider ID

const provider: Provider = await sdk.getProviderById(npi: ProviderNationalIdType) : Promise<Provider>;

Returns information about the provider with the specified NPI.

Parameter name Data type Meaning Required? Default
npi ProviderNationalIdType The provider’s National Provider ID Yes  

Get the EMR’s maximum lookahead days

const lookaheadDays: Number = await sdk.getMaxLookaheadDays(emrName?: string, visitTypeName?: VisitTypeNameType): Promise<Number>;

Returns the EMR’s configured value of how far into the future it will return slots.

Parameter name Data type Meaning Required? Default
emrName string The EMR’s name in the DexCare system Yes  
visitTypeName VisitTypeNameType The short name of the visit type Yes  

Get time slots for a retail provider

const slots: RetailAppointmentTimeSlot[] = await sdk.getRetailProviderTimeSlots(npi: ProviderNationalIdType, departmentId?: string, visitTypeId?: VisitTypeIdType, useCaseName?: string, startDate?: Date, endDate?: Date, onlyAvailableTimeSlots?: boolean)  :
        Promise<RetailAppointmentTimeSlot[]>;

Retrieves the available retail appointment time slots for the specified provider.

Parameter name Data type Meaning Required? Default
npi ProviderNationalIdType The provider’s National Provider ID Yes  
departmentId string The department ID for the department at which the appointment is to take place No All departments at which the provider can provide services
visitTypeId VisitTypeIdType The ID of the visit type No All visit types
useCaseName string A use case name to be used for tracing requests No Value from the SDK configuraiton
startDate Javascript Date object The start of the desired date range for which slots are to be returned No The current date
endDate Javascript Date object The end date of the desired date range for which slots are to be returned No The starting date value plus the default number of days forward (3 days)
onlyAvailableTimeSlots boolean Whether or not the results are to be restricted to only available time slots No false

Get time slots for one or more retail providers (batch mode)

const slots : RetailAppointmentTimeSlots[] = 
        await sdk.getRetailProviderTimeSlotsBatch(npi: ProviderNationalIdType[], visitTypeId?: VisitTypeIdType, useCaseName?: string,
                                             maxSlots?: number, startDate?: Date, endDate?: Date,
                                             onlyAvailableTimeSlots?: boolean)  :
        Promise<RetailAppointmentTimeSlot[]> ;

Retrieves the available retail appointment time slots for one or more specified provider across all departments at which the specified providers can provide services.

Parameter name Data type Meaning Required? Default
npi ProviderNationalIdType array An array of National Provider IDs Yes  
visitTypeId VisitTypeIdType The ID of the visit type No All visit types
useCaseName string A use case name to be used for tracing requests No Value from the SDK configuraiton
maxSlots number The maximum number of slots to be returned No 5
startDate Javascript Date object The start of the desired date range for which slots are to be returned No The current date
endDate Javascript Date object The end date of the desired date range for which slots are to be returned No The starting date value plus the default number of days forward (3 days)
onlyAvailableTimeSlots boolean Whether or not the results are to be restricted to only available time slots No false

Virtual visit functions

Get a list of DexCare virtual practice regions

const regions: PracticeRegion[] = await sdk.getPracticeRegions(practiceId?: PracticeIdType) : Promise<PracticeRegion[]>;

Retrieve a list of virtual practice regions for the specified practice ID.

Parameter name Data type Meaning Required? Default
practiceId PracticeIdType The virtual practice ID No The virtual practice ID value from the SDK configuration.

Get virtual practice region by ID

const region: PracticeRegion = 
    await sdk.getPracticeRegionById(practiceRegionId: PracticeRegionIdType, practiceId?: PracticeIdType) : Promise<PracticeRegion>;

Retrieve information about a specific virtual practice region.

Parameter name Data type Meaning Required? Default
practiceRegionId PracticeRegionIdType The virtual practice region ID Yes  
practiceId PracticeIdType The virtual practice ID No The virtual practice ID value from the SDK configuration.

Get practice regions by region code and market

const region: PracticeRegion = 
    await sdk.getPracticeRegionByRegionCodeAndMarket(regionCode: RegionCodeType, market?: MarketNameType, practiceId?: PracticeIdType) :
        Promise<PracticeRegion>;

Returns a virtual practice region definition corresponding to the specified region code, market and practice ID.

Parameter name Data type Meaning Required? Default
regionCode RegionCodeType The region code Yes  
market MarketNameType The market name No The market name from the SDK configuration.
practiceId PracticeIdType The virtual practice ID No The virtual practice ID value from the SDK configuration.

Get virtual region availability and wait time

const waitTimes: WaitTimeAvailability[] = 
    await sdk.getRegionAvailabilityAndWaitTime(params: AvailAndWaitTimeRequestParams) : Promise<WaitTimeAvailability[]>;

Returns an array of WaitTimeAvailability objects representing the virtual visit wait time for a particular region.

This request allows for a high level of variability in the type of information used to qualify the regions to be returned. For that reason, the parameters for this call are contained in a AvailAndWaitTimeRequestParams object with the properties described below.

Property name Data type Meaning Required? Default
regionCodes RegionCodeType array The region codes for which wait time is to be returned No All region codes for the specified practice ID.
assignmentQualifiers AssignmentQualifier array An array of one or more assignment qualifiers, used to further filter the information returned. Assignment qualifiers are defined when the practice region is created. No None
visitTypeNames VisitTypeNameType array An array of visit types for which wait times are to be returned. No All visit types
practiceId PracticeIdType The virtual practice ID No The virtual practice ID value from the SDK configuration.
homeMarket MarketNameType The market name No The market name from the SDK configuration.