imednet package

iMednet SDK - A Python client for the iMednet EDC REST API.

Subpackages

Submodules

imednet.config module

Global SDK configuration state.

This module provides the core configuration object for the iMednet SDK.

class imednet.config.Config[source]

Bases: object

Configuration object for the SDK client.

api_key: str | None = None

The API key for authentication.

Type:

str | None

security_key: str | None = None

The security key for authentication.

Type:

str | None

base_url: str | None = None

The base URL for the iMednet API.

Type:

str | None

oidc_token: str | None = None

Optional OIDC token for authentication.

Type:

str | None

timeout: float = 30.0

The default timeout for network requests.

Type:

float

strict_mode: bool = False

Toggle strict mode for data validation.

Type:

bool

simulation_mode: bool = False

Toggle offline simulation mode.

Type:

bool

imednet.config.load_config(api_key=None, security_key=None, base_url=None, oidc_token=None, timeout=None, strict_mode=None, simulation_mode=None, *, credential_source=None, require_credentials=True, has_transport=False)[source]

Return configuration using arguments or environment variables.

Parameters:
  • api_key (str | None) – The API key for authentication. Defaults to IMEDNET_API_KEY environment variable.

  • security_key (str | None) – The security key for authentication. Defaults to IMEDNET_SECURITY_KEY environment variable.

  • base_url (str | None) – The base URL for the iMednet API. Defaults to IMEDNET_BASE_URL environment variable.

  • oidc_token (str | None) – Optional OIDC token. Defaults to IMEDNET_OIDC_TOKEN environment variable.

  • timeout (float | None) – HTTP request timeout in seconds. Defaults to IMEDNET_TIMEOUT environment variable or 30.0.

  • strict_mode (bool | None) – Toggle strict mode for data validation. Defaults to IMEDNET_STRICT_MODE environment variable or False.

  • simulation_mode (bool | None) – Toggle offline simulation mode. Defaults to IMEDNET_SIMULATION_MODE environment variable or False.

  • credential_source (CredentialSource | None) – Optional caller-owned source, consulted before the environment.

  • require_credentials (bool) – Validate default credential requirements. Custom authentication or an injected client owns authentication when this is False.

  • has_transport (bool) – Bypass default credential requirements when an offline HTTP transport is supplied.

Returns:

The loaded SDK configuration.

Raises:

ConfigurationError – If required authentication parameters are missing or credential loading fails.

Return type:

Config

imednet.constants module

Common constants used throughout the iMednet SDK.

This module centralizes configuration constants to avoid magic numbers and improve maintainability.

imednet.constants.CONTENT_TYPE_JSON = 'application/json'

JSON content type value.

imednet.constants.DEFAULT_BACKOFF_FACTOR = 1.0

Default backoff factor for exponential retry delays.

imednet.constants.DEFAULT_BASE_URL = 'https://edc.prod.imednetapi.com'

Default base URL for the iMednet API.

imednet.constants.DEFAULT_MAX_RETRY_AFTER = 60.0

Default maximum delay in seconds honored from HTTP Retry-After headers.

imednet.constants.DEFAULT_PAGE_SIZE = 100

Default number of items to fetch per page.

imednet.constants.DEFAULT_RETRIES = 3

Default number of retry attempts for failed requests.

imednet.constants.DEFAULT_TIMEOUT = 30.0

Default timeout in seconds for HTTP requests.

imednet.constants.HEADER_ACCEPT = 'Accept'

HTTP Accept header name.

imednet.constants.HEADER_API_KEY = 'x-api-key'

iMednet API key header name.

imednet.constants.HEADER_CONTENT_TYPE = 'Content-Type'

HTTP Content-Type header name.

imednet.constants.HEADER_EMAIL_NOTIFY = 'x-email-notify'

iMednet email notification header name.

imednet.constants.HEADER_SECURITY_KEY = 'x-imn-security-key'

iMednet security key header name.

imednet.constants.LARGE_PAGE_SIZE = 500

Page size for endpoints with large metadata (forms, intervals, variables).

imednet.constants.MAX_PAGE_SIZE = 500

Maximum number of items per page allowed by the upstream iMednet API.

imednet.constants.MAX_SQLITE_COLUMNS = 2000

Maximum number of columns allowed in a SQLite table.

When exporting data to SQLite, tables exceeding this limit must be split into multiple tables.

imednet.constants.TERMINAL_JOB_STATES = frozenset({'CANCELLED', 'COMPLETE', 'COMPLETED', 'FAILED', 'SUCCESS', 'TIMEOUT'})

Job states that indicate the job has finished processing.

These states are used by the job poller to determine when to stop polling. Jobs in these states will not transition to another state.

imednet.discovery module

Runtime discovery utilities for live tests and scripts.

exception imednet.discovery.NoLiveDataError[source]

Bases: RuntimeError

Raised when required live data cannot be found.

imednet.discovery.discover_form_key(sdk, study_key)[source]

Return the first subject record form key for study_key.

Parameters:
Return type:

str

imednet.discovery.discover_interval_name(sdk, study_key)[source]

Return the first non-disabled interval name for study_key.

Parameters:
Return type:

str

imednet.discovery.discover_site_name(sdk, study_key)[source]

Return the first eligible site name for study_key.

A site is eligible when its site_enrollment_status is one of ELIGIBLE_SITE_STATUSES. When no eligible site is found the encountered statuses are logged so callers can distinguish missing data from unsupported status vocabulary.

Parameters:
Return type:

str

imednet.discovery.discover_study_key(sdk)[source]

Return the first study key available for the provided SDK.

Parameters:

sdk (ImednetSDK) –

Return type:

str

imednet.discovery.discover_subject_key(sdk, study_key)[source]

Return the first eligible subject key for study_key.

A subject is eligible when its subject_status is one of ELIGIBLE_SUBJECT_STATUSES. When no eligible subject is found the encountered statuses are logged so callers can distinguish missing data from unsupported status vocabulary.

Parameters:
Return type:

str

imednet.discovery.is_site_eligible(site_enrollment_status)[source]

Return True when site_enrollment_status is usable for live tests.

Parameters:

site_enrollment_status (str | SiteEnrollmentStatus | None) –

Return type:

bool

imednet.discovery.is_subject_eligible(subject_status, *, deleted=None)[source]

Return True when subject_status is usable for live tests and not soft-deleted.

Parameters:
  • subject_status (str | SubjectStatus | None) –

  • deleted (bool | None) –

Return type:

bool

imednet.plugins module

Plugin contracts for the iMednet SDK.

This module defines the PluginProtocol that namespace-level plugin factories satisfy when discovered via the imednet.plugins entry-point group (such as sinks = "imednet_sinks.plugin:create_sinks"), together with mode-separated SyncWorkflowsNamespaceProtocol, AsyncWorkflowsNamespaceProtocol, WorkflowsNamespaceProtocol, SinksNamespaceProtocol, and AsyncSinksNamespaceProtocol.

Individual workflows exposed on sdk.workflows are discovered lazily by WorkflowRegistry via the imednet.workflows entry-point group, where each entry point maps a workflow attribute name to a callable accepting the SDK instance.

Minimal plugin skeleton

To register an individual workflow on sdk.workflows:

  1. Expose a class or factory callable under [project.entry-points."imednet.workflows"].

  2. The callable must accept a single argument — the ImednetSDK (or AsyncImednetSDK) instance — and return the workflow helper.

Example pyproject.toml snippet:

[project.entry-points."imednet.workflows"]
my_workflow = "myplugin.workflows:MyWorkflow"

[project.entry-points."imednet.plugins"]
sinks = "imednet_sinks.plugin:create_sinks"

Example workflow class:

# myplugin/workflows.py
from imednet.sdk import ImednetSDK

class MyWorkflow:
    def __init__(self, sdk: ImednetSDK) -> None:
        self._sdk = sdk
class imednet.plugins.AsyncDataExtractionWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.data_extraction.

async extract_audit_trail(study_key, start_date=None, end_date=None, user_filter=None, **filters)[source]

Extract record revisions bounded by optional UTC dates and filters.

Parameters:
  • study_key (str) –

  • start_date (str | None) –

  • end_date (str | None) –

  • user_filter (dict[str, Any] | None) –

  • filters (Any) –

Return type:

list[RecordRevision]

async extract_odm_audit_records(study_key, start_date=None, end_date=None, user_filter=None, *, default_location_oid=None, mask_phi=True, phi_keys=None, **filters)[source]

Asynchronously extract record revisions mapped to CDISC ODM 1.3.2 AuditRecord models.

Parameters:
  • study_key (str) –

  • start_date (str | None) –

  • end_date (str | None) –

  • user_filter (dict[str, Any] | None) –

  • default_location_oid (str | None) –

  • mask_phi (bool) –

  • phi_keys (Collection[str] | None) –

  • filters (Any) –

Return type:

list[OdmAuditRecord]

async extract_records_by_criteria(study_key, record_filter=None, subject_filter=None, visit_filter=None, on_progress=None, *, include_deleted=False, record_data_filter=None, **other_filters)[source]

Extract study records matching combined subject, visit, and record filters.

Parameters:
  • study_key (str) –

  • record_filter (dict[str, Any] | None) –

  • subject_filter (dict[str, Any] | None) –

  • visit_filter (dict[str, Any] | None) –

  • on_progress (Callable[[str], None] | None) –

  • include_deleted (bool) –

  • record_data_filter (str | None) –

  • other_filters (Any) –

Return type:

list[Record]

class imednet.plugins.AsyncDuckDBIngestionWorkflowProtocol[source]

Bases: Protocol

Asynchronous contract for sdk.workflows.duckdb_centralizer on AsyncImednetSDK.

async aclose()[source]

Asynchronously close the underlying DuckDB connection.

Return type:

None

async build_silver_view(study_key, *, include_deleted=False)[source]

Asynchronously create or replace the deduplicated DuckDB silver view for a study.

Parameters:
  • study_key (str) –

  • include_deleted (bool) –

Return type:

None

close()[source]

Close the underlying DuckDB connection.

Return type:

None

async ingest_revisions(study_key, *, start_date=None, end_date=None, mode='append', mask_phi=None)[source]

Asynchronously ingest study record revisions into the DuckDB bronze table.

Parameters:
  • study_key (str) –

  • start_date (str | None) –

  • end_date (str | None) –

  • mode (Literal['append', 'replace']) –

  • mask_phi (bool | None) –

Return type:

int

class imednet.plugins.AsyncMongoDbExportSinkFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.AsyncMongoDbExportSink.

