imednet_workflows.uat package
Submodules
imednet_workflows.uat.inspector module
Study metadata inspector for UAT specification generation.
- class imednet_workflows.uat.inspector.StudySchemaInspector[source]
Bases:
objectFetch and index all structural metadata for an iMednet study.
Supports both sync and async SDK clients. When an async client is used, metadata calls are executed concurrently via
asyncio.gather. The in-memory cache is per inspector instance. It can be shared by concurrent tasks in a single event loop, but is not thread-safe across threads/processes; use external synchronization or separate inspector instances for that access pattern.- __init__(sdk)[source]
- Parameters:
sdk (ImednetSDK | AsyncImednetSDK) –
- Return type:
None
- async async_inspect(study_key, *, force_refresh=False)[source]
Asynchronously fetch metadata concurrently and return a study snapshot.
- Return type:
- Parameters:
study_key (str) –
force_refresh (bool) –
- clear_cache(study_key=None)[source]
Clear snapshot cache for one study key or all keys.
- Return type:
None- Parameters:
study_key (str | None) –
- class imednet_workflows.uat.inspector.StudySnapshot[source]
Bases:
ImednetBaseModelPoint-in-time snapshot of a study’s structural metadata.
- captured_at: datetime
- enrollment_forms()[source]
Return forms with form_type indicating subject registration.
- Return type:
list[Form]
- forms: list[Form]
- forms_by_key: dict[str, Form]
- intervals: list[Interval]
- intervals_by_name: dict[str, Interval]
- model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'str_strip_whitespace': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(_StudySnapshot__context)[source]
Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.
- Return type:
None- Parameters:
_StudySnapshot__context (object) –
- scheduled_forms()[source]
Return scheduled (non-enrollment, non-unscheduled) forms.
- Return type:
list[Form]
- sites: list[Site]
- study_key: str
- variables: list[Variable]
- variables_by_form: dict[str, list[Variable]]