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-6/

FHIR Result Retrieval Helpers

A helper module for retrieving FHIR resources efficiently using the result-fetching utilities of the dependency client.

Capabilities

Direct resource retrieval

  • Given a client and resource identifiers (type and id), returns the resource as a Python dict and propagates dependency errors when the resource is missing or ambiguous. @test

First active patient

  • Returns the identifier of the first Patient marked active; raises a ValueError when no active Patient exists. @test

Appointment aggregation with total

  • For a patient id, collects all Appointment ids across paginated results ordered by start date ascending and also returns the server-reported total number of matches. @test

Raw encounter bundle

  • Fetches the raw bundle for Encounters matching a given status, preserving any included related Practitioners, and returns the bundle unchanged. @test

Implementation

@generates

API

from typing import Any, Dict, List, Tuple

def get_resource(client: Any, resource_type: str, resource_id: str) -> Dict[str, Any]:
    """
    Retrieve a single resource by type and id using the provided client.
    """

def first_active_patient_id(client: Any) -> str:
    """
    Return the id of the first active Patient. Raises ValueError when none exist.
    """

def list_patient_appointments(client: Any, patient_id: str) -> Tuple[List[str], int]:
    """
    Return appointment ids for the patient across all pages ordered by start ascending,
    along with the server-reported total count of matches.
    """

def raw_encounter_bundle(client: Any, status: str) -> Dict[str, Any]:
    """
    Return the raw bundle for Encounters matching the given status, preserving included resources.
    """

Dependencies { .dependencies }

fhirpy { .dependency }

Provides FHIR client and resource search helpers.

tile.json