__call__(config)[source]

Instantiate an asynchronous MongoDB export sink.

Parameters:

config (Any) –

Return type:

AsyncExportSink

class imednet.plugins.AsyncNeo4jExportSinkFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.AsyncNeo4jExportSink.

__call__(config)[source]

Instantiate an asynchronous Neo4j export sink.

Parameters:

config (Any) –

Return type:

AsyncExportSink

class imednet.plugins.AsyncQueryManagementWorkflowProtocol[source]

Bases: Protocol

Asynchronous contract for sdk.workflows.query_management on AsyncImednetSDK.

async extract_odm_annotations(study_key, additional_filter=None, *, open_only=False, include_answered=False, mask_phi=True, phi_keys=None, **kwargs)[source]

Asynchronously extract study queries mapped to CDISC ODM 1.3.2 Annotation models.

Parameters:
  • study_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • open_only (bool) –

  • include_answered (bool) –

  • mask_phi (bool) –

  • phi_keys (Collection[str] | None) –

  • kwargs (Any) –

Return type:

list[OdmAnnotation]

async get_open_queries(study_key, additional_filter=None, include_answered=False, **kwargs)[source]

Asynchronously retrieve open queries for a study, optionally including answered.

Parameters:
  • study_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • include_answered (bool) –

  • kwargs (Any) –

Return type:

list[Query]

async get_queries_by_site(study_key, site_key, additional_filter=None, **kwargs)[source]

Asynchronously retrieve queries associated with a specific site.

Parameters:
  • study_key (str) –

  • site_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • kwargs (Any) –

Return type:

list[Query]

async get_queries_for_subject(study_key, subject_key, additional_filter=None, **kwargs)[source]

Asynchronously retrieve queries associated with a specific subject.

Parameters:
  • study_key (str) –

  • subject_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • kwargs (Any) –

Return type:

list[Query]

async get_query_state_counts(study_key, **kwargs)[source]

Asynchronously count queries grouped by query status.

Parameters:
  • study_key (str) –

  • kwargs (Any) –

Return type:

dict[str, int]

async get_unresolved_queries(study_key, additional_filter=None, **kwargs)[source]

Asynchronously retrieve all unresolved (OPEN and ANSWERED) queries for a study.

Parameters:
  • study_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • kwargs (Any) –

Return type:

list[Query]

async sync_queries_to_triage(study_key, store=None, *, additional_filter=None, unresolved_only=False, default_severity='medium', **kwargs)[source]

Asynchronously synchronize clinical queries into a local triage queue.

Parameters:
  • study_key (str) –

  • store (TriageStoreProtocol | str | Path | None) –

  • additional_filter (dict[str, Any] | None) –

  • unresolved_only (bool) –

  • default_severity (str) –

  • kwargs (Any) –

Return type:

list[TriageItem]

class imednet.plugins.AsyncRecordMapperProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.record_mapper.

async build_hierarchy(study_key, visit_key=None, use_labels_as_keys=False, variable_whitelist=None, form_whitelist=None, *, mask_phi=None, include_deleted=None, records=None)[source]

Generate a nested JSON hierarchy for study records.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_keys (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • records (Iterable[Record] | AsyncIterable[Record] | None) –

Return type:

list[dict[str, Any]]

async dataframe(study_key, visit_key=None, use_labels_as_columns=True, variable_whitelist=None, form_whitelist=None, *, as_sdtm=False, domain=None, mask_phi=None, include_deleted=None)[source]

Return mapped study records as a pandas DataFrame.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • as_sdtm (bool) –

  • domain (str | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

DataFrame

iter_dataframes(study_key, visit_key=None, use_labels_as_columns=True, variable_whitelist=None, form_whitelist=None, *, as_sdtm=False, domain=None, mask_phi=None, include_deleted=None)[source]

Yield mapped study record DataFrames in bounded chunks.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • as_sdtm (bool) –

  • domain (str | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

AsyncIterator[DataFrame]

iter_sdtm_dataframes(study_key, domain, visit_key=None, variable_whitelist=None, form_whitelist=None, *, mask_phi=None, include_deleted=None)[source]

Yield chunked DataFrames mapped to a CDISC SDTM domain.

Parameters:
  • study_key (str) –

  • domain (str) –

  • visit_key (str | None) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

AsyncIterator[DataFrame]

async sdtm_dataframe(study_key, domain, visit_key=None, variable_whitelist=None, form_whitelist=None, *, mask_phi=None, include_deleted=None)[source]

Return study records mapped to a CDISC SDTM domain DataFrame.

Parameters:
  • study_key (str) –

  • domain (str) –

  • visit_key (str | None) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

DataFrame

async sdtm_dataset_json(study_key, domain, visit_key=None, variable_whitelist=None, form_whitelist=None, *, preserve_record_id=False, mask_phi=None, include_deleted=None, metadata_version_oid='MDV.001', file_oid=None, creation_datetime=None)[source]

Asynchronously emit a CDISC Dataset-JSON v1.1 envelope for a specific SDTM domain.

Parameters:
  • study_key (str) –

  • domain (str) –

  • visit_key (str | None) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • preserve_record_id (bool) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • metadata_version_oid (str) –

  • file_oid (str | None) –

  • creation_datetime (str | None) –

Return type:

DatasetJsonEnvelope

async to_dataset_json(study_key, visit_key=None, use_labels_as_columns=False, variable_whitelist=None, form_whitelist=None, *, form_key=None, as_sdtm=None, domain=None, naming_convention=None, preserve_record_id=False, mask_phi=None, include_deleted=None, metadata_version_oid='MDV.001', file_oid=None, creation_datetime=None, records=None)[source]

Asynchronously emit a CDISC Dataset-JSON v1.1 envelope for CDASH Forms or SDTM domains.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • form_key (str | None) –

  • as_sdtm (bool | None) –

  • domain (str | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • metadata_version_oid (str) –

  • file_oid (str | None) –

  • creation_datetime (str | None) –

  • records (Iterable[Any] | AsyncIterable[Any] | None) –

Return type:

DatasetJsonEnvelope

async to_dataset_json_bundle(study_key, visit_key=None, use_labels_as_columns=False, variable_whitelist=None, form_whitelist=None, *, form_key=None, as_sdtm=None, domain=None, naming_convention=None, preserve_record_id=False, mask_phi=None, include_deleted=None, metadata_version_oid='MDV.001', file_oid=None, creation_datetime=None, records=None)[source]

Asynchronously emit a multi-dataset CDISC Dataset-JSON v1.1 bundle.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • form_key (str | None) –

  • as_sdtm (bool | None) –

  • domain (str | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • metadata_version_oid (str) –

  • file_oid (str | None) –

  • creation_datetime (str | None) –

  • records (Iterable[Any] | AsyncIterable[Any] | None) –

Return type:

DatasetJsonBundle

transform_to_sdtm(records, domain, study_key, *, mask_phi=None, include_deleted=None, seq_counters=None, record_seqs=None, preserve_record_id=False)[source]

Transform records into a normalized SDTM domain DataFrame.

Parameters:
  • records (Iterable[Any]) –

  • domain (str) –

  • study_key (str) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • seq_counters (dict[str, int] | None) –

  • record_seqs (dict[str, int] | None) –

  • preserve_record_id (bool) –

Return type:

DataFrame

class imednet.plugins.AsyncRecordUpdateWorkflowProtocol[source]

Bases: Protocol

Asynchronous contract for sdk.workflows.record_update on AsyncImednetSDK.

async_create_new_record(study_key, form_identifier, subject_identifier, data, form_identifier_type='key', subject_identifier_type='key', wait_for_completion=False, timeout=300, poll_interval=5, *, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Asynchronously create a new unscheduled record for an existing subject.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • subject_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async_create_or_update_records(study_key, records_data, wait_for_completion=False, timeout=300, poll_interval=5, *, email_notify=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously submit records for creation or update and return the Job.

Parameters:
Return type:

Job

async_create_or_update_records_batch(study_key, records_data, wait_for_completion=False, timeout=300, poll_interval=5, *, email_notify=None, chunk_size=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously validate once, submit chunks, and return a batch summary.

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • email_notify (bool | str | None) –

  • chunk_size (int | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async_register_subject(study_key, form_identifier, site_identifier, data, form_identifier_type='key', site_identifier_type='name', wait_for_completion=False, timeout=300, poll_interval=5, *, subject_key=None, subject_oid=None, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Asynchronously register a new subject via the Records API.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • site_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • site_identifier_type (Literal['name', 'id']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • subject_key (str | None) –

  • subject_oid (str | None) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async_update_record(study_key, data=None, *, record_id=None, record_oid=None, visit_id=None, form_identifier=None, form_identifier_type='key', subject_identifier=None, subject_identifier_type='key', interval_identifier=None, interval_identifier_type='name', site_identifier=None, site_identifier_type='name', record_status=None, reason_for_change=None, wait_for_completion=False, timeout=300, poll_interval=5, email_notify=None, schema=None, resolve_results=True)[source]

Asynchronously update an existing record by recordId, recordOid, visitId, or interval.

Parameters:
  • study_key (str) –

  • data (dict[str, Any] | None) –

  • record_id (int | None) –

  • record_oid (str | None) –

  • visit_id (int | None) –

  • form_identifier (str | int | None) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier (str | int | None) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • interval_identifier (str | int | None) –

  • interval_identifier_type (Literal['name', 'id']) –

  • site_identifier (str | int | None) –

  • site_identifier_type (Literal['name', 'id']) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async_update_scheduled_record(study_key, form_identifier, subject_identifier, interval_identifier, data, form_identifier_type='key', subject_identifier_type='key', interval_identifier_type='name', wait_for_completion=False, timeout=300, poll_interval=5, *, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Asynchronously update an existing scheduled record for a subject.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • subject_identifier (str | int) –

  • interval_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • interval_identifier_type (Literal['name', 'id']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async create_new_record(study_key, form_identifier, subject_identifier, data, form_identifier_type='key', subject_identifier_type='key', wait_for_completion=False, timeout=300, poll_interval=5, *, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Create a new unscheduled record for an existing subject.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • subject_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async create_or_update_records(study_key, records_data, wait_for_completion=False, timeout=300, poll_interval=5, *, email_notify=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Submit records for creation or update and return the resulting Job.

Parameters:
Return type:

Job

async create_or_update_records_batch(study_key, records_data, wait_for_completion=False, timeout=300, poll_interval=5, *, email_notify=None, chunk_size=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Validate once, submit records in bounded chunks, and return a batch summary.

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • email_notify (bool | str | None) –

  • chunk_size (int | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async register_subject(study_key, form_identifier, site_identifier, data, form_identifier_type='key', site_identifier_type='name', wait_for_completion=False, timeout=300, poll_interval=5, *, subject_key=None, subject_oid=None, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Register a new subject by submitting a single enrollment record.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • site_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • site_identifier_type (Literal['name', 'id']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • subject_key (str | None) –

  • subject_oid (str | None) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async update_record(study_key, data=None, *, record_id=None, record_oid=None, visit_id=None, form_identifier=None, form_identifier_type='key', subject_identifier=None, subject_identifier_type='key', interval_identifier=None, interval_identifier_type='name', site_identifier=None, site_identifier_type='name', record_status=None, reason_for_change=None, wait_for_completion=False, timeout=300, poll_interval=5, email_notify=None, schema=None, resolve_results=True)[source]

Asynchronously update an existing record by recordId, recordOid, visitId, or interval.

Parameters:
  • study_key (str) –

  • data (dict[str, Any] | None) –

  • record_id (int | None) –

  • record_oid (str | None) –

  • visit_id (int | None) –

  • form_identifier (str | int | None) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier (str | int | None) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • interval_identifier (str | int | None) –

  • interval_identifier_type (Literal['name', 'id']) –

  • site_identifier (str | int | None) –

  • site_identifier_type (Literal['name', 'id']) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

async update_scheduled_record(study_key, form_identifier, subject_identifier, interval_identifier, data, form_identifier_type='key', subject_identifier_type='key', interval_identifier_type='name', wait_for_completion=False, timeout=300, poll_interval=5, *, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Update an existing scheduled record for a subject.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • subject_identifier (str | int) –

  • interval_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • interval_identifier_type (Literal['name', 'id']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

class imednet.plugins.AsyncRegisterSubjectsWorkflowProtocol[source]

Bases: Protocol

Asynchronous contract for sdk.workflows.register_subjects on AsyncImednetSDK.

async_register_subjects(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Deprecated alias for register_subjects().

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

Job

async_register_subjects_batch(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, chunk_size=None, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Deprecated alias for register_subjects_batch().

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • chunk_size (int | None) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async register_subjects(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously register one or more subjects in a study.

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

Job

async register_subjects_batch(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, chunk_size=None, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously validate sites and submit subject registrations in bounded chunks.

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • chunk_size (int | None) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

class imednet.plugins.AsyncSinksNamespaceProtocol[source]

Bases: Protocol

Asynchronous sinks namespace contract exposed on AsyncImednetSDK.sinks.

property AsyncMongoDbExportSink: AsyncMongoDbExportSinkFactoryProtocol

Asynchronous sink class for MongoDB record exports.

property AsyncNeo4jExportSink: AsyncNeo4jExportSinkFactoryProtocol

Asynchronous sink class for Neo4j record exports.

property AsyncSnowflakeExportSink: AsyncSnowflakeExportSinkFactoryProtocol

Asynchronous sink class for Snowflake record exports.

property MongoDbExportSink: MongoDbExportSinkFactoryProtocol

Synchronous sink class for MongoDB record exports.

property MongoDbSinkConfig: MongoDbSinkConfigFactoryProtocol

Configuration class for MongoDB export sinks.

property Neo4jExportSink: Neo4jExportSinkFactoryProtocol

Synchronous sink class for Neo4j record exports.

property Neo4jSinkConfig: Neo4jSinkConfigFactoryProtocol

Configuration class for Neo4j export sinks.

property SnowflakeExportSink: SnowflakeExportSinkFactoryProtocol

Synchronous sink class for Snowflake record exports.

property SnowflakeSinkConfig: SnowflakeSinkConfigFactoryProtocol

Configuration class for Snowflake export sinks.

property export_to_mongodb: BoundAsyncExportToMongoDbProtocol

Bound coroutine helper to export study records to MongoDB.

property export_to_neo4j: BoundAsyncExportToNeo4jProtocol

Bound coroutine helper to export study records to Neo4j.

property export_to_snowflake: BoundAsyncExportToSnowflakeProtocol

Bound coroutine helper to export study records to Snowflake.

class imednet.plugins.AsyncSnowflakeExportSinkFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.AsyncSnowflakeExportSink.

__call__(config)[source]

Instantiate an asynchronous Snowflake export sink.

Parameters:

config (Any) –

Return type:

AsyncExportSink

class imednet.plugins.AsyncStudySchemaInspectorProtocol[source]

Bases: Protocol

Asynchronous contract for sdk.workflows.uat_inspector on AsyncImednetSDK.

async_inspect(study_key, *, force_refresh=False)[source]

Deprecated alias for inspect().

Parameters:
  • study_key (str) –

  • force_refresh (bool) –

Return type:

StudySnapshotProtocol

clear_cache(study_key=None)[source]

Clear cached study snapshots.

Parameters:

study_key (str | None) –

Return type:

None

async inspect(study_key, *, force_refresh=False)[source]

Asynchronously fetch and index structural study metadata concurrently.

Parameters:
  • study_key (str) –

  • force_refresh (bool) –

Return type:

StudySnapshotProtocol

class imednet.plugins.AsyncSubjectDataWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.subject_data.

async get_all_subject_data(study_key, subject_key, *, include_deleted=False)[source]

Retrieve subject details, visits, records, and queries for a subject.

Parameters:
  • study_key (str) –

  • subject_key (str) –

  • include_deleted (bool) –

Return type:

SubjectComprehensiveDataProtocol

class imednet.plugins.AsyncUATWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.uat.

build_spec(snapshot, **kwargs)[source]

Auto-generate a UAT specification from a study snapshot.

Parameters:
  • snapshot (Any) –

  • kwargs (Any) –

Return type:

Any

generate(spec, snapshot, *, data_dictionary=None, seed=None)[source]

Generate synthetic record sets from a UAT specification and snapshot.

Parameters:
  • spec (Any) –

  • snapshot (Any) –

  • data_dictionary (DataDictionary | None) –

  • seed (int | None) –

Return type:

list[Any]

async inspect(study_key)[source]

Inspect study metadata via StudySchemaInspector.

Parameters:

study_key (str) –

Return type:

StudySnapshotProtocol

property last_result: UATRunResultProtocol | None

Result from the most recent run() invocation, if any.

async monitor(study_key, submission_result)[source]

Poll submitted UAT job batches to completion.

Parameters:
  • study_key (str) –

  • submission_result (Any) –

Return type:

Any

reset()[source]

Reset the UAT workflow state machine.

Return type:

None

async run(study_key, *, spec=None, subject_count=2, site_name=None, enabled_form_keys=None, email_notify=None, data_dictionary=None, schema=None, seed=None, dry_run=False)[source]

Execute the end-to-end UAT pipeline and return its run result.

Parameters:
  • study_key (str) –

  • spec (Any) –

  • subject_count (int) –

  • site_name (str | None) –

  • enabled_form_keys (list[str] | None) –

  • email_notify (bool | str | None) –

  • data_dictionary (DataDictionary | None) –

  • schema (ValidationSchemaProtocol | None) –

  • seed (int | None) –

  • dry_run (bool) –

Return type:

UATRunResultProtocol

property state: str

Current lifecycle state of the UAT workflow.

property state_history: Sequence[str]

Recorded lifecycle state transitions for the current or latest run.

async submit(study_key, record_sets, email_notify=None, *, schema=None)[source]

Submit generated UAT record sets in two phases.

Parameters:
  • study_key (str) –

  • record_sets (list[Any]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

Return type:

Any

transition_to(target, *, dry_run=False)[source]

Transition workflow state along a valid lifecycle edge.

Parameters:
  • target (str) –

  • dry_run (bool) –

Return type:

str

class imednet.plugins.AsyncWorkflowsNamespaceProtocol[source]

Bases: Protocol

Asynchronous workflows namespace contract exposed on AsyncImednetSDK.workflows.

property data_extraction: AsyncDataExtractionWorkflowProtocol

Access the asynchronous data extraction workflow.

property duckdb_centralizer: AsyncDuckDBIngestionWorkflowProtocol

Access the asynchronous DuckDB bronze/silver ingestion workflow.

property query_management: AsyncQueryManagementWorkflowProtocol

Access the asynchronous query management workflow.

property record_mapper: AsyncRecordMapperProtocol

Access the asynchronous tabular and SDTM record mapper workflow.

property record_update: AsyncRecordUpdateWorkflowProtocol

Access the asynchronous record submission and update workflow.

property register_subjects: AsyncRegisterSubjectsWorkflowProtocol

Access the asynchronous bulk subject registration workflow.

property subject_data: AsyncSubjectDataWorkflowProtocol

Access the asynchronous comprehensive subject data retrieval workflow.

property uat: AsyncUATWorkflowProtocol

Access the asynchronous end-to-end UAT orchestration workflow.

property uat_inspector: AsyncStudySchemaInspectorProtocol

Access the asynchronous study schema inspector.

class imednet.plugins.BoundAsyncExportToMongoDbProtocol[source]

Bases: Protocol

Bound coroutine contract for async_sdk.sinks.export_to_mongodb.

async __call__(study_key: str, uri: str = '', database: str = '', collection: str = '', *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int[source]
async __call__(sdk: AsyncImednetFacade, study_key: str, uri: str = '', database: str = '', collection: str = '', *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int

Asynchronously export study records to MongoDB using the bound AsyncImednetSDK.

class imednet.plugins.BoundAsyncExportToNeo4jProtocol[source]

Bases: Protocol

Bound coroutine contract for async_sdk.sinks.export_to_neo4j.

async __call__(study_key: str, uri: str = '', auth: tuple[str, str] = ('', ''), *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int[source]
async __call__(sdk: AsyncImednetFacade, study_key: str, uri: str = '', auth: tuple[str, str] = ('', ''), *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int

Asynchronously export study records to Neo4j using the bound AsyncImednetSDK.

class imednet.plugins.BoundAsyncExportToSnowflakeProtocol[source]

Bases: Protocol

Bound coroutine contract for async_sdk.sinks.export_to_snowflake.

async __call__(study_key: str, *, config: Any, mask_phi: bool | None = None) → int[source]
async __call__(sdk: AsyncImednetFacade, study_key: str, *, config: Any, mask_phi: bool | None = None) → int

Asynchronously export study records to Snowflake using the bound AsyncImednetSDK.

class imednet.plugins.BoundExportToMongoDbProtocol[source]

Bases: Protocol

Bound callable contract for sdk.sinks.export_to_mongodb.

__call__(study_key: str, uri: str = '', database: str = '', collection: str = '', *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int[source]
__call__(sdk: ImednetFacade, study_key: str, uri: str = '', database: str = '', collection: str = '', *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int

Export study records to MongoDB using the bound SDK client.

class imednet.plugins.BoundExportToNeo4jProtocol[source]

Bases: Protocol

Bound callable contract for sdk.sinks.export_to_neo4j.

__call__(study_key: str, uri: str = '', auth: tuple[str, str] = ('', ''), *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int[source]
__call__(sdk: ImednetFacade, study_key: str, uri: str = '', auth: tuple[str, str] = ('', ''), *, config: Any = None, mask_phi: bool | None = None, **kwargs: Any) → int

Export study records to Neo4j using the bound SDK client.

class imednet.plugins.BoundExportToSnowflakeProtocol[source]

Bases: Protocol

Bound callable contract for sdk.sinks.export_to_snowflake.

__call__(study_key: str, *, config: Any, mask_phi: bool | None = None) → int[source]
__call__(sdk: ImednetFacade, study_key: str, *, config: Any, mask_phi: bool | None = None) → int

Export study records to Snowflake using the bound SDK client.

class imednet.plugins.DataExtractionWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.data_extraction.

extract_audit_trail(study_key, start_date=None, end_date=None, user_filter=None, **filters)[source]

Extract record revisions bounded by optional UTC dates and filters.

Parameters:
  • study_key (str) –

  • start_date (str | None) –

  • end_date (str | None) –

  • user_filter (dict[str, Any] | None) –

  • filters (Any) –

Return type:

list[RecordRevision]

extract_odm_audit_records(study_key, start_date=None, end_date=None, user_filter=None, *, default_location_oid=None, mask_phi=True, phi_keys=None, **filters)[source]

Extract record revisions mapped to CDISC ODM 1.3.2 AuditRecord models.

Parameters:
  • study_key (str) –

  • start_date (str | None) –

  • end_date (str | None) –

  • user_filter (dict[str, Any] | None) –

  • default_location_oid (str | None) –

  • mask_phi (bool) –

  • phi_keys (Collection[str] | None) –

  • filters (Any) –

Return type:

list[OdmAuditRecord]

extract_records_by_criteria(study_key, record_filter=None, subject_filter=None, visit_filter=None, on_progress=None, *, include_deleted=False, record_data_filter=None, **other_filters)[source]

Extract study records matching combined subject, visit, and record filters.

Parameters:
  • study_key (str) –

  • record_filter (dict[str, Any] | None) –

  • subject_filter (dict[str, Any] | None) –

  • visit_filter (dict[str, Any] | None) –

  • on_progress (Callable[[str], None] | None) –

  • include_deleted (bool) –

  • record_data_filter (str | None) –

  • other_filters (Any) –

Return type:

list[Record]

class imednet.plugins.DuckDBIngestionWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.duckdb_centralizer.

build_silver_view(study_key, *, include_deleted=False)[source]

Create or replace the deduplicated DuckDB silver view for a study.

Parameters:
  • study_key (str) –

  • include_deleted (bool) –

Return type:

None

close()[source]

Close the underlying DuckDB connection.

Return type:

None

ingest_revisions(study_key, *, start_date=None, end_date=None, mode='append', mask_phi=None)[source]

Ingest study record revisions into the DuckDB bronze table.

Parameters:
  • study_key (str) –

  • start_date (str | None) –

  • end_date (str | None) –

  • mode (Literal['append', 'replace']) –

  • mask_phi (bool | None) –

Return type:

int

class imednet.plugins.MongoDbExportSinkFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.MongoDbExportSink.

__call__(config)[source]

Instantiate a MongoDB export sink.

Parameters:

config (Any) –

Return type:

ExportSink

class imednet.plugins.MongoDbSinkConfigFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.MongoDbSinkConfig.

__call__(study_key, batch_size=500, max_retries=3, retry_backoff=1.0, idempotent=True, mask_phi=True, extra=Ellipsis, quality_gate_enabled=False, min_schema_readiness_score=100.0, tracer=None, modified_since=None, record_filter=None, record_data_filter=None, include_deleted=False, incremental=False, stream_name=None, ledger_path=None, state_provider=None, max_buffered_records=None, as_sdtm=False, sdtm_domain=None, standards_profile=None, min_standards_score=None, naming_convention=None, preserve_record_id=None, uri='', database='', collection='')[source]

Instantiate a MongoDB sink configuration.

Parameters:
  • study_key (str) –

  • batch_size (int) –

  • max_retries (int) –

  • retry_backoff (float) –

  • idempotent (bool) –

  • mask_phi (bool) –

  • extra (dict[str, Any]) –

  • quality_gate_enabled (bool) –

  • min_schema_readiness_score (float) –

  • tracer (Any | None) –

  • modified_since (datetime | str | None) –

  • record_filter (dict[str, Any] | str | None) –

  • record_data_filter (str | None) –

  • include_deleted (bool) –

  • incremental (bool) –

  • stream_name (str | None) –

  • ledger_path (str | Path | None) –

  • state_provider (Any | None) –

  • max_buffered_records (int | None) –

  • as_sdtm (bool) –

  • sdtm_domain (str | None) –

  • standards_profile (str | Any | None) –

  • min_standards_score (float | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool | None) –

  • uri (str) –

  • database (str) –

  • collection (str) –

Return type:

MongoDbSinkConfigProtocol

class imednet.plugins.MongoDbSinkConfigProtocol[source]

Bases: Protocol

Structural contract for MongoDbSinkConfig instances.

study_key: str
uri: str
database: str
collection: str
batch_size: int
max_buffered_records: int | None
as_sdtm: bool
sdtm_domain: str | None
standards_profile: str | Any | None
min_standards_score: float | None
naming_convention: str | None
preserve_record_id: bool | None
idempotent: bool
mask_phi: bool
include_deleted: bool
incremental: bool
modified_since: datetime | str | None
record_filter: dict[str, Any] | str | None
class imednet.plugins.Neo4jExportSinkFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.Neo4jExportSink.

__call__(config)[source]

Instantiate a Neo4j export sink.

Parameters:

config (Any) –

Return type:

ExportSink

class imednet.plugins.Neo4jSinkConfigFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.Neo4jSinkConfig.

__call__(study_key, batch_size=500, max_retries=3, retry_backoff=1.0, idempotent=True, mask_phi=True, extra=Ellipsis, quality_gate_enabled=False, min_schema_readiness_score=100.0, tracer=None, modified_since=None, record_filter=None, record_data_filter=None, include_deleted=False, incremental=False, stream_name=None, ledger_path=None, state_provider=None, max_buffered_records=None, as_sdtm=False, sdtm_domain=None, standards_profile=None, min_standards_score=None, naming_convention=None, preserve_record_id=None, uri='', auth=('', ''), database='neo4j')[source]

Instantiate a Neo4j sink configuration.

Parameters:
  • study_key (str) –

  • batch_size (int) –

  • max_retries (int) –

  • retry_backoff (float) –

  • idempotent (bool) –

  • mask_phi (bool) –

  • extra (dict[str, Any]) –

  • quality_gate_enabled (bool) –

  • min_schema_readiness_score (float) –

  • tracer (Any | None) –

  • modified_since (datetime | str | None) –

  • record_filter (dict[str, Any] | str | None) –

  • record_data_filter (str | None) –

  • include_deleted (bool) –

  • incremental (bool) –

  • stream_name (str | None) –

  • ledger_path (str | Path | None) –

  • state_provider (Any | None) –

  • max_buffered_records (int | None) –

  • as_sdtm (bool) –

  • sdtm_domain (str | None) –

  • standards_profile (str | Any | None) –

  • min_standards_score (float | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool | None) –

  • uri (str) –

  • auth (tuple[str, str]) –

  • database (str) –

Return type:

Neo4jSinkConfigProtocol

class imednet.plugins.Neo4jSinkConfigProtocol[source]

Bases: Protocol

Structural contract for Neo4jSinkConfig instances.

study_key: str
uri: str
auth: tuple[str, str]
database: str
batch_size: int
max_buffered_records: int | None
as_sdtm: bool
sdtm_domain: str | None
standards_profile: str | Any | None
min_standards_score: float | None
naming_convention: str | None
preserve_record_id: bool | None
idempotent: bool
mask_phi: bool
include_deleted: bool
incremental: bool
modified_since: datetime | str | None
record_filter: dict[str, Any] | str | None
class imednet.plugins.PluginProtocol[source]

Bases: Protocol

Protocol that every iMednet plugin factory must satisfy.

A conforming factory is a callable that accepts an SDK instance and returns an object implementing WorkflowsNamespaceProtocol.

Example:

from imednet.plugins import PluginProtocol
from imednet.sdk import ImednetSDK

class MyWorkflows:
    def __init__(self, sdk: ImednetSDK) -> None:
        self.data_extraction = ...
        self.duckdb_centralizer = ...
        self.query_management = ...
        self.record_mapper = ...
        self.record_update = ...
        self.register_subjects = ...
        self.subject_data = ...
        self.uat = ...
        self.uat_inspector = ...

def create_workflows(sdk: ImednetSDK) -> MyWorkflows:
    return MyWorkflows(sdk)

# Verify conformance at import time (optional, for development use):
assert isinstance(create_workflows, PluginProtocol)
__call__(sdk_instance, /)[source]

Initialize the workflows plugin with an SDK instance.

Parameters:

sdk_instance (ImednetFacade) –

Return type:

SyncWorkflowsNamespaceProtocol

class imednet.plugins.QueryManagementWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.query_management.

extract_odm_annotations(study_key, additional_filter=None, *, open_only=False, include_answered=False, mask_phi=True, phi_keys=None, **kwargs)[source]

Extract study queries mapped to CDISC ODM 1.3.2 Annotation models.

Parameters:
  • study_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • open_only (bool) –

  • include_answered (bool) –

  • mask_phi (bool) –

  • phi_keys (Collection[str] | None) –

  • kwargs (Any) –

Return type:

list[OdmAnnotation]

get_open_queries(study_key, additional_filter=None, include_answered=False, **kwargs)[source]

Retrieve open queries for a study, optionally including answered queries.

Parameters:
  • study_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • include_answered (bool) –

  • kwargs (Any) –

Return type:

list[Query]

get_queries_by_site(study_key, site_key, additional_filter=None, **kwargs)[source]

Retrieve queries associated with a specific site.

Parameters:
  • study_key (str) –

  • site_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • kwargs (Any) –

Return type:

list[Query]

get_queries_for_subject(study_key, subject_key, additional_filter=None, **kwargs)[source]

Retrieve queries associated with a specific subject.

Parameters:
  • study_key (str) –

  • subject_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • kwargs (Any) –

Return type:

list[Query]

get_query_state_counts(study_key, **kwargs)[source]

Count queries grouped by query status.

Parameters:
  • study_key (str) –

  • kwargs (Any) –

Return type:

dict[str, int]

get_unresolved_queries(study_key, additional_filter=None, **kwargs)[source]

Retrieve all unresolved (OPEN and ANSWERED) queries for a study.

Parameters:
  • study_key (str) –

  • additional_filter (dict[str, Any] | None) –

  • kwargs (Any) –

Return type:

list[Query]

sync_queries_to_triage(study_key, store=None, *, additional_filter=None, unresolved_only=False, default_severity='medium', **kwargs)[source]

Synchronize clinical queries for a study into a local triage queue.

Parameters:
  • study_key (str) –

  • store (TriageStoreProtocol | str | Path | None) –

  • additional_filter (dict[str, Any] | None) –

  • unresolved_only (bool) –

  • default_severity (str) –

  • kwargs (Any) –

Return type:

list[TriageItem]

class imednet.plugins.RecordMapperProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.record_mapper.

build_hierarchy(study_key, visit_key=None, use_labels_as_keys=False, variable_whitelist=None, form_whitelist=None, *, mask_phi=None, include_deleted=None, records=None)[source]

Generate a nested JSON hierarchy for study records.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_keys (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • records (Iterable[Record] | None) –

Return type:

list[dict[str, Any]]

dataframe(study_key, visit_key=None, use_labels_as_columns=True, variable_whitelist=None, form_whitelist=None, *, as_sdtm=False, domain=None, mask_phi=None, include_deleted=None)[source]

Return mapped study records as a pandas DataFrame.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • as_sdtm (bool) –

  • domain (str | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

DataFrame

iter_dataframes(study_key, visit_key=None, use_labels_as_columns=True, variable_whitelist=None, form_whitelist=None, *, as_sdtm=False, domain=None, mask_phi=None, include_deleted=None)[source]

Yield mapped study record DataFrames in bounded chunks.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • as_sdtm (bool) –

  • domain (str | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

Iterator[DataFrame]

iter_sdtm_dataframes(study_key, domain, visit_key=None, variable_whitelist=None, form_whitelist=None, *, mask_phi=None, include_deleted=None)[source]

Yield chunked DataFrames mapped to a CDISC SDTM domain.

Parameters:
  • study_key (str) –

  • domain (str) –

  • visit_key (str | None) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

Iterator[DataFrame]

sdtm_dataframe(study_key, domain, visit_key=None, variable_whitelist=None, form_whitelist=None, *, mask_phi=None, include_deleted=None)[source]

Return study records mapped to a CDISC SDTM domain DataFrame.

Parameters:
  • study_key (str) –

  • domain (str) –

  • visit_key (str | None) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

Return type:

DataFrame

sdtm_dataset_json(study_key, domain, visit_key=None, variable_whitelist=None, form_whitelist=None, *, preserve_record_id=False, mask_phi=None, include_deleted=None, metadata_version_oid='MDV.001', file_oid=None, creation_datetime=None)[source]

Emit a CDISC Dataset-JSON v1.1 envelope for a specific SDTM domain.

Parameters:
  • study_key (str) –

  • domain (str) –

  • visit_key (str | None) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • preserve_record_id (bool) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • metadata_version_oid (str) –

  • file_oid (str | None) –

  • creation_datetime (str | None) –

Return type:

DatasetJsonEnvelope

to_dataset_json(study_key, visit_key=None, use_labels_as_columns=False, variable_whitelist=None, form_whitelist=None, *, form_key=None, as_sdtm=None, domain=None, naming_convention=None, preserve_record_id=False, mask_phi=None, include_deleted=None, metadata_version_oid='MDV.001', file_oid=None, creation_datetime=None, records=None)[source]

Emit a CDISC Dataset-JSON v1.1 envelope for CDASH Forms or SDTM domains.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • form_key (str | None) –

  • as_sdtm (bool | None) –

  • domain (str | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • metadata_version_oid (str) –

  • file_oid (str | None) –

  • creation_datetime (str | None) –

  • records (Iterable[Any] | None) –

Return type:

DatasetJsonEnvelope

to_dataset_json_bundle(study_key, visit_key=None, use_labels_as_columns=False, variable_whitelist=None, form_whitelist=None, *, form_key=None, as_sdtm=None, domain=None, naming_convention=None, preserve_record_id=False, mask_phi=None, include_deleted=None, metadata_version_oid='MDV.001', file_oid=None, creation_datetime=None, records=None)[source]

Emit a multi-dataset CDISC Dataset-JSON v1.1 bundle for CDASH Forms or SDTM domains.

Parameters:
  • study_key (str) –

  • visit_key (str | None) –

  • use_labels_as_columns (bool) –

  • variable_whitelist (list[str] | None) –

  • form_whitelist (list[int] | None) –

  • form_key (str | None) –

  • as_sdtm (bool | None) –

  • domain (str | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • metadata_version_oid (str) –

  • file_oid (str | None) –

  • creation_datetime (str | None) –

  • records (Iterable[Any] | None) –

Return type:

DatasetJsonBundle

transform_to_sdtm(records, domain, study_key, *, mask_phi=None, include_deleted=None, seq_counters=None, record_seqs=None, preserve_record_id=False)[source]

Transform records into a normalized SDTM domain DataFrame.

Parameters:
  • records (Iterable[Any]) –

  • domain (str) –

  • study_key (str) –

  • mask_phi (bool | None) –

  • include_deleted (bool | None) –

  • seq_counters (dict[str, int] | None) –

  • record_seqs (dict[str, int] | None) –

  • preserve_record_id (bool) –

Return type:

DataFrame

imednet.plugins.RegisterSubjectsWorkflowProtocol: TypeAlias = SyncRegisterSubjectsWorkflowProtocol

Explicit protocol type alias for SyncRegisterSubjectsWorkflowProtocol.

class imednet.plugins.SinksNamespaceProtocol[source]

Bases: Protocol

Synchronous sinks namespace contract exposed on ImednetSDK.sinks.

property MongoDbExportSink: MongoDbExportSinkFactoryProtocol

Sink class for MongoDB record exports.

property MongoDbSinkConfig: MongoDbSinkConfigFactoryProtocol

Configuration class for MongoDB export sinks.

property Neo4jExportSink: Neo4jExportSinkFactoryProtocol

Sink class for Neo4j record exports.

property Neo4jSinkConfig: Neo4jSinkConfigFactoryProtocol

Configuration class for Neo4j export sinks.

property SnowflakeExportSink: SnowflakeExportSinkFactoryProtocol

Sink class for Snowflake record exports.

property SnowflakeSinkConfig: SnowflakeSinkConfigFactoryProtocol

Configuration class for Snowflake export sinks.

property export_to_mongodb: BoundExportToMongoDbProtocol

Bound helper to export study records to MongoDB.

property export_to_neo4j: BoundExportToNeo4jProtocol

Bound helper to export study records to Neo4j.

property export_to_snowflake: BoundExportToSnowflakeProtocol

Bound helper to export study records to Snowflake.

class imednet.plugins.SinksPluginProtocol[source]

Bases: Protocol

Protocol for the sinks plugin factory.

__call__(sdk_instance: AsyncImednetFacade, /) → AsyncSinksNamespaceProtocol[source]
__call__(sdk_instance: ImednetFacade, /) → SinksNamespaceProtocol
__call__(sdk_instance: ImednetFacade | AsyncImednetFacade, /) → SinksNamespaceProtocol | AsyncSinksNamespaceProtocol

Initialize the sinks plugin with an SDK instance.

class imednet.plugins.SnowflakeExportSinkFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.SnowflakeExportSink.

__call__(config)[source]

Instantiate a Snowflake export sink.

Parameters:

config (Any) –

Return type:

ExportSink

class imednet.plugins.SnowflakeSinkConfigFactoryProtocol[source]

Bases: Protocol

Callable factory contract for sdk.sinks.SnowflakeSinkConfig.

__call__(study_key, batch_size=500, max_retries=3, retry_backoff=1.0, idempotent=True, mask_phi=True, extra=Ellipsis, quality_gate_enabled=False, min_schema_readiness_score=100.0, tracer=None, modified_since=None, record_filter=None, record_data_filter=None, include_deleted=False, incremental=False, stream_name=None, ledger_path=None, state_provider=None, max_buffered_records=None, as_sdtm=False, sdtm_domain=None, standards_profile=None, min_standards_score=None, naming_convention=None, preserve_record_id=None, account='', user='', password='', database='', schema='PUBLIC', warehouse='', stage='', table='', stage_prefix='imednet', prefix=None, local_staging_dir=None, manifest_path=None, hard_delete=False)[source]

Instantiate a Snowflake sink configuration.

Parameters:
  • study_key (str) –

  • batch_size (int) –

  • max_retries (int) –

  • retry_backoff (float) –

  • idempotent (bool) –

  • mask_phi (bool) –

  • extra (dict[str, Any]) –

  • quality_gate_enabled (bool) –

  • min_schema_readiness_score (float) –

  • tracer (Any | None) –

  • modified_since (datetime | str | None) –

  • record_filter (dict[str, Any] | str | None) –

  • record_data_filter (str | None) –

  • include_deleted (bool) –

  • incremental (bool) –

  • stream_name (str | None) –

  • ledger_path (str | Path | None) –

  • state_provider (Any | None) –

  • max_buffered_records (int | None) –

  • as_sdtm (bool) –

  • sdtm_domain (str | None) –

  • standards_profile (str | Any | None) –

  • min_standards_score (float | None) –

  • naming_convention (str | None) –

  • preserve_record_id (bool | None) –

  • account (str) –

  • user (str) –

  • password (str) –

  • database (str) –

  • schema (str) –

  • warehouse (str) –

  • stage (str) –

  • table (str) –

  • stage_prefix (str) –

  • prefix (str | None) –

  • local_staging_dir (str | PathLike[str] | None) –

  • manifest_path (str | PathLike[str] | None) –

  • hard_delete (bool) –

Return type:

SnowflakeSinkConfigProtocol

class imednet.plugins.SnowflakeSinkConfigProtocol[source]

Bases: Protocol

Structural contract for SnowflakeSinkConfig instances.

study_key: str
account: str
user: str
database: str
schema: str
warehouse: str
stage: str
table: str
stage_prefix: str
batch_size: int
max_buffered_records: int | None
as_sdtm: bool
sdtm_domain: str | None
standards_profile: str | Any | None
min_standards_score: float | None
naming_convention: str | None
preserve_record_id: bool | None
idempotent: bool
mask_phi: bool
include_deleted: bool
incremental: bool
modified_since: datetime | str | None
record_filter: dict[str, Any] | str | None
class imednet.plugins.StudySnapshotProtocol[source]

Bases: Protocol

Structural contract for a study metadata snapshot.

active_sites()[source]

Return actively enrolling sites.

Return type:

list[Site]

property captured_at: datetime

UTC timestamp when the snapshot was captured.

enrollment_forms()[source]

Return forms configured for subject enrollment/registration.

Return type:

list[Form]

property forms: list[imednet.models.forms.Form]

Study form definitions.

property forms_by_key: dict[str, imednet.models.forms.Form]

Lookup dictionary mapping form keys to Form models.

property intervals: list[imednet.models.intervals.Interval]

Study interval definitions.

property intervals_by_name: dict[str, imednet.models.intervals.Interval]

Lookup dictionary mapping interval names to Interval models.

scheduled_forms()[source]

Return scheduled non-enrollment forms.

Return type:

list[Form]

property sites: list[imednet.models.sites.Site]

Study site definitions.

property study_key: str

Study key identifier.

unscheduled_forms()[source]

Return unscheduled forms.

Return type:

list[Form]

property variables: list[imednet.models.variables.Variable]

Study variable definitions.

property variables_by_form: dict[str, list[imednet.models.variables.Variable]]

Lookup dictionary mapping form keys to Variable lists.

class imednet.plugins.SubjectComprehensiveDataProtocol[source]

Bases: Protocol

Structural contract for aggregated subject data returned by subject_data.

property queries: list[imednet.models.queries.Query]

Queries associated with the subject.

property records: list[imednet.models.records.Record]

Records associated with the subject.

property subject_details: Subject | None

Core details of the subject.

property visits: list[imednet.models.visits.Visit]

Visits associated with the subject.

class imednet.plugins.SubjectDataWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.subject_data.

get_all_subject_data(study_key, subject_key, *, include_deleted=False)[source]

Retrieve subject details, visits, records, and queries for a subject.

Parameters:
  • study_key (str) –

  • subject_key (str) –

  • include_deleted (bool) –

Return type:

SubjectComprehensiveDataProtocol

class imednet.plugins.SyncRecordUpdateWorkflowProtocol[source]

Bases: Protocol

Synchronous contract for sdk.workflows.record_update on ImednetSDK.

create_new_record(study_key, form_identifier, subject_identifier, data, form_identifier_type='key', subject_identifier_type='key', wait_for_completion=False, timeout=300, poll_interval=5, *, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Create a new unscheduled record for an existing subject.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • subject_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

create_or_update_records(study_key, records_data, wait_for_completion=False, timeout=300, poll_interval=5, *, email_notify=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Submit records for creation or update and return the resulting Job.

Parameters:
Return type:

Job

create_or_update_records_batch(study_key, records_data, wait_for_completion=False, timeout=300, poll_interval=5, *, email_notify=None, chunk_size=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Validate once, submit records in bounded chunks, and return a batch summary.

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • email_notify (bool | str | None) –

  • chunk_size (int | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

register_subject(study_key, form_identifier, site_identifier, data, form_identifier_type='key', site_identifier_type='name', wait_for_completion=False, timeout=300, poll_interval=5, *, subject_key=None, subject_oid=None, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Register a new subject by submitting a single enrollment record.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • site_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • site_identifier_type (Literal['name', 'id']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • subject_key (str | None) –

  • subject_oid (str | None) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

update_record(study_key, data=None, *, record_id=None, record_oid=None, visit_id=None, form_identifier=None, form_identifier_type='key', subject_identifier=None, subject_identifier_type='key', interval_identifier=None, interval_identifier_type='name', site_identifier=None, site_identifier_type='name', record_status=None, reason_for_change=None, wait_for_completion=False, timeout=300, poll_interval=5, email_notify=None, schema=None, resolve_results=True)[source]

Update an existing record by recordId, recordOid, visitId, or interval.

Parameters:
  • study_key (str) –

  • data (dict[str, Any] | None) –

  • record_id (int | None) –

  • record_oid (str | None) –

  • visit_id (int | None) –

  • form_identifier (str | int | None) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier (str | int | None) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • interval_identifier (str | int | None) –

  • interval_identifier_type (Literal['name', 'id']) –

  • site_identifier (str | int | None) –

  • site_identifier_type (Literal['name', 'id']) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

update_scheduled_record(study_key, form_identifier, subject_identifier, interval_identifier, data, form_identifier_type='key', subject_identifier_type='key', interval_identifier_type='name', wait_for_completion=False, timeout=300, poll_interval=5, *, record_status=None, reason_for_change=None, email_notify=None, schema=None, resolve_results=True)[source]

Update an existing scheduled record for a subject.

Parameters:
  • study_key (str) –

  • form_identifier (str | int) –

  • subject_identifier (str | int) –

  • interval_identifier (str | int) –

  • data (dict[str, Any]) –

  • form_identifier_type (Literal['key', 'id']) –

  • subject_identifier_type (Literal['key', 'id', 'oid']) –

  • interval_identifier_type (Literal['name', 'id']) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • record_status (RecordStatus | str | None) –

  • reason_for_change (str | None) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • resolve_results (bool) –

Return type:

Job

class imednet.plugins.SyncRegisterSubjectsWorkflowProtocol[source]

Bases: Protocol

Synchronous contract for sdk.workflows.register_subjects on ImednetSDK.

async async_register_subjects(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously register one or more subjects in a study.

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

Job

async async_register_subjects_batch(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, chunk_size=None, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously register subjects in bounded chunks.

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • chunk_size (int | None) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

register_subjects(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Register one or more subjects in a study.

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

Job

register_subjects_batch(study_key, subjects, email_notify=None, wait_for_completion=False, timeout=300, poll_interval=5, *, chunk_size=None, filter_enrolled=None, skip_existing=False, subject_key_field=None, schema=None, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Validate sites and submit subject registrations in bounded chunks.

Parameters:
  • study_key (str) –

  • subjects (Sequence[RegisterSubjectRequest | dict[str, Any]] | Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (str | None) –

  • wait_for_completion (bool) –

  • timeout (int) –

  • poll_interval (int) –

  • chunk_size (int | None) –

  • filter_enrolled (bool | None) –

  • skip_existing (bool) –

  • subject_key_field (str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

imednet.plugins.SyncSinksNamespaceProtocol: TypeAlias = SinksNamespaceProtocol

Explicit protocol type alias for SinksNamespaceProtocol.

class imednet.plugins.SyncStudySchemaInspectorProtocol[source]

Bases: Protocol

Synchronous contract for sdk.workflows.uat_inspector on ImednetSDK.

clear_cache(study_key=None)[source]

Clear cached study snapshots.

Parameters:

study_key (str | None) –

Return type:

None

inspect(study_key, *, force_refresh=False)[source]

Synchronously fetch and index structural study metadata.

Parameters:
  • study_key (str) –

  • force_refresh (bool) –

Return type:

StudySnapshotProtocol

class imednet.plugins.SyncWorkflowsNamespaceProtocol[source]

Bases: Protocol

Synchronous workflows namespace contract exposed on ImednetSDK.workflows.

property data_extraction: DataExtractionWorkflowProtocol

Access the synchronous data extraction workflow.

property duckdb_centralizer: DuckDBIngestionWorkflowProtocol

Access the lazy DuckDB bronze/silver ingestion workflow.

property query_management: QueryManagementWorkflowProtocol

Access the query management workflow.

property record_mapper: RecordMapperProtocol

Access the tabular and SDTM record mapper workflow.

property record_update: SyncRecordUpdateWorkflowProtocol

Access the synchronous record submission and update workflow.

property register_subjects: SyncRegisterSubjectsWorkflowProtocol

Access the synchronous bulk subject registration workflow.

property subject_data: SubjectDataWorkflowProtocol

Access the comprehensive subject data retrieval workflow.

property uat: UATWorkflowProtocol

Access the end-to-end UAT orchestration workflow.

property uat_inspector: SyncStudySchemaInspectorProtocol

Access the synchronous study schema inspector.

class imednet.plugins.TriageStoreProtocol[source]

Bases: Protocol

Structural contract for triage stores used by sdk.workflows.query_management.

get_queue(study_key, status=None)[source]

Fetch the triage queue for a study, optionally filtered by status.

Parameters:
Return type:

list[TriageItem]

get_triage_item(item_id)[source]

Fetch a single triage item by ID.

Parameters:

item_id (str) –

Return type:

TriageItem | None

upsert_item(item)[source]

Insert or update a triage item while preserving annotations and history.

Parameters:

item (TriageItem) –

Return type:

None

class imednet.plugins.UATRunResultProtocol[source]

Bases: Protocol

Structural contract for UATWorkflow.run execution results.

property completed_at: datetime | None

UTC timestamp when the UAT run finished, if completed.

property dry_run: bool

Whether the run executed in local dry-run validation mode.

property error_message: str | None

Failure message captured when a phase errors.

property failed_phase: str | None

Alias for failure_phase.

property failure_phase: str | None

Phase in which execution failed, if any.

property is_terminal: bool

Whether the run reached a terminal lifecycle state.

property overall_success: bool

Whether all UAT batches completed without failure.

property phase_durations: Mapping[str, float]

Elapsed seconds recorded per execution phase.

property poll_summary: Any

Job polling summary produced by the monitor phase.

property record_sets: Sequence[Any]

Generated synthetic record sets submitted during the run.

property run_id: str

Unique execution identifier.

property spec: Any

Generated or supplied UAT specification.

property started_at: datetime

UTC timestamp when the UAT run started.

property state: str

Current or final lifecycle state value.

property state_history: Sequence[str]

Ordered sequence of visited lifecycle states.

property study_key: str

Study key tested.

property submission_result: Any

Bulk submission result produced by the submit phase.

summary()[source]

Format a human-readable execution summary.

Return type:

str

property validation_report: Any

Local batch validation report captured during dry-run execution, if any.

class imednet.plugins.UATWorkflowProtocol[source]

Bases: Protocol

Structural contract for sdk.workflows.uat.

build_spec(snapshot, **kwargs)[source]

Auto-generate a UAT specification from a study snapshot.

Parameters:
  • snapshot (Any) –

  • kwargs (Any) –

Return type:

Any

generate(spec, snapshot, *, data_dictionary=None, seed=None)[source]

Generate synthetic record sets from a UAT specification and snapshot.

Parameters:
  • spec (Any) –

  • snapshot (Any) –

  • data_dictionary (DataDictionary | None) –

  • seed (int | None) –

Return type:

list[Any]

inspect(study_key)[source]

Inspect study metadata via StudySchemaInspector.

Parameters:

study_key (str) –

Return type:

StudySnapshotProtocol

property last_result: UATRunResultProtocol | None

Result from the most recent run() invocation, if any.

monitor(study_key, submission_result)[source]

Poll submitted UAT job batches to completion.

Parameters:
  • study_key (str) –

  • submission_result (Any) –

Return type:

Any

reset()[source]

Reset the UAT workflow state machine.

Return type:

None

run(study_key, *, spec=None, subject_count=2, site_name=None, enabled_form_keys=None, email_notify=None, data_dictionary=None, schema=None, seed=None, dry_run=False)[source]

Execute the end-to-end UAT pipeline and return its run result.

Parameters:
  • study_key (str) –

  • spec (Any) –

  • subject_count (int) –

  • site_name (str | None) –

  • enabled_form_keys (list[str] | None) –

  • email_notify (bool | str | None) –

  • data_dictionary (DataDictionary | None) –

  • schema (ValidationSchemaProtocol | None) –

  • seed (int | None) –

  • dry_run (bool) –

Return type:

UATRunResultProtocol

property state: str

Current lifecycle state of the UAT workflow.

property state_history: Sequence[str]

Recorded lifecycle state transitions for the current or latest run.

submit(study_key, record_sets, email_notify=None, *, schema=None)[source]

Submit generated UAT record sets in two phases.

Parameters:
  • study_key (str) –

  • record_sets (list[Any]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

Return type:

Any

transition_to(target, *, dry_run=False)[source]

Transition workflow state along a valid lifecycle edge.

Parameters:
  • target (str) –

  • dry_run (bool) –

Return type:

str

imednet.plugins.WorkflowsNamespaceProtocol: TypeAlias = SyncWorkflowsNamespaceProtocol

Explicit protocol type alias for SyncWorkflowsNamespaceProtocol.

imednet.sdk module

Public entry-point for the iMednet SDK.

This module provides the ImednetSDK class which: - Manages configuration and authentication - Exposes all endpoint functionality through a unified interface - Provides context management for proper resource cleanup

class imednet.sdk.AsyncImednetSDK[source]

Bases: AsyncSDKConvenienceMixin

Async variant of ImednetSDK using the async HTTP client.

Always use this class with async with or call await sdk.aclose() explicitly when done. Using the synchronous context manager (with) or synchronous close() on this class will raise a TypeError.

__init__(api_key=None, security_key=None, base_url=None, timeout=None, strict_mode=None, retry_config=None, async_client=None, retries=None, backoff_factor=None, retry_policy=None, simulation_mode=None, transport=None, *, config=None, oidc_token=None, auth=None, credential_source=None)[source]

Initialize the asynchronous SDK.

Parameters:
  • api_key (str | None) –

  • security_key (str | None) –

  • base_url (str | None) –

  • timeout (float | None) –

  • strict_mode (bool | None) –

  • retry_config (RetryConfig | None) –

  • async_client (AsyncClient | None) –

  • retries (int | None) –

  • backoff_factor (float | None) –

  • retry_policy (RetryPolicy | None) –

  • simulation_mode (bool | None) –

  • transport (Any) –

  • config (Config | None) –

  • oidc_token (str | None) –

  • auth (AuthStrategy | None) –

  • credential_source (CredentialSource | None) –

Return type:

None

async aclose()[source]

Close the underlying asynchronous client and free resources.

Return type:

None

async_create_record(study_key, records_data, email_notify=None, *, schema=None, skip_validation=False)

Deprecated alias for create_record().

Parameters:
Return type:

Job

async_create_records_batch(study_key, records_data, email_notify=None, *, schema=None, chunk_size=100, skip_validation=False, wait_for_completion=False, timeout=300.0, interval=5.0, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)

Deprecated alias for create_records_batch().

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • chunk_size (int) –

  • skip_validation (bool) –

  • wait_for_completion (bool) –

  • timeout (float) –

  • interval (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async async_get_codings(study_key=None, **filters)

Asynchronously list codings.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Coding]

async async_get_forms(study_key=None, **filters)

Asynchronously list forms.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Form]

async async_get_intervals(study_key=None, **filters)

Asynchronously list intervals.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Interval]

async_get_job(study_key, batch_id)

Deprecated alias for get_job().

Parameters:
  • study_key (str) –

  • batch_id (str) –

Return type:

JobStatus

async async_get_queries(study_key=None, **filters)

Asynchronously list queries.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Query]

async async_get_record_revisions(study_key=None, **filters)

Asynchronously list record_revisions.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[RecordRevision]

async async_get_records(study_key=None, **filters)

Asynchronously list records.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Record]

async async_get_sites(study_key=None, **filters)

Asynchronously list sites.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Site]

async async_get_studies(study_key=None, **filters)

Asynchronously list studies.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Study]

async async_get_subjects(study_key=None, **filters)

Asynchronously list subjects.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Subject]

async async_get_users(study_key=None, **filters)

Asynchronously list users.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[User]

async async_get_variables(study_key=None, **filters)

Asynchronously list variables.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Variable]

async async_get_visits(study_key=None, **filters)

Asynchronously list visits.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Visit]

async_poll_job(study_key, batch_id, *, interval=5, timeout=300, on_progress=None, resolve_results=False)

Deprecated alias for poll_job().

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • resolve_results (bool) –

Return type:

JobStatus

async_poll_jobs(study_key, batch_ids, *, interval=5.0, timeout=300.0, on_progress=None, fail_fast=False, resolve_results=False)

Deprecated alias for poll_jobs().

Parameters:
  • study_key (str) –

  • batch_ids (list[str]) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • fail_fast (bool) –

  • resolve_results (bool) –

Return type:

JobPollSummary

property auth: AuthStrategy | None

Return the authentication provider used by the async client.

close()[source]

Raise TypeError as sync close is not supported.

Return type:

None

async create_record(study_key, records_data, email_notify=None, *, schema=None, skip_validation=False)

Asynchronously create records in the specified study.

Parameters:
Return type:

Job

async create_records_batch(study_key, records_data, email_notify=None, *, schema=None, chunk_size=100, skip_validation=False, wait_for_completion=False, timeout=300.0, interval=5.0, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)

Asynchronously validate once and submit records in bounded chunks.

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • chunk_size (int) –

  • skip_validation (bool) –

  • wait_for_completion (bool) –

  • timeout (float) –

  • interval (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async get_codings(study_key=None, **filters)

Asynchronously list codings.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Coding]

async get_forms(study_key=None, **filters)

Asynchronously list forms.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Form]

async get_intervals(study_key=None, **filters)

Asynchronously list intervals.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Interval]

async get_job(study_key, batch_id)

Asynchronously get job status.

Parameters:
  • study_key (str) –

  • batch_id (str) –

Return type:

JobStatus

async get_queries(study_key=None, **filters)

Asynchronously list queries.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Query]

async get_record_revisions(study_key=None, **filters)

Asynchronously list record_revisions.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[RecordRevision]

async get_records(study_key=None, **filters)

Asynchronously list records.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Record]

async get_sites(study_key=None, **filters)

Asynchronously list sites.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Site]

async get_studies(study_key=None, **filters)

Asynchronously list studies.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Study]

async get_subjects(study_key=None, **filters)

Asynchronously list subjects.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Subject]

async get_users(study_key=None, **filters)

Asynchronously list users.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[User]

async get_variables(study_key=None, **filters)

Asynchronously list variables.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Variable]

async get_visits(study_key=None, **filters)

Asynchronously list visits.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Visit]

async poll_job(study_key, batch_id, *, interval=5, timeout=300, on_progress=None, resolve_results=False)

Asynchronously poll a job until terminal state, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • resolve_results (bool) –

Return type:

JobStatus

async poll_jobs(study_key, batch_ids, *, interval=5.0, timeout=300.0, on_progress=None, fail_fast=False, resolve_results=False)

Asynchronously poll multiple jobs concurrently, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_ids (list[str]) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • fail_fast (bool) –

  • resolve_results (bool) –

Return type:

JobPollSummary

property retry_policy: RetryPolicy

Return the current retry policy of the async client.

study_context(study_key)

Set a temporary default study key for the current thread/task context.

Parameters:

study_key (str) –

Return type:

Iterator[Self]

class imednet.sdk.ImednetSDK[source]

Bases: SyncSDKConvenienceMixin

Public entry-point for library users.

Provides access to all iMednet API endpoints and maintains configuration.

__init__(api_key=None, security_key=None, base_url=None, timeout=None, strict_mode=None, retry_config=None, client=None, retries=None, backoff_factor=None, retry_policy=None, simulation_mode=None, transport=None, *, config=None, oidc_token=None, auth=None, credential_source=None)[source]

Initialize the SDK with credentials and configuration.

Parameters:
  • api_key (str | None) – iMednet API key.

  • security_key (str | None) – iMednet security key.

  • base_url (str | None) – Base URL for the iMednet API.

  • timeout (float | None) – Default request timeout in seconds.

  • strict_mode (bool | None) – Toggle strict mode for data validation.

  • retry_config (RetryConfig | None) – Centralized configuration for retry behaviors.

  • client (Client | None) – Pre-configured client instance.

  • retries (int | None) – Number of retries for failed requests.

  • backoff_factor (float | None) – Backoff factor for retry delays.

  • retry_policy (RetryPolicy | None) – Custom retry policy.

  • simulation_mode (bool | None) – Toggle offline simulation mode.

  • transport (Any) – Custom HTTP transport or SimulationTransport.

  • config (Config | None) – Pre-resolved configuration instance.

  • oidc_token (str | None) – Explicit OIDC bearer token.

  • auth (AuthStrategy | None) – Explicit authentication strategy, used instead of default credentials.

  • credential_source (CredentialSource | None) – Caller-owned credential source for client construction.

Return type:

None

async aclose()[source]

Asynchronous close is not supported on the synchronous SDK.

Return type:

None

property auth: AuthStrategy | None

Return the authentication provider used by the client.

close()[source]

Close the synchronous client connection and free resources.

Return type:

None

create_record(study_key, records_data, email_notify=None, *, schema=None, skip_validation=False)

Create records in the specified study.

Parameters:
Return type:

Job

create_records_batch(study_key, records_data, email_notify=None, *, schema=None, chunk_size=100, skip_validation=False, wait_for_completion=False, timeout=300.0, interval=5.0, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)

Validate once and submit records in bounded chunks (default 100 per POST).

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • chunk_size (int) –

  • skip_validation (bool) –

  • wait_for_completion (bool) –

  • timeout (float) –

  • interval (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

get_codings(study_key=None, **filters)

List codings.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Coding]

get_forms(study_key=None, **filters)

List forms.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Form]

get_intervals(study_key=None, **filters)

List intervals.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Interval]

get_job(study_key, batch_id)

Get job status.

Parameters:
  • study_key (str) –

  • batch_id (str) –

Return type:

JobStatus

get_queries(study_key=None, **filters)

List queries.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Query]

get_record_revisions(study_key=None, **filters)

List record_revisions.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[RecordRevision]

get_records(study_key=None, **filters)

List records.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Record]

get_sites(study_key=None, **filters)

List sites.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Site]

get_studies(study_key=None, **filters)

List studies.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Study]

get_subjects(study_key=None, **filters)

List subjects.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Subject]

get_users(study_key=None, **filters)

List users.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[User]

get_variables(study_key=None, **filters)

List variables.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Variable]

get_visits(study_key=None, **filters)

List visits.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Visit]

poll_job(study_key, batch_id, *, interval=5, timeout=300, on_progress=None, resolve_results=False)

Poll a job until it reaches a terminal state, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • resolve_results (bool) –

Return type:

JobStatus

poll_jobs(study_key, batch_ids, *, interval=5.0, timeout=300.0, on_progress=None, fail_fast=False, resolve_results=False)

Poll multiple jobs concurrently until terminal states, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_ids (list[str]) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • fail_fast (bool) –

  • resolve_results (bool) –

Return type:

JobPollSummary

property retry_policy: RetryPolicy

Return the current retry policy.

study_context(study_key)

Set a temporary default study key for the current thread/task context.

Parameters:

study_key (str) –

Return type:

Iterator[Self]

imednet.sdk_convenience module

Convenience mixins for the iMedNet SDK.

These mixins contain high-level helper methods that delegate to specific endpoints. They are architecturally linked to the core execution engine.

class imednet.sdk_convenience.AsyncSDKConvenienceMixin[source]

Bases: object

Asynchronous SDK convenience methods.

async_create_record(study_key, records_data, email_notify=None, *, schema=None, skip_validation=False)[source]

Deprecated alias for create_record().

Parameters:
Return type:

Job

async_create_records_batch(study_key, records_data, email_notify=None, *, schema=None, chunk_size=100, skip_validation=False, wait_for_completion=False, timeout=300.0, interval=5.0, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Deprecated alias for create_records_batch().

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • chunk_size (int) –

  • skip_validation (bool) –

  • wait_for_completion (bool) –

  • timeout (float) –

  • interval (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async async_get_codings(study_key=None, **filters)

Asynchronously list codings.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Coding]

async async_get_forms(study_key=None, **filters)

Asynchronously list forms.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Form]

async async_get_intervals(study_key=None, **filters)

Asynchronously list intervals.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Interval]

async_get_job(study_key, batch_id)[source]

Deprecated alias for get_job().

Parameters:
  • study_key (str) –

  • batch_id (str) –

Return type:

JobStatus

async async_get_queries(study_key=None, **filters)

Asynchronously list queries.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Query]

async async_get_record_revisions(study_key=None, **filters)

Asynchronously list record_revisions.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[RecordRevision]

async async_get_records(study_key=None, **filters)

Asynchronously list records.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Record]

async async_get_sites(study_key=None, **filters)

Asynchronously list sites.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Site]

async async_get_studies(study_key=None, **filters)

Asynchronously list studies.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Study]

async async_get_subjects(study_key=None, **filters)

Asynchronously list subjects.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Subject]

async async_get_users(study_key=None, **filters)

Asynchronously list users.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[User]

async async_get_variables(study_key=None, **filters)

Asynchronously list variables.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Variable]

async async_get_visits(study_key=None, **filters)

Asynchronously list visits.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Visit]

async_poll_job(study_key, batch_id, *, interval=5, timeout=300, on_progress=None, resolve_results=False)[source]

Deprecated alias for poll_job().

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • resolve_results (bool) –

Return type:

JobStatus

async_poll_jobs(study_key, batch_ids, *, interval=5.0, timeout=300.0, on_progress=None, fail_fast=False, resolve_results=False)[source]

Deprecated alias for poll_jobs().

Parameters:
  • study_key (str) –

  • batch_ids (list[str]) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • fail_fast (bool) –

  • resolve_results (bool) –

Return type:

JobPollSummary

async create_record(study_key, records_data, email_notify=None, *, schema=None, skip_validation=False)[source]

Asynchronously create records in the specified study.

Parameters:
Return type:

Job

async create_records_batch(study_key, records_data, email_notify=None, *, schema=None, chunk_size=100, skip_validation=False, wait_for_completion=False, timeout=300.0, interval=5.0, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Asynchronously validate once and submit records in bounded chunks.

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • chunk_size (int) –

  • skip_validation (bool) –

  • wait_for_completion (bool) –

  • timeout (float) –

  • interval (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

async get_codings(study_key=None, **filters)

Asynchronously list codings.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Coding]

async get_forms(study_key=None, **filters)

Asynchronously list forms.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Form]

async get_intervals(study_key=None, **filters)

Asynchronously list intervals.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Interval]

async get_job(study_key, batch_id)[source]

Asynchronously get job status.

Parameters:
  • study_key (str) –

  • batch_id (str) –

Return type:

JobStatus

async get_queries(study_key=None, **filters)

Asynchronously list queries.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Query]

async get_record_revisions(study_key=None, **filters)

Asynchronously list record_revisions.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[RecordRevision]

async get_records(study_key=None, **filters)

Asynchronously list records.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Record]

async get_sites(study_key=None, **filters)

Asynchronously list sites.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Site]

async get_studies(study_key=None, **filters)

Asynchronously list studies.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Study]

async get_subjects(study_key=None, **filters)

Asynchronously list subjects.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Subject]

async get_users(study_key=None, **filters)

Asynchronously list users.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[User]

async get_variables(study_key=None, **filters)

Asynchronously list variables.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Variable]

async get_visits(study_key=None, **filters)

Asynchronously list visits.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Visit]

async poll_job(study_key, batch_id, *, interval=5, timeout=300, on_progress=None, resolve_results=False)[source]

Asynchronously poll a job until terminal state, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • resolve_results (bool) –

Return type:

JobStatus

async poll_jobs(study_key, batch_ids, *, interval=5.0, timeout=300.0, on_progress=None, fail_fast=False, resolve_results=False)[source]

Asynchronously poll multiple jobs concurrently, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_ids (list[str]) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • fail_fast (bool) –

  • resolve_results (bool) –

Return type:

JobPollSummary

imednet.sdk_convenience.SDKConvenienceMixin

alias of SyncSDKConvenienceMixin

class imednet.sdk_convenience.SyncSDKConvenienceMixin[source]

Bases: object

Synchronous SDK convenience methods.

create_record(study_key, records_data, email_notify=None, *, schema=None, skip_validation=False)[source]

Create records in the specified study.

Parameters:
Return type:

Job

create_records_batch(study_key, records_data, email_notify=None, *, schema=None, chunk_size=100, skip_validation=False, wait_for_completion=False, timeout=300.0, interval=5.0, on_progress=None, dry_run=False, collect_errors=False, resolve_results=True)[source]

Validate once and submit records in bounded chunks (default 100 per POST).

Parameters:
  • study_key (str) –

  • records_data (Sequence[BaseRecordRequest | Mapping[str, Any]] | DataFrameLike | str | PathLike[str]) –

  • email_notify (bool | str | None) –

  • schema (ValidationSchemaProtocol | None) –

  • chunk_size (int) –

  • skip_validation (bool) –

  • wait_for_completion (bool) –

  • timeout (float) –

  • interval (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • dry_run (bool) –

  • collect_errors (bool) –

  • resolve_results (bool) –

Return type:

BatchSubmissionSummary

get_codings(study_key=None, **filters)

List codings.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Coding]

get_forms(study_key=None, **filters)

List forms.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Form]

get_intervals(study_key=None, **filters)

List intervals.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Interval]

get_job(study_key, batch_id)[source]

Get job status.

Parameters:
  • study_key (str) –

  • batch_id (str) –

Return type:

JobStatus

get_queries(study_key=None, **filters)

List queries.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Query]

get_record_revisions(study_key=None, **filters)

List record_revisions.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[RecordRevision]

get_records(study_key=None, **filters)

List records.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Record]

get_sites(study_key=None, **filters)

List sites.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Site]

get_studies(study_key=None, **filters)

List studies.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Study]

get_subjects(study_key=None, **filters)

List subjects.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Subject]

get_users(study_key=None, **filters)

List users.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[User]

get_variables(study_key=None, **filters)

List variables.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Variable]

get_visits(study_key=None, **filters)

List visits.

Parameters:
  • study_key (str | None) –

  • filters (str | int | float | bool | tuple[str, str | int | float | bool | None] | list[tuple[str, str | int | float | bool | None]] | list[str | int | float | bool | None] | None) –

Return type:

list[Visit]

poll_job(study_key, batch_id, *, interval=5, timeout=300, on_progress=None, resolve_results=False)[source]

Poll a job until it reaches a terminal state, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_id (str) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • resolve_results (bool) –

Return type:

JobStatus

poll_jobs(study_key, batch_ids, *, interval=5.0, timeout=300.0, on_progress=None, fail_fast=False, resolve_results=False)[source]

Poll multiple jobs concurrently until terminal states, optionally resolving resultUrl payloads.

Parameters:
  • study_key (str) –

  • batch_ids (list[str]) –

  • interval (float) –

  • timeout (float) –

  • on_progress (JobProgressCallback | Callable[[JobStatusEvent], None] | None) –

  • fail_fast (bool) –

  • resolve_results (bool) –

Return type:

JobPollSummary