CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-fhirpy

Async/sync FHIR client for Python providing comprehensive API for CRUD operations over FHIR resources

Agent Success

Agent success rate when using this tile

68%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.08x

Baseline

Agent success rate without this tile

63%

Overview
Eval results
Files

task.mdevals/scenario-5/

FHIR Resource Builder

A small utility that assembles core clinical resources and produces their serialized form for submission.

Capabilities

Patient record assembly

  • Creates a patient record containing resource type, given and family names, birth date, city, country, and phone contact; serialization drops any fields provided as empty strings. @test

Observation record referencing a patient

  • Builds an observation for a vital sign with code, display text, measured value, unit, and effective date, linking to the patient by ID (e.g., Patient/123); serialization keeps numeric values and nested coding. @test

Transaction bundle composition

  • Produces a transaction bundle with POST requests for the patient and each observation, preserving local references so the observation entry uses the patient entry's fullUrl. @test

Implementation

@generates

API

from typing import Any, Dict, List

def create_patient_record(given_name: str, family_name: str, birth_date: str, city: str, country: str, phone: str) -> Any:
    """Return a patient resource object built from the provided demographics."""
    ...

def create_observation_record(patient_id: str, code: str, display: str, value: float, unit: str, effective_date: str) -> Any:
    """Return an observation resource object that references the patient."""
    ...

def build_transaction_bundle(patient: Any, observations: List[Any]) -> Any:
    """Combine patient and observations into a transaction bundle resource."""
    ...

def serialize_resource(resource: Any) -> Dict[str, Any]:
    """Convert any resource produced by this module into its serialized JSON-safe form."""
    ...

Dependencies { .dependencies }

fhirpy { .dependency }

Python FHIR client for constructing and serializing resources.

tile.json