Skip to main content
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 FHIR ResearchStudy and Molecular Observation Bundle Orchestrator

Format
Code-aware
Lines
69
Sections
11
Linked challenge
Build a FHIR ResearchStudy and Molecular Observation Bundle Orchestrator

Prompt source

Original prompt text with formatting preserved for inspection.

69 lines
11 sections
No variables
1 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.

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.