Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cookbook/cds_discharge_summarizer_hf_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ def start_api():

# Create sandbox client and load test data
client = SandboxClient(
api_url="http://localhost:8000",
endpoint="/cds/cds-services/discharge-summarizer",
url="http://localhost:8000/cds/cds-services/discharge-summarizer",
workflow="encounter-discharge",
)
# Load discharge notes from CSV
client.load_free_text(
workflow="encounter-discharge",
csv_path="data/discharge_notes.csv",
column_name="text",
)
Expand Down
5 changes: 2 additions & 3 deletions cookbook/cds_discharge_summarizer_hf_trf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ def start_api():

# Create sandbox client and load test data
client = SandboxClient(
api_url="http://localhost:8000",
endpoint="/cds/cds-services/discharge-summarizer",
url="http://localhost:8000/cds/cds-services/discharge-summarizer",
workflow="encounter-discharge",
)
# Load discharge notes from CSV
client.load_free_text(
workflow="encounter-discharge",
csv_path="data/discharge_notes.csv",
column_name="text",
)
Expand Down
4 changes: 3 additions & 1 deletion cookbook/notereader_clinical_coding_fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def run_server():

# Create sandbox client for testing
client = SandboxClient(
api_url="http://localhost:8000", endpoint="/notereader/fhir/", protocol="soap"
url="http://localhost:8000/notereader/fhir/",
workflow="sign-note-inpatient",
protocol="soap",
)
# Load clinical document from file
client.load_from_path("./data/notereader_cda.xml")
Expand Down
3 changes: 1 addition & 2 deletions docs/cookbook/clinical_coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ from healthchain.sandbox import SandboxClient

# Create sandbox client for SOAP/CDA testing
client = SandboxClient(
api_url="http://localhost:8000",
endpoint="/notereader/ProcessDocument",
url="http://localhost:8000/notereader/ProcessDocument",
workflow="sign-note-inpatient",
protocol="soap"
)
Expand Down
6 changes: 2 additions & 4 deletions docs/cookbook/discharge_summarizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,14 @@ from healthchain.sandbox import SandboxClient

# Create sandbox client for testing
client = SandboxClient(
api_url="http://localhost:8000",
endpoint="/cds/cds-services/discharge-summarizer",
url="http://localhost:8000/cds/cds-services/discharge-summarizer",
workflow="encounter-discharge"
)

# Load discharge notes from CSV and generate FHIR data
client.load_free_text(
csv_path="data/discharge_notes.csv",
column_name="text",
workflow="encounter-discharge"
column_name="text"
)
```

Expand Down
12 changes: 8 additions & 4 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,19 @@ Test your AI applications in realistic healthcare contexts with `SandboxClient`
```python
from healthchain.sandbox import SandboxClient

# Create client and load test data
# Create client with service URL and workflow
client = SandboxClient(
api_url="http://localhost:8000",
endpoint="/cds/cds-services/my-service",
url="http://localhost:8000/cds/cds-services/my-service",
workflow="encounter-discharge"
)

# Load from datasets or files
client.load_from_registry("synthea", num_patients=5)
client.load_from_registry(
"synthea-patient",
data_dir="./data/synthea",
resource_types=["Condition", "DocumentReference"],
sample_size=3
)
responses = client.send_requests()
```

Expand Down
6 changes: 2 additions & 4 deletions docs/reference/utilities/data_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ According to the [UK ONS synthetic data classification](https://www.ons.gov.uk/m

## CDS Data Generator

The `.generate_prefetch()` method will return a `Prefetch` model with the `prefetch` field populated with a dictionary of FHIR resources. Each key in the dictionary corresponds to a FHIR resource type, and the value is a list of FHIR resources of that type. For more information, check out the [CDS Hooks documentation](https://cds-hooks.org/specification/current/#providing-fhir-resources-to-a-cds-service).
The `.generate_prefetch()` method will return a dictionary of resources. Each key in the dictionary corresponds to a FHIR resource type, and the value is a list of FHIR resources or a Bundle of that type. For more information, check out the [CDS Hooks documentation](https://cds-hooks.org/specification/current/#providing-fhir-resources-to-a-cds-service).

For each workflow, a pre-configured list of FHIR resources is randomly generated and placed in the `prefetch` field of a `CDSRequest`.

Expand All @@ -33,16 +33,14 @@ You can use the data generator with `SandboxClient.load_free_text()` or standalo

# Create client
client = SandboxClient(
api_url="http://localhost:8000",
endpoint="/cds/cds-services/my-service",
url="http://localhost:8000/cds/cds-services/my-service",
workflow="encounter-discharge"
)

# Generate FHIR data from clinical notes
client.load_free_text(
csv_path="./data/discharge_notes.csv",
column_name="text",
workflow="encounter-discharge",
random_seed=42
)

Expand Down
Loading