Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Multi-Center Research Specimen FHIR Bundle Synthesizer
Format
Code-aware
Lines
68
Sections
11
Linked challenge
Build a Multi-Center Research Specimen FHIR Bundle Synthesizer
Prompt source
Original prompt text with formatting preserved for inspection.
68 lines
11 sections
No variables
1 code block
## Build
Process biological specimen metadata from research cohorts and correlate with NCBI gene accession references. Assemble validated FHIR R5 Specimen and DiagnosticReport bundles.
## User
Biobank Informatics Specialist
## Workflow
1. Ingest specimen accession sheets and associated sequence run IDs from research archives.
2. Query mock NCBI Datasets endpoints to retrieve corresponding transcript and protein identifiers.
3. Construct valid FHIR Specimen resources containing collection method, container, and taxon codes.
4. Assemble FHIR Bundle payloads linking Specimen, Observation, and DiagnosticReport entities.
## Interface
Web dashboard showing specimen graph nodes, resource JSON previews, and FHIR validation badges.
## Data
Load synthetic biobank specimen records referencing NCBI human gene accessions NM_020107.5 and NP_001334352.2.
Starter examples below are synthetic. They are not downloaded records.
## Source
[NCBI Datasets gene download](https://www.ncbi.nlm.nih.gov/datasets/docs/v2/how-tos/genes/download-gene-data-package/)
Applies NCBI Datasets accession query parameters 'datasets download gene accession NM_020107.5 NP_001334352.2'.
## Tools
langgraph, pydantic-ai, biopython.
Manages multi-stage state transitions across specimen validation, accession lookup, and FHIR bundle linking.
Remote hosted API capable of structured tool calling and stateful context propagation.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Generates FHIR R5 Bundle resources with correct 'transaction' or 'collection' bundle types.
- Validates bidirectional references between Specimen and DiagnosticReport resources.
- Rejects records containing non-standard NCBI accession formatting with explicit diagnostic errors.
## Starter Examples
```json
[
{
"input": {
"specimen_id": "SPEC-9021",
"body_site": "Venous blood",
"taxon": "Homo sapiens",
"accession": "NM_020107.5"
},
"expected_output": {
"bundle_entry_count": 2,
"specimen_id": "SPEC-9021",
"accession_valid": true,
"fhir_bundle_type": "collection",
"validation_errors": []
}
},
{
"input": {
"specimen_id": "SPEC-BAD",
"body_site": "",
"taxon": "Unknown",
"accession": "INVALID_ACCESSION"
},
"expected_output": {
"bundle_entry_count": 0,
"specimen_id": "SPEC-BAD",
"accession_valid": false,
"fhir_bundle_type": "collection",
"validation_errors": [
"Invalid NCBI accession format",
"Missing mandatory body_site"
]
}
}
]
```
## Safety
Uses synthetic research specimen records; strictly excluded from actual clinical laboratory operation workflows.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.