ihris@1.0.1
This adaptor exports the following namespaced functions:
- http.get(resource, options)
- http.post(resource, body, options)
- http.put(resource, 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(resource, options) ⇒ Operation
Get a FHIR resource by ID or list all resources of a type
| Param | Type | Description |
|---|---|---|
| resource | string | FHIR resource type |
| options | object | Options including headers and query parameters |
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: List all practitioners
http.get('/fhir/Practitioner');
Example: List a specific practitioner by ID
http.get('/fhir/Practitioner/P10004');
Example: Get active practitioners, limit to 1 result
http.get('/fhir/Practitioner', {
query: {
active: true,
_count: 1,
},
});
http.post
post(resource, body, options) ⇒ Operation
Create a new FHIR resource
| Param | Type | Description |
|---|---|---|
| resource | string | FHIR resource type |
| body | object | FHIR resource data |
| options | object | 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: Create a new Practitioner resource
http.post('/fhir/Practitioner', {
"resourceType": "Practitioner",
"meta": {
"versionId": "1",
"lastUpdated": "2024-08-06T06:13:10.163+00:00",
"source": "#m5UGgxqUFEI7qIRF",
"profile": [
"http://ihris.org/fhir/StructureDefinition/ihris-practitioner"
]
},
"extension": [
// ... extension data
],
"active": true,
"name": [
{
"use": "official",
"text": "Tekiokion Traifrop",
"family": "Traifrop",
"given": [
"Tekiokion"
]
}
],
"gender": "male",
"birthDate": "1979-01-01",
"qualification": [
{
"code": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0360|2.7",
"code": "BA"
}
],
"text": "Bachelor of Arts"
}
}
]
});
http.put
put(resource, body, options) ⇒ Operation
Update an existing FHIR resource
| Param | Type | Description |
|---|---|---|
| resource | string | Path to FHIR resource |
| body | object | Updated FHIR resource data |
| options | object | 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: Update a Practitioner resource
http.put('/fhir/Practitioner/6462', {
resourceType: 'Practitioner',
id: '6462',
meta: {
versionId: '1',
lastUpdated: '2025-11-03T07:06:59.309+00:00',
source: '#m5UGgxqUFEI7qIRF',
profile: ['http://ihris.org/fhir/StructureDefinition/ihris-practitioner'],
},
extension: [
{
url: 'http://ihris.org/fhir/StructureDefinition/ihris-practitioner-nationality',
valueCoding: {
system: 'urn:iso:std:iso:3166',
code: 'TF',
},
},
{
url: 'http://ihris.org/fhir/StructureDefinition/ihris-practitioner-residence',
valueReference: {
reference: 'Location/TF.W.GAS',
},
},
{
url: 'http://ihris.org/fhir/StructureDefinition/ihris-practitioner-marital-status',
valueCoding: {
system: 'http://terminology.hl7.org/CodeSystem/v3-MaritalStatus',
code: 'S',
},
},
],
active: true,
name: [
{
use: 'official',
text: 'Tekiokionses Traifrop',
family: 'Traifrop',
given: ['Tekiokionses'],
},
],
gender: 'male',
birthDate: '1979-01-01',
qualification: [
{
code: {
coding: [
{
system: 'http://terminology.hl7.org/CodeSystem/v2-0360|2.7',
code: 'BA',
},
],
text: 'Bachelor of Arts',
},
},
],
});
http.request
request(method, path, body, options) ⇒ Operation
Make a general HTTP request to iHRIS
| 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: Make a GET request with query parameters
http.request(
'GET',
'/fhir/Practitioner',
{},
{
query: { active: 'true', _count: '10' },
}
);
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 | body data to append 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. |