openelis@1.0.0
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
http
These functions belong to the http namespace.
http.get
get(path, options) ⇒ Operation
Make a GET request to an OpenELIS instance
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| 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: Get all orders in progress
http.get('home-dashboard/ORDERS_IN_PROGRESS');
Example: Get all orders ready for validation
http.get('home-dashboard/ORDERS_READY_FOR_VALIDATION');
Example: Get all the reasons why a lab order could be referred
http.get('referral-reasons');
http.post
post(path, body, options) ⇒ Operation
Make a POST request to an OpenELIS instance
| Param | Type | Description |
|---|---|---|
| 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: Validate results for a lab order
http.post('AccessionValidation', {
"formName": "ResultValidationForm",
"formMethod": "POST",
"cancelAction": "Home",
"submitOnCancel": false,
"cancelMethod": "POST",
"searchFinished": true,
"paging": {
"totalPages": "1",
"currentPage": "1",
"searchTermToPage": [
{
"id": "25RSH00005L",
"value": "1"
}
]
},
"currentDate": "",
"resultList": [
{
"id": 4,
<more details>
}
],
"testSection": "",
"accessionNumber": "25RSH00005L",
"testDate": "",
"testName": "",
"testSections": [
{
"id": "56",
"value": "Biochemistry"
}
],
"testSectionsByName": [
{
"id": "56",
"value": "Biochemistry"
}
],
"displayTestSections": true
});
Example: Add results to an order
http.post('LogbookResults', {
"formName": "LogbookResultsForm",
"formMethod": "POST",
"cancelAction": "Home",
"submitOnCancel": false,
"cancelMethod": "POST",
"paging": {
"totalPages": "1",
"currentPage": "1",
"searchTermToPage": [
{
"id": "DEV01260000000000003",
"value": "1"
}
]
},
"accessionNumber": "DEV01260000000000003",
"singlePatient": false,
"currentDate": "09/02/2026",
"displayTestMethod": true,
"displayTestKit": false,
"testResult": [
{
"id": "0",
<more details>
}
],
"inventoryItems": [],
"hivKits": [],
"syphilisKits": [],
"type": "",
"displayMethods": true,
"testSectionId": "",
"displayTestSections": true,
"searchByRange": false,
"searchFinished": true
});
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: Edit an existing patient's information
http.request('POST', 'PatientManagement', {
"patientUpdateStatus": "UPDATE",
"nationalId": "1234567892",
"subjectNumber": "1234567892",
"lastName": "Lazic",
"firstName": "Aleksa",
"streetAddress": "",
"city": "",
"primaryPhone": "+255-45-89-63-21",
"gender": "F",
"birthDateForDisplay": "13/08/2000",
"commune": "",
"education": "",
"maritialStatus": "",
"nationality": "",
"healthDistrict": "",
"healthRegion": "",
"otherNationality": "",
"patientContact": {
"person": {
"firstName": "",
"lastName": "",
"primaryPhone": "",
"email": "",
"lastupdated": 1764586121386,
"id": "409"
},
"lastupdated": 1764536400000,
"id": "200",
"patientId": "202"
},
"patientPK": "202",
"guid": "c7e48932-2ed8-440a-9312-b68112e3873f",
"aka": "",
"mothersName": "",
"mothersInitial": "",
"addressDepartment": "",
"insuranceNumber": "",
"occupation": "",
"readOnly": false,
"stnumber": ""
});
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 |
RequestOptions
Options provided to the HTTP request
Properties
| Name | Type | Description |
|---|---|---|
| body | object | string | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). |
| query | object | An object of query parameters to be encoded into the URL. |
| headers | object | An object of headers to append to the request. |
| parseAs | string | Parse the response body as json, text or stream. By default will use the response headers. |