Class: APIWrapper

APIWrapper(_config)

new APIWrapper(_config)

SanteDB HDSI implementation that uses HTTP (note, other implementations may provide alternates)

Parameters:
Name Type Description
_config any The configuration of the service
Properties
Name Type Description
base string The base URL for the service
idByQuery boolean When true, indicates the wrapper wants to pass IDs by query
Source:

Methods

(static) checkinAsync(configuration) → {Promise}

Performs a CHECKIN on an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be locked
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The object that is to be locked on the server
data any The additional data that should be sent for the delete command
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) checkoutAsync(configuration) → {Promise}

Performs a CHECKOUT on an existing item on the instance which locks the resource from modifications by others

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be locked
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The object that is to be locked on the server
data any The additional data that should be sent for the delete command
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) copyAsync(configuration) → {Promise}

Performs a COPY operation against the specified object

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be fetched
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The id of the resource to copy to the server
Source:
Returns:
The promise for the operation
Type
Promise

(static) deleteAsync(configuration) → {Promise}

Performs a DELETE on an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be deleted
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The object that is to be deleted on the server
data any The additional data that should be sent for the delete command
mode string The mode in which the delete should occur. Can be NULLIFY, CANCEL or OBSOLETE (default)
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) getAsync(configuration) → {Promise}

Performs a GET on an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be fetched
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
query any The query to be applied to the get
Source:
Returns:
The promise for the operation
Type
Promise

(static) lockAsync(configuration) → {Promise}

Performs a LOCK on an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be locked
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The object that is to be locked on the server
data any The additional data that should be sent for the delete command
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) patchAsync(configuration) → {Promise}

Patches an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be posted
data any The data that is to be posted
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id string The identifier of the object on the interface to update
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) postAsync(configuration) → {Promise}

Creates a new item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be posted
data any The data that is to be posted
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) putAsync(configuration) → {Promise}

Updates an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be posted
data any The data that is to be posted
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id string The identifier of the object on the interface to update
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) searchAsync(configuration) → {Promise}

Performs an HTTP SEARCH operation with the payload being a long query string

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be searched
query any The query to be posted
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
Source:
Returns:
The promise for the operation
Type
Promise

(static) this.configure(config)

Reconfigures this instance of the API wrapper

Parameters:
Name Type Description
config any The configuration of the service
Properties
Name Type Description
base string The base URL for the service
idByQuery boolean When true, indicates the wrapper wants to pass IDs by query
Source:

(static) this.getUrl()

Gets the base url of the API

Source:

(static) touchAsync(configuration) → {Promise}

Performs a TOUCH on an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be locked
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The object that is to be locked on the server
data any The additional data that should be sent for the delete command
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise

(static) unLockAsync(configuration) → {Promise}

Performs a UNLOCK on an existing item on the instance

Parameters:
Name Type Description
configuration any The configuration object
Properties
Name Type Description
resource string The resource that is to be locked
state any A piece of state data which is passed back to the caller for state tracking
sync boolean When true, executes the request in synchronous mode
id any The object that is to be locked on the server
data any The additional data that should be sent for the delete command
contentType string Identifies the content type of the data
Source:
Returns:
The promise for the operation
Type
Promise