ihris@1.1.1
This adaptor exports the following namespaced functions:
- fhir.get(path, query)
- 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
fhir
These functions belong to the fhir namespace.
fhir.get
get(path, query) ⇒ Operation
Make a get request to any FHIR endpoint in iHRIS
| Param | Type | Description |
|---|---|---|
| path | string | Path to resource |
| query | FhirParameters | Request parameters |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the FHIR server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Get encounters based on lastUpdated field
fhir.get('Encounter', { count: 100, lastUpdated: 'ge2024-01-01T00:00:00Z' })
Example: Get all active practitioner roles for a location
fhir.get('PractitionerRole', {
count: 500,
active: true,
location: 1234,
include: 'PractitionerRole:practitioner',
})
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
FhirParameters
iHRIS FHIR requests parameters options. This combines FHIR search parameters, resource-specific parameters, and pagination options.
Properties
| Name | Type | Description |
|---|---|---|
| count | string | Number of results to return (_count in FHIR) |
| sort | string | Sorting criteria for the results (_sort in FHIR) |
| include | string | Resources to include in the response (_include in FHIR) |
| revinclude | string | Reverse includes to include in the response (_revinclude in FHIR) |
| summary | string | Summary mode for the response (_summary in FHIR) |
| total | string | Whether to include a total count of matching resources (_total in FHIR) |
| elements | string | List of elements to include in the response (_elements in FHIR) |
| contained | string | Whether to include contained resources (_contained in FHIR) |
| containedType | string | Type of contained resources (_containedType in FHIR) |
| id | string | Logical ID of the resource to filter on (_id in FHIR) |
| lastUpdated | string | Timestamp to filter resources last updated after this date (_lastUpdated in FHIR) |
| tag | string | Tag to filter resources by (_tag in FHIR) |
| profile | string | Profile URL to filter resources by (_profile in FHIR) |
| security | string | Security labels to filter resources by (_security in FHIR) |
| text | string | Text search on narrative content (_text in FHIR) |
| content | string | Full-text search on resource content (_content in FHIR) |
| list | string | Search resources included in a particular list (_list in FHIR) |
| has | string | Perform search based on reference chains (_has in FHIR) |
| getPagesOffset | string | Offset for pagination, used to skip a number of results (_getpagesoffset in iHRIS) |
| getPages | string | Get specific pages of resources (_getpages in iHRIS) |
| bundleType | string | Type of bundle to return (e.g., searchset, batch, history) (_bundleType in FHIR) |
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. |