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 RefSeq Transcript Isoform StructureDefinition Inspector

Format
Code-aware
Lines
81
Sections
11
Linked challenge
Build a RefSeq Transcript Isoform StructureDefinition Inspector

Prompt source

Original prompt text with formatting preserved for inspection.

81 lines
11 sections
No variables
1 code block
## Build
Validate research transcript annotation records against custom FHIR StructureDefinition rules. Verify required molecular elements, cardinality, and coding bindings for translational genomics catalogs.

## User
Health Informatics Conformance Lead

## Workflow
1. Ingest transcript metadata and gene annotations parsed from NCBI Datasets packages.
2. Evaluate incoming JSON payloads against FHIR R5 StructureDefinition conformance profiles.
3. Identify cardinality violations, missing required codings, or invalid extension URLs.
4. Emit an authoritative FHIR OperationOutcome report detailing compliance issues.

## Interface
Validation workbench highlighting schema compliance badges, path-level error trees, and JSON diffs.

## Data
Use synthetic transcript FHIR Observation files derived from NCBI Datasets gene reports.
Starter examples below are synthetic. They are not downloaded records.

## Source
[HL7 FHIR overview](https://hl7.org/fhir/overview.html)
Applies FHIR StructureDefinition conformance rules to restrict element cardinality and terminology bindings.

## Tools
evidently-ai, pydantic, jsonschema.
evidently-ai evaluates schema drift and validation error rates across successive batches of FHIR payloads.
Local Python script execution environment; language model not required for core JSON schema validation logic.

## 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
- Evaluate payload compliance against FHIR StructureDefinition element rules.
- Produce an OperationOutcome resource containing severity and diagnostics fields.
- Track error distributions across ingestion batches with Evidently AI test suites.

## Starter Examples
```json
[
  {
    "input": {
      "resourceType": "Observation",
      "status": "final",
      "code": {
        "coding": [
          {
            "system": "http://loinc.org",
            "code": "48018-6",
            "display": "Gene studied"
          }
        ]
      },
      "valueString": "BRCA1"
    },
    "expected_output": {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "information",
          "code": "informational",
          "diagnostics": "Payload conforms to StructureDefinition"
        }
      ],
      "valid": true
    }
  },
  {
    "input": {
      "resourceType": "Observation",
      "status": "final",
      "code": {},
      "valueString": "BRCA1"
    },
    "expected_output": {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "required",
          "diagnostics": "Missing required element 'coding' in code"
        }
      ],
      "valid": false
    }
  }
]
```

## Safety
Restricted to schema syntax and conformance checking. No human clinical decision support or protected health data.
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.