@healthcloudai/hc-impilo-connector
v0.0.2
Published
Healthcheck Impilo connector for authenticated patient vitals import.
Maintainers
Readme
Healthcheck Impilo Connector
SDK connector for importing available Impilo vitals for the authenticated patient.
HCImpiloClient reuses the active patient session from HCLoginClient. Patient identity is resolved automatically from that authenticated session.
Installation
npm install @healthcloudai/hc-impilo-connector \
@healthcloudai/hc-login-connector \
@healthcloudai/hc-httpImport
import { HCImpiloClient } from "@healthcloudai/hc-impilo-connector";
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
import { FetchClient } from "@healthcloudai/hc-http";Setup
Configure and authenticate HCLoginClient, then pass the same instance into HCImpiloClient.
const httpClient = new FetchClient();
const loginClient = new HCLoginClient(httpClient);
loginClient.configure("healthcheck", "dev");
await loginClient.login("[email protected]", "ExamplePassword123!");
const impiloClient = new HCImpiloClient(httpClient, loginClient);API Key
If the environment requires an API key, configure it once:
impiloClient.setApiKey("x-api-key", process.env.HEALTHCLOUD_API_KEY ?? "");Methods
importVitals
Imports available readings from the authenticated patient's linked Impilo account. No arguments are required.
The connector asks the platform to:
- Check whether the authenticated patient has a valid Impilo registration.
- Retrieve all readings returned by Impilo across the supported reading streams.
- Normalize those readings into the shared vitals format.
- Send the normalized readings through the existing Healthcheck vitals import flow.
The imported reading categories include:
- blood pressure
- blood glucose
- oxygen saturation
- weight
- temperature
- heart rate
Blood pressure readings are normalized into separate systolic and diastolic records.
The shared vitals import flow applies the existing platform behavior, including Timescale deduplication, PHC analysis triggers, configured FHIR writes, and Athena import.
const response = await impiloClient.importVitals();
if (!response.IsOK) {
console.error(response.ErrorMessage);
return;
}
console.log(response.Data);Data: true means that the import request was handled successfully. It does not always mean that new vital records were added. The operation is also considered successful when:
- the patient does not have a linked Impilo account
- a previously stored Impilo mapping is no longer valid
- Impilo returns no readings to import
Example response:
{
"Data": true,
"IsOK": true,
"ErrorMessage": null
}Notes
- Configure and authenticate
HCLoginClientbefore callingimportVitals. - Reuse the same authenticated
HCLoginClientinstance when creatingHCImpiloClient. - The connector resolves patient context automatically.
- The connector does not create or link Impilo accounts. Registration must already exist.
- The connector does not accept a vitals payload. Readings are retrieved from Impilo by the platform.
- The method returns the service response without transforming or unwrapping it.
Error Handling
If the platform cannot complete the import, the SDK call throws a connector error. This includes failures while retrieving Impilo readings or forwarding them through the shared vitals import flow.
import { APIError } from "@healthcloudai/hc-http";
try {
await impiloClient.importVitals();
} catch (err) {
if (err instanceof APIError) {
console.error("Impilo import failed:", err.message);
}
}