lamisplus@0.1.3
This adaptor exports the following namespaced functions:
This adaptor exports the following from common:
- as()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- map()
- merge()
- scrubEmojis()
- sourceValue()
- util
Functions
getPatients
getPatients(query) ⇒ Operation
Get Patient resources from LAMISPlus
| Param | Type | Description |
|---|---|---|
| query | string | Query params, eg size, page |
Example
Get all patients
getPatients()
Example
Get a single patient
getPatients({ size: 1})
http
These functions belong to the http namespace.
http.post
post(path, data, [options]) ⇒ operation
Make a POST request to a LAMISPlus endpoint
| Param | Type | Default | Description |
|---|---|---|---|
| path | string | path to resource | |
| data | any | the body data in JSON format | |
| [options] | HTTPRequestOptions | {} | An object containing query params and headers for the request |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Create a patient
http.post(
'/plugin/ehr/api/v1/patient/',
{
name: 'John doe',
},
);
http.request
request(method, path, body, options) ⇒ Operation
Make a general HTTP request
| Param | Type | Description |
|---|---|---|
| method | string | HTTP method to use |
| path | string | Path to resource |
| body | object | Object which will be attached to the POST body |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example
request("POST", "patient", { "name": "Bukayo" });
Interfaces
HttpState
State object
Properties
| Name | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |