Overview

The SampleHC API is a RESTful API that allows you to interact with workflows. It is used to start, stop, and manage workflows, as well as to retrieve workflow data.

Client

Workflows created before the client was released may not have the client installed. Please refer to the latest template to see how the client is set up.

If any methods are different/missing from the SDK, you may need to update the SDK version in requirements.txt to the latest version.

A Python SDK is available for ease of calling the SampleHC API.

By default, a client manager is included in the new workflow template in src/client_manager.py that automatically configures the client with the correct backend URL and API key.

Here is a minimal example of how to use the client manager to initiate a client and call the API in a workflow.

from workflows_py.workflow import ScreenStep, Step, Workflow
from client_manager import SampleHealthcareClient

def trigger_reasoning(documents, task):
    client = SampleHealthcareClient()
    return client.v2.documents.legacy.reason(
        documents=documents, task=task
    ).async_result_id

workflow = Workflow().then(
  Step("trigger-reasoning", trigger_reasoning)
).then(
  ScreenStep("reasoning-screen", screen_path="./screens/legacy-document-reasoning-screen.tsx", get_props=lambda resultIds: [ctx.get_step_result("trigger-reasoning")])
)

Refer to the SampleHC API Reference for more details on the available endpoints, required parameters, and the expected responses from the SDK.