Skip to main content

openelis@1.0.0

This adaptor exports the following namespaced functions:

http.get(path, options)
http.post(path, body, options)
http.request(method, path, body, options)

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

ParamTypeDescription
pathstringPath to resource
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan 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

ParamTypeDescription
pathstringPath to resource
bodyobjectObject which will be attached to the POST body
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan 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

ParamTypeDescription
methodstringHTTP method to use
pathstringPath to resource
bodyobjectObject which will be attached to the POST body
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan 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

NameDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

RequestOptions

Options provided to the HTTP request

Properties

NameTypeDescription
bodyobject | stringbody 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).
queryobjectAn object of query parameters to be encoded into the URL.
headersobjectAn object of headers to append to the request.
parseAsstringParse the response body as json, text or stream. By default will use the response headers.