fhir@3.1.0
Functions
- create(path, params, callback)
- createTransactionBundle(params, callback)
- get(path, query, callback)
- getClaim(claimId, query, callback)
create
create(path, params, callback) ⇒ Operation
Creates a resource in a destination system using a POST request
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
path | string | Path to resource |
params | object | data to create the new resource |
callback | function | (Optional) callback function |
Example
create("Bundle", {...state.data: type: "collection"})
createTransactionBundle
createTransactionBundle(params, callback) ⇒ Operation
Creates a transactionBundle for HAPI FHIR
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
params | object | data to create the new transaction |
callback | function | (Optional) callback function |
Example
createTransactionBundle({
resourceType: "Bundle",
type: "transaction",
entry: [
{
fullUrl: "https://hapi.fhir.org/baseR4/Patient/592442",
resource: {
resourceType: "Patient",
id: "592442",
name: [{ given: "Caleb", family: "Cushing" }],
},
request: {
method: "POST",
url: "Patient",
},
},
],
});
get
get(path, query, callback) ⇒ Operation
Get a resource in a FHIR system
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
path | string | Path to resource |
query | object | data to get the new resource |
callback | function | (Optional) callback function |
Example (Get Claim from FHIR with optional query)
get("Claim", { _include: "Claim:patient", _sort: "-_lastUpdated", _count: 200 })
Example (Get Patient from FHIR)
get('Patient');
getClaim
getClaim(claimId, query, callback) ⇒ Operation
Get Claim in a FHIR system
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
claimId | string | (optional) claim id |
query | object | (optinal) query parameters |
callback | function | (Optional) callback function |
Example
getClaim({ _include: "Claim:patient", _sort: "-_lastUpdated", _count: 200 });
request
request ⇒ This is an asynchronous function that sends a request to a specified URL with optional parameters and headers, and returns the response data in JSON format.
Kind: global constant
Returns: The request
function is returning the parsed JSON data from the response of the HTTP
request made to the specified url
with the given params
and method
. If there is an error in
the response, the function will throw an error.
Param | Type | Default | Description |
---|---|---|---|
url | string | The URL of the API endpoint that the request is being made to. | |
[params] | object | An object containing any additional parameters to be sent with the request, such as query parameters or request body data. It is an optional parameter and defaults to an empty object if not provided. | |
[method] | string | "GET" | The HTTP method to be used for the request. It defaults to 'GET' if not specified. |