npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@healthcloudai/hc-cdx

v0.0.3

Published

Healthcheck CDX SDK with TypeScript

Readme

Healthcheck CDX Connector

This connector handles the CDX rapid test flow: fetch a test profile by GTIN, request a screening upload URL, and submit a rapid test scan. It reuses the authenticated login client together with the shared HTTP client.

Features

  1. Get a test profile by GTIN
  2. Request a screening canned upload URL
  3. Submit a rapid test scan

Installation

npm install @healthcloudai/hc-cdx \
@healthcloudai/hc-login-connector \
@healthcloudai/hc-http

Import

import { HCTakeTestClient } from "@healthcloudai/hc-cdx";
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
import { FetchClient } from "@healthcloudai/hc-http";

Setup

const httpClient = new FetchClient();
const loginClient = new HCLoginClient(httpClient);

loginClient.configure("demo-tenant", "dev");
await loginClient.login("[email protected]", "ExamplePassword123!");

const takeTestClient = new HCTakeTestClient(
  httpClient,
  loginClient
);

Reuse the same authenticated HCLoginClient instance when creating HCTakeTestClient so both connectors share the same base URL and auth state.

Public API

getTestProfileByGTIN(gtin)

Public signature: takeTestClient.getTestProfileByGTIN(gtin)

Gets the rapid test profile for a GTIN. This is an authenticated GET call.

const profileResponse = await takeTestClient.getTestProfileByGTIN(
  "00816862024500"
);

Full API request

This method performs an authenticated request internally and places the GTIN in the request path. It does not send a request body.

API response

Status:

200
{
  "Data": {
    "ID": "test-profile-id-example",
    "TestName": "WELLlife COVID-19/Influenza A&B Test",
    "CustomTestName": "WELLlife COVID-19/Influenza A&B Test",
    "ShortName": "WELLlife COVID/Flu",
    "VendorName": "Vendor Example",
    "ManufactureName": "Manufacturer Example",
    "CaptureMethod": 0,
    "GS1GTINs": [
      "00816862024500"
    ],
    "Instructions": [
      {
        "Title": "Example collection step",
        "ImageUrl": "https://assets.example.com/instructions/example-step.svg"
      }
    ],
    "Included": [
      "1 Test Cassette",
      "1 Disposable Swab"
    ],
    "Analytes": [
      {
        "Name": "SARS-CoV-2",
        "CasseteCode": "CoV"
      }
    ]
  },
  "ErrorMessage": null,
  "IsOK": true
}

getScreeningCannedUrl(extension)

Public signature: takeTestClient.getScreeningCannedUrl(extension)

Requests a canned upload URL for the screening image. The response includes the upload URL and the generated file key. The package does not upload the file bytes itself.

const screeningUpload = await takeTestClient.getScreeningCannedUrl("jpg");

Full API request

{
  "Data": {
    "Extension": "jpg"
  }
}

API response

Status:

200
{
  "ImageURL": "https://storage.example.com/screeningphoto_example.jpg?signature=example",
  "FileName": "screeningphoto_example.jpg",
  "Extension": "jpg"
}

scanTest(type, scan)

Public signature: takeTestClient.scanTest(type, scan)

Submits a rapid test scan to the selected test route. The request body is sent as { "Data": scan }.

const scanResponse = await takeTestClient.scanTest("rapid", {
  FileID: screeningUpload.FileName,
  GTINID: "00816862024500",
  TestProfileID: "test-profile-id-example",
  HealthServiceID: "health-service-id-example",
  EncounterID: "encounter-id-example",
  LotNumber: "LOT-12345",
  ExpirationDate: "2026-03-31T23:59:59.000Z",
  Outcome: {
    Result: "NEGATIVE",
    Comment: "Example comment"
  }
});

Full API request

{
  "Data": {
    "FileID": "screeningphoto_example.jpg",
    "GTINID": "00816862024500",
    "TestProfileID": "test-profile-id-example",
    "HealthServiceID": "health-service-id-example",
    "EncounterID": "encounter-id-example",
    "LotNumber": "LOT-12345",
    "ExpirationDate": "2026-03-31T23:59:59.000Z",
    "Outcome": {
      "Result": "NEGATIVE",
      "Comment": "Example comment"
    }
  }
}

API response

Status:

200
{
  "Data": {
    "Results": [
      {
        "Analyte": "SARS-CoV-2",
        "Result": "NEGATIVE"
      },
      {
        "Analyte": "influenza A",
        "Result": "NEGATIVE"
      },
      {
        "Analyte": "influenza B",
        "Result": "NEGATIVE"
      }
    ]
  },
  "ErrorMessage": null,
  "IsOK": true
}

Flow

Typical integration flow:

  1. Call getTestProfileByGTIN(gtin) to load the test profile for the scanned GTIN.
  2. Call getScreeningCannedUrl(extension) to get an upload URL and generated FileName.
  3. Upload the image file directly to the returned ImageURL outside this SDK.
  4. Use the returned FileName as FileID.
  5. Call scanTest(type, scan) with that FileID.

Example:

const profileResponse = await takeTestClient.getTestProfileByGTIN(
  "00816862024500"
);

const screeningUpload = await takeTestClient.getScreeningCannedUrl("jpg");

// Upload the file directly to screeningUpload.ImageURL outside of this SDK.

const scanResponse = await takeTestClient.scanTest("rapid", {
  FileID: screeningUpload.FileName,
  GTINID: "00816862024500",
  TestProfileID: profileResponse.Data?.ID
});

For frontend integrations, the recommended approach is to upload the file directly to the returned canned URL using the AWS SDK. The upload should include x-amz-acl: public-read, and the returned file name can then be used in the next API step.

Notes

  • HCTakeTestClient is the preferred client name.
  • The SDK does not upload the file.
  • The FileName returned by getScreeningCannedUrl(...) must be sent back as FileID in the scan request.