Back to prompt library
Build a FHIR ResearchStudy and Molecular Observation Bundle Orchestrator — implementation
Linked challenge: Build a FHIR ResearchStudy and Molecular Observation Bundle Orchestrator
Prompt source
implementation69 lines11 sectionsNo variables1 code block
## Build
Construct multi-resource FHIR R5 bundles linking ResearchStudy, Specimen, and DiagnosticReport entities. Validate cross-resource references and export bundles for translational biobanks.
## User
Interoperability Architect
## Workflow
1. Ingest trial metadata and synthetic sequence observation tables.
2. Construct corresponding FHIR ResearchStudy and Observation resources with valid references.
3. Evaluate link integrity between specimens and molecular diagnostic reports.
4. Serialize bundle into standard FHIR R5 JSON format with narrative sections.
## Interface
Web interface with visual resource dependency graph and JSON schema validator.
## Data
Construct synthetic research trial protocols and synthetic specimen IDs matching FHIR R5 schema guides.
Starter examples below are synthetic. They are not downloaded records.
## Source
[HL7 FHIR overview](https://hl7.org/fhir/overview.html)
Implements FHIR resource composition and reference linking between Foundation, Administration, and Diagnostics modules.
## Tools
langgraph, pydantic, fastapi.
LangGraph manages stateful multi-step cycles required to resolve and validate bi-directional FHIR references.
API-hosted Claude or OpenAI model to verify narrative text consistency and FHIR rule alignment.
## 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
- Builds valid FHIR R5 Bundle objects containing ResearchStudy and Specimen resources.
- Ensures all internal resource references resolve without broken pointers.
- Validates resource syntax against standard FHIR JSON schemas.
## Starter Examples
```json
[
{
"input": {
"study_id": "STUDY-42",
"title": "Synthetic Genomic Trial",
"specimen_ids": [
"SP-10"
]
},
"expected_output": {
"resourceType": "Bundle",
"type": "collection",
"total_resources": 2,
"reference_integrity": "VALID",
"study_id": "STUDY-42"
}
},
{
"input": {
"study_id": "STUDY-43",
"title": "Incomplete Trial",
"specimen_ids": [
"SP-999_NONEXISTENT"
]
},
"expected_output": {
"resourceType": "Bundle",
"type": "collection",
"total_resources": 1,
"reference_integrity": "BROKEN_REFERENCE",
"missing_references": [
"SP-999_NONEXISTENT"
]
}
}
]
```
## Safety
Translational research bundling engine using mock patient and study data. No diagnostic operations.
Use mock external writes. Require human review before any real deployment